Re: [PHP] session problem using headers
Thanks for your email. I did the changes you suggested, and the page is now going to input.php?= ie no record of the SID. I added the following lines to the code. echo SID: $SID; and echo SID: $PHPSESSID; and $SID was not displayed i.e just SID: was displayed. I guess this is the problem. For some reason, SID is not assigned a value. However, PHP is creating a file in /tmp on the server called sess_09591b3e465294959ecde0ee41f6c188 and as I said in the last e-mail, sessions with cookies is working fine. Thanks again for any ideas. I am using php 4.0.5 running on Sun Solaris David scott [gts] wrote: you're passing the PHPSESSID incorrectly, it seems you must do something like this: A HREF=nextpage.php??=SID? or header(Location: nextpage.php?$SID); what you're doing now will go to page input.php?=SID instead of input.php?938sa9fa98f7daf987a9s (or similar) -Original Message- From: David Allen [mailto:[EMAIL PROTECTED]] Sent: Friday, July 13, 2001 6:45 AM To: [EMAIL PROTECTED] Subject: [PHP] session problem using headers Hi, I am having problems with sessions. With cookies turned on it works fine. Turn off cookies it fails. I have tried both header(Location: input.php?=SID); header(Location: input.php?PHPSESSID=.PHPSESSID); to pass the session id to the programme input.php but neither works. The first lines of input.php are ? session_register(userid); ? userid is the variable I wish to pass. However, I have no other code related to sessions in this script. Do I need in some way tell the script to use this session id? As a have said before, it works fine if cookies are turned on. Thanks in advance for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session problem using headers
Further to the last e-mail the plot thickens... If cookies is turned on, the line echo SID: $PHPSESSID; displays the session id. I thought the whole idea of using $PHPSESSID was so that sessions would work with cookies turned off! Am I missing something here? I disabled cookies via the preferences advanced tab in Netscape. David David Allen wrote: Thanks for your email. I did the changes you suggested, and the page is now going to input.php?= ie no record of the SID. I added the following lines to the code. echo SID: $SID; and echo SID: $PHPSESSID; and $SID was not displayed i.e just SID: was displayed. I guess this is the problem. For some reason, SID is not assigned a value. However, PHP is creating a file in /tmp on the server called sess_09591b3e465294959ecde0ee41f6c188 and as I said in the last e-mail, sessions with cookies is working fine. Thanks again for any ideas. I am using php 4.0.5 running on Sun Solaris David scott [gts] wrote: you're passing the PHPSESSID incorrectly, it seems you must do something like this: A HREF=nextpage.php??=SID? or header(Location: nextpage.php?$SID); what you're doing now will go to page input.php?=SID instead of input.php?938sa9fa98f7daf987a9s (or similar) -Original Message- From: David Allen [mailto:[EMAIL PROTECTED]] Sent: Friday, July 13, 2001 6:45 AM To: [EMAIL PROTECTED] Subject: [PHP] session problem using headers Hi, I am having problems with sessions. With cookies turned on it works fine. Turn off cookies it fails. I have tried both header(Location: input.php?=SID); header(Location: input.php?PHPSESSID=.PHPSESSID); to pass the session id to the programme input.php but neither works. The first lines of input.php are ? session_register(userid); ? userid is the variable I wish to pass. However, I have no other code related to sessions in this script. Do I need in some way tell the script to use this session id? As a have said before, it works fine if cookies are turned on. Thanks in advance for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session problem using headers
Hi, I am having problems with sessions. With cookies turned on it works fine. Turn off cookies it fails. I have tried both header(Location: input.php?=SID); header(Location: input.php?PHPSESSID=.PHPSESSID); to pass the session id to the programme input.php but neither works. The first lines of input.php are ? session_register(userid); ? userid is the variable I wish to pass. However, I have no other code related to sessions in this script. Do I need in some way tell the script to use this session id? As a have said before, it works fine if cookies are turned on. Thanks in advance for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] pop textarea field w/ text incl. quotes
Why store the html in the db? Why not have multiple db fields, say url and desc then when you grab them from the db to be outputed put them into the html print 'A HREF="'.$url.'"'.$desc.'/A'; Then you wouldn't have to input all the html when it gets stored in the db, not have to worry about quotes, or htmlspecialchars();. Also out of curiosity are you stripping all tags but A from the input? Wouldn't want to get any nasty users inputting META refresh tags or anything... -David Reid On Wed, 21 Feb 2001 17:46:30 -0800 (PST), John Monfort said: Is it necessary to include the 'http:' in the DB field? It would make your life a lot easier to drop it. You would then store the url values as www.mydomain.com Then, modify your code to add the 'HTTP' whenever it encounter a URL, or wherever you will create a link. This would eliminate the need to deal with special characters... __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___+- On Wed, 21 Feb 2001, Paul Warner wrote: Simon- Thanks for the tip...I trued using the htmlspecialchars() which allowed the remainder of the form to display properly, but left no value in the textarea. Then I noticed a difference in the method I was using compared to yours - I'm still learning the ways of PHP so it will take me a while to determine the significance of the syntax differences: Mine: td width = "60%"?php echo $linkurl . 'brtextarea value="htmlspecialchars($linkurl)"/textarea/td\n' ? Yours: ?php echo "textarea" . htmlspecialchars($link) . "/textarea" ? I wanted a graphical representation of the present link displayed above the textarea and then attempted to use php's substitution to build the text area within the same string. I updated my code to be more like yours and arrived at: ?php echo $linkurl . 'brform'??php echo "textarea" . htmlspecialchars($linkurl) . "/textarea\n"? which seems to make the parser behave as I intended. Anyway...thanks! -- Paul - Original Message - From: "Simon Garner" [EMAIL PROTECTED] To: "Paul Warner" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, February 21, 2001 8:19 PM Subject: Re: [PHP] pop textarea field w/ text incl. quotes Don't worry about quotes - the problem is that you have HTML markup inside your textarea. You just need to convert and to lt; and gt;, respectively, in your link text. The functions htmlspecialchars() or strip_tags() can do this for you. i.e.: ? echo "textarea" . htmlspecialchars($link) . "/textarea" ? When the form is submitted (and when it's viewed), those entities will be converted back to their real characters automatically by the browser. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Karl's version of Parkinson's Law: Work expands to exceed the time alloted it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]