Jump to content

Submit form com varias select option selected


guarana1

Recommended Posts

Boas, estou a fazer submit de um form, e nele tenho:

[b]<!-- Start Formoid form-->
<link rel="stylesheet" href="formoid_files/formoid1/formoid-metro-cyan.css" type="text/css" />
<script type="text/javascript" src="formoid_files/formoid1/jquery.min.js"></script>
<form enctype="multipart/form-data" class="formoid-metro-cyan" style="background-color:#FFFFFF;margin-top: 70px;font-size:14px;font-family:'Open Sans','Helvetica Neue','Helvetica',Arial,Verdana,sans-serif;color:#666666;max-width:480px;min-width:150px" method="post">
<br>
<br>
<div class="element-file" ></label><label class="large" ><div class="button">Escolha o ficheiro</div><input type="file" class="file_input" name="file" required="required"/><div class="file_text">No file selected</div></label></div>
<div class="element-input" ><input placeholder="Título" class="large" type="text" name="titulo" required="required"/></div>[/b]
[b]<div class="element-multiple" ><div class="null"><select name="multiple[]" multiple="multiple" required="required">

<?php
$query_select = "SELECT * FROM tema;";
$result_select = mysql_query($query_select) or die(mysql_error());
$rows = array();
while($row = mysql_fetch_array($result_select))
   $rows[] = $row;
foreach($rows as $row){
   $shots = stripslashes($row['tema']);
   {
$filename = $shots;
echo "[/b]
[b]<option value=".$filename."> ".$filename." </option> <br/>
"; }
}
?>  
 </select></span></div></div>
<div class="element-date" ><input class="large" placeholder="yyyy-mm-dd" type="date" name="data" required="required"/></div>
<div class="element-input" ><input class="large" placeholder="Equipamento" type="text" name="equipamento" required="required"/></div>
<div class="element-textarea" ><textarea class="medium" name="descr" placeholder="Descrição" cols="20" rows="5" required="required"></textarea></div>[/b]
[b]<div class="submit"><input type="submit" value="Submit"/></div></form>
<br><br><br>
<script type="text/javascript" src="formoid_files/formoid1/formoid-metro-cyan.js"></script>[/b]
[b]<!-- Stop Formoid form-->[/b]

Isto e o upload de uma imagen no site com o seu titulo, etc...

Cada imagem tem o seu tema, mas a imagem pode ter varios temas, por isso pus o multile select.

Tenho uma tabela com todos os dados da imagen, tema, nome, diretoria, etc...

e tenho outra tabela so com os nomes dos temas.

Como faço para a imagen estar "ligada" a dois ou mais temas ao mesmo tempo?

Como ficaria o sql?

Obrigado e bom ano novo a todos.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.