Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello,
I just need to fix my code to work. I have an upload.html file and an load.php file. On the html file, I just need to know if the selection option dropdown will correspond properly with the code on the upload form. On the upload form, I'm trying to figure out if I have it written properly overall, and I suspect my SQL code is wrong as well. here are the two code examples:
upload.html
[syntax="html"]
<form action=load.php method=post enctype="multipart/form-data">
<INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="90000">
<table>
<tr>
<td colspan="2">Featured Clients Upload Form </td>
</tr>
<tr>
<td width="13%">Title:</td>
<td width="87%"><input type="text" name="title" size="28"></td>
</tr>
<tr>
<td>Company Name: </td>
<td><input type="text" name="company" size="28" /></td>
</tr>
<tr>
<td>Contact Info :</td>
<td><textarea rows="5" name="address" cols="23"></textarea></td>
</tr>
<tr>
<td colspan="2">Featured the listing spot:</td>
</tr>
<tr>
<td> </td>
<td><label>
<select name="feature_num">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
</select>
</label></td>
</tr>
<tr>
<td>Category</td>
<td><input type="text" name="category" size="28" /></td>
</tr>
<tr>
<td colspan="2">Tour Images : </td>
</tr>
<tr>
<td>Tour Image #1 </td>
<td><input type="file" name="tourimage01" size="28" /></td>
</tr>
<tr>
<td>Tour Image #2 </td>
<td><input type="file" name="tourimage02" size="28" /></td>
</tr>
<tr>
<td>Tour Image #3 </td>
<td><input type="file" name="tourimage03" size="28" /></td>
</tr>
<tr>
<td>Tour Image #4</td>
<td><input type="file" name="tourimage04" size="28" /></td>
</tr>
<tr>
<td>Tour Image #5 </td>
<td><input type="file" name="tourimage05" size="28" /></td>
</tr>
<tr>
<td colspan="2">Tour Thumbnails (thumb # must correspond to the above Tour Image) </td>
</tr>
<tr>
<td>Tour Thumbnail #1 </td>
<td><input type="file" name="tourimage01thumb" size="28" /></td>
</tr>
<tr>
<td>Tour Thumbnail #2</td>
<td><input type="file" name="tourimage02thumb" size="28" /></td>
</tr>
<tr>
<td>Tour Thumbnail #3</td>
<td><input type="file" name="tourimage03thumb" size="28" /></td>
</tr>
<tr>
<td>Tour Thumbnail #4 </td>
<td><input type="file" name="tourimage04thumb" size="28" /></td>
</tr>
<tr>
<td>Tour Thumbnail #5</td>
<td><input type="file" name="tourimage05thumb" size="28" /></td>
</tr>
<tr>
<td colspan="2">Company ( logo must be small): </td>
</tr>
<tr>
<td>Logo:</td>
<td><input type="file" name="logo" size="28" /></td>
</tr>
<tr>
<td width="13%">Description:</td>
<td width="87%"><textarea rows="5" name="desc" cols="23"></textarea></td>
</tr>
</table>
<p align="center"><input type=submit name=action value="Load"><input type="reset" value="Reset" name="B2"></p>
</form>load.php[/syntax]
Code: Select all
<?php
if ($action == "Load")
{
$folder = "/home/dtours3/public_html/tours/tourimages/";
@copy("$tourimage01" , "$folder/$tourimage01_name");
@copy("$tourimage02" , "$folder/$tourimage02_name");
@copy("$tourimage03" , "$folder/$tourimage03_name");
@copy("$tourimage04" , "$folder/$tourimage04_name");
@copy("$tourimage05" , "$folder/$tourimage05_name");
@copy("$tourimage01thumb" , "$folder/$tourimage01thumb_name");
@copy("$tourimage02thumb" , "$folder/$tourimage02thumb_name");
@copy("$tourimage03thumb" , "$folder/$tourimage03thumb_name");
@copy("$tourimage04thumb" , "$folder/$tourimage04thumb_name");
@copy("$tourimage05thumb" , "$folder/$tourimage015thumb_name");
@copy("$logo" , "$folder/$logo_name");
echo "
<br><p align=center>File <b><i>$tourimage01_name</i></b><br>
<br><p align=center>File <b><i>$tourimage02_name</i></b><br>
<br><p align=center>File <b><i>$tourimage03_name</i></b><br>
<br><p align=center>File <b><i>$tourimage04_name</i></b><br>
<br><p align=center>File <b><i>$tourimage05_name</i></b><br>
<br><p align=center>File <b><i>$tourimage01thumb_name</i></b><br>
<br><p align=center>File <b><i>$tourimage02thumb_name</i></b><br>
<br><p align=center>File <b><i>$tourimage03thumb_name</i></b><br>
<br><p align=center>File <b><i>$tourimage04thumb_name</i></b><br>
<br><p align=center>File <b><i>$tourimage05thumb_name</i></b><br>
<br><p align=center>File <b><i>$logo_name</i></b><br>
loaded...";
$result = mysql_connect("localhost", "dtours3_deb", "cybergirl") or die("Could not connect: " . mysql_error());
@mysql_select_db("dtours3_rich") or die("Could not select database");
@mysql_query("INSERT into tours (tourid, title, company, address, feature_num, category, desc, tourimage01, tourimage02, tourimage03, tourimage04, tourimage05, tourimage01thumb, tourimage02thumb, tourimage03thumb, tourimage04thumb, tourimage05thumb, logo) VALUES('', 'tourid', 'title', 'company', 'address', 'category', 'feature_num', 'desc', '$tourimage01_name', '$tourimage02_name', '$tourimage03_name', '$tourimage04_name', '$tourimage05_name', '$tourimage01thumb_name', '$tourimage02thumb_name', '$tourimage03thumb_name', '$tourimage04thumb_name', '$tourimage05thumb_name', '$logo_name') ");
if($result) { echo "Featured Client profile and image names saved into database"; }
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]