/    Sign up×
Community /Pin to ProfileBookmark

URGENT…Help Me..Please…

What wrong about my script?
hello,

I Have file time.php like bellow :
<html>
<head>
<title></title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<META HTTP-EQUIV=”REFRESH” CONTENT=”55;URL=time.php”>
</head>

<body bgcolor=”#000000″ bottommargin=”0″ leftmargin=”0″ rightmargin=”0″ topmargin=”0″>

<?
$m =date(“i”);
$h = date(“H”);
$menit = $m % 10;
if ($h > 5 && $h < 19)
{
if ($menit ==1 )
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=2″></script>
<?
}
else if ($menit ==2)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=6″></script>
<?
}
else if ($menit ==3)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=8″></script>
<?
}
else if ($menit ==4)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=2″></script>
<?
}
else if ($menit ==5)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=5″></script>
<?
}
else if ($menit ==6)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=4″></script>
<?
}
else if ($menit ==7)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=1″></script>
<?
}
else if ($menit ==8)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=8″></script>
<?
}
else if ($menit ==9)
{
?>
<script type=”text/javascript” src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=5″></script>
<?
}
else if ($menit ==0)
{
?>
<script type=”text/javascript”src=”http://a.b.c.d:e/nphControlCamera?Direction=Preset&PresetOperation=Move&Data=7″></script>
<?
}
}
?>
</body>
</html>

Then I run the time.php file by runningfile.php file like below:
<? include “header.php”;
include “config/database.php”;
?>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title></title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>

<body bgcolor=”#000000″ text=”#FFFFFF”>
<iframe src=”time.php” scrolling=”no” frameborder=”0″ width=”5″ height=”5″ marginheight=”0″ marginwidth=”0″></iframe>
</html>
<? include “footer.php”;?>

then view message error like bellow :
Line : 2
Char : 1
Error : Syntax Error
Code : 0
URL : [url]http://www.mydomain.com/time.php[/url]

How solution for me?
any help me?
Help me..please….!!
thank you for your attention…

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@jenyJun 21.2006 — look at the meta tag you given

<META HTTP-EQUIV="REFRESH" CONTENT="55;URL=time.php">

no need to give ' " ' in content. if u give u have to close it.

check the following

<meta http-equiv=refresh content=0;url=time.php>
Copy linkTweet thisAlerts:
@themartyJun 21.2006 — look at the meta tag you given

<META HTTP-EQUIV="REFRESH" CONTENT="55;URL=time.php">

no need to give ' " ' in content. if u give u have to close it.

check the following

<meta http-equiv=refresh content=0;url=time.php>[/QUOTE]


Jeny, the way he's written the meta-tag is correct. That's just how it's done.

Besides that, a meta-tag could never give that error.

[b]komang[/b]: The error you get is a javascript error. But since we don't know the source it's impossible to tell what is causing it.

Try using [url=http://www.mozilla.org/firefox]Firefox[/url]: it gives much better javascript-errors than IE

(it's just a much better browser in general ;-))

Also, take a look at this code:

<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;META HTTP-EQUIV="REFRESH" CONTENT="55; URL=time.php"&gt;
&lt;/head&gt;

&lt;body bgcolor="#000000" bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0"&gt;

&lt;?
$m = date("i");
$h = date("H");
$menit = $m % 10;
if ($h &gt; 5 &amp;&amp; $h &lt; 19)
{
$convertArr = array(1=&gt;2, 2=&gt;6, 3=&gt;8, 4=&gt;2, 5=&gt;5, 6=&gt;4, 7=&gt;1, 8=&gt;8, 9=&gt;5, 0=&gt;7)
if ($menit &gt;= 0 &amp;&amp; $menit &lt;= 9)
{
echo "&lt;script type="text/javascript" src="http://a.b.c.d:e/nphControlCamera?Direction=Preset&amp;PresetOperation=Move&amp;Data=".$convertArr[$menit].""&gt;&lt;/script&gt;n";
}
}
?&gt;
&lt;/body&gt;
&lt;/html&gt;


It does the same, but is much more efficiently written
×

Success!

Help @komang spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...