php javascript postback

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How can I do the following using php/javascript

Page 1 has a form with a text field, when you click on a link next to
the textfield it launches page2 where you click on a picture which
returns a value back to page 1 without page 1 reloading.

So basically I want to launch a new page2 from page1 and then return a
value back to the form on page 1.

Please provide a simple example code if possible.


Re: php javascript postback

Quoted text here. Click to load it

Probably impossible. Without reloading (AJAX) server answers to the page
which is sending request. Why not dynamically load pictures after clicking
the "link" on page 1?

Re: php javascript postback wrote:
Quoted text here. Click to load it

You can't do it in PHP - PHP is executed on the server, so in order to  
get something back in page 1, you'll have to reload the page or use Ajax.

Javascript can do it, though.  Try a javascript newsgroup.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: php javascript postback

Kimmo Laine wrote:
Quoted text here. Click to load it

Unless next_page.php generates PHP, the script with this include will
only get HTML.

Quoted text here. Click to load it


    if (isset($_GET['foo'])) {
      echo '<?php echo $_GET[\'foo\']; ?>';
    } else {
      echo '<?php echo \'Not available\'; ?>';

File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

Site Timeline