Jump to content

help me please :(:(


runnerjp

Recommended Posts

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

[code]<?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";
    }
}

?>[/code]
Link to comment
Share on other sites

like so,,,,

[code]<?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";
    }
}

?>[/code]
Link to comment
Share on other sites

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

[code]

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


[/code]

That will then obviously echo the value of that variable at that stage and exit to show it to you...
Link to comment
Share on other sites

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