Jump to content

Limitation on how many PHP programs can be called?


wts03202509

Recommended Posts

I'm doing a database query tool.  On 1 report, I allow the user to click on the value of the first field, this in turn calls a php program via href.  In this second report, I allow the same thing but I'm href'ing a different php program from the 2nd report.  The problem is that no matter what I do, the href in the 2nd called php program keeps referencing the href that was used in the first php program called.

 

In bullet form:

 

php program1 > allows user to click on node name, this calls php program2 via href,

php program2 > creates another report, allows user to click on serial # and pull report, calls php program3

 

my problem is that when php program 2 tries to call php program3 via the href, it keeps referring to itself even though the href clearly references another program (php program 3).  Is there some limitation on how many times you can call a php program from a php program?

How would I programatically (or otherwise I guess) eliminate caching as the issue?

 

The syntax that I use for these calls is as follows:

 

print '<td NOWRAP>'."<a href=\"Allfields-50.php/$href_top_x\">$href_top_x</a>".'</td>';

 

I use $PATH_INFO in my called program to grab the parameters.

It looks to me like you're not formatting your links correctly. What's with the forward slash after the .php page? Also....

 

 

print '<td NOWRAP>'."<a href=\"Allfields-50.php/$href_top_x\">$href_top_x[/url]".'</td>';

 

<?php

echo'<td NOWRAP><a href="Allfields-50.php'./.'$href_top_x.'">'.$href_top_x.'[/url]</td>;

?>

 

But I'm still not clear on what you're doing. Would have to see the rest of your code...or how the link is actually echo'ing out.

The URL is correct in my code.  I have no idea why the href is referencing the code of the calling program.

 

The / slash after the php is a way of feeding parameters to the php program.  I got it from tips and tricks on zend.  This way you dont need to do all the variable name=value stuff.  You just list it as a URL and break out all the values from the $PATH_INFO array.

 

so you can do stuff like

 

a href=reporting.php/$fieldvalue/$fromclause/$whereclause/  etc.

 

then in reporting.php you'd do

 

list($var1, $var2, $var3) = explode ('/', substr($PATH_INFO,1))

 

I dont know where that [/url] came from in my posted code.

 

after $href_top_x  it should have just had   

 

<?php

 

</a>".'</td>';

 

?>

 

Well I cant figure out how to get it to post right and I cant find the posting guidelines that cover this.

 

thats supposed to be  <  /  a > ". '</td>'      without all the spaces of course.

 

So I'm trying to call the Allfields-50.php program from within my top-x.php program but the listed href keeps calling top-x.php instead of Allfields-50.php........which I find impossible....but its happening.

 

 

Ok, I figured out how to force it to work (still not a solution) and I'm not sure why I had to do this.

 

just using href=\"myphp.php"/param\"

 

was not working.  It was putting the totally wrong program in the link.  In fact it was putting the program of which this code is a part of in the link.

 

I had to do the following to get it to work:

 

    href=\"http://localhost/blah/dev/myphp.php/$param\"

 

in order for it to work.  Any ideas on why I had to do this?  All the programs are in the same directory and I have never had to do this until now.  In fact the  .php file that calls this one does not have to be listed that way.  Of course this wont work as I cant go around chaning paths in my programs.  Anybody have an idea whats going on?

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.