Hello, and welcome to the PCCS-Linux Home Page.
Your last visit was !!!
Your Browser is running on Other
Variables
Your First PHP Script
<? echo "Hello World"; ?>
Creating Variables to use inside you scripts...
<?
// a is assigned a value of 1
$a = "1";
// b is assigned a value of 2
$b = "2";
// c is assigned the sum of a and b
$c = "$a + $b";
// today is assigned its value using the PHP date function
$today = date("M-d-Y");
// connected_from is assigned its value from GLOBAL variables
$connected_from = $GLOBALS["REMOTE_ADDR"];
?>
Getting GLOBAL variables
<? phpinfo() ?>
Creating arrays
From a SELECT box (array list1[])
<select multiple size="2" name="list1[]">
<?
$query = "
SELECT DISTINCT name
FROM software
WHERE category = 'ORGEXT'
ORDER BY name";
";
$appsres = mysqlquery("$db_name","$query")
for ($i = 0; $i < mysql_numrows($appsres); $i++):
$appslist_output = mysql_result($appsres,$i,"name");
echo "
";
endfor;
?>
To Process the list1[] array do something like;
This web site is prepared and maintained by Chauncey Thorn.
The information contained in this site was valid at the time of posting.
Chauncey Thorn, assumes no liability for damages incurred directly or indirectly as a result of errors, omissions or discrepancies.