Re: [PHP] Php lib?
Thanks for that rather handy! Does anyone know what the function set_var() does in template.inc in phplib? I persume it has something to do with the template system.but thats as much as I have figured out!! I am going to replace the phplib template system with Smarty there is not a converter for this(wishful thinking! anything for an easy life) My boss set me this task before he went on holiday...I am sure he is bloody laghing his socks off right now! I wondered why he never bothered porting this for PHP4! Arrgh! John Anyone got any handy hints on how to convert scripts running on PHP3 and PHPlib? 1. Roughly speaking, page_open() goes to session_start(): Old: page_open(array(sess = my_web_Session)); New: session_start(); 2. page_close() goes away; if you don't have time to remove all those calls, write your own page_close() function that simply returns true. 3. Use functions instead of methods for managing the session variables. For example, for the object $sess created in step 1 above: Old: $sess-register('firstName'); New: session_register('firstName'); Brings back fond memories - not! ;) Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php lib?
Hi, sets the value of the var to be parsed later. HTH Andrey - Original Message - From: John Wards [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 12:58 PM Subject: Re: [PHP] Php lib? Thanks for that rather handy! Does anyone know what the function set_var() does in template.inc in phplib? I persume it has something to do with the template system.but thats as much as I have figured out!! I am going to replace the phplib template system with Smarty there is not a converter for this(wishful thinking! anything for an easy life) My boss set me this task before he went on holiday...I am sure he is bloody laghing his socks off right now! I wondered why he never bothered porting this for PHP4! Arrgh! John Anyone got any handy hints on how to convert scripts running on PHP3 and PHPlib? 1. Roughly speaking, page_open() goes to session_start(): Old: page_open(array(sess = my_web_Session)); New: session_start(); 2. page_close() goes away; if you don't have time to remove all those calls, write your own page_close() function that simply returns true. 3. Use functions instead of methods for managing the session variables. For example, for the object $sess created in step 1 above: Old: $sess-register('firstName'); New: session_register('firstName'); Brings back fond memories - not! ;) Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php lib?
Again ta! I had sort of figured it out while waiting for someone to get back to me. Mental note..must learn objects.no argh John Hi, sets the value of the var to be parsed later. HTH Andrey - Original Message - From: John Wards [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 12:58 PM Subject: Re: [PHP] Php lib? Thanks for that rather handy! Does anyone know what the function set_var() does in template.inc in phplib? I persume it has something to do with the template system.but thats as much as I have figured out!! I am going to replace the phplib template system with Smarty there is not a converter for this(wishful thinking! anything for an easy life) My boss set me this task before he went on holiday...I am sure he is bloody laghing his socks off right now! I wondered why he never bothered porting this for PHP4! Arrgh! John Anyone got any handy hints on how to convert scripts running on PHP3 and PHPlib? 1. Roughly speaking, page_open() goes to session_start(): Old: page_open(array(sess = my_web_Session)); New: session_start(); 2. page_close() goes away; if you don't have time to remove all those calls, write your own page_close() function that simply returns true. 3. Use functions instead of methods for managing the session variables. For example, for the object $sess created in step 1 above: Old: $sess-register('firstName'); New: session_register('firstName'); Brings back fond memories - not! ;) Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php-lib questions
Here is the script "request.php" 62 lines, 1585 characters ? include ("layout.php"); page_open(array("sess" = "Repository_Session")); if (!isset($s)) { $s=0; }; $sess-register("s"); site_header("Request a Document - Document Cart"); echo 'P align=leftfont face="Arial, Helvetica, sans-serif" size="2" color="#66"Below is your bifont color="#FF"Document Cart/font/i/b.br br /fontfont face="Arial, Helvetica, sans-serif" size="2" color="#66"Any time you request a document we will store it here. You may a href="http://starbase.msfc.nasa.gov/rs-bin/show_files.pl?search='.$s earch.'" return to your search results/a at any time and choose another documentbr or you may perform a a href="search.php"New Search/a.br br /fontfont face="Arial, Helvetica, sans-serif" size="2"You may also Increase or Decrease the Number of copies you wish to request by using the font color="#FF"Add/Remove /fontlinks, or completly empty the cart with the font color="#FF"Clear cart/font link.br br /fontfont face="Arial, Helvetica, sans-serif" size="2" color="#66"Whenever you are done selecting documents click the ifont color="#FF"Checkout/font/ifont color="#FF" /fontlink to process your request./font/P BR'; global $scart; global $obj_id; $scart-start(); switch($action) { case add: $scart-add_item($obj_id,1); break; case remove: $scart-remove_item($obj_id,1); break; case clearcart: $scart-reset(); break; } $scart-show_all(); page_close(); site_footer(); ? I'm not familiar with the ob* functions, is this phplib or just php, I'll look for some docs on it and give it a try though thanks. -Mark ""Plutarck"" [EMAIL PROTECTED] wrote in message 9b4bb7$1tf$[EMAIL PROTECTED]">news:9b4bb7$1tf$[EMAIL PROTECTED]... That sounds like a problem with the way you handle sessions. What happens is your program tries to start a session, but the page isn't sent if a session isn't started. It still shouldn't reply with a 404 though...search your script for header and see if you send any. Once someone has the session, then the page will load correctly. Muck through your php code and see if there are any conditions or loops which require a session to be running. Still, that shouldn't happen and it's probably one of those bugs that you can't figure out why they happen, or what causes them, but after tinkering around suddenly everything works. One thing to try, if it's available, is use the ob_* functions as a debugger. Stick an obstart at the begining and a ob_end_flush at the end, and see if the problem disappears magically. Odd what sometimes fixes things... -- Plutarck Should be working on something... ...but forgot what it was. ""Mark"" [EMAIL PROTECTED] wrote in message 9b4ar1$t6i$[EMAIL PROTECTED]">news:9b4ar1$t6i$[EMAIL PROTECTED]... I have a php script which is like a modified shopping cart. It starts with a search that calls a perl script ( I know, but it's the only way I can include certain proprietary functionality I need). This returns a results set of documents that can be either downloaded or requested depending on permissions. If you click to request a document a php script request.php is called it is sort of like a cart script, and uses phplib sessions and db_oci8. The strange problem I am having is this: If it is the first time you have reqeusted this script since last opening your browser, you will get a 404, if you hit back/forward or refresh the script works fine as if nothing ever happened. You will not get this error again as long as you do not close and reopen your browser. Any ideas? -- 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]