PHP not working
Posted by: wilkjames (---.dsl.bell.ca)
Date: October 01, 2006 04:32AM

I am runing this script:

<?
$val = $_GET['id'];
$val .= ".php";
$dirty = array(".."winking smiley;
$clean = array(""winking smiley;
$val = str_replace($dirty, $clean, $val);

if (isset($_GET['id'])) {
if (file_exists($val)) {
include "$val";
}
else {
include "404.shtml";
}
}
else {
include "home.php";
}
if (file_exists($val)) {
include_once "$val";
}

?>

And it will not include any of the pages, what do i have to do?

as well this script wont work either:
<?
srand((double)microtime()*1000000);
function banner($select, $host, $host2)
{
$eattempted = true;
$lines = file("banners.txt"winking smiley;
$count = count($lines);
$random = rand(0,$count-1);
$selected = $lines[$random];
$pieces = explode(",", $selected);
IF ($host == $pieces[0] OR $host2 == $pieces[0])
{
banner ("display", $host, $host2);
}
ELSE
{
echo ("<center><A HREF=\"$pieces[0]\"><IMG SRC=\"$pieces[1]\" BORDER=0></A></center>"winking smiley;
}
}
$host = "["]; . $HTTP_HOST;
$host2 = str_replace("www.","",$host);
IF (!isset($attempted))
{
banner ("display", $host, $host2);
}
?>

Thanks
-James

Options: ReplyQuote
Re: PHP not working
Posted by: roms (---.fbx.proxad.net)
Date: October 01, 2006 09:08AM

This is a short_open_tags issue. Change <? by <?php



Romain

Options: ReplyQuote


Sorry, only registered users may post in this forum.