Soldato
- Joined
- 12 Feb 2006
- Posts
- 17,628
- Location
- Surrey
unfortunately once again i'm having to turn to my last resort to get this sorted.
simple put i have a site that is created dynamically using php, ie. the page title includes a file which checks the file name and echos whatever is correct for the page the user is on, making it easier for me to change the titles if i need to in one big go, and also this is for coursework so i'm trying to do as much as possible with php. Other things are like lists of links echoed out depending on page, the stylesheet again includes a file and then php checks if a cookie is set, or if the user is logged in then what stylesheet they have chosen which is stored in a database, if not give the default stylesheet name.
now problem i'm having is with the login script and headers.
i have it all working on it's own (just php no html) but it's when i start including the login/logout/register pages with the design that i have problems with headers.
after googling i'm pretty certain the problem is that i have the page echo stuff like the stylesheet, site title, links, before it then changes the header, which is apparently not do able.
after changing a lot most of the log in/register scripts works, the only part i'm stuck with is after the user has logged in, if they revisit the login page (should not be able to but could happen accidentally) then the page checks cookies if they have logged in and then tries to redirect to the profile page which it can't because stuff is echoed out before.
Now i could just ignore it and remove the check if logged in part so making it possible for a logged in user to log in again, but the trouble is the plans i have for this site i will definately come across this problem again so really could do with a solution.
so any one able to help me out with this one?
[edit]
love it how everytime i have a problem, my first solution is to keep retrying it remembering why, if not check php/google, finally after many hours/days of searching i will turn to you guys, write a long post, then as i'm rereading my post to make sure it explains the problem i think of a fix.
ave realised i could just do the check if logged in at the top of the design page and then have the html/design, and then include the loggin script if still needed, so that way the first thing is the header if logged in.
ok this should sort the problem and hopefully any in future but if there is another solution i'd love to hear it.
simple put i have a site that is created dynamically using php, ie. the page title includes a file which checks the file name and echos whatever is correct for the page the user is on, making it easier for me to change the titles if i need to in one big go, and also this is for coursework so i'm trying to do as much as possible with php. Other things are like lists of links echoed out depending on page, the stylesheet again includes a file and then php checks if a cookie is set, or if the user is logged in then what stylesheet they have chosen which is stored in a database, if not give the default stylesheet name.
now problem i'm having is with the login script and headers.
i have it all working on it's own (just php no html) but it's when i start including the login/logout/register pages with the design that i have problems with headers.
after googling i'm pretty certain the problem is that i have the page echo stuff like the stylesheet, site title, links, before it then changes the header, which is apparently not do able.
after changing a lot most of the log in/register scripts works, the only part i'm stuck with is after the user has logged in, if they revisit the login page (should not be able to but could happen accidentally) then the page checks cookies if they have logged in and then tries to redirect to the profile page which it can't because stuff is echoed out before.
Now i could just ignore it and remove the check if logged in part so making it possible for a logged in user to log in again, but the trouble is the plans i have for this site i will definately come across this problem again so really could do with a solution.
so any one able to help me out with this one?
[edit]
love it how everytime i have a problem, my first solution is to keep retrying it remembering why, if not check php/google, finally after many hours/days of searching i will turn to you guys, write a long post, then as i'm rereading my post to make sure it explains the problem i think of a fix.
ave realised i could just do the check if logged in at the top of the design page and then have the html/design, and then include the loggin script if still needed, so that way the first thing is the header if logged in.
ok this should sort the problem and hopefully any in future but if there is another solution i'd love to hear it.
Last edited: