dsjoes Posted December 17, 2010 Share Posted December 17, 2010 i have got this code: // *** Read the value of "Download" (POST or GET method). if (isset(($_POST['Download'])) $fileName = $_POST['Download']; if (isset(($_GET['Download'])) $fileName = $_POST['Download']; // *** Build the link string. $downloadLink = "<a href=\"$fileName\">Download</a>"; but i not sure what i need to do with it (i did not write it) i don't know if it goes with my form or the insert script here they are. this is the form <form action="insert.php" method="post"> Name: <input type="text" name="Name" /><br /> Message: <input type="text" name="Message" /><br /> Download: <input name="Download" type="text" /> <br /> <input type="submit" value="Submit" /></form> and this is the insert script <?php $con = mysql_connect("host","user","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("b32_5584692_Docs", $con); $sql="INSERT INTO Docs(Name, Message, Download) VALUES ('$_POST[Name]','$_POST[Message]','$_POST[Download]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Record added"; header('Location: upload_test.php'); mysql_close($con) ?> Quote Link to comment https://forums.phpfreaks.com/topic/221989-quick-question-about-forms/ Share on other sites More sharing options...
Pikachu2000 Posted December 18, 2010 Share Posted December 18, 2010 We don't really know what you need to do with it either unless you describe the problem you hope to solve with it. Quote Link to comment https://forums.phpfreaks.com/topic/221989-quick-question-about-forms/#findComment-1148898 Share on other sites More sharing options...
dsjoes Posted December 18, 2010 Author Share Posted December 18, 2010 i am trying to make my form easier to use. i have a upload form on the admin part of my site so i can upload word docs and after i have done that i use this form to give the information in a table and a link to open/download the doc. but at the minute i have to type this in the download part of the form everytime. This <a href="test.doc">Download</a> in here Download: <input name="Download" type="text" /> so i am wanting to be able to just type the name of the doc in and the form makes it the link for me. Quote Link to comment https://forums.phpfreaks.com/topic/221989-quick-question-about-forms/#findComment-1148992 Share on other sites More sharing options...
dsjoes Posted December 19, 2010 Author Share Posted December 19, 2010 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/221989-quick-question-about-forms/#findComment-1149269 Share on other sites More sharing options...
dsjoes Posted December 25, 2010 Author Share Posted December 25, 2010 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/221989-quick-question-about-forms/#findComment-1151230 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.