Hi anyOne. I've got a odd trouble with the xhmtl validation for my personal site blogial. When I try to validate I get this:
<li><a href="/index.php?cat=1&PHPSESSID=e1c8723eaf7d0eefd07706afe6b49a38">Php&nb An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon [;]. The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".
but in the xhtml source I've got only this:
<li><a href="/index.php?cat=1">Php (2)</a></li>
Well, I'm wondering I sent by GET only a value (category ID) and so what's the problem with PHPSESSID. If I sent 2 values I could work it around using for instance
<a href="foo.cgi?chapter=1&section=2&copy=3&lang=en">...</a>
but I'm sending only a value π Could you help me ? TKs.
PHPSESSID can be turned off with:
ini_set('session.use_trans_sid', 0);
Hi. First of all lots of thanks for the ready reply . I tried to put
ini_set('session_use_trans_sid', 0);
but unfortunately it doesn't work π I've got the same parse error
Warning Line 22 column 30: cannot generate system identifier for general entity "PHPSESSID".
I don't know what the heck is going on my code !!!!!!!!!!! I'm awaiting a piece of news anxiously π I don't have any troubles for this problem but I'm very annoyed about it. I'd like to valdate my xhtml code. Take care.
I think a space between Php and might help with validation.
Blu
Hi. Tks for the piece of advice but guess you it doesn't work. SooooBBbb ................. Bye-Bye
WDG FAQ wrote:Ampersands (&'s) in URLs Another common error occurs when including a URL which contains an ampersand ("&"): <!-- This is invalid! --> <a href="foo.cgi?chapter=1§ion=2©=3&lang=en">...</a> This example generates an error for "unknown entity section" because the "&" is assumed to begin an entity reference. Browsers often recover safely from this kind of error, but real problems do occur in some cases. In this example, many browsers correctly convert ©=3 to Β©=3, which may cause the link to fail. Since ⟨ is the HTML entity for the left-pointing angle bracket, some browsers also convert &lang=en to 〈=en. And one old browser even finds the entity §, converting §ion=2 to Β§ion=2. To avoid problems with both validators and browsers, always use & in place of & when writing URLs in HTML: <a href="foo.cgi?chapter=1&section=2&copy=3&lang=en">...</a> Note that replacing & with & is only done when writing the URL in HTML, where "&" is a special character (along with "<" and ">"). When writing the same URL in a plain text email message or in the location bar of your browser, you would use "&" and not "&". With HTML, the browser translates "&" to "&" so the Web server would only see "&" and not "&" in the query string of the request.
Ampersands (&'s) in URLs
Another common error occurs when including a URL which contains an ampersand ("&"):
<!-- This is invalid! --> <a href="foo.cgi?chapter=1§ion=2©=3&lang=en">...</a>
This example generates an error for "unknown entity section" because the "&" is assumed to begin an entity reference. Browsers often recover safely from this kind of error, but real problems do occur in some cases. In this example, many browsers correctly convert ©=3 to Β©=3, which may cause the link to fail. Since ⟨ is the HTML entity for the left-pointing angle bracket, some browsers also convert &lang=en to 〈=en. And one old browser even finds the entity §, converting §ion=2 to Β§ion=2.
To avoid problems with both validators and browsers, always use & in place of & when writing URLs in HTML:
Note that replacing & with & is only done when writing the URL in HTML, where "&" is a special character (along with "<" and ">"). When writing the same URL in a plain text email message or in the location bar of your browser, you would use "&" and not "&". With HTML, the browser translates "&" to "&" so the Web server would only see "&" and not "&" in the query string of the request.
Have you read that?
i.e. use url_encode() properly....
Hi again ! I tried to put into the constant file
ini_set('session_use_trans_sid','0');
but I also tried this:
$inis = ini_get_all(); echo "<pre>"; print_r($inis); echo "</pre>";
and I've got this:
[session.use_trans_sid] => Array ( [global_value] => 1 [local_value] => 1 [access] => 6 )
Could you explain me why ? Take care.
what does your PHPinfo page show as the enabled stuff (should be a listing of --enable-XXX commands).
And what version of PHP are you using?
Also check this part of php.ini:
; The separator used in PHP generated URLs to separate arguments. ; Default is "&". ;arg_separator.output = "&"
And the corresponding page in the manual.
Hi anyOne. How are you ? I hope fine. Here is the list I trust you π I put this into my main include file (Constant etc )
ini_set('session_use_trans_sid',0); ini_set('arg_separator.output', '&');
Thanks a lot again. Bye-Bye
Does it work? does it not work?
ini_set('session_use_trans_sid',0);
That's not completely right, it should be:
ini_set('session.use_trans_sid',0);
Notice the "." instead of the "_"
Sorry, that was my bad π
Hi again. It's enough, it doesn't work. I asked for help to my web hosting π I tried your new version but into phpinfo I got
session.use_trans_sid On On
Ah sooob π I'll catch you up on my trouble. Thanks again for your help and advice. Bye-Bye. Greetings from Italy π
Well, it doesnt' change in your PHP.ini... it changes on the page that you run the app on.... so unless you call ini_set('session.use_trans_sid', 0); before you call phpinfo(); it won't make a difference in the PHPInfo page...
Ok. I got it. I've a headache. I think to give up trobling π But π)))))) the trouble doesn't change. Take care
The last news ! I got this by my host: You can use the following directive in the .htaccess file. php_flag session.use_trans_sid off but tomorrow !!!! Bye.
Hi. I'm sorry to disturb you again I got over my disease π How can I create (I mean the syntax) the .htaccess file with
php_flag session.use_trans_sid off
and where can I put it ? I'm very weak managing with apache. BYe
Sorry now I go to bed π
I hope the headache is better tomorrow π
open a text file, paste the line your host gave you into it
Save it as htaccess.txt Save it in ASCII format!! That's important
Upload it, then rename it to .htaccess
Then just try your page again.