[xdebug-general] using xdebug with php designer

From: Lawrence Flancbaum <lawrencef[@]hlac.com.au>
Date: Wed, 10 Feb 2010 10:15:37 +1100

Hi xdebug

 

I'm new to using phpdesigner and Xdebug but have been debugging through some test PHP scripts using phpdesigner integrated with xdebug

 

When I debug through a procedure in one file and it calls another file, I expected that the debug would continue through the called file ie be able to step through the code in the 2nd called file as well as the first. unfortunately it doesn't. I asked the support team at phpdesigner and they responded

 

“Thanks for the feedback. Not sure if Xdebug support this fully… alternative you must debug it manually, both index.php and login.php.”

 

That’s surprising that xdebug may not be able to do this – how would you suggest the best way to debug through different files in a single code procedure …. the idea of having to hard code variables at the top of each file called in a procedure doesn't sound like my idea of fun  .

 

As example below I got simple form in index.php and if I debug and step through and enter fields in form, I want to be able to continue to step through code in the called file “Log in.php” – is this possible

 

Any suggestions ??

 

 

Cheers

 

 

Lawrence

 

 

 

 

 

 

INDEX.PHP

 

<html>

 

<form action="login.php" method="post" enctype="text/plain">

 

    username: <input type="text" align="LEFT" name="username" /><br />

    password: <input type="text" align="LEFT" name="password" /><br />

    <input type="submit" value="login" />

    

</form>

 

</html>

 

 

LOG IN.PHP

 

<?php

 

session_start("");

 

$username = $_POST ['username'];

$password = $_POST ['password'];

 

 

if ($username&&$password)

{

    $connect = mysql_connect("localhost","root","gokibu") or die ("couldn't connect");

    mysql_select_db("hlaclogin") or die ("couldn't find database");

    

 

    //query db for username and password

    $query = mysql_query("SELECT * FROM users WHERE username = '$username'");

    

    $numrows = mysql_num_rows($query);

    

    if ($numrows!=0)

    {

        //code to login

        while ($row = mysql_fetch_assoc($query))

        {

            $dbusername = $row['username'];

            $dbpassword = $row['password'];

        }

        if ($username==$dbusername&&$password==$dbpassword)

        {

            

         echo "you have successfully logged in. <a href='member.php'/>Click<a/> here to enter the member page" ;

         $_SESSION['username']=$dbusername;

        }

        else

            echo "incorrect password do not match";

    }

    else

        die ("user name does not exist");

}

 

else

    die ("please enter a username and a password");

 

 

 

?>

 

 

 

 
Received on Tue Feb 09 2010 - 23:30:12 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST