Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile sending data from one page to another page in php

    hi, guys. can give some tips on how to send a data from one page to another page using php code...



    it would be greatly appreciated.......

    thank you so much...

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    Hello there,

    You can do this in many ways.

    one way is to use $_GET to send data from one page to another. for example, you have a link in page one.php and you wish to send data to page two.php. you can write your link in this way.

    Code:
    <a href="two.php?data=some_data_here">page two</a>
    if you look at the href, you will notice "?" followed by data=....

    here, we have create a variable and called data and assigned a value to it. In page two.php, we can obtain this data as follow

    PHP Code:
    <?php $data $_GET['data']; ?>
    Another way is to use sessions variables. this method is better in a sense that you would be able to share this data throughout your website.

    Good luck.
    Ess


  •  

    Posting Permissions

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