Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > note 71879 added to ref.mysql
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 25th May 00:51
External User
 
Posts: 1
Default note 71879 added to ref.mysql


<?php

// DESCRIPTION
// Displays Form, Inserts Form data into Database Table and Redirects

$EmployeeFirstName = $_REQUEST["EmployeeFirstName"];
$EmployeeLastName = $_REQUEST["EmployeeLastName"];
if ($_SERVER['REQUEST_METHOD'] == 'GET'){
echo '<TABLE WIDTH=450 BORDER=0 CELLSPACING=0 CELLPADDING=3>
<TR BGCOLOR=#OOOO84>
<TD COLSPAN=2><STRONG><FONT COLOR=#FFFFFF> Form</FONT></TD>
</TR>
<FORM METHOD=POST>
<TR VALIGN=TOP BGCOLOR=#BFBFBF>
<TD ALIGN=RIGHT> EmployeeID</TD>
<TD><INPUT TYPE=TEXT NAME=EmployeeID SIZE=40 MAXLENGTH=256 VALUE=></TD>
</TR>
<TR VALIGN=TOP BGCOLOR=#BFBFBF>
<TD ALIGN=RIGHT> EmployeeFirstName</TD>
<TD><INPUT TYPE=TEXT NAME=EmployeeFirstName SIZE=40 MAXLENGTH=256 VALUE=></TD>
</TR>
<TR VALIGN=TOP BGCOLOR=#BFBFBF>
<TD ALIGN=RIGHT> EmployeeLastName</TD>
<TD><INPUT TYPE=TEXT NAME=EmployeeLastName SIZE=40 MAXLENGTH=256 VALUE=></TD>
</TR>
<TR ALIGN=CENTER BGCOLOR=#BFBFBF>
<TD COLSPAN=2><INPUT TYPE=SUBMIT VALUE=Submit> <INPUT TYPE=RESET VALUE=Reset></TD>
</TR>
</FORM>
</TABLE>';
} else {
$link = mysql_connect('localhost', 'wizzyweb', 'password') or die('Could not connect: ' . mysql_error());
mysql_select_db('wizzyweb') or die('Could not select database');

$query = "INSERT INTO Employees (EmployeeFirstName, EmployeeLastName) VALUES ('$EmployeeFirstName', '$EmployeeLastName');";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Closing connection
mysql_close($link);
header("Location: http://www.wizzyweb.com"); }
?>
----
Server IP: 64.71.164.2
Probable Submitter: 166.137.141.251
----
Manual Page -- http://www.php.net/manual/en/ref.mysql.php
Edit -- https://master.php.net/note/edit/71879
Del: integrated -- https://master.php.net/note/delete/71879/integrated
Del: useless -- https://master.php.net/note/delete/71879/useless
Del: bad code -- https://master.php.net/note/delete/71879/bad+code
Del: spam -- https://master.php.net/note/delete/71879/spam
Del: non-english -- https://master.php.net/note/delete/71879/non-english
Del: in docs -- https://master.php.net/note/delete/71879/in+docs
Del: other reasons-- https://master.php.net/note/delete/71879
Reject -- https://master.php.net/note/reject/71879
Search -- https://master.php.net/manage/user-notes.php
  Reply With Quote


  sponsored links


2 25th May 02:54
External User
 
Posts: 1
Default note 71879 deleted from ref.mysql by nlopess


Note Submitter:

----

<?php

// DESCRIPTION
// Displays Form, Inserts Form data into Database Table and Redirects

$EmployeeFirstName = $_REQUEST["EmployeeFirstName"];
$EmployeeLastName = $_REQUEST["EmployeeLastName"];
if ($_SERVER['REQUEST_METHOD'] == 'GET'){
echo '<TABLE WIDTH=450 BORDER=0 CELLSPACING=0 CELLPADDING=3>
<TR BGCOLOR=#OOOO84>
<TD COLSPAN=2><STRONG><FONT COLOR=#FFFFFF> Form</FONT></TD>
</TR>
<FORM METHOD=POST>
<TR VALIGN=TOP BGCOLOR=#BFBFBF>
<TD ALIGN=RIGHT> EmployeeID</TD>
<TD><INPUT TYPE=TEXT NAME=EmployeeID SIZE=40 MAXLENGTH=256 VALUE=></TD>
</TR>
<TR VALIGN=TOP BGCOLOR=#BFBFBF>
<TD ALIGN=RIGHT> EmployeeFirstName</TD>
<TD><INPUT TYPE=TEXT NAME=EmployeeFirstName SIZE=40 MAXLENGTH=256 VALUE=></TD>
</TR>
<TR VALIGN=TOP BGCOLOR=#BFBFBF>
<TD ALIGN=RIGHT> EmployeeLastName</TD>
<TD><INPUT TYPE=TEXT NAME=EmployeeLastName SIZE=40 MAXLENGTH=256 VALUE=></TD>
</TR>
<TR ALIGN=CENTER BGCOLOR=#BFBFBF>
<TD COLSPAN=2><INPUT TYPE=SUBMIT VALUE=Submit> <INPUT TYPE=RESET VALUE=Reset></TD>
</TR>
</FORM>
</TABLE>';
} else {
$link = mysql_connect('localhost', 'wizzyweb', 'password') or die('Could not connect: ' . mysql_error());
mysql_select_db('wizzyweb') or die('Could not select database');

$query = "INSERT INTO Employees (EmployeeFirstName, EmployeeLastName) VALUES ('$EmployeeFirstName', '$EmployeeLastName');";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Closing connection
mysql_close($link);

header("Location: http://www.wizzyweb.com");
}
?>
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666