Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

php - headers sent??

Posted on 2016-08-09
4
Medium Priority
?
49 Views
Last Modified: 2016-08-14
I get this:

Warning: Cannot modify header information - headers already sent by (output started at /home/rkassoc/public_html/Houston/save_to_session.php:65) in /home/rkassoc/public_html/Houston/post_form.php on line 76

Attached is post_form.php & save_to_session.php

How does it think line 65 of save_to_session.php (the closing php tag) is sending a header?

How do I fix?

Thanks
post_form.php
save_to_session.php
0
Comment
Question by:Richard Korts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 41749678
This has been a common problem for many years, so much so, that we have articles here at E-E explaining it and showing how to get past the issues!
https://www.experts-exchange.com/articles/4423/Warning-Cannot-modify-header-information-headers-already-sent.html

Using the "close PHP"  tag is a well-known antipractice (see #14).  Don't do that any more!

TL;DR: Learn about ob_start().
0
 

Author Comment

by:Richard Korts
ID: 41749707
Ray,

I actually thought about you and your comment (on some other question) about the closing php tag.

I'll try it tomorrow. I'm about 98% sure that will do it.

Richard
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 41749875
And turn on 'error_reporting' in 'post_form.php'.  Always.  And 'save_to_session.php' is saving a lot of &_POST data to $_SESSION variables without doing any checking.  If one of the indexes for the &_POST data is missing, it will cause an error by sending an error message to the browser before your 'header' statements at the end of 'post_form.php'.
0
 
LVL 9

Expert Comment

by:Mukesh Yadav
ID: 41749970
Try this ;)

Just remove closing PHP tags from save_to_session.php
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question