| Code: |
| <html>
<head> </head> <body> <img src="saysiorbanner.jpg" width="100%"> <?php $title = $_POST['title']; $type = $_POST['type']; $content = $_POST['content']; $password = $_POST['password']; $docname = $_POST['docname']; $date = date("Y/m/d"); $summary = $_POST['summary']; $comments = $_POST['comments']; $con = mysql_connect("localhost", "*******", "******"); mysql_select_db("********", $con) or die(mysql_error()); $ins = mysql_query("INSERT INTO documents (title, type, date, content, docname, summary, comments) VALUES ($title, $type, $date, $content, $docname, $summary, $comments)"); mysql_close($con); if ($ins) { echo "<br><br><br><center>Nice work. " . $title . " has been uploaded and is now available for the public to view."; } else { echo "There was a problem"; } ?> </body></html> |
I've been tweaking this code for a while and I can't get it to work. What really bugs me is that I've written stuff like this before, so I have no idea why I can't get it to work now. Would anyone who can please tell me where I went wrong with this? $ins has been returning false, and I've looked at my database records. Thank you so much in advance.
EDIT: I found some old code that does what I want this code to do, and it works, so I no longer have a problem.
Last edited by Saysior on Sun Sep 09, 2007 9:24 pm; edited 1 time in total
