Parašė sniuff· 2010 Sau. 22 19:01:30
#14
Su get:
<?php
$name = isset($_GET['name']) ? $_GET['name'] : "";
if($name != "") {
echo "Sveikas {$name}, kaip gyvenimas";
} else {
?>
<form name="input" method="get">
Username:
<input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
<?php
}
?>
Su post:
<?php
$name = isset($_POST['name']) ? $_POST['name'] : "";
if($name != "") {
echo "Sveikas {$name}, kaip gyvenimas";
} else {
?>
<form name="input" method="post">
Username:
<input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
<?php
}
?>
Redagavo sniuff· 2010 Sau. 22 19:01:39