Jump to content

Dynamic Form Fields


bigdspbandj

Recommended Posts

I want to have it setup so when the user clicks this link a value is sent via get and that value is put through a for loop to generate an additional form field:

 

if(isset($_GET['add_upload']) && is_numeric($_GET['add_upload'])) {
			$add_upload = $_GET['add_upload'];
			$add_upload+1;
			if ($add_upload > 0) {
				for($i=1; $i <= $add_upload; $i++) {
					echo 'upload'.$i;
				}
			}
		}
	?>
	<a href="<?php echo $_SERVER['PHP_SELF'].'?add_upload='; if (isset($add_upload)) { echo $add_upload; } else { echo 1; } ?>">Click Here To Add Another Upload Field</a>

 

The value keep returning as 1. Can anyone give this a second look and let me know what I am missing.

Link to comment
https://forums.phpfreaks.com/topic/74800-dynamic-form-fields/
Share on other sites

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.