petenetman Posted July 23, 2010 Share Posted July 23, 2010 Mind has gone blank on me. What I have is a survey html file where I want to post the fields to a php file and use the php file to insert the passed field names into my mysql database. I can't remember the get into php code and insert Any help I would be grateful. Link to comment https://forums.phpfreaks.com/topic/208656-html-php-mysql/ Share on other sites More sharing options...
ram4nd Posted July 23, 2010 Share Posted July 23, 2010 $_GET['name'] or $_POST['name'] depends on method, I suggest post Link to comment https://forums.phpfreaks.com/topic/208656-html-php-mysql/#findComment-1090080 Share on other sites More sharing options...
petenetman Posted July 23, 2010 Author Share Posted July 23, 2010 Hi thanks for the reply. I can't seem to get the html file to post the variable to the PHP. I put together some simple code and still didn't <html> <head> <title>Data Survey</title> </head> <body> <form id="form1" name="html" method="post" action="SurveyAdd.php"> Clock No: <label> <input name="Clock" type="text" /> </label> <p> Group: <input name="group" type="text" /> </p> <p> <input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" /> </p> </form> </body> </html> <html> <head> <Title>Post page</title> </head> <body> <?php $Clock = $_POST['Clock']; $group = $_POST['group']; ?> <table border=0 cellspacing=0 cellpadding=3> <tr><td> Your Staff No: <td> <?=$Clock?> <tr><td> Your Task Group: <td> <?=$group?> <tr><td> </body> </html> Link to comment https://forums.phpfreaks.com/topic/208656-html-php-mysql/#findComment-1090168 Share on other sites More sharing options...
Pikachu2000 Posted July 23, 2010 Share Posted July 23, 2010 Have a look at the html page source after submitting the form. See if the <?=$Clock?> and <?=group?> tags are showing up in it. You need to get rid of the quick-echo syntax, and use full tags anyhow. It will cause you headaches in the future. <?php echo $Clock; ?> Link to comment https://forums.phpfreaks.com/topic/208656-html-php-mysql/#findComment-1090174 Share on other sites More sharing options...
petenetman Posted July 23, 2010 Author Share Posted July 23, 2010 Thanks Pikachu2000 all sorted now. As the song says "Tonight's gona be a good night" P Link to comment https://forums.phpfreaks.com/topic/208656-html-php-mysql/#findComment-1090228 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.