Forum Moderators: coopster

Message Too Old, No Replies

Repeat Region for Variables?

         

naveenmedia

11:47 pm on Jul 12, 2004 (gmt 0)

10+ Year Member



Hi all.

Is there a way to create new variables on the fly?

I have a page with a form, listing data, with a repeat region. Next to each data item is a corresponding checkbox. The name attribute for the checkbox is:

"location<?php echo $row_rs_properties['property_id']?>"

So it comes out to be "location1", "location2", etc. for each respective row.

I'm trying to send this data via e-mail. So I have a script to handle the data, located in a file "refer.php".

In this file, I have the variable

$location = $_POST['location'];

However, this will only read data from a checkbox named "location". Is there a way to dynamically create more variables using the same recordset used to create the additional data and checkboxes?

That way, it automatically creates the variables $location1, $location2, etc. as needed?

Thanks,
Naveen

Timotheos

12:15 am on Jul 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Take a look at variable variables [ca.php.net]

Swash

2:48 am on Jul 13, 2004 (gmt 0)

10+ Year Member



Wowser thanks Timotheos, there's some uber-handy code on that page! I love stumbling across stuff like this.