All pastes #978050 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-04-09 08:15 UTC
rendered paste body
<?php
//ob start
ob_start();
//session start
session_start();
?>
<html>
<head>
<title>programming to the end</title>
<!--style-->
<link rel="stylesheet" type="text/css" href="stil.css">
</head>
<body>
<p>this script is designed for showing what i have learned. it's not all. 
<br> not all the functions will work</p>
<?php
//include 
include('database.php');  
//vars 
$var = 10; 
//post med var
$var1 = $_POST ['felt'];
//hente informasjon fra session med var
$var2 = $_SESSION ['username'];
//get med var 
$var3 = $_GET ['felt2'];
//echo informasjon 
echo 'printer ut var: ';
echo $var; 
//linjeskift med echo 
echo '<br>'; 
//if og else 
echo 'if syntax';
echo '<br>';
if ($var == 10) {
echo 'var er 10';	
}
else {
echo 'var er ikke 10';	
}
echo '<br>';
//form med post
echo 'form med post method: '; 
echo '<br>'; 
echo '<form action="" method="POST">'; 
echo '<input type="text" name="felt"><br>';
echo '<input type="submit" name="submit" value="send inn">';
echo '</form>';
//if sjekk for form 
if (isset($_POST ['submit'])){
echo 'din informasjon er:';
echo '<br>'; 
echo $var1; 
}
//form med get 
echo 'form med get method: ';
echo '<br>'; 
echo '<form action="" method="GET">'; 
echo '<input type="text" name="felt2"> <br>';
echo '<input type="text value="send inn" name="submit">'; 
echo '</form>'; 
//if sjekk for get form
if (isset($_GET ['submit'])) {
echo 'din informasjon er:';
echo '<br>';
echo $var3; 
}
echo 'lager funksjonen main();'; 
function main()
{
echo 'dette er funksjon main';	
}
main();
?>
<p align="center">the end for now</p>
</body>
</html>