icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » Sessions and XHTML

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old October 5th, 2004, 8:25 PM   #1 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,092 posts
Gave thanks: 48
Thanked 131 times
Sessions and XHTML

Hey,

Wondering if someone can help me out here. I'm working on a bit of the schools website, and it's going to have student logins and whatnot. Anyhow, it validates perfectly fine EXCEPT when I have sessions. It's wanting to throw a session tag on the end of the URL. Because of that, it's using invalid URL usage by putting "&" instead of "&"

Anyone know how I can either get it to stop putting that on the end of URLs, or how I can get it to put "&" instead?

Thanks.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 5th, 2004, 10:27 PM   #2 (permalink)
the one who was
Super #1
 
patrickb's Avatar
 
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
Try this in a .htaccess file in the root of your website.

Code:
php_flag session.use_trans_sid 1
That should work, but there is a known bug where it doesn't work. If that is the case, we will have to manually add it your site's info in the httpd.conf for any site you need this changed on.
__________________
Patrick

Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org
patrickb is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 5th, 2004, 11:48 PM   #3 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,092 posts
Gave thanks: 48
Thanked 131 times
Thanks Patrick. That worked great on the actual pages; however, for some reason the validator is still picking it up.

The page: http://hosted.hauglanddesigns.com/ndss/
The Validation: http://validator.w3.org/check?uri=ht...igns.com/ndss/

I did find something weird though. When I open it for the first time in a browser, it WILL show the session ID in the URL, but if I refresh for click another link, it disappears and doesn't show up again.

Thanks again, greatly appreciated.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 6th, 2004, 12:06 AM   #4 (permalink)
the one who was
Super #1
 
patrickb's Avatar
 
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
Yes, the behavior of that one variable is sporadic I think. I don't deal with cookies myself, other than to store the session ID. Everything else is stored server side with the session info. Try setting these values and forcing cookie usage only. This may help you some more. The use only cookies may work, but the last two entries will force PHP to use the encoded version of the ampersand which should get you past the validation problem.

Code:
php_flag session.use_only_cookies 1
php_value arg_separator.output "&"
php_value arg_separator.input "&"
__________________
Patrick

Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org
patrickb is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 6th, 2004, 12:17 AM   #5 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,092 posts
Gave thanks: 48
Thanked 131 times
Thank you Patrick! I got away with using the bottom two. I've never touched cookies, so I thought I'd try to avoid the cookie one.

It works perfectly. Now I can brag to my teacher about my elite skills and then when he asks how I did it, I can say the great Patrick of Surmunity told me the way.

Anyhow, thank you very much Patrick. Two thumbs up and a nomination for Admin of the Hour.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 6th, 2004, 6:34 PM   #6 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,092 posts
Gave thanks: 48
Thanked 131 times
Ahh.. Sorry to bring this back, but it turns out I'm not very observant. I was just editing the one page and main layout last night and never really clicked any links. There's a wee problem. For some reason it's deciding to only load the "home" page. I have it set to load it if no other variables are set. This does come across as a problem as it hinders navigation. I tried taking it out and the links seem to function properly, but then it doesn't validate... I'm so confused and lost now as to what I should do.

Also, it's not the only page that it affects.. I just launched my main site and it's stuck on the main page too.

Ok -- I just tried something before I hit submit and I seemed to solve it. I removed "php_value arg_separator.input "&" " and it seemed to have working links AND validate.

Further proof that I am in fact, a blonde.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 6th, 2004, 7:00 PM   #7 (permalink)
the one who was
Super #1
 
patrickb's Avatar
 
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
So much for bragging to the teach about your elite skills.

I recall telling someone else to do this once before and not even mentioning using the arg_separator.input arugment and had no problems. It just makes logical sense to me that the input would need to be adjusted since the output is changed and there would be compatibility problems when clicking the links. Looks like I was backwards on the thinking behind this.

Of course, I never have cared much for validation, since all of the various browsers out there don't stick to any single standard very well. I just ignore validation entirely. Maybe that is why my designs look so bad? dunno... glad you figured it out though...
__________________
Patrick

Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org
patrickb is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On