PHP Knowledge Base Update -- June 27th, 1999
[email protected] (Nathan Wallace) Mon, 28 Jun 1999 11:55:45 +0000
| Newsgroups | php.kb |
|---|---|
| Organization | Synop Software |
| Message-ID | <[email protected]> |
This is the first official message to the new PHP Knowledge Base Mailing
List. I want to give particular thanks to Jim Winstead, Christopher
Curtis, Paul Meagher, Tom Henry and all the others who sent encouraging
words.
You can search, browse and contribute to the knowledge base at:
http://e-gineer.com/phpkb/
I disappeared into a coding world for a few days there to get things
working. Now that the format and site are mostly working I have
completed the summaries for the days I missed. They are archived at:
http://e-gineer.com/e-gineer/phpkb/archive.phtml
Anyone can contribute to the knowledge base, so if you see something
that isn't quite right - fix it!
BTW, I'll admit straight away that the search engine is crap. I'll fix
it after I've done some real work so I can pay my rent this week...<g>
Cheers,
Nathan
------------------------------------------------------------
Why is fgets() always adding slashes to the string it returns?
http://e-gineer.com/phpkb/view.phtml/qid/216
------------------------------------------------------------
Jim Winstead
For example, if fgets() sees this string in the socket:
<a href="http//www.yahoo.com">Yahoo!</a>
it returns:
<a href=\"http//www.yahoo.com\">Yahoo!</a>
You should check your value of magic_quotes_runtime.
>From http://www.php.net/manual/configuration.php3
If magic_quotes_runtime is enabled, most functions that return data from
any sort of external source including databases and text files will have
quotes escaped with a backslash.
------------------------------------------------------------
Can I create a form that enables the upload of multiple files?
How can I upload multiple files in one PHP script?
http://e-gineer.com/phpkb/view.phtml/qid/217
------------------------------------------------------------
Sascha Schumann, Mike Robinson
PHP (and most browsers, including Netscape) follow RFC 1867
("Form-based File Upload in HTML") which allows for multiple
files to be uploaded.
Uploading multiple files should work by using various NAME attributes in
the HTML code, i.e.
<input type=file name=file1>
<input type=file name=file2>
<input type=file name=file3>
You could even try it this way
<input type=file name=file[]>
<input type=file name=file[]>
<input type=file name=file[]>
------------------------------------------------------------
Will an MD5 encoded string ever have spaces in it?
What form does an MD5 string take?
http://e-gineer.com/phpkb/view.phtml/qid/219
------------------------------------------------------------
Sascha Schumann
An MD5 string will always match:
^[a-zA-Z0-9]{32}$
That is, 32 characters long with each character being a single digit or
a letter.
------------------------------------------------------------
How do I specify the default document in a directory?
How do I set the index file name for a directory in Apache?
http://e-gineer.com/phpkb/view.phtml/qid/221
------------------------------------------------------------
Steven Champeon, Nathan Wallace
In Apache you use the DirectoryIndex directive. Apache will then search
the directory for the index file in left to right order. You can
specify the DirectoryIndex in your .htaccess file or in httpd.conf.
DirectoryIndex index.php3 index.html index.htm default.htm
http://www.apache.org/docs/mod/mod_dir.html#directoryindex
------------------------------------------------------------
How can I delete a file from PHP?
What does unlink do?
http://e-gineer.com/phpkb/view.phtml/qid/223
------------------------------------------------------------
Kim Shrier
Use the unlink function:
http://www.php.net/manual/function.unlink.php3
The reason it is called unlink is because the UNIX file system allows a
single file to be refered to from multiple file names. These additional
references are created by using the link subroutine to create a
reference from the file name to the inode that holds information about
the actual disk blocks that contain the file. Links are removed by
using the unlink subroutine. When the last link to a file is removed,
the file is deleted.