Debugging shows blank page
4 posts
• Page 1 of 1
Debugging shows blank page
Hi there.
I just purchased PHP Tools. And i am trying to debug my existing project.
However, i have found that my signup.php page is not loading, it simply returns a completely blank page (nothing at all when viewing source).
I have found that if i remove the code block below from my script, the page renders as it should, but it is an essential part of my script. It works 100% when i debug it on a WAMP server.
I really want it to work, and so far this is not a good first impression.
The code block that makes the page return blank.
Thanks for your help.
Regards, Jonas.
I just purchased PHP Tools. And i am trying to debug my existing project.
However, i have found that my signup.php page is not loading, it simply returns a completely blank page (nothing at all when viewing source).
I have found that if i remove the code block below from my script, the page renders as it should, but it is an essential part of my script. It works 100% when i debug it on a WAMP server.
I really want it to work, and so far this is not a good first impression.
The code block that makes the page return blank.
- Code: Select all
switch($key) {
case "username":
if(empty($value) || strlen($value) > 255) $errors[] = $key;
else if (!empty($db->getAccountByUsername($value))) $errors[] = 'usernametaken';
break;
case "password":
if(empty($value) || strlen($value) > 255 || strlen($value) < 6) $errors[] = $key;
break;
case "repeatpassword":
if($value != $_POST['password']) $errors[] = "repeatpassword";
break;
case "email":
if(empty($value) || strlen($value) > 255 || !filter_var($value, FILTER_VALIDATE_EMAIL)) $errors[] = $key;
else if (!empty($db->getAccountByEmail($value))) $errors[] = 'emailtaken';
break;
case "year":
if(empty($_POST['month']) || empty($_POST['day']) || empty($value)) {
$errors[] = "birthdate";
break;
}
if(!checkdate($_POST['month'], $_POST['day'], $value)) $errors[] = "birthdate";
break;
case "captcha":
if($value != $_SESSION['captcha']['code']) $errors[] = $key;
break;
}
Thanks for your help.
Regards, Jonas.
- papand13
- Posts: 2
- Joined: August 16th, 2014, 7:42 pm
Re: Debugging shows blank page
Hello,
Thanks for your post.
The code you've sent seems to be ok. But if blank page is returned that seems to be some issue that prevented to run PHP at all, you can take a look at error_log file ( defined at php.ini error_log option )
But if you use WAMP server to run project I recommend debugging it on WAMP server also. By default PHP projects are set to use PHP Built-in server inside PHP which is very limited, you can change this setting in project properties ( right click on project icon in solution explorer and hit Properties ). Then select Custom Server and enter URL of the project.
If your WAMP server is correctly setup it will work.
Please give me know if that helped.
Thanks!
Thanks for your post.
The code you've sent seems to be ok. But if blank page is returned that seems to be some issue that prevented to run PHP at all, you can take a look at error_log file ( defined at php.ini error_log option )
But if you use WAMP server to run project I recommend debugging it on WAMP server also. By default PHP projects are set to use PHP Built-in server inside PHP which is very limited, you can change this setting in project properties ( right click on project icon in solution explorer and hit Properties ). Then select Custom Server and enter URL of the project.
If your WAMP server is correctly setup it will work.
Please give me know if that helped.
Thanks!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Debugging shows blank page
Hi.
I did as you told me, and it seem to work as it is supposed to now.
Thank you for your help.
I did as you told me, and it seem to work as it is supposed to now.
Thank you for your help.
- papand13
- Posts: 2
- Joined: August 16th, 2014, 7:42 pm
Re: Debugging shows blank page
Hi,
Great!
Have a good one;-)
Great!
Have a good one;-)
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 73 guests