Difference between revisions of "CSC220 echoform.php"
(Created page with '--~~~~ ---- <code><pre> </pre></code> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> Category:CSC220Category:Php') |
|||
Line 4: | Line 4: | ||
<code><pre> | <code><pre> | ||
+ | <html> | ||
+ | <head> | ||
+ | <title>Php Echo-Form -- CSC220</title> | ||
+ | </head> | ||
+ | <body> | ||
+ | <div> | ||
+ | |||
+ | <h2>Echo Form</h2> | ||
+ | |||
+ | <?php | ||
+ | |||
+ | function printVar( $s, $v ) { | ||
+ | printf( "<pre>\n$s=", $s ); | ||
+ | print_r( $v ); | ||
+ | printf( "</pre>\n" ); | ||
+ | } | ||
+ | |||
+ | /* | ||
+ | $a = (int) empty( $b ); | ||
+ | printVar( '$a', $a ); | ||
+ | */ | ||
+ | |||
+ | print "<P>Your form parameters read as follows:<P><ul>"; | ||
+ | foreach ( $_REQUEST as $key=>$value ) { | ||
+ | $value = $_REQUEST[ $key ]; | ||
+ | print "<li><b>$key</b> : $value</li>"; | ||
+ | } | ||
+ | print "</ul>"; | ||
+ | |||
+ | |||
+ | ?> | ||
+ | |||
+ | </div> | ||
+ | </body> | ||
+ | </html> | ||
</pre></code> | </pre></code> |
Revision as of 08:01, 22 September 2010
--D. Thiebaut 12:56, 22 September 2010 (UTC)
<html>
<head>
<title>Php Echo-Form -- CSC220</title>
</head>
<body>
<div>
<h2>Echo Form</h2>
<?php
function printVar( $s, $v ) {
printf( "<pre>\n$s=", $s );
print_r( $v );
printf( "
\n" );
}
/*
$a = (int) empty( $b );
printVar( '$a', $a );
- /
print "Your form parameters read as follows:<P>
";
foreach ( $_REQUEST as $key=>$value ) {
$value = $_REQUEST[ $key ];
print "- $key : $value
";
}
print "
";
?>
</div>
</body>
</html>
</pre></code>