Jump to content

echo JavaScript


yogibear

Recommended Posts

Hi

 

Can you tell me how to fix this, I know the problem is the quotes. I have been trying to copy the fix on http://www.phpfreaks.com/forums/index.php/topic,120612.0.html but have had no luck.

 

echo '<script language="javascript" type="text/javascript">
     <!--
     window.setTimeout('window.location="http://www.***.co.uk/record/admin/main.php"; ',2000);
     // -->
</script>';

 

Best wishes

yogi

Link to comment
https://forums.phpfreaks.com/topic/120832-echo-javascript/
Share on other sites

To make it easier, use heredoc syntax:

 

echo <<<html
<script language="javascript" type="text/javascript">
     <!--
     window.setTimeout("window.location='http://www.***.co.uk/record/admin/main.php';",2000);
     // -->
</script>
html;

Link to comment
https://forums.phpfreaks.com/topic/120832-echo-javascript/#findComment-622861
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.