Home
 
 
Search:  
C C++ Perl PHP Python HTML ShellScripts
 
 
  Coding Books
  Tutorials
  Search Code
  Browse Code
  Link to Us
  Site News
  Contact Metalshell
 
 
 
  Submit Code   Statistics
 



Beginning PHP4    (ISBN: 1861003730)


 

 List Price: $39.99
 Our Price: $27.99
 Used Price: $27.75

 Release Date: October, 2000
 Manufacturer: Wrox Press Inc (Perfect Paperback)
 Sales Rank: 5,315

 Author: Chris Lea, Wankyu Choi, Allan Kent, Ganesh Prasad, Chris Ullman









More Info

 Retrieve Posted Data 2003-03-16 14:16:59
  php 
Category: source:php:cgi
Description: Example on posting data to php.
Platform: all
Author: detour
Viewed: 3022
Rating: 3.6/5 (5 votes)
If you have any questions about this piece of code or still need help, try posting your question on the forum.

 

Printable Version
post.php
<?php
  /* post.php by detour@metalshell.com
   *
   * Example on posting data to php.
   *
   * http://www.metalshell.com/
   *
   */

// If submit button was hit, info_sub will not return null
if($_POST["info_sub"]) {
  // Check to make sure both fields where filled out
  if($_POST["title"] && $_POST["url"]) {
    echo('<H3>You Entered: </H3>');
    echo('Title: ' . $_POST["title"] . '<br>');
    echo('URL:  ' . $_POST["url"] . '<br>');
  } else {
    // They left something blank.
    echo('<H3>Field Missing</H3>');
  }
}

?>

<form method="post">
<table align="center">
<tr>
  <td>Title: </td>
  <td><input type="text" name="title" value=""></td>
</tr>
<tr>
  <td>URL: </td>
  <td><input type="text" name="url" value=""></td>
</tr>
</table>
<center><input type="submit" value="Submit URL" name="info_sub"></center>
</form>
Rate this code:
(Not Helpful)  (Very Helpful) 

 
 
   Developer.*  
   Blue Parrots  
   Technipal  
   Defy Magazine  
   Code Project  
   Prog. Heaven  


Got Money?