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

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");
    }

Archived

This topic is now archived and is closed to further replies.

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