View Single Post
  #2 (permalink)  
Old Feb 13th, 2008, 21:15
Marc's Avatar
Marc Marc is offline
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,661
Thanks: 0
Thanked 9 Times in 9 Posts
Re: javascript in php

Why dont you use:

PHP: Select all

if ($_POST["Psword"] != "MyPassword")
{
header("Location: http://www.google.co.uk");


OR if you want your JavaScript to work.. you have to escape the ".

PHP: Select all

<?php
if ($_POST["Psword"] != "MyPassword")
{
     echo 
"<script type=\"text/javascript\">window.location=\"http://www.google.com\"</script>";
}
 
?>
Good luck!
Reply With Quote