473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

any body have idea about diff in window.loaction & header of php

Hello

can any body tell me the dff between
function redirect($url)
{
echo "<script>";
echo "window.location='".$url."'";
echo "</script>";
}

and

header("Location $url")

syntex belong to php

Feb 19 '07 #1
2 1305
2291980 wrote:
Hello

can any body tell me the dff between
function redirect($url)
{
echo "<script>";
echo "window.location='".$url."'";
echo "</script>";
}

and

header("Location $url")

syntex belong to php
Then why not ask on comp.lang.php?

--
Ian Collins.
Feb 19 '07 #2
2291980 wrote:
Hello

can any body tell me the dff between
function redirect($url)
{
echo "<script>";
echo "window.location='".$url."'";
echo "</script>";
}

and

header("Location $url")

syntex belong to php
The first will redirect the visitor only if they have javascript
enabled. The second will redirect all visitors regardless of if they
have scripting enabled or not.
--
http://www.hunlock.com -- Musings in Javascript, CSS.
$FA
Feb 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Soxos | last post by:
Hi all, I'm trying to use css&php as substitutes of frames. I have to replace a page with this layout: |----------------| | header | |----------------| | c t | m | | o n ...
6
by: Joakim Braun | last post by:
How do you give a <body> a 10px margin on every side, then a border? That is, an inset border. In the example below, the browsers I've tried interpret "width:100%" as 100% of the width including...
1
by: Massimiliano Alberti | last post by:
My program is heavily template based, and I use the VC++, so I have to keep the templates in the header file. My .cpp files are quite empty (they are more a connection between header files). Now,...
6
by: Sentinel | last post by:
how can i place a script in body (it must be ran automaticly when html interpreter reaches it) that will redirect to another page? what i am doing is checking in php if login is successful...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
5
by: 2291980 | last post by:
Hello can any body tell me the dff between function redirect($url) { echo "<script>"; echo "window.location='".$url."'"; echo "</script>";
5
by: ~~~ .NET Ed ~~~ | last post by:
Well the subject says it all but I am going to elaborate a bit. As we all now since 2.0 it is possible to access the Header from code behind without much wizardry and that is a good thing. ...
3
by: Noorain | last post by:
I designed a site. i want to header,footer,left & right column fixed but body information only scrolling. this site screen to be 800/600 px. i designed this way but when i used position fixed all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.