nut legend Posted January 31, 2008 Share Posted January 31, 2008 Hello, I have a couple of things I would like to know about PHP Forms, firstly lets say you were making a game, if someone sumbits a form where does the information go or does it just go on the websites database? Secondly, if possible could someone help me with sorting out a form? In the form I would like it say: Username: Password: Password (again): Email: Email (again): Age: Thanks in advance Nut Legend P.S. If possible could someone tell me how to add the bot protection part (where the user has to type in some in words from a muddled up picture). Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/ Share on other sites More sharing options...
GameYin Posted January 31, 2008 Share Posted January 31, 2008 Uhh take a look at this form <form action="process.php" method="post"> <input type="text" name="username"> <input type="text" name="pass1"> <input type="text" name="pass2"> <input type="text" name="email1"> <input type="text" name="email2"> <input type="text" name="age"> <input type="button" value="Submit"> The form action will process the page, variables will be assigned in the process.php because we gave "name="username" so the variable will come out like.. <?php // retrieve form data $input = $_POST['username"]; // use it echo "You said: <i>$input</i>"; ?> Whatever was typed into username box will be outputted. Copy as needed. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454297 Share on other sites More sharing options...
haku Posted January 31, 2008 Share Posted January 31, 2008 Any answer on this thread isn't going to be enough for you to be able to program a form on your own. And this forum is for helping people who are having problems with the code they've written, not for writing code for people. So while your question is fair, its not likely to get answered in a way that you can use. What you should do is go to google, and search for "beginners php" and maybe "tutorials". You need to learn about PHP if you want to be able to start programming forms. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454301 Share on other sites More sharing options...
nut legend Posted January 31, 2008 Author Share Posted January 31, 2008 Thanks alot for the info Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454302 Share on other sites More sharing options...
GameYin Posted January 31, 2008 Share Posted January 31, 2008 Any time dude. If you need a developer I am for hire. Go look in PHP programmers for hire section of this forum. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454411 Share on other sites More sharing options...
revraz Posted January 31, 2008 Share Posted January 31, 2008 Actually, $input = $_POST['username"]; should be $input = $_POST['username']; And you should always sanitize and verify the data before doing anything with it. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454417 Share on other sites More sharing options...
nut legend Posted January 31, 2008 Author Share Posted January 31, 2008 Any time dude. If you need a developer I am for hire. Go look in PHP programmers for hire section of this forum. I might need one later except I don't think (not too sure) I need any more PHP, I am trying to make an online game (a game like: www.tribalwars.net, except better ) If you think you would be able to help im sure I might be able to hire you, although I am not too sure. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454609 Share on other sites More sharing options...
elpaisa Posted January 31, 2008 Share Posted January 31, 2008 It's a long run to be a good programmer in php, and you should take a look at some existent game script and study the code, and when you understand it, begin your own projects. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454613 Share on other sites More sharing options...
GameYin Posted January 31, 2008 Share Posted January 31, 2008 Lol sorry revraz. My examples are hand-coded from my knowledge. I shouldn't say copy and paste as needed. I noticed I forgot to close the form tag and I meant to do single-quotes just mistyped. I know how to do forms, just a typo . I might be able to make a game like that. Don't feel like doing it w/o pay though because it's a lot of work. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454732 Share on other sites More sharing options...
revraz Posted January 31, 2008 Share Posted January 31, 2008 Yep, I know it was a typo, I was just trying to avoid the common reply .. "It doesn't work.." Because most of the time people just copy and paste and never review or change to fit their needs. Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454736 Share on other sites More sharing options...
GameYin Posted January 31, 2008 Share Posted January 31, 2008 Lol yea, that has to be the most annoying response when someone has a problem. Too lazy to go fix my errors so I'll just leave them be. Thanks for pointing out the problem. I have trouble noticing errors and yea... Quote Link to comment https://forums.phpfreaks.com/topic/88714-form/#findComment-454761 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.