Jump to content

Getting blank screen when trying to include or redirect >:|


deleet

Recommended Posts

This page was working fine 2 hours ago but now it's not.

 

<?php
$user_name = "----"; // replace your user name within the 2x "
    $password = "-----"; // replace your password within the 2x "
    $database_name = "--------"; // replace the database name within the 2x "
    $table_name = "member";


   $namea = strtolower($_REQUEST["firstnamea"]);
   $assworda =$_REQUEST["passworda"];

$dbh = mysql_connect("localhost", $user_name, $password, $database_name);



session_start();


$dbh = mysql_connect("localhost", $user_name, $password, $database_name);
    if (!$dbh)
    {

    }
    else
    {  mysql_select_db("********", $dbh);



        $query = "SELECT * FROM member WHERE username='$namea' and password='$assworda'";
        $result = mysql_query( $query ) or exit( mysql_error() );
        if (!$result)
     { echo "THIS SHOULD NOT BE A BLANK SCREEN BUT IT IS";


        }
        else


         {while($row = mysql_fetch_array($result))
           {

            if ($row['password']==$assworda)
               {if (strtolower($row['username'])==$namea)
                  {$SESSION['email']=$row['email'];
$_SESSION['myaff']=$row['id'];
          $_SESSION['views'] = $_SESSION['views']+ 1;if ($row['gold']=='1'){ $_SESSION['gold']="gold";include('top.php');}else { include('main.php');} }

}}}}

?>


 

My brain box of a business partner decided to launch while I was trying to fix this, so any help would be appreciated.  Thanks

Link to comment
Share on other sites

I'm thinking maybe the database connection is failing - there is no contingency for that:

 

 $dbh = mysql_connect("localhost", $user_name, $password, $database_name);
    if (!$dbh)
    {

    }

 

Try putting something inside the 'if' statement:

 

 $dbh = mysql_connect("localhost", $user_name, $password, $database_name);
    if (!$dbh)
    {
       die("this is where it's dying");
    }

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.