Diversions
10-06-2008, 08:10 PM
I am trying to build a website in php on wamp server and I am running into a problem but not sure what it is.
1. I am pulling a php page with <?php include(thedirectory.php); ?> which is fine I am not getting any errors.
2. within "thedirectory.php" file I am pulling a graphics file (hilighted in red) such as the following
<?php
srand((float) microtime() * 10000000);
$input = array(
'<tr><td width="20%" align="center"><a href="jump.php/CaseStudy" title="Case StudyA"><b>Case Study A</b></a></td><td width="15%" align="center"><?php include("starrating.php"); ?></td><td width="65%" align="left">short description</td><tr>',
);
$rand_keys = array_rand($input, 5);
echo $input[$rand_keys[0]] . "\n";
echo $input[$rand_keys[1]] . "\n";
echo $input[$rand_keys[2]] . "\n";
echo $input[$rand_keys[3]] . "\n";
echo $input[$rand_keys[4]] . "\n";
echo $input[$rand_keys[5]] . "\n";
?>
I am not now getting any errors. The starrating.php file is a five line file and pulls the graphic from the images folder which is definitely in there.
Because I am pretty new to the PHP language I am not sure if
A. this can be done, and
B. if the process outlined above is not correct then I require a fix.
Of course, if the code seems okay then I will have to keep looking for what is likely a pretty silly oversight.
Many thanks
D
1. I am pulling a php page with <?php include(thedirectory.php); ?> which is fine I am not getting any errors.
2. within "thedirectory.php" file I am pulling a graphics file (hilighted in red) such as the following
<?php
srand((float) microtime() * 10000000);
$input = array(
'<tr><td width="20%" align="center"><a href="jump.php/CaseStudy" title="Case StudyA"><b>Case Study A</b></a></td><td width="15%" align="center"><?php include("starrating.php"); ?></td><td width="65%" align="left">short description</td><tr>',
);
$rand_keys = array_rand($input, 5);
echo $input[$rand_keys[0]] . "\n";
echo $input[$rand_keys[1]] . "\n";
echo $input[$rand_keys[2]] . "\n";
echo $input[$rand_keys[3]] . "\n";
echo $input[$rand_keys[4]] . "\n";
echo $input[$rand_keys[5]] . "\n";
?>
I am not now getting any errors. The starrating.php file is a five line file and pulls the graphic from the images folder which is definitely in there.
Because I am pretty new to the PHP language I am not sure if
A. this can be done, and
B. if the process outlined above is not correct then I require a fix.
Of course, if the code seems okay then I will have to keep looking for what is likely a pretty silly oversight.
Many thanks
D