I have 2 columns on my add_membership page. The left column is 'Memberships added' and the right column is 'Memberships too add'.
The code to present the 'memberships to add' is:
$credit=mysql_query("SELECT * FROM credit");
while($rowc=mysql_fetch_assoc($credit)){
$credit_id=$rowc['credit_id'];
if(in_array($credit_id, $_SESSION['pa']))
{}else{
$url_log=$rowc['logo_url'];
$name=$rowc['name'];
?>
<form action="#" method="post">
<div class="text_right"><input type="submit" value="Add"
name="asubmit" class="search_input_submit" /></div>
<?php echo "<img src='$url_log' width='50' height='50' alt='$name' title='$name'>"; ?>
<input type="checkbox" value="<?php echo $credit_id; ?>" name="credit_id" />
<strong><?php echo $name; ?></strong><br />
Membership Number:<input type="text" name"membership">
</form><br /><br />
<?php
}
}
?>
As you can see the Membership number input.
This is the code i've been trying to get to work to add the Membership Number:
<?php
if($_POST['asubmit']){
$credit_id_add=$_POST['credit_id'];
$membership=$_POST['membership'];
mysql_query("INSERT INTO accreditation VALUES(NULL, $lid, $credit_id_add,
'$membership','0' )");
echo $membership ;
$credit_id_add=null;
$referer = $_SERVER['HTTP_REFERER'];
echo "<meta http-equiv='refresh' content='1; url=$referer'> ";
}
?>
I have 'echo'd' the variables I need to save and they all appear except for the 'Membership' which is why the error is occurring because it's trying to find the $membership value.
For the top section of the code, I have had to include the Credit ID into a checkbox as it doesn't seem to work by me just echo'ing for the $_POST to pick up, or putting it in a hidden text field.
Any light shed on this would be hugely appreciated.
Thanks in advance.