R. Smith R. Smith - 1 year ago 66
Ajax Question

PHP Confusion.. Assistance please

I have made a signup page in PHP (pastebin to php below), Ive made it ask for your name, username, email, password(and confirm), gender and country. I can make it all go through except the first and last name, Its not posting to my database either. I think it wont post to the database because the names are not going through... I have tried a lot and in now completely stuck.. Ive tried google, youtube etc and i cant find anything... Can anybody help me?
Thanks in advanced


Answer Source

In your code besides what was mentioned in the comments you have an if statement that is assigning variables.

if($f = "" || $l = "" || $u == "" || $e == "" || $p == "" || $g == "" || $c == ""){}

Notice the = and not == after $f and $l, it should be:

if($f == "" || $l == "" || $u == "" || $e == "" || $p == "" || $g == "" || $c == ""){}

This way you aren't replacing the original contents and are now checking the contents.

And for future an empty() check will check for "" or even unset POST variables, allowing you to check missing POST values and empty strings in 1 go.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download