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?>" /> Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 11, 2008 Share Posted May 11, 2008 Use the name="...." parameter. Quote Link to comment 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['??'])? Quote Link to comment 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? Quote Link to comment 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']......... Quote Link to comment 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>"; Quote Link to comment 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... Quote Link to comment 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.