Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I have a form. That has multiple drop downs but I'm only concerned about one for this issue. the options in this drop down box is blank, submitted, open and closed. The default selected is submitted. I want when the user changes this drop down box that an email is sent to them saying that their work order status has changed and the status to be changed in the database accordingly.
I want to use javascript and php which I know is possible but I can't get it to work so I resorted to this code which doesn't work. Could someone please help me accomplish this. I maybe going about this all wrong so please help me get my head on straight.
I have things commented out to see if thing work or not. It was for testing purposes.Code: Select all
<select name="test" onchange="window.location=('reditproblem.php?test=' + this.options[this.selectedIndex].value)">
<?php
if (isset($GET['test']) && $GET['test']=='open')
{
mssql_query("UPDATE problems SET status='open' WHERE id='$id2'") or die('Error, update query failed');
/*$from = "KCSIT@Keisercollege.edu";
$to = "bnikki@keisercollege.edu";
$subject = "Keiser Support";
$rep_name = "Nikki Barnard";
$body = "Hi Nikki,
You have been assigned a work order.";
mail($to, $subject, $body, "From: $from");*/
}
else if (isset($GET['test']) && $GET['test']=='closed'){
mssql_query("UPDATE problems SET status='closed' WHERE id='$id2'") or die('Error, update query failed');
}
mssql_close($connect);?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]1.[/b] Select the correct board for your query. Take some time to read the guidelines in the sticky topic.[/quote]