location

i need the syntax for the location statement! i am not sure if this is a php or js :S
almahaAsked:
Who is Participating?
 
BatalfConnect With a Mentor Commented:
Do you mean Javascripts "location" object?
----------------------------------------------
Set a new location of current page:

location.href='newPage.html';



0
 
heddesheimerCommented:
maybe you need:
<?php
header("Location: http://www.mydomain.com/mypage.php");
?>

Marian
0
 
campioneCommented:
<?php
 
 header("Location: http://whatever");

?>


But just make sure of the syntax. Only double quotes, and another thing "DO NOT" send any output request before the header call. That's an error.

For eg.

<?php

 print "I just messed up the program.";
 header("Location: http://whatever");

?>

This one's gonna create an error. Just remove the print and its fine.

Hope this'll solve your problem if its for PHP.
0
 
almahaAuthor Commented:
noo :( you didn't get what i really need.
i don't want a header!
okay, i have a cancel button that i want it to link to another php file. but i don't wana do it as a usual html form!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.