Debugging shows blank page

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Debugging shows blank page

Postby papand13 » August 16th, 2014, 7:46 pm

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.
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

Postby Miloslav Beno » August 18th, 2014, 2:00 pm

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!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Debugging shows blank page

Postby papand13 » August 18th, 2014, 7:47 pm

Hi.

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

Postby Miloslav Beno » August 21st, 2014, 2:57 pm

Hi,

Great!

Have a good one;-)
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 73 guests

cron

User Control Panel

Login

Who is online

In total there are 73 users online :: 0 registered, 0 hidden and 73 guests (based on users active over the past 5 minutes)
Most users ever online was 511 on April 27th, 2024, 10:11 pm

Users browsing this forum: No registered users and 73 guests