Ok i worked this script up from all the stuff i've seen and it works great nuthin fancy but it does the job uploads the image to a dir and i can insert all information about the site i'm adding but now i can't seem to find enough info on getting all that same info into a nice lil table like 3rows 1col top row being the site name middle row being the screenshot of the site and the bottom row split into 3cols left to right-> gallery url,join url,tour url...
i need the screenshoot which was uploaded to be displayed as well and for each cat that is picked i need the table to show all the sites for that cat my table structure is really small until i get most of the small stuff figured out then there will be a table for each cat.anyone who can help me i will be indebt to for this is for a rather large project and i'm just getting into mysql
function handleupload() {
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
$realname = $_FILES['userfile']['name'];
echo "<img src=/main/screenshots/$realname>";
print "";
copy($_FILES['userfile']['tmp_name'],
"../screenshots/".$realname);
return "../screenshots/" . $realname;
} else {
echo "Possible file upload attack: filename
".$_FILES['userfile']['name'].".";
}
}
if ($act == "upload") {
$site_screen = handleupload();
//open the connection
$conn = mysql_connect("localhost", "#", "#");
//pick the database to use
mysql_select_db("aelinks",$conn);
//create the SQL statemnet
$sql = "INSERT INTO sites values ('', '$site_name', '$site_tour_url', '$site_join_url ', '$site_cat', '$site_gall_url', '$site_screen')";
//execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());
}
<body>
<form ENCTYPE="multipart/form-data" method="POST" action="upload.php?act=upload">
Site Name<BR>
<INPUT NAME="site_name" TYPE="text" SIZE="30">
<BR>
Site Tourpage URL<BR>
<INPUT NAME="site_tour_url" TYPE="text" VALUE="http://" SIZE="30">
<BR>
Site Joinpage URL<BR>
<INPUT NAME="site_join_url" TYPE="text" VALUE="http://" SIZE="30">
<BR>
Site Catagorey<BR>
<SELECT NAME="site_cat">
<OPTION VALUE="cat1">cat1</OPTION>
<OPTION VALUE="cat2">cat2</OPTION>
<OPTION VALUE="cat3">cat3</OPTION>
<OPTION VALUE="cat4">cat4</OPTION>
</SELECT>
<BR>
Site Gallery URL<BR>
<INPUT NAME="site_gall_url" TYPE="text" VALUE="http://" SIZE="30">
<BR>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
Site Screenshot<BR>
<INPUT TYPE="FILE" NAME="userfile" SIZE="30">
<br>
<input type="submit" value="Upload" name="B1">
Please click only <b>once</b> and wait for confirmation
</form>
<a href=upload.php>clear form</a>
</body>