Results 1 to 2 of 2

Thread: How to return values ?

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    How to return values ?

    If i pass a php script a value from a webpage how can i have to return the value ?

    I know how to get the incoming data using $_GET or $HTTP_POST_VARS the process or whatever bit don't know how to actually return the reuslts to the page.

  2. #2
    Lively Member lavarock09's Avatar
    Join Date
    Jun 2005
    Posts
    124

    Re: How to return values ?

    Well,

    If the URL is something along the lines of

    http://www.example.com/file.php?id=34

    Then to show the value of id you would do this.

    Code:
    <?
    $id = $_GET['id'];
    echo $id;
    ?>
    or

    Code:
    <?
    $id = $_REQUEST['id'];
    echo $id;
    ?>
    If it is a POST value then it is basically the same,

    Code:
    <?
    $id = $_POST['id'];
    echo $id;
    ?>
    or

    Code:
    <?
    $id = $_REQUEST['id'];
    echo $id;
    ?>
    I hope this helps =)

Posting Permissions

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



Click Here to Expand Forum to Full Width