Jump to content


Photo

Redirect php output to calling html page


  • Please log in to reply
5 replies to this topic

#1 geronimo

geronimo
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 05 April 2006 - 07:09 PM

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

link1
link2
getlist.php


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):

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

Thank you


#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 05 April 2006 - 07:17 PM

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

#3 geronimo

geronimo
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 05 April 2006 - 10:10 PM

[!--quoteo(post=362019:date=Apr 5 2006, 03:17 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 5 2006, 03:17 PM) View Post[/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

#4 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 05 April 2006 - 10:20 PM

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.

#5 geronimo

geronimo
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 06 April 2006 - 03:44 PM

[!--quoteo(post=362064:date=Apr 5 2006, 06:20 PM:name=akitchin)--][div class=\'quotetop\']QUOTE(akitchin @ Apr 5 2006, 06:20 PM) View Post[/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

#6 Anidazen

Anidazen
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 06 April 2006 - 04:04 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users