Hi All,
For some reason, I cannot get the values to pass to the ACTION page correctly in the code below:
<?
$id_Event = '1';
?>
<head>
</head>
<body>
<form id="form2" name="Operation" method="post" action="EvVolProcess.php?id_Service=<?php echo '$id_Event'; ?>">
<input name="id_Event" type="hidden" id="id_Event" value="<?php echo '$id_Event'; ?>" />
<select name="SelVol" id="SelVol">
<?
$query = "select id,First_Name,Last_Name from Volunteers order by Last_Name,First_Name";
$result = mysql_query ($query) or die ("select failed : ".mysql_error());
while($line = mysql_fetch_array($result))
{
echo "<option value = \"".$line[0]."\">".$line[2].", ".$line[1]."</option>\n";
}
?>
</select>
<input name="Operation" type="submit" id="Operation" value="ADD" />
<input name="Operation" type="submit" id="Operation" value="Email" />
</form>
</body>
ACTION page looks like this:
<?
$id_Vol = $_POST['SelVol'];
$id_Service = $_POST['id_Service'];
//print_r($_POST['ADD']);
//print_r($id_Vol);
//print_r($id_Service);
?>
<?php
require_once('auth.php');
?>
<?
include("inc/interface.php");
include("inc/funct.php");
ServerConnect();
DB_Connect();
?>
<?php
if ($_POST['ADD'])
{
<?php
// Finds the Volunteer to grab more values
$query = "select id,First_Name,Last_Name,Instrumnets from Volunteers where id='$id_Vol'";
$results = mysql_query($query) or die("Error performing query");
// Sets additional values for the the next Query
$Name = .$line[2].", ".$line[1].; // The fields need to format the Name Last_Name, First_Name - HELP!
$Instruments = echo $row['Instruments'];
// Adds new record
$sql="INSERT INTO Ev_AvVolunteers (id_Event, id_Volunteer, Name, Instruments) VALUES ('$id_Event','$id_Vol','$Name','$Instruments')";
//print_r($sql);
$result = mysql_query($sql) or die(mysql_error());
header("location: [Service_Dates_detail.php]"); } else if ($_POST['Email']) {
header("location: [Service_Dates1_detail.php]"); }
?>
I need the $Name to be formatted correctly, SEARCH and ADD actions to work, then to redirect back to the page. Also, I don't think the IF Statement is working correctly. Sigh...
Thanks!