Hi,
Any ideas what I can do to practice some PHP? I want to learn more
Today I did this today, but it was too easy:
Unecessarily (sp?) complicated, but it was to practice. I did it all off the top of my heae, no manuals or anything, but as I said it was too easy and I didn't learn anything from it >.<
So, any other ideas of what I can write to practice / learn more ?
Craig.
Any ideas what I can do to practice some PHP? I want to learn more
Today I did this today, but it was too easy:
Code:
<?
function tpl($d, $o){
DEFINE($d, $o);
}
$layout[1] = '<table width="100%" border="1"><tr><td><b>items</b></td><td><b>_SERVER code</b></td></tr>';
$layout[2] = '<tr>';
$layout[3] = '<td>';
$layout[4] = '</td>';
$layout[5] = '</tr>';
$layout[6] = '</table>';
$l = $layout;
tpl('l1', $l[1]);
tpl('l2', $l[2]);
tpl('l3', $l[3]);
tpl('l4', $l[4]);
tpl('l5', $l[5]);
tpl('l6', $l[6]);
$uAddr = $_SERVER['REMOTE_ADDR'];
$uAgent = $_SERVER['HTTP_USER_AGENT'];
$uHost = $_SERVER['HTTP_HOST'];
$uDocRoot = $_SERVER['DOCUMENT_ROOT'];
$sName = $_SERVER['SERVER_NAME'];
$sSoftware = $_SERVER['SERVER_SOFTWARE'];
$sSig = $_SERVER['SERVER_SIGNATURE'];
$rURI = $_SERVER['REQUEST_URI'];
echo l1;
echo l2;
echo l3;
echo $uAgent;
echo l4;
echo l3;
echo 'HTTP_USER_AGENT';
echo l4;
echo l5;
echo l2;
echo l3;
echo $uAddr;
echo l4;
echo l3;
echo 'REMOTE_ADDR';
echo l4;
echo l5;
echo l2;
echo l3;
echo $uHost;
echo l4;
echo l3;
echo 'HTTP_HOST';
echo l4;
echo l5;
echo l2;
echo l3;
echo $uDocRoot;
echo l4;
echo l3;
echo 'DOCUMENT_ROOT';
echo l4;
echo l5;
echo l2;
echo l3;
echo $sName;
echo l4;
echo l3;
echo 'SERVER_NAME';
echo l4;
echo l5;
echo l2;
echo l3;
echo $sSoftware;
echo l4;
echo l3;
echo 'SERVER_SOFTWARE';
echo l4;
echo l5;
echo l2;
echo l3;
echo $sSig;
echo l4;
echo l3;
echo 'SERVER_SIGNATURE';
echo l4;
echo l5;
echo l2;
echo l3;
echo $rURI;
echo l4;
echo l3;
echo 'REQUEST_URI';
echo l4;
echo l5;
echo l2;
echo l3;
echo $uDocRoot;
echo $rURI;
echo l4;
echo l3;
echo 'DOCUMENT_ROOT & REQUEST_URI';
echo l4;
echo l5;
echo l4;
?>
Unecessarily (sp?) complicated, but it was to practice. I did it all off the top of my heae, no manuals or anything, but as I said it was too easy and I didn't learn anything from it >.<
So, any other ideas of what I can write to practice / learn more ?
Craig.