• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp
KEEP IN TOUCH

Posts tagged information

WebDev > Fixing Warning: “Headers already sent” & “Cannot modify header information”

Mar24
2012
Leave a Comment Written by Scott Rowley

Eventually in your web development you may run into one of these annoying errors. What it typically means is that your browser is being sent some HTML before the PHP command header() and it’s causing your issue.

Unfortunately there is no easy way to go about troubleshooting this other than following the logic through your code, hopefully you’ve saved & tested recently and have a fairly short code to go troubleshooting with. In video games I learned early on to “Save early, save often”. I’ve since modified that to my programming so that I remember to save early, save often but also “Test early, test often”. Make little changes, then you know how much you need to go back and troubleshoot when there is an error. Anyway, another less known cause of this issue is that you’ve got the dos character ^M inserted in your code. This recently happened to me when I used FTP to download a website and then uploaded it somewhere else. Somewhere along the line my windows PC decided my perfectly fine files should have some ^M inserted into some of the files. As a result I got the “Headers already sent” error.

I’d run into the error before but I knew that I hadn’t introduced any new code so I knew it couldn’t be any html being sent before the header() function. After much googling and “facedesk”‘ing I finally found that the dos character could also cause this error. After a bit more googling I found that the easiest way to get rid of this is to simply run the following command and it will easily and quickly remove all of the dos characters (^M).

dos2unix your_messed_up_file.php

I ran this command on the file and then tried my test again and just like that I was back to normal again 🙂

Posted in Web Development - Tagged already, cannot, development, dos2unix, fix, fixed, fixing, headers, modify, php, save, sent, test, troubleshoot, warning, web
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

WebDev > CSS Stylings

Jan25
2012
Leave a Comment Written by Scott Rowley

Just starting to make a note of some of my CSS creations:

Informational Box

SudoBash is proud to announce our newest office location

123 Kittens Street conveniently located 1 mile from LOLcat lane.

 <style type='text/css'>
.info {
  border: 2px solid #D8D8D8;
  margin: 10px 0px;
  background-repeat: no-repeat;
  padding: 10px 0 10px 150px;
  background-position: 10px center;
  color: #00529B;
  background-color: #E0E0E0;
  background-image: url('/images/info.png');
}
</style>

<div class="info"><strong>SudoBash is proud to announce our newest office location</strong><br><br>

123 Kittens Street conveniently located 1 mile from LOLcat lane.</div>
Posted in Web Development - Tagged css, dev, development, html, info, web, Web Development
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Sudo Bash Member sites

Iowa SAR
Des Moines, Iowa Tattoo & Piercing
The Man In Black

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS HowToGeek

  • Google and Amazon Are Killing the Smarthome Hub, and That’s Great
  • Geek Trivia: What Common Office Supply Staple Is Capable Of Generating X-Ray Radiation?
  • How to See All the Apps You’ve Purchased From the Mac App Store
  • Samsung Wants You to Love the Galaxy Fold… But Not to Buy It
  • Deal Alert: Get 20% Off All dbrand Skins

RSS TheGeekStuff

  • 20 Practical Ruby Loop Command Examples – For, Each, While, Until
  • Happy New Year 2018 – From Geek, Dolls and Penguins
  • How to Install Configure LDAP Client for 389 Directory Server
  • 15 mysqlbinlog Command Examples for MySQL Binary Log Files
  • How to View Chrome OS Current version and Force Update Chromebook OS

RSS LifeHacker

EvoLve theme by Blogatize  •  Powered by WordPress Sudo Bash
By Geeks - For Geeks

Back to Top