![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Warning: Cannot modify header information - headers already sent byHello again,
I am getting this error for one PHP script including another PHP script. And I am not sure what I am doing wrong. I am trying to set up one file to hold my username, password, hostname, and so forth. That way once the databases are working correctly, and if I do any changes, I can just change this file, instead of multiple files. Here is the php script with the database login info PHP Code:
Then here is the second php script that works with the database. PHP Code:
I am getting this error, and it points to the "HEADER ("Location: $link"); line. Any ideas what to do? Thanks, Richard |
|
#2
|
|||
|
|||
Re: Warning: Cannot modify header information - headers already sent byI figured out a solution, but I am not certain if this is a correct one. Or does it leave me open to some type of problems????
This is the way it was in the 1st post. PHP Code:
This is the revised file. PHP Code:
I removed the last "?>" from the 1st php file, and all the error went away. And it actually works. Now, am I leaving myself open to problems, or something. Thanks, Richard |
|
#3
|
||||
|
||||
Re: Warning: Cannot modify header information - headers already sent byWhenever you send headers, you must ensure no markup (or content) is sent to the browser BEFORE the header is sent.
When you had this: Code:
there was a newline/carriage return in between the tags. |
|
#4
|
|||
|
|||
Re: Warning: Cannot modify header information - headers already sent bySo, how should it have looked?
PHP Code:
|
Recent GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Database Program | goldfish | C Programming Language | 6 | 13-May-2006 13:12 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| Pcap programming in C++ | goal86sg | C++ Forum | 2 | 25-Jan-2006 14:02 |
| My program can run,but warning were display on Vc++ | fwongmc | C Programming Language | 5 | 08-Dec-2004 10:15 |
| link error? | pablowablo | C++ Forum | 14 | 19-Jun-2004 10:00 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The