Qbasicnews.com

Full Version: Small HTML/PHP problem.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Okay, on my site, every single page is a child of index.php, so all of the urls will be in the form of "index.php?page=[insert page here]". I have a user-registration page, that includes a form. When the user clicks submit, it's supposed to take them to the signup script (index.php?page=signup.php), but instead it takes them to the index.php page. This is apparently a problem caused by the fact that register.php is a child of index.php, because when I load register.php by itsself, it works just fine. Does anyone know what's going on?
Lets see the source code.

Does it have it set up so that it load the page? *Do other pages work? index.php=blah.php

Or does it only not work for the form?
EDIT: Alright, I fixed it. I forgot to close off a form tag that came before...

Now, I have a new problem...
Code:
mysql_query("INSERT INTO TABLE users VALUES('',$username,$dbpass,useremail)");

Shouldn't that work? I don't get any errors, but then again... nothing shows up in the database.
Put single quotes around the variables. And you can probably drop the word "TABLE" as well.
Quote:Put single quotes around the variables. And you can probably drop the word "TABLE" as well.

Wow. I suck...
Well, you can't know before you've learned, right?
Heh, im surprised that you have got so far in a php website without knowing to put quotes around the vars in queries. Wink Or was that just a mistake..?
Well, you only have to put quotes around the vars in queries if they're string values correct?

I dunno... maybe he was just uber lucky lol.
Quote:Heh, im surprised that you have got so far in a php website without knowing to put quotes around the vars in queries. Wink Or was that just a mistake..?
PHP and SQL are not mutually exclusive. You can develop sites based on PHP without knowing a lick of SQL or how to use it in PHP. And yes...the single quotes only go around string entries. Smile
Quote:PHP and SQL are not mutually exclusive. You can develop sites based on PHP without knowing a lick of SQL or how to use it in PHP.

Yes, but come on... you have to admit that 90% of people use PHP for its support of MySQL. I know that I do, anyhow.
Pages: 1 2