All pastes #823421 Raw Edit

Jeez

public text v1 · immutable
·published 2007-12-19 10:42 UTC
rendered paste body
//xx.php

<?php
// $_POST['zipcode'] holds the value of the submitted form parameter

// "zipcode"

$zipcode = trim($_POST['zipcode']);

// Now $zipcode holds that value, with any leading or trailing spaces

// removed

$zip_length = strlen($zipcode);

// Complain if the ZIP code is not 5 characters long
print "ZIP: ".$zipcode;

if ($zip_length != 5) {

    print "Please enter a ZIP code that is 5 characters long.";

}
?>



//ran.html

<form name="user" action="xx.php"
method="get">
Username:
<input type="text" name="zipcode">
<input type="submit" value="Submit">
</form>