Page 1 of 1

Javascript Redirect Question

Posted: Sun Dec 14, 2008 9:05 am
by patriotofgod
Hi, I have put a small php code on a website so that when I access the website, it will redirect me to a second website.

Code: Select all

 
<?php
 
$site2 = "http://www.google.com";
 
echo "<body onload="javascript&#058;frmClickTracking.submit();">";
echo "<form action="" . $site2 . "" method="post" name="frmClickTracking">";
echo "</form>";
 
?>
 
<body>
</body>
</html>
 
Why is this code not working?

Re: Javascript Redirect Question

Posted: Sun Dec 14, 2008 10:05 am
by patriotofgod
When I access the page, it just keeps trying to reload. I can really use the help, thanks.

Re: Javascript Redirect Question

Posted: Mon Dec 15, 2008 2:36 pm
by cavemaneca

Code: Select all

<?php 
  $site2 = "http://www.google.com";
 
?>
 
  <body onload="javascript&#058;frmClickTracking.submit();">
    <form action="<?php echo $site2; ?>">
    </form>
 
  </body>
</html>
Either use this or make sure you escape all of the quotation marks like you should be doing.
Also, one body tag is enough. I don't see why you needed two. And Google doesn't allow POST to their website, so trying to track clicks or whatever you are doing and sending a name won't do anything.