/    Sign up×
Community /Pin to ProfileBookmark

How to send the value with form is submitted ?


——————————————————-
[code=php]<?
session_start();
?>
<html>
<head><title>Ticket System</title>
<script language=”javascript”>

function tkvalid()
{
var frmname=window.document.form1;
if(frmname.servers.value==’0′)
{
alert(“Please select the server ip”);
frmname.servers.focus();
return false;
}
if(frmname.department.value==’0′)
{
alert(“Please select the Department”);
frmname.department.focus();
return false;
}
if(frmname.message.value==””)
{
alert(“Please Enter the message”);
frmname.message.focus();
return false;
}
}
function tkthome()
{
document.location=”customerhome.php”;
}
</script>
</head>
<!–body bgcolor=”lavenderblush”–>
<?
include(“include.php”);
$username=$_SESSION[‘usernam’];
$password=$_SESSION[‘passwrd’];
$query=”select * from server_info where email=’$username'”;
$result=mysql_query($query);
//echo $row->full_name;
?>
<body bgcolor=”seashell”>
<?
echo “<center><b><font face=’verdana’ color=’brown’ size=’4′>Welcome to Ticket System</font></b></center><br>”;
?>
<form method=”post” action=”send_ticket.php” name=”form1″>
<table border=’1′ align=’center’ width=’100%’>
<tr>
<tr>
<td align=”center” colspan=””><font face=’verdana’ color=’black’ size=’2′><b>Submit Trouble Ticket</b></font></td>
</tr>
<tr>
<td align=”center”>

<table border=”1″ align=”center” width=”70%”>

<tr>
<td align=”right” colspan=””><font face=’verdana’ color=’black’ size=’2′>Server IP </font></td>
<td align=”left”><font face=’verdana’ color=’black’ size=’2′>
<select name=”servers” size=”1″>
<option value=”0″>Please Choose</option>
<?

while($row=mysql_fetch_object($result))
{
$serverip=$row->server_ip;
echo “<option value=$serverip>$serverip</option>”;
}
?>
</select>
</font></td>
</tr>
<tr>
<td align=”right”><font face=’verdana’ color=’black’ size=’2′>Department </font></td>
<td align=”left”><font face=’verdana’ color=’black’ size=’2′>
<select name=”department” size=”1″>
<option value=”0″>Please Choose</option>
<?
$query1=”select * from department”;
$result1=mysql_query($query1);
while($row1=mysql_fetch_object($result1))
{
$depart=$row1->dept_name;
echo “<option value=$depart>$depart</option>”;
}
?>

</select></font></td>
</tr>

<tr>
<td align=”right”><font face=’verdana’ color=’black’ size=’2′>Message</font></td>
<td align=”left”><font face=’verdana’ color=’black’ size=’2′><textarea name=”message” rows=”4″ cols=”27″/></textarea></font></td>
</tr>
</table>

</td>
</tr>
<tr><td colspan=””>&nbsp;</td></tr>
<tr>
<td align=”center” colspan=”2″><font face=’verdana’ color=’black’ size=’2′><input type=”button” name=”close” value=”Home” onclick=”tkthome();”>&nbsp;&nbsp;<input type=”submit” name=”submit” value=”submit” onclick=”return tkvalid();”></font></td></tr>
</table>
</form>
<?
if(!isset($_GET[‘msg’]))
{
$msg=””;
}
else if($_GET[‘msg’]==’1′)
{
?>
<table align=”center” border=”0″>
<tr><td align=”center”><font face=’verdana’ color=’red’ size=’2′>
<b>Your Ticket is successfully submitted</b></font></td></tr></table>
<?
}
else if($_GET[‘msg’]==’0′)
{
?>
<table align=”center” border=”0″>
<tr><td align=”center”><font face=’verdana’ color=’red’ size=’2′>
<b>Your Ticket is not successfully submitted</b></font></td></tr></table>
<?
}
?>[/code]

—————————
when the user clicks with value “NO” to a field “status” in the table:

how to send & write to afield with value ?
help

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYJan 04.2006 — please edit your post and place your code in colored tags:

[B][ php ][/B] [I]paste your whole code in here[/I] [B][/ php ][/B] ([U]without[/U] the spaces)
Copy linkTweet thisAlerts:
@chazzyJan 04.2006 — to get the value of a form field, on the processing page (where the form action goes to) if you use post, you use $_POST['fieldname'] similarly if you use get you use $_GET['fieldname']
Copy linkTweet thisAlerts:
@LazyJonesJan 04.2006 — The values from the from is stored in $_POST when the form method is 'post' So an input in <input name="message" ... > will be stored in $_POST['message']
Copy linkTweet thisAlerts:
@patsauthorJan 05.2006 — I think i didn't ask the question properly. ok

1.The value is not entered by the user,once the FORM is submitted i should send "NO" to a "field of table in the database" like this "lib.php?NO"

2.How to append session value with "www.aaa.com?ssid=12341421423?" how to do this. ?
×

Success!

Help @pats spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...