Morning Guys,
I have made a simple html form that uses an insert.php to input data in to my mysql DB (that is used for my search).
At the moment the form only consists of text fields, however I need to updload an image and a PDF to the record (individual columns have been created). I basicly want to upload the two items to the server and simply store the file path in the database....... problem is I have no ide how to do this short of manualy uploading the two and manualy typing the filepaths into the mysql DB.
Can someone please help me out?!
Code so far (stripped down to basic's):-
[uHTML ]Form[/u]
<form action="insert.php" method="post">
Project Number: <input type="text" name="projectnumber" />
Property: <input type="text" name="property" />
Address: <input type="text" name="address" />
City: <input type="text" name="city" />
Post Code: <input type="text" name="postcode" />
<input type="submit" />
</form>
insert.php
$sql="INSERT INTO database_name (projectnumber, property, address, city, postcode)
VALUES
('$_POST[projectnumber]','$_POST[property]','$_POST[address]','$_POST[city]','$_POST[postcode]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
This needs to be upload at the same time as the new record is inserted so that it gets matched up witht the right property.
Would really appreciate help on this as I have scoured the net for hours and short of purchasing a program (which doesn't teach jack) can figure it out.
Thanks again, in advance.
Kuga