473,491 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Page to open only in Frameset

3 New Member
Hi Expert,
Please help. Please look at the code below for 'include.php', which is included in every php file of my application
//Include.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. if(!session_is_registered("SESSION")){
  4. $home_url = 'http://'. $_SERVER['HTTP_HOST'].'/admin_dev/authentication/login.php';
  5. header('Location: ' . $home_url);
  6. exit();
  7. }
  8. else
  9. $timeout_url = 'http://'.$_SERVER['HTTP_HOST'].'/admin_dev/authentication/timeout.php';
  10. header( "refresh: 120; url=$timeout_url");
  11. $home_url2= 'http://'. $_SERVER['HTTP_HOST'].'/admin_dev/authentication/frame.php';
  12. //echo "<script>if (parent.frames.length<1) location.replace($home_url2)</script>";
  13. ?>
  14.  
Actually when I uncomment the 'echo' statement i am getting " header cannot be modified error....', and when I comment it things are working fine.
I hope the page in which it is included also tries to send something in header, but since 'echo' statement has already sent the header, I am getting this error.
My problem is, I want to open all those pages in which include.php is included, in a frameset and not as individual pages.
Please let me know how can I implement this.
Note: I can't touch the files in which it is included but only this file for certain reasons.

Thanks
May 8 '09 #1
1 1552
dlite922
1,584 Recognized Expert Top Contributor
It's a little foggy on why you're using frames, but checkout PHP's ob_start() (ob stands for output buffer)

If you call that function at the top of your script, php won't send any data back to the browser until it is done processing (or ob_flush() is called)

Reason your getting the error is because you can't modify the header() after the content is already sent.

I hope that helps you find your way,


Dan
May 8 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3909
by: ck388 | last post by:
I am trying to open a frameset in a new window......where the frame called "main" shows the file called customerGeneral.aspx. I can't get it to work though...i always get something like...
3
2408
by: B.G. | last post by:
I know I've done this in the past, but dang, I forget how I did it! If you know how its done, I'd sure appreciate it if you would share that info with me. I want to go from a non-frames page to...
4
1626
by: anag | last post by:
I am opening pop up windows from a hint button on several pages in my site. If the user leaves the pop up window open from a previous page, I would like the new hint to open in that window. I...
10
1745
by: Bernard Davis | last post by:
Hi, I've been asked to add some pages to an existing web-site that was done in frames (two different sets of frames with different navigation links). I need to ensure that if someone tries to...
3
7105
by: JezB | last post by:
I want to clear some specific Session variables when the user closes a page. On my page I have a "return to ..." button which navigates back to the parent page from which it was invoked - under the...
42
3809
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
6
2637
by: Ben | last post by:
Hi, In the first start page, I use JavaScript window.open to open a new ASP IE window that is used to display real-time stock price and refresh each 10 seconds. The problem is when ASP...
25
2055
by: Geoff Cox | last post by:
Hello, The following <frame src="topbar-frameset.php?newVar=<?php echo $groups; ?>"> passes the value of the variable $groups from a php file to the top page in a frameset but how do I...
6
5963
by: Thiago Macedo | last post by:
I could not find on the web a complete solution for this task. This is not the perfect solution, because it's doesn't have the ability to log the logout if browser crash or user leave it open while...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
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
7192
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
7364
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...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.