[FAQTS] PHP Knowledge Base Update -- January 24th, 2000

From: Date: Mon, 24 Jan 2000 16:52:22 +0000
Subject: [FAQTS] PHP Knowledge Base Update -- January 24th, 2000
Groups: php.kb 
Request: Send a blank email to php-kb+get-40@lists.php.net to get a copy of this message
After a complete rewrite and many improvements the PHP Knowledge Base has now moved to: http://php.faqts.com Now that the code is stable, I can concentrate on adding content to the Knowledge Base by continuing to summarise this mailing list. Many of the improvements are focused on making it easier for anyone to share their knowledge by contributing. If you have any suggestions for the site or wish to add a knowledge base of your own please mail me at nathan@synop.com. Cheers, Nathan ## Unanswered Questions ######################################## ------------------------------------------------------------- Does anyone know how I can delete an element from an array cookie? http://www.faqts.com/knowledge-base/view.phtml/aid/650 ------------------------------------------------------------- Dave Martindale ------------------------------------------------------------- How can I setup PHP with Netscape Enterprise Server 3.5.1? http://www.faqts.com/knowledge-base/view.phtml/aid/649 ------------------------------------------------------------- Xavier Choukroun, Nathan Wallace ## New Entries ################################################# ------------------------------------------------------------- How do I delete a cookie? http://www.faqts.com/knowledge-base/view.phtml/aid/636 ------------------------------------------------------------- Nathan Wallace You can't delete a cookie as such. Instead you just empty it and set it to expire at some time in the past. For example: // delete the userid cookie setcookie('userid', '', time()-48*3600, '/'); ------------------------------------------------------------- How can I do permanent sessions or authorization with PHPLIB? http://www.faqts.com/knowledge-base/view.phtml/aid/637 ------------------------------------------------------------- Nathan Wallace Jesse Swensen First, I believe what your are asking for is a permanent authorization not a session. So with that in mind, I took a look at auth.inc and found this: var $lifetime = 15; ## Max allowed idle time before ## reauthentication is necessary. ## If set to 0, auth never expires. ------------------------------------------------------------- What are the differences between GET and POST? http://www.faqts.com/knowledge-base/view.phtml/aid/638 ------------------------------------------------------------- Nathan Wallace Damien Mc Kenna, Scott Stevenson, Eugene Teo Variable data is sent as part of the URL for GET requests. In POST requests it is sent as a separate HTTP header. As a request GET has some sort of maximum string length limit (the maximum limit of a URL string). So POST requests are better for large data strings. If you use GET, info is logged by the server (apache). For example, if you submitted password in cleartext, we can see it. POST request data is not usually logged. ------------------------------------------------------------- How can I backup a MySQL database through PHP only? Can I backup my database using PHPMyAdmin? http://www.faqts.com/knowledge-base/view.phtml/aid/639 ------------------------------------------------------------- Nathan Wallace Murray Shields Try phpMyAdmin: http://www.htmlwizard.net/phpMyAdmin/ As well as a great tool for administering your MySql database, it allows you to dowload a dump of the entire database through your web browser. ------------------------------------------------------------- Is there a quick way to check that all form fields were entered? http://www.faqts.com/knowledge-base/view.phtml/aid/640 ------------------------------------------------------------- Nathan Wallace Richard Lynch Try something like this that just checks to see that all the POST variables are not empty. <?php if (isset($HTTP_POST_VARS)){ while(list($var, $val) = each($HTTP_POST_VARS)){ if (empty($val)){ $bad[$var] = 1; } } } ?> <FORM ...> <?php if (isset($bad)){ echo "<FONT COLOR=FF0000>All Fields Required</FONT>"; } ?> <?php if (isset($bad['whatever'])){ echo "<FONT COLOR=FF0000>"; ?> Whatever: <INPUT NAME=whatever> </FORM> ## Edited Entries ############################################## ------------------------------------------------------------- Where can I get PHPLIB? Does PHPLIB run on Windows NT? http://www.faqts.com/knowledge-base/view.phtml/aid/249 ------------------------------------------------------------- Nathan Wallace Vivek Awasthi PHPLIB can be found at: http://phplib.netuse.de You can download the tar.gz version, it works on all PHP platforms. On Windows NT you'll probably need WinZip to install it. Furthur instructions are well documented in it.

« previous php.kb (#40) next »