Jump to content

Archived

This topic is now archived and is closed to further replies.

geronimo

Redirect php output to calling html page

Recommended Posts

1. I have an index.html page with hyper links on it.

[u]link1 [/u]
[u]link2 [/u]
[u]getlist.php [/u]


2. The hyper links are/run/trigger php scripts....ex: getlist.php.
3. The php script queries a mysql database.
4. The results are produced and then viewed on a new web page.

Question-problem: I want to imbed the results on the calling HTML page....i.e. index.html

EXAMPLE : Output sought (Displayed on index.html):

[u]link1 [/u]
[u]link2 [/u]
RESULTS of php code query of the mysql database should go here.
aaaa(bbbb)
"
"
etc.
etc.

Thank you

Share this post


Link to post
Share on other sites
Either you combine your PHP and HTML into one PHP script or you can use AJAX techniques from javascript to asynchronasly call your PHP scripts and return the information back to javascript to display

Ken

Share this post


Link to post
Share on other sites
[!--quoteo(post=362019:date=Apr 5 2006, 03:17 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 5 2006, 03:17 PM) [snapback]362019[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Either you combine your PHP and HTML into one PHP script or you can use AJAX techniques from javascript to asynchronasly call your PHP scripts and return the information back to javascript to display

Ken
[/quote]

1. Thanks for responding.
2. I thought about combining the PHP and HTML but that would require multiple copies - close to 100 of the same HTML file......and that file is already big.
3. I don't know anything about AJAX!

Thanks
soc

Share this post


Link to post
Share on other sites
i believe what ken meant was that you could send the links to the same page you're on, and simply run the appropriate query based on what was sent. then output it where appropriate.

you only need ONE file to parse all the links in this way, not a great deal of them.

Share this post


Link to post
Share on other sites
[!--quoteo(post=362064:date=Apr 5 2006, 06:20 PM:name=akitchin)--][div class=\'quotetop\']QUOTE(akitchin @ Apr 5 2006, 06:20 PM) [snapback]362064[/snapback][/div][div class=\'quotemain\'][!--quotec--]
i believe what ken meant was that you could send the links to the same page you're on, and simply run the appropriate query based on what was sent. then output it where appropriate.

you only need ONE file to parse all the links in this way, not a great deal of them.
[/quote]

Hi:
1. Thanks for responding.
2. What I did was add this line to the "called" php script: <?php include("index.html"); ?>
3. I made this the first line in the script.
4. It worked........but.
5. The results are produced at the bottom of the page and below the table.

Need: I would like it to be displayed in the following location:(here is the code)
****************************************************************
<tr>
<td height="380" valign="top"> </td>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
</tr>
</table>
***************************************************************

XXXXXXX - marks the spot.


Any suggestions?

Thanks
soc

Share this post


Link to post
Share on other sites
I believe you can access the page that sent you via http_refer or some similar command in PHP. (Search the docs for 'refer'). This could be used to make a link?


Alternatively, you can use the JavaScript window.history.Back(); function.

Share this post


Link to post
Share on other sites

×

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.