WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Simple POST and GET example
Categories : PHP, Beginner Guides, Form Processing, HTML and PHP Click here to Update Your Picture
tedd sperling
Date : Mar 01st 2006
Grade : 2 of 5 (graded 3 times)
Viewed : 11338
File : No file for this code example.
Images : No Images for this code example.
Search : More code by tedd sperling
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

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
Db_lib - practical example usage of database abstraction and form validation.
Categories : PHP, Form Processing, PHP Classes, Data Validation, Beginner Guides
Newbie Notes #1 - Making a form return to itself
Categories : PHP, Beginner Guides, HTML and PHP
Form Submission Using Array's
Categories : PHP, HTML and PHP, Beginner Guides, Arrays
How to preset a text string in a textarea input field
Categories : HTML, HTML and PHP, PHP, Beginner Guides
Kewl Date Example
Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides
Form Validation Using PHP to highlight non valid fields
Categories : PHP, Form Processing, Data Validation, Beginner Guides
Sql Builder
Categories : PHP, HTML and PHP, Databases, General SQL, Form Processing
Multiple Select box, Select multiple Items from Menu.List box
Categories : PHP, HTML and PHP, Beginner Guides
mySQL/PHP/search with multientry form and table output with colored rows
Categories : PHP, Beginner Guides, MySQL, HTML and PHP, Databases
How to Create a Shoutbox Using PHP & MySQL
Categories : PHP, MySQL, Web Applications, Beginner Guides, HTML and PHP
Dynamic form field
Categories : PHP, HTML and PHP, Form Processing
PHP and javascript mouseover, mouseout, and mousedown events
Categories : PHP, Java Script, Form Processing, Beginner Guides
Real simple example of removing HTML tags from text then changing \n (new line) to <br>. Could be used in a forum for instance.
Categories : HTML, PHP, HTML and PHP, Beginner Guides
PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use!
Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP