[SOLVED] When accessing database returns blank page
Moderator: General Moderators
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
[SOLVED] When accessing database returns blank page
When I test the script the page comes up. It works correctly if you try and register with a already registered username. But when you try adding a user to the database you get a blank page. I have checked the database nothing gets added. A registered user is: test. You can try it at
Last edited by anthony88guy on Thu May 12, 2005 5:49 pm, edited 1 time in total.
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Or insert the following lines into your Php.
This should display any php errors or warnings. (Coding not logic)
Code: Select all
error_reporting(E_ALL);
ini_set('display_errors', TRUE);-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
I dont think you guys understand what i mean. I tested out where my problems begin by using print at different stages in the code. The print function stops working at line: 31. So I believe that their is something going on their thats not Correct. My objective is to make a register script that checks:
1) Matching passwords
2) Any blank feilds
3) If username is taken
4) Register account
I have some ideas about how to write some of the code. Hopefully it will work. My old register script worked, but it didn't check for registered usernames.
1) Matching passwords
2) Any blank feilds
3) If username is taken
4) Register account
I have some ideas about how to write some of the code. Hopefully it will work. My old register script worked, but it didn't check for registered usernames.
Last edited by anthony88guy on Thu May 12, 2005 6:04 pm, edited 1 time in total.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
ERROR - Please Try Again Later-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
have you tried this?CoderGoblin wrote:Or insert the following lines into your Php.
This should display any php errors or warnings. (Coding not logic)Code: Select all
error_reporting(E_ALL); ini_set('display_errors', TRUE);
Try this query...
Code: Select all
$result = mysql_query("INSERT INTO users (user, pass, strikeaction, armysize, statid) VALUES('".$username."', '".$pass1."', '".$strikeaction."', '".$armysize."', '".$statid."')") or die(mysql_error());-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
Yes, I have tried that. Nothing turns up. I will try your query infolock.Phenom wrote:have you tried this?CoderGoblin wrote:Or insert the following lines into your Php.
This should display any php errors or warnings. (Coding not logic)Code: Select all
error_reporting(E_ALL); ini_set('display_errors', TRUE);
EDIT: Same result infolock. Am I using mysql_query() wrong on line 31?
EDIT2: I uploaded my old register.php that worked. Only thing it doesnt check for registered usernames.
no your query was correct i just didn't know how you setup your id field so i omitted it from the query itself. was just a test more than anything else.
however, in your check this might cause a problem :
try this instead...
however, in your check this might cause a problem :
Code: Select all
if($username !== "" && $pass1 !== "" && $pass2 !== "" && $statid !== "" && $strikeaction !== "" && $armysize !== "" && $pass1 == $pass2){Code: Select all
if($username != "" && $pass1 != "" && $pass2 != "" && $statid != "" && $strikeaction != "" && $armysize != "" && $pass1 == $pass2){-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
Correct me if i am wrong but DONT you need to compare them using ==, if you use = you are setting the variable. I am a noob so i could be wrong. I also had another thought that it could be my hosting because it is very flaky and i have rewritten the same code like 5 times in different ways, all the same result. I have free hosting and they seem to have more down time then uptime. I know its not the right place but if you know any good quailty hosting with PHP (duh) and good amount of space and bandwidth please tell me.infolock wrote:no your query was correct i just didn't know how you setup your id field so i omitted it from the query itself. was just a test more than anything else.
however, in your check this might cause a problem :
try this instead...Code: Select all
if($username !== "" && $pass1 !== "" && $pass2 !== "" && $statid !== "" && $strikeaction !== "" && $armysize !== "" && $pass1 == $pass2){Code: Select all
if($username != "" && $pass1 != "" && $pass2 != "" && $statid != "" && $strikeaction != "" && $armysize != "" && $pass1 == $pass2){
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
when alone, yes, that's true. But with the negation (!) it's a completely different operator. I can understand the confusion, since both ! and = are operators seperately, plus they are a different operator together.anthony88guy wrote:Correct me if i am wrong but DONT you need to compare them using ==, if you use = you are setting the variable.
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA