MrAdam Posted February 15, 2007 Share Posted February 15, 2007 i wasn't sure where to post this, as i wasn't sure how it would be fixed.I'm trying to get my webpage to validate as strict XHTML, there's 1 or 2 errors i know how to fix, but this one i'm not sure...basically, the server appears to be generating "PHPSESSID=blahblah" (sometimes) on links and forms. Of course this means it's using "&PHPSESSID=blahblah" which means it's not validating.http://www.minimerc.co.uk/new/shop.php?c=E...amp;m=W114-W115 (not much works yet so no point in trying to view other pages)How can I stop the server from doing this (i have .htaccess rights, but cannot change the server configuration directly)- Thanks! Link to comment Share on other sites More sharing options...
reportingsjr Posted February 15, 2007 Share Posted February 15, 2007 Im pretty sure that those are on all links because of the shopping cart, this is so it can store the users info in the database. You should check the shopping cart script for anything that has that part of the link. So just look around for those. Link to comment Share on other sites More sharing options...
MrAdam Posted February 15, 2007 Author Share Posted February 15, 2007 nar - thanks for the help - but it's the way the server is setup, occasionally it seems to pop the session into the link or form, where as on my server it never does. I've seen people using a function I can't remmeber the name of, to modify the confirguration in a particular script... Link to comment Share on other sites More sharing options...
justsomeguy Posted February 15, 2007 Share Posted February 15, 2007 That is a session configuration option. If cookies are not available or can't be used, PHP will put the session ID in URLs. If you want to disable that, so that only cookies are used and not the URL, use this on the top of each page:ini_set("session.use_only_cookies", 1); Link to comment Share on other sites More sharing options...
MrAdam Posted February 15, 2007 Author Share Posted February 15, 2007 that's not worked either :S Link to comment Share on other sites More sharing options...
justsomeguy Posted February 15, 2007 Share Posted February 15, 2007 Try this: ini_set("session.use_cookies", 1);ini_set("session.use_only_cookies", 1);ini_set("session.use_trans_sid", 1); Make sure those get processed in the beginning of each page, definately before any output. Link to comment Share on other sites More sharing options...
MrAdam Posted February 15, 2007 Author Share Posted February 15, 2007 still not working .. first lines of my script for shop.php: <?phpini_set("session.use_cookies", 1);ini_set("session.use_only_cookies", 1);ini_set("session.use_trans_sid", 1); session_start(); here's the errors it's giving me:http://validator.w3.org/check?uri=http%3A%...26m%3DW114-W115 Link to comment Share on other sites More sharing options...
justsomeguy Posted February 15, 2007 Share Posted February 15, 2007 Try setting the trans_sid to 0 instead of 1, I wasn't clear on what that directive does. But you might also not be able to set that directive during runtime. Try adding this instead:ini_set('url_rewriter.tags', '');That will probably work, and you can also try to put a php.ini file in the same directory as your scripts with the session.use_trans_sid and session.use_only_cookies directives in it. Link to comment Share on other sites More sharing options...
MrAdam Posted February 15, 2007 Author Share Posted February 15, 2007 owwwwww yessssssss !worked with "ini_set('url_rewriter.tags', '');"!http://validator.w3.org/check?uri=http%3A%...26m%3DW114-W115passes now ! :)Thankyou very, very much !x Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now