Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003

    Unanswered: retrieving data from another page...

    Using php/mysql... We have predefinied functions using id as a key that needs to be attained from a choice selected on a previous page, how can you bring this field into the function??

  2. #2
    Join Date
    Sep 2003
    I'm not sure if I follow you, but I think as long as you pass the variable to the script and define it before you use it in a function, you should be

    I.e. user picks form choice from page, form element is named "id"

    <form action=thescript.php method=post>
    <select name=id size=1>
    <option value=1>1
    <option value=2>2
    <option value=3>3
    <option value=4>4
    </input type=submit>

    Then "thescript.php" just has to have a line near the top like:

    $id = $_POST['id'];

    Then call your function...

    $result = $myfunction($id); // or whatever.

    Hope that helps...if not, tell us more about what you're trying to do.

    -- Nully

Posting Permissions

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