Jump to content

[SOLVED] help passing variable num of post variables


skycruiser

Recommended Posts

I'm a php/mysql noob and I'm a little stuck at the moment.

 

I've got one page that generates a set of POST variables (number depends on the number of records in a mysql query).  The vars are doc_master0, doc_master1 etc.

 

That part works fine.  I can see that the variables are available on the next page.  I can echo them directly.  But I'm trying to access those variables in a loop and there's where I'm running into trouble.

 

In my loop with index 'i', I'm creating a temp variable $doc_master_temp = "doc_master".$i;  But if I try to retrieve that post variable with $doc_master = $POST_["doc_master_temp"]; I get an error undefined POST variable.  I also tried $doc_master = $POST_["$doc_master_temp"];

 

Is there any way to get this to work or do I need a completely different approach (arrays or something??). 

 

Thanks for the help!

MIchael

 

 

Link to comment
Share on other sites

Can't PM yet.  wanted to say I'm also in Richardson TX - at UTD.  And I noticed you do freelance work.  Once my database is done and ready to go online we may want an "expert" review for security issues or other general advice.  I'll keep you in mind when we get there (if you're interested).

MIchael

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.