Jump to content


Photo

help me please :(:(


  • Please log in to reply
6 replies to this topic

#1 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 13 October 2006 - 01:47 PM

hey all... i got a post script and well you can view it by going to www.runnerselite.com  and on marquee area their is a post link... click that then takes u to pop up link that is where u can entre text you want to add... iit then asks you to login so sends you to page login all clear so far but then when u try login it takes you to a blank page.,... i think its because i have done comethign wrong within the code on my page ...can any one help me???

here is the code for the page

<?php

include "connect.php";

if (isset($_POST['submit'])) // name of submit button
{
    $chatter=$_POST['chatter'];
    $password=$_POST['password'];
    $password=md5($password);
    $query = "select * from ch_chatters where chatter='$chatter' and password='$password'"; 
    $result = mysql_query($query) or die("No te Gusta") ;
    
    $isAuth = false; //set to false originally
    
    while($row = mysql_fetch_array($result))
    {
      $isAuth=true;
      session_start();
      $_SESSION['chatter']=$chatter;
      
    }  
    
    if($isAuth==true)
    {
      print "logged in successfully<br><br>";
      print "<A href='index.php'>Go to Chat</a>";
      $check="SELECT * from ch_online where sessionname='$chatter'";
      $check2=mysql_query($check) or die("2");
      $check3=mysql_fetch_array($check2);
      if(!$check3)
      {
        $day=date('U');
        $s="INSERT into ch_online (sessionname, time) values ('$chatter','$day' )";
        $s2=mysql_query($s) or die("not queried");
      }
                
    }
    else
    {
       print "Wrong username or password";
    }
}

?>


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 October 2006 - 01:53 PM

Session_start() has to be at the beging of the page and at the beging of all pages try.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 13 October 2006 - 01:55 PM

like so,,,,

<?php
Session_start() 
include "connect.php";

if (isset($_POST['submit'])) // name of submit button
{
    $chatter=$_POST['chatter'];
    $password=$_POST['password'];
    $password=md5($password);
    $query = "select * from ch_chatters where chatter='$chatter' and password='$password'"; 
    $result = mysql_query($query) or die("No te Gusta") ;
    
    $isAuth = false; //set to false originally
    
    while($row = mysql_fetch_array($result))
    {
      $isAuth=true;
      session_start();
      $_SESSION['chatter']=$chatter;
      
    }  
    
    if($isAuth==true)
    {
      print "logged in successfully<br><br>";
      print "<A href='index.php'>Go to Chat</a>";
      $check="SELECT * from ch_online where sessionname='$chatter'";
      $check2=mysql_query($check) or die("2");
      $check3=mysql_fetch_array($check2);
      if(!$check3)
      {
        $day=date('U');
        $s="INSERT into ch_online (sessionname, time) values ('$chatter','$day' )";
        $s2=mysql_query($s) or die("not queried");
      }
                
    }
    else
    {
       print "Wrong username or password";
    }
}

?>


#4 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 13 October 2006 - 01:56 PM

still just a blank page :(

#5 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 13 October 2006 - 02:08 PM

Try using exit(); to debug the different stages. For example...


 while($row = mysql_fetch_array($result))
    {
      $isAuth=true;
      session_start();
      $_SESSION['chatter']=$chatter;
echo $isAuth;
exit();
    }  



That will then obviously echo the value of that variable at that stage and exit to show it to you...

#6 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 13 October 2006 - 02:31 PM

nope that didnt work...it has worked b4 and i leave it for a month come back to it and dnt work...wierd

#7 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 13 October 2006 - 05:56 PM

What happened when you tried to debug the script? Did it still show nothing? If so, then obviously your $isAuth variable is empty/null. You are depending on values of variables to evaluate true in your if/while statements, but they might not be. For instance, if $isAuth evaluates to false, then the 2nd stage won't be processed, and will therefore give you a blank screen. Also, try and explicitly set $isAuth to true and see if it then processes the rest of the script.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users