darkhappy Posted May 11, 2008 Share Posted May 11, 2008 I have a while loop that pulls rows of data from a sql table, and at the beginning if each row I have a button that says "Approve Sheet ID # xxxxx". I want the button to just say "Approve" and attach the unique sheet id some other way in the button without it displaying - do you know if there is a way to do this? Or some other way to get the unique identifier to post without putting it in the value of the "Approve" button? <input name="approve" type="submit" class="style4" value="Approve Sheet ID #<?php echo $sheetid?>" /> Link to comment https://forums.phpfreaks.com/topic/105126-submit-button-identifier/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 11, 2008 Share Posted May 11, 2008 Use the name="...." parameter. Link to comment https://forums.phpfreaks.com/topic/105126-submit-button-identifier/#findComment-538234 Share on other sites More sharing options...
darkhappy Posted May 11, 2008 Author Share Posted May 11, 2008 Use the name="...." parameter. if i made the name unique how would i know how to recall this information once i post it ($_POST['??'])? Link to comment https://forums.phpfreaks.com/topic/105126-submit-button-identifier/#findComment-538235 Share on other sites More sharing options...
AndyB Posted May 11, 2008 Share Posted May 11, 2008 Do you want to 'approve' one at a time or do you want to choose multiple items to be approved when you submit the form? Link to comment https://forums.phpfreaks.com/topic/105126-submit-button-identifier/#findComment-538245 Share on other sites More sharing options...
darkhappy Posted May 11, 2008 Author Share Posted May 11, 2008 Do you want to 'approve' one at a time or do you want to choose multiple items to be approved when you submit the form? I see where you're going with that, I'd like to approve 1 at a time. It's actually easier because its 1 click and just reloads the page. I think I figured out how though. I can use the "name" parameter as suggested in the first reply, and set the value to "approve". then when i process the script i can run the same query i used to display the approval options to begin with, and use a while loop to cycle through different POST statements until I find a match. i think that would work - assuming i can insert a $var into existing $_POST['var']......... Link to comment https://forums.phpfreaks.com/topic/105126-submit-button-identifier/#findComment-538252 Share on other sites More sharing options...
AndyB Posted May 11, 2008 Share Posted May 11, 2008 One at a time. Why not just use a link and abstract the passed id in the approval script ... something like" echo "<a href='approve_me.php?id=". $row['item_id']. "'>Approve</a>"; Link to comment https://forums.phpfreaks.com/topic/105126-submit-button-identifier/#findComment-538254 Share on other sites More sharing options...
darkhappy Posted May 11, 2008 Author Share Posted May 11, 2008 One at a time. Why not just use a link and abstract the passed id in the approval script ... something like" echo "<a href='approve_me.php?id=". $row['item_id']. "'>Approve</a>"; hmm ok i will try that thanks... Link to comment https://forums.phpfreaks.com/topic/105126-submit-button-identifier/#findComment-538263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.