Hi,
I'm trying to have a button click run a specific php with an variable passed through. However, when I do it this way, it does not seem to work. The add_footer function is called inside another php code, so I don't think I need the <? and ?> around it.
The line I'm trying to get working is
print '<form method="POST" ACTION="main.php?id=$ticket_id" style="display: inline">';
When I hover the mouse over the button, the $ticket_id is not the value it should be, like 371 or whatever was passed on to the add_footer function. it actually displays "main.php?id=$ticket_id" rather than "main.php?id=371" Any ideas?
function add_footer($ticket_id)
{
print '<BR><FONT SIZE="2">';
if (!is_guest())
{
print "<A HREF=\"edit.php?id=$ticket_id\">Edit Ticket</A> | ";
print "<A HREF=\"edit.php?id=$ticket_id&delete=1\">Delete Ticket</A></FONT>";
print " | Email Ticket To : ";
$r = mysql_query("SELECT * FROM $GLOBALS[mysql_prefix]staff") or die(mysql_error());
print '<form method="POST" ACTION="main.php?id=$ticket_id" style="display: inline">';
print '<select name="email">';
while ( $line = mysql_fetch_assoc($r) ) {
if ( strlen($line['staffemail']) > 2 )
print '<option value="' . $line['staffemail'] . '">' . $line['staffname'] . '</option>';
}
print '</select> <a href="#" onclick="document.getElementById(\'message\').style.display = \'block\'; return false">[Add Message]</a> <input type="submit" value="Send EMail" />
<br /><textarea id="message" style="display:none; width: 100%; height: 100px;" name="message"></textarea>
</form>';
}
}