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
https://forums.phpfreaks.com/topic/23850-help-me-please/
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
https://forums.phpfreaks.com/topic/23850-help-me-please/#findComment-108334
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
https://forums.phpfreaks.com/topic/23850-help-me-please/#findComment-108340
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
https://forums.phpfreaks.com/topic/23850-help-me-please/#findComment-108506
Share on other sites

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.