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

 

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.