supermerc Posted February 17, 2008 Share Posted February 17, 2008 Hi, Im trying to make a registration script but im getting problems, Im not getting any errors but it doesnt work, like if i enter the information, even if its filled in it tells me i have to enter my first name you can try it here: http://r4ndom.com/yourplace/preg.php For some reason it gives me an error when I try posting my code so i put it on a paste site because it seems to be the only thing I can do so here it is: http://pastebin.com/m52d8f829 Thanks a lot in advance for helping me! Quote Link to comment Share on other sites More sharing options...
supermerc Posted February 17, 2008 Author Share Posted February 17, 2008 bump Quote Link to comment Share on other sites More sharing options...
trq Posted February 17, 2008 Share Posted February 17, 2008 Your going to need to at least narrow your code down to the relevent parts and indent it so it is readable. Quote Link to comment Share on other sites More sharing options...
supermerc Posted February 17, 2008 Author Share Posted February 17, 2008 what do you mean by indent? Quote Link to comment Share on other sites More sharing options...
trq Posted February 17, 2008 Share Posted February 17, 2008 Most programmers follow consistent indentation to group parts of there code into blocks. eg; Parts within if{} statements are indented. eg; <?php if (expression) { echo "do something"; } else { echo "Do something else"; if (expression2) { echo "Do another thing"; } } ?> This makes code alot easier to read. It has pretty much been standard practice since procedural code was invented. Quote Link to comment Share on other sites More sharing options...
supermerc Posted February 17, 2008 Author Share Posted February 17, 2008 is this better? http://pastebin.com/m56dde9e6 Quote Link to comment Share on other sites More sharing options...
trq Posted February 17, 2008 Share Posted February 17, 2008 Yeah, a little. Your code really is quite the mess I'm sorry to say. Why do you have so many empty if statments? eg; if (expression) { // do nothing. } else { // here you do something. } These could just as easily be done using... if (!expression) { // do something. } As for your problem, you check if the variable $fname is empty on this line... if (empty($fname)) Yet I don't see $fname get defined anywhere in your code. Quote Link to comment Share on other sites More sharing options...
supermerc Posted February 17, 2008 Author Share Posted February 17, 2008 thx, now its actually working, the only thing is now, I cant select between male and female, like if i select male, then it selects female. I cant select male at all. <td><label> <input type="radio" name="gender" value="female"> Female <input type="radio" name="gender" value="male"> Male</label></td> </tr> thats the code, I dont know whats wrong, but if i select male then it selects female and enters that in the database. Quote Link to comment 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.