<?php if(is_admin($user_info['uid'], $info['companyid']) === false) { if (isset($_POST['join'])) { echo "works"; die(); } $companies = fetch_company_by_name($info['cname']); ?> <table class="feed pts pbl"> <?php foreach ($companies as $company) { ?> <tr class="mbm"> <td> <form method="post" id="ccreateform" class="man"> <input type="submit" name="join[<?php echo $company['companyid']; ?>]" value="Join" /> </form> </td> </tr> <?php } ?> </table> <?php } ?>
Unique Submit Buttons Won't Post
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Unique Submit Buttons Won't Post
I can't figure out why my $_POST['join'] isn't working. Does my form need to be inside my foreach?
Re: Unique Submit Buttons Won't Post
no.unemployment wrote: Does my form need to be inside my foreach?
But it isn't working because you have not given the form an action attribute.
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Unique Submit Buttons Won't Post
The action doesn't seem to be the problem as this isn't killing that page when I hit submit.jacek wrote:no.unemployment wrote: Does my form need to be inside my foreach?
But it isn't working because you have not given the form an action attribute.
if (isset($_POST['join'])) { var_dump($_POST['join']); echo "works"; die(); }
Re: Unique Submit Buttons Won't Post
First, please use the code buttons when posting code on the forum
Second, try moving the var_dump outside of the if block to see what post data you are actually getting.
Second, try moving the var_dump outside of the if block to see what post data you are actually getting.