NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Phped Debugging Issue


Joined: 24 May 2011
Posts: 9
Reply with quote
Hi Sir's,

In very simple term, I have .htaccess file that says "how-itworks'.html --> index.php

Now I open phped IDE and run my main file that is index.php, it stops at 1st line and i run through code and output window is web page...
Then
I click on link "hot-it-works", then the browser says http://localhost/howitworks.html .
It applies .htaccess file rewrite rule correctly, but debugger is not again going to 1st break point at index.php file. It simply outputs the result of index.php file with how it works.
How can I make it go to break point again? I want to test functionality of "how-it-works', by stepping through break point.
View user's profileFind all posts by kaprishi1Send private messageAIM Address
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
I just put this into a .htaccess:

Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/howitworks.html [NC]
RewriteRule ^(.*)$ /index.php [R,L]


Then I put a breakpoint at the start of an index.php which contains the following:

Code:
echo '<a href="howitworks.html">test</a>';
exit;


With a breakpoint on the echo statement, PhpED stops everytime I click the link, so seems to work fine.

The NuSphere DBG module uses browser cookies to determine if debugging is enabled, so if your browser was blocking session cookies, that could cause a problem with breakpoints when clicking links.

You could try changing your link to something like:

Code:
echo '<a href="howitworks.html?DBGSESSID=1234">test</a>';
exit;


That will cause DBG to to be invoked even if session cookies are disabled (any number can be used; 1234 will work).
View user's profileFind all posts by plugnplaySend private message
Thanks !


Joined: 24 May 2011
Posts: 9
Reply with quote
Dear Sir,

My .haccess file is : RewriteRule ^([^/]+).html /index.php?file=$1 [NC]
RewriteRule ^([^/]+)/([^/]+).html /index.php?file=$1&sub1=$2 [NC]
~~~~~~~~~~~~~~~~~~~~~~~~~
And portion of Index.php is
<?php ob_start(); ?>
$file_name = $_REQUEST["file"];
$root_dir_path = 'themes/'.$theme_name.'/pages/'; //root directory
$root_sidebar_path = 'themes/'.$theme_name.'/';
switch($file_name)
{
case "order":
$sub1 = $_REQUEST["sub1"];
if($sub1 == "category")
{
$url = $_SERVER['REQUEST_URI'];
$last_uri = end(explode('/',$url));
$category_name = current(explode('.',$last_uri));

$left = $root_dir_path."category.php";

$page_title = ucfirst("Deals In ".$category_name);
$view = "template_2.php";
}
default:
$page_title = "Home";
$left = $root_dir_path."home.php";
$right = $root_sidebar_path."side_bar.php";
$view = "template_3.php";
break;
} // end switch

Now 1st time when I run index.php file in PHPed IDE, then it opens output window with http://localhot:8080/index.php?debugsessionid=..... and breakpoint is at 1st line of code (index.php) then it opens web page wih links like how it works , Order etc Now , When I click on Order, the cursor is not going back to the index.php( break point), it simply outputs the web result that is Order page.

PLeas guide me, what steps should I follow to make breakpoint working 2nd time ( that is from browser to index.php).

thanks so much.after so much fight, your replay gave me some hope.

thanks. God bless you.
View user's profileFind all posts by kaprishi1Send private messageAIM Address
Phped Debugging Issue


Joined: 24 May 2011
Posts: 9
Reply with quote
I tired using your method,
my index.php file is
<? php
echo '<a href="howitworks.html?DBGSESSID=1234">HOME</a>' ;
?>

and i wrote your rewrite conditon and rule, when i start debugger , it stops at echo at 1st time, then press F7, goes into exit mode then output windows shows HOME link, after I click on HOME, the ouput window says "webpage cannot be found" .

I was expecting the breakpoint to go back to my index.php file

Don't know wat's wrong. PLease help
View user's profileFind all posts by kaprishi1Send private messageAIM Address
Phped Debugging Issue
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic