The below code is a simple example of Post and Get.
To see the example at work, please review:
http://www.xn--ovg.com/form/post_get1.php
tedd
--- copy below and save as post_get1.php -----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Stuff by tedd</title>
</head>
<body>
<h1>tedd's POST & GET example Part 1</h1>
<h2> Post form</h2>
<form method="post" action="post_get2.php">
text:<input type="text" size =40 name="name">
<input type=submit value="Submit Post">
</form>
<h2> GET form</h2>
<form method="get" action="post_get2.php">
text:<input type="text" size =40 name="name">
<input type=submit value="Submit Get" >
</form>
</body>
</html>
--- copy below and save as post_get2.php -----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Stuff by tedd</title>
</head>
<body>
<h1>tedd's POST & GET example Part 2</h1>
<?
function stripFormSlashes ( $arr )
{
if (! is_array ( $arr ))
{
return stripslashes ( $arr );
}
else
{
return array_map ( 'stripFormSlashes' , $arr );
}
}
if ( get_magic_quotes_gpc ())
{
$_GET = stripFormSlashes ( $_GET );
$_POST = stripFormSlashes ( $_POST );
}
echo ( "<br/>" );
echo ( "<pre>" );
echo ( "POST info:\n" );
print_r ( $_POST );
echo( "</pre>" );
echo ( "<br/>" );
echo ( "<pre>" );
echo ( "GET info:\n" );
print_r ( $_GET );
echo( "</pre>" );
if( $_GET [ 'name' ])
{
$name = $_GET [ 'name' ];
}
echo( $name );
?>
<p>
<a><input type="button" value="back" onclick="history.go(-1)"></a>
</p>
</body>
</html>
Simple PHP Form Field Generator Categories : PHP , Beginner Guides , Form Processing , HTML and PHP mySQL/PHP/search with multientry
form and table output with colored rows Categories : PHP , Beginner Guides , MySQL , HTML and PHP , Databases The Nearly Perfect Contact Us Form Categories : PHP , Form Processing , HTML and PHP Form Submission Using Array's Categories : PHP , HTML and PHP , Beginner Guides , Arrays How to Create a Shoutbox Using PHP & MySQL Categories : PHP , MySQL , Web Applications , Beginner Guides , HTML and PHP Kewl Date Example Categories : PHP , HTML and PHP , Date Time , CSS , Beginner Guides PHP based HTML rabbing Tools Categories : PHP , HTML and PHP , Tag Extractors , Regexps , Beginner Guides Using PHP im HTML image tags Categories : PHP , HTML and PHP , Graphics , Beginner Guides Newbie Notes #9 - Hyperlinking a post Categories : PHP , Java Script , HTML and PHP , Beginner Guides Db_lib - practical example usage of database abstraction and form validation.
Categories : PHP , Form Processing , PHP Classes , Data Validation , Beginner Guides Form Validation Using PHP to highlight non valid fields Categories : PHP , Form Processing , Data Validation , Beginner Guides Basic Authentication with sessions Categories : PHP , Beginner Guides , Authentication , Form Processing , Sessions How to preset a text string in a textarea input field Categories : HTML , HTML and PHP , PHP , Beginner Guides Dynamic form field Categories : PHP , HTML and PHP , Form Processing Sql Builder Categories : PHP , HTML and PHP , Databases , General SQL , Form Processing