bigdspbandj Posted October 25, 2007 Share Posted October 25, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/74800-dynamic-form-fields/ Share on other sites More sharing options...
KrisNz Posted October 25, 2007 Share Posted October 25, 2007 you want $add_upload+=1; or $add_upload++; Quote Link to comment https://forums.phpfreaks.com/topic/74800-dynamic-form-fields/#findComment-378273 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.