If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > retrieving data from another page...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-21-03, 23:48
ab8140 ab8140 is offline
Registered User
 
Join Date: May 2003
Posts: 25
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??
Reply With Quote
  #2 (permalink)  
Old 09-22-03, 14:02
nulldev1ce nulldev1ce is offline
Registered User
 
Join Date: Sep 2003
Posts: 2
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 okay...no?

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
(etc.)
</select>
</input type=submit>
</form>

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On