mandukar Posted May 1, 2007 Share Posted May 1, 2007 hi i'm trying to make a web page where someone can fill in a form and the information can be then sent to a database. can someone tell me how I can go about doing this? heres the forum I wish to use basiclly its char name: Char Gender: background: <form name="form1" method="post" action=""> Character name: <label> <input name="Character name:" type="text" id="Character name:"> </label> <p>Character Gender: <label> <input name="Character Gender:" type="text" id="Character Gender:"> </label> </p> <p>Background information: <label> <textarea name="background information:" id="background information:"></textarea> </label> </p> <p> <label> <input type="submit" name="Submit" value="Submit"> </label> <label> <input type="reset" name="Submit2" value="Reset"> </label> </p> </form> thanks in advanced Link to comment https://forums.phpfreaks.com/topic/49474-information-to-a-database/ Share on other sites More sharing options...
trq Posted May 1, 2007 Share Posted May 1, 2007 try this tutorial. There are many tutorials around that describe what you want to do... do we really need to write you another one here? Link to comment https://forums.phpfreaks.com/topic/49474-information-to-a-database/#findComment-242476 Share on other sites More sharing options...
hackerkts Posted May 1, 2007 Share Posted May 1, 2007 I would recommend you to change your form name to words that doesn't include spaces, I will write a short example on it to let you see, hope you can understand from it. <html> <head> </head> <body> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="test" size="20"><input type="submit" value="Submit" name="submit"> </form> </body> </html> <?php if (isset($_POST['submit'])) { // (1) echo $_POST['test']; //(2) // scripts } ?> For the example I had use POST action. (1) - This line is just to check whether the submit button had been pressed, take note of the submit button's name. (2) - $_POST['test'] this is how you can get the value that submitted in form test, take note of the form's name. As for the // scripts, you can continue from there yourself. Take a look on this tutorial how to submit data into the database, http://www.php-mysql-tutorial.com/mysql-insert-php.php Link to comment https://forums.phpfreaks.com/topic/49474-information-to-a-database/#findComment-242495 Share on other sites More sharing options...
mandukar Posted May 2, 2007 Author Share Posted May 2, 2007 many thanks will keep you updated Link to comment https://forums.phpfreaks.com/topic/49474-information-to-a-database/#findComment-243287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.