quick newbie Q - script pase error
Posted: Thu Aug 12, 2004 11:16 am
feyd | Please use
(end script)
And here's the error I get when I hit http://www.mysite.com/mls.php:
Parse error: parse error, unexpected $ in /homepages/27/d100590837/htdocs/mls.php on line 51
So... I'm sure it's obvious to you - what siple error have I made?
Thanks
Scott
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi, my first post, total php newbie so I'm following cut n paste instructions without really understanding the syntax or rules.
Here's my script:Code: Select all
<html>
<head>
</head>
<title>
</title>
<body>
<?php
$link1='www.microsoft-secrets.com';
$link2='www.microsoft-licensing.com';
$tr1='50';
$tr2='50';
$filename="MSLS1.log";
$tr1=$tr1+0;
if($tr2>0){
$tr2=$tr2+$tr1;
}else{
$tr2=0;
}
$secm100=floor(100*(date("s")+1)/60);
if ($secm100 >0 && $secm100 <= $tr1){
$url=$link1;
}elseif($secm100 > $tr1 && $secm100 <= $tr2){
$url=$link2;
if (!isset($_COOKIE['uvst'])){
setcookie ("uvst",$url);
if ($fh = fopen($filename, "a+")){
fwrite($fh, $url."\n");
fclose($fh);
}
}else{
$url=$_COOKIE['uvst'];
}
header("HTTP/1.1 301 Moved Permanently");
header("Location: $url");
?>
</body>
</html>And here's the error I get when I hit http://www.mysite.com/mls.php:
Parse error: parse error, unexpected $ in /homepages/27/d100590837/htdocs/mls.php on line 51
So... I'm sure it's obvious to you - what siple error have I made?
Thanks
Scott
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]