thecopperhat Posted December 28, 2012 Posted December 28, 2012 Hey Guys, I'm having some significant issues with my webstore lately unfortunatley the guy I hired to build it turned out to be a flake and I can't seem to track him down to complete his maintenance contract! Anyway the issue I'm having is clients add products to the shopping cart and click check out. That's when this little guy pops up: Warning: Cannot modify header information - headers already sent by (output started at /home/content/82/6334182/html/catalog/includes/application_top.php:1065) in/home/content/82/6334182/html/catalog/includes/functions/general.php on line 33 I believe this is the section it's talking about: if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL } } header('Location: ' . $url); tep_exit(); } //// // Parse the data used in the html tags to ensure the tags will not break function tep_parse_input_field_data($data, $parse) { return strtr(trim($data), $parse); } Any help would be greatly appreciated as I'm most basic of basic at this kind of thing. I specialize in what my business does as opposed to how to make the website work lol. Cheers Brad
♥geoffreywalton Posted December 28, 2012 Posted December 28, 2012 Brad Try this in google site:www.oscommerce.com/forums Warning: Cannot modify header information - headers already sent by 33 There is a funny character in one of the files on your site that needs to be deleted. HTH G @@thecopperhat Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
MrPhil Posted December 28, 2012 Posted December 28, 2012 The problem is at application_top.php, around line 1065. I'll guess that's at about the end of the file. Probably there is a blank or other stuff after the last closing ?> . You need to make sure there is nothing after ?> (no blanks, no nothing), as well as no blank lines. Same goes for the beginning of the file (no Byte Order Mark, no blank/empty lines, no blanks/tabs/etc. before <?php).
thecopperhat Posted December 29, 2012 Author Posted December 29, 2012 The problem is at application_top.php, around line 1065. I'll guess that's at about the end of the file. Probably there is a blank or other stuff after the last closing ?> . You need to make sure there is nothing after ?> (no blanks, no nothing), as well as no blank lines. Same goes for the beginning of the file (no Byte Order Mark, no blank/empty lines, no blanks/tabs/etc. before <?php). Found no symbols, spaces etc before <?php . Also cruised to the very last line where I found a bit of white space after ?>. I deleted the extra space however to no avail. I appreciate the help guys, I'm new to this and learning very slowly on top of running the business lol. Oh the joys of the internet.
thecopperhat Posted December 29, 2012 Author Posted December 29, 2012 Also Geoffrey, I searched the aforementioned but wasn't able to understand clearly what I was looking for or supposed to do. I believed the error was directing me to the specific line that the issue was coming from however I haven't got a clue if that line looks funny or not.
MrPhil Posted December 29, 2012 Posted December 29, 2012 There are two application_top.php files. Make sure you looked at the right one. Perhaps your editor put more whitespace back into the file after you thought you had removed it? Or, it inserted a Byte Order Mark at the very beginning? Or you failed to properly save the file, so your edit was lost? Or you uploaded to the wrong place? Or your file or directory was "write-protected" ("read-only") so the upload or edit was silently ignored? Lots of things to check there.
thecopperhat Posted December 29, 2012 Author Posted December 29, 2012 There are two application_top.php files. Make sure you looked at the right one. Perhaps your editor put more whitespace back into the file after you thought you had removed it? Or, it inserted a Byte Order Mark at the very beginning? Or you failed to properly save the file, so your edit was lost? Or you uploaded to the wrong place? Or your file or directory was "write-protected" ("read-only") so the upload or edit was silently ignored? Lots of things to check there. What I don't understand is in the "functions" folder under everything, I don't actually have an application_top.php file independent of anything. I'm currently looking at the general.php file as that's where it says the error originates from. Also I'm editing and saving the file directly in the FTP file manager. Not downloading, editing and re uploading. I edit, save and refresh.
thecopperhat Posted December 29, 2012 Author Posted December 29, 2012 hahahahahaha finally. Alright MrPhil you were right. I went digging and found the application_top.php and application_top_old.php files in the includes file no deeper. Both files had excess while space after the ?> . Deleted, saved, refreshed and magically the checkout is working again.
MrPhil Posted December 29, 2012 Posted December 29, 2012 Hooray! If you read the error message carefully, you'll see that the error was not really in general.php, but was in application_top.php. application_top.php was outputting text to the browser when it shouldn't have been (which flushes the headers to the browser). When general.php tried to output a header, it was told that the train had already left the station.
♥joli1811 Posted December 30, 2012 Posted December 30, 2012 :thumbsup: To improve is to change; to be perfect is to change often.
thecopperhat Posted December 31, 2012 Author Posted December 31, 2012 More than appreciate the fast awesome answers from forum members!!!! It's a huge help to an untrained "bull in a china shop" web "administrator". lol.
MrPhil Posted December 31, 2012 Posted December 31, 2012 osC does not have an application_top_old.php file. That's something left behind by whoever was working on the site. You can keep it around if you want, or eventually erase it once everything is running smoothly for a while and there's no chance you'll want to roll back your site to an earlier state. I mentioned the two application_tops because there is one in catalog/includes/ and another in catalog/admin/includes/. The admin one is used only when you're in admin (store backend), and might have the same problems.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.