Results 1 to 10 of 10

Thread: How to bring data from one page to another?

  1. #1
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to bring data from one page to another?

    I got a web page where users can type in their email address (or something), when they click on Next button to go to another page their email address will be displayed on the new page. Could anybody show me how to do that?

    I wonder if Javascritp can do that or I have to resort to PHP, CGI or something?

    thanks,

    sabas

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    you can do this in javascript... and what you have to do is store the information first

  3. #3
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pissa
    you can do this in javascript... and what you have to do is store the information first
    Err..., how? Could you specify your solution?

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    If all you want to do is to put a value (e-mail address in this case) onto another page, you can do this in JavaScript.

    Code:
    <input type="text" id="email">
    <br><input type="button" onclick="document.write(email.value+'<iframe src=\yourpage.htm'\'></iframe>')" value="Submit">
    - Mike

  5. #5
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Did you check this post?? http://www.dynamicdrive.com/forums/s...ad.php?t=11883

    Well that script is written by me and if you need any help with it I can.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You can do it in Javascript, but it's unreliable and quite cumbersome. A server-side script would be much easier.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah, good information, Shachi. I'll work around on it but I'm just afraid users disable Javascript so it turns out Javascript is not a good solution. PHP is alternative?

    mburt, thanks for your code. I'll give it a try.

    Thanks guys,

  8. #8
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I agree with you, Twey. So your specific solution is...(code please)

  9. #9
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah PHP is the best choice.

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I agree with you, Twey. So your specific solution is...(code please)
    page1.html:
    Code:
    <form action="page2.php">
      <input type="text" name="email">
      <input type="submit" value="Next">
    </form>
    page2.php:
    Code:
    <?php echo($_GET['email']); ?>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •