By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,738 Members | 1,822 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,738 IT Pros & Developers. It's quick & easy.

Using Javascripts In PHP Codes

P: 1
I'm a newbie coder in fact I'm pretty bad.

So I was wondering if anyone know how to execute a javascript file in php. Is it the same as html where I just dump the code into the php code?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. header("Status: 301 Moved Permanently", false, 301);
  3. header("Location: http://www.domain.com; Refresh: 5;");
  4. @include_once $GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT'].'/twatch_include/logger.php';
  5. ?> 
  6.  
  7.  
  8. <!-- Google Code for signup Conversion Page -->
  9. <script language="JavaScript" type="text/javascript">
  10. <!--
  11. var google_conversion_id = IDNUMBER;
  12. var google_conversion_language = "en_GB";
  13. var google_conversion_format = "2";
  14. var google_conversion_color = "FFFFFF";
  15. if (1) {
  16.   var google_conversion_value = 1;
  17. }
  18. var google_conversion_label = "signup";
  19. //-->
  20. </script>
  21. <script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
  22. </script>
  23. <noscript>
  24. <img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/conversion/1068748880/?value=1&label=signup&script=0">
  25. </noscript>
  26.  
  27.  
  28. <?php
  29. exit();
  30. ?> 
  31.  
This is a normal 301 redirect using PHP header however I"m trying to put a refresh of 5 sec's is that correct?

Plus the javascript Google Tracking code this is the right way to insert javascrpts? Withou PHP brackets?

Thanks!

BEN
Feb 1 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.