Redirect the user to another page
Posted: Thu Jul 08, 2004 12:14 pm
Hi,
Using the Linux Cron I am trying to execute a php script , mypage.php .
The PHP page is fetching data from the mysql database . Using javascript I am trying to open a POP UP WINDOW for each records of the fetched data like destination URL, querystring etc.
While POP UP, the destination URL will trigger a mail functionality .(This is the requirement flow of my client :) )
For test purpose from the shell prompt of Linux , using command php mypage.php I am trying to execute the php page.
My problem is, the triggering function of the POP UP window is not called while testing. So I am not getting the test mail from the system. But the same php script is working while running in a browser.
I have tried using header redirection, javascript document.location and also javascript window.open(url) methods.
How can I make it to work in CRON? am I doing it in a wrong way while executing in shell? Whats about the Javascript running in CRON?
Please help me to correct this problem ASAP. Thanx in advance.
The sample code of mypage.php for your reference
-----------------------------------------------------------
Thanx & Regards,
Sathish
feyd | added
Using the Linux Cron I am trying to execute a php script , mypage.php .
The PHP page is fetching data from the mysql database . Using javascript I am trying to open a POP UP WINDOW for each records of the fetched data like destination URL, querystring etc.
While POP UP, the destination URL will trigger a mail functionality .(This is the requirement flow of my client :) )
For test purpose from the shell prompt of Linux , using command php mypage.php I am trying to execute the php page.
My problem is, the triggering function of the POP UP window is not called while testing. So I am not getting the test mail from the system. But the same php script is working while running in a browser.
I have tried using header redirection, javascript document.location and also javascript window.open(url) methods.
How can I make it to work in CRON? am I doing it in a wrong way while executing in shell? Whats about the Javascript running in CRON?
Please help me to correct this problem ASAP. Thanx in advance.
The sample code of mypage.php for your reference
-----------------------------------------------------------
Code: Select all
<html>
<head>
<script language='javascript'>
function popClose()
{
if (newwindow) newwindow.close();
//window.close();
}
function popitup(urlData)
{
newwindow=window.open(urlData);
return false;
}
self.setTimeout('popClose();', 15000);
</script>
</head>
<body>
<?php
$sql = " SELECT url,toEmail ....";
rs = mysql_query($sql); ....
for($i=0;$i<$num_rows;$i++)
{
$scriptVar="http://".mysql_result($rs,i,0)."?email=".mysql_result($rs,i,1)."";
print("<script language="JavaScript">popitup(".$scriptVar.");</script>");
/*
print("<script language="JavaScript">document.location="".$scriptVar."";</script>");
*/
}
?>
</body>
<html>Sathish
feyd | added
Code: Select all
tags[/color]