Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 9th, 2007, 11:04 AM
Registered User
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calling Header Using PHP!

Hi guys,
          i have asked this question before but never got a perfect solution..now i have some sort of script recomemded by some experts but i don't know how to make it work properly.

[u]What i want!</u>

First open http://progam3s.com/index.php and you will see everything is loaded fine and the home page data has been loaded in the iframe.

Now if open body opens this link http://progam3s.com/home.php , it will not open with index.php page which contains all the layout feature.

i tried using a javacode but that didn't really helped, yeah it only helped me by opening ONLY home.php with the index.php, i was unable to load 100 more pages in different directories in that index.php page though i used the javascript in all pages, it used to load the home.php back when i used to open them using seperate links.

i asked some and i got this in response but i need more explanation and help that in what page i should insert what code to make this system work.

These are different codes, tell me which one will help and please do explain how to install.

A short one
header('WWW-Authenticate: Negotiate');
header('WWW-Authenticate: NTLM', false);
another one


function redirect($u , $s = 0) {
    if($s < 1)
        header("Location: " . $u);
        function doRefresh() {
            window.location = '{$u}';
        doRefreshTimeout = setTimeout(\"doRefresh()\" , ".($s*1000).");
        <h1>Sind suunatakse...</h1>

Maybe this will help

quote:In your server PHP code look at $_SERVER['HTTP_REFERER'] and compare it to the url of the frameset.
Then use the header function, if necessary to reload page in the frame.

One of the javascript someone recomemded.

quote:<script language="javascript" type="text/javascript">
// 1
if (top.location == location) {
    // window is loaded directly
     window.location.href = frameset.html;

// 2
if (self == top) {
    // window has no parent, loaded directly
     window.location.href = frameset.html;

// 3
if (top.location != my_frameset_url) {
    // reload in the frameset
     top.location.href = my_frameset_url;

a short one

header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */

Now please people, tell me which one i should use and how to install them like u can guide me that put this in home and this in index.

I really need this to be done, its my need..please help would be appreaciated.

Similar Threads
Thread Thread Starter Forum Replies Last Post
header("location:./in.php"); aneesh_sunu@yahoo.co.in PHP How-To 0 November 25th, 2006 08:27 AM
"PHP Header" heerajee Pro PHP 3 January 25th, 2006 10:47 AM
chp2 can't see header.php in directory sgibsonart BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 3rd, 2005 10:34 AM
can't see header.php in directory sgibsonart Beginning PHP 1 February 3rd, 2005 10:32 AM
PHP ( Cannot modify header information) squared_ring Beginning PHP 6 August 14th, 2004 05:29 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.