[PHP] PHP and the C Preprocessor

2002-12-04 Thread Daniel Grace
p the Make if there's a syntax error.) By the way, once I get this all working, I'll release the build system (not what it builds, however) as open-source for whoever wants it. It's going to be quite handy IMHO. -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: open or save problem

2002-07-30 Thread Daniel Grace
rther research into this, I periodically hear something about an issue between Apache and PDF, but I don't know the details of that. It's possible the problems are related -- if so, there may be a fix somewhere on the Apache site. -- Daniel Grace - Original Message - From: "Dy

[PHP] Re: Search a flat file.

2002-06-08 Thread Daniel Grace
Be warned that explode won't work as expected if any of your fields contain colons, though it doesn't look like it'll be an issue in this sort of case. "Gaylen Fraley" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Use the explode() function based on the colon

[PHP] Re: ssl security question

2002-06-08 Thread Daniel Grace
and thus someone with access to the history can determine their username/password. POST would really be a better method to use here in this case. -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Speed comparison of PHP vs. PERL (not conclusive)

2002-06-05 Thread Daniel Grace
e continue(2) is actually a tiny tiny bit slower (we're talking around 0.010s over a 1-iteration loop on a 700 mhz machine here) than doing it by hand the old way. With an amount that small though, I'm more inclined to believe it's just statistical error/random variance than anything else. -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Daniel Grace
se I pondered the idea of maybe writing a Win32 API extension for PHP) And a loop in PHP isn't exactly non-typical. I'd need more fingers and toes to count how many times I've wrote "while($row = mysql_fetch_assoc($result)) { ... }" -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Daniel Grace
ect the output made -- wasn't noticeable) and forgot to remove them when c+p'ing the source to the newsgroup. -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Daniel Grace
This all started in a little debate between me and a friend of mine who I think is as much a PERL zealot as I am a PHP zealot (I was briefly pondering the idea of a Win32 API extension for PHP), and the results were rather surprising -- to me, at least.. It all started when I asked him what PERL

[PHP] Re: Apache, html, PHP and global variables

2002-05-30 Thread Daniel Grace
long time...it adds up real fast!). If the ability to raise the connection limit isn't available, you may want to use mysql_connect instead -- slightly slower, but you won't have to worry about unused connections lingering. (It's still possible to hit the limit, though, just not as l

Re: [PHP] Re: reindexing an array after unset()

2002-05-18 Thread Daniel Grace
s perfect, except that I don't want to take the last > element off the end. Otherwise I would definitely use it. > > Erik > $array = array_values($array) will re-index your array without the need for array_pop and array_push. -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Empty Delimiter error

2002-04-15 Thread Daniel Grace
our script can handle $email being empty, simply adjust your level of error-reporting or silence the warning with an @. Otherwise, fix whatever it is that's causing $email to be empty. -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Overriding session headers

2002-03-01 Thread Daniel Grace
header from being sent and I'm not being allowed to override it. Maybe in some later version we'll get the ability to either fine-tune what headers the Session handler sends, or the ability to directly modify what's being sent for headers? Pleeease? -- Daniel Grace (my original me

[PHP] Re: get the median from an array of integers

2002-03-01 Thread Daniel Grace
gt; As for the median value, there's a relatively easy way to do this in PHP: 1. Sort the array (sort()) 2. Count the number of elements in the array (count()) 3. Take the element that is equal to half the number of the elements (rounded to an int, which way you round doesn't matter)

[PHP] Overriding session headers

2002-02-28 Thread Daniel Grace
nding my own cache-control headers with header() either merges them with the ones the session_start sends, or does absolutely nothing (verified by doing a GET /url HTTP/1.0 via telnet to port 80), regardless of whether the header occurs before or after the session_start. -- Daniel Grace P.S. The P

Re: [PHP] breaking out of two loops

2002-02-04 Thread Daniel Grace
orben That being said, break only breaks out of looping constructs. A break placed within an if-block will break out of the loop around it. There isn't a direct way to break out of an if-block alone (if that's your intent), though this will work: do { if(condition) { ...

[PHP] Re: Newbie: function for downloading

2002-02-02 Thread Daniel Grace
"Manuel Ritsch" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hey There > > I have a little question > > I'm making a page where you can download mp3's (hip hop and funk beats made > by myself) and i want, if you press on the > link (), that it doesn't start a

[PHP] Re: echo " HTML code ";

2002-01-31 Thread Daniel Grace
riables, your current way is fine. By the way, you may wish to consider using 'here documents': echo << will work just fine. For more about Here Documents, take a look at here: http://www.php.net/manual/en/language.types.string.php XYZZY; -- Daniel Grace -- PHP General Mail

[PHP] Re: Swapping for \n... ?

2002-01-29 Thread Daniel Grace
"Jon" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Nevermind, I found some code at last which actually works : > > $txt = preg_replace("/(\015\012)|(\015)|(\012)/","",$txt); > rather than using a regular expression, try: $txt = strtr($txt, array("\r\n" =>

Re: [PHP] bug in echo function?

2002-01-19 Thread Daniel Grace
each 'piece' to the output buffer/to the browser one by one rather than having to go through the work of building one large string and then outputting that. Caveats: This won't work if you use the function-like syntax for echo << echo(foo, bar, baz) /* this won't work

Re: [PHP] how to send to URL on if statement?

2002-01-19 Thread Daniel Grace
There is one other option if you're willing to take a slight drop in performance. Take a quick look at: http://www.php.net/manual/en/ref.outcontrol.php -- Daniel Grace <[EMAIL PROTECTED]> "Richard Crawford" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]"

[PHP] Re: 1st 100 charactors that are pulled from a mySql Database

2002-01-17 Thread Daniel Grace
know whether it's too long) is combine both #1 and #2 and actually pull the first 150-200 characters from the database, which should be enough to deal with most HTML escapes without dumping the entire table. -- Daniel Grace <[EMAIL PROTECTED]> -- PHP General Mailing List (http

Re: [PHP] Overriding php.ini at runtime

2002-01-15 Thread Daniel Grace
"Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Tuesday 15 January 2002 17:24, Daniel Grace wrote: > > Is there an equivalent to the php_ini directive available for the CGI > > version > > Some settings in php.ini can

[PHP] Re: PHP array or SQL problem

2002-01-15 Thread Daniel Grace
#x27; >spot. Here is my SQL query: > >select * from employees order by fname; > >Should I create an array and sort it there or can I somehow query MySQL to >sort by nickname only if it exists and then by fname? > >Dean > > SELECT IF(nickname IS NOT NULL AND nickname !

[PHP] Overriding php.ini at runtime

2002-01-15 Thread Daniel Grace
ache group says not to modify...) -- Daniel Grace <[EMAIL PROTECTED]> Please CC me in replies -- 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] Re: Get Page Title

2002-01-02 Thread Daniel Grace
"R. Elsenaar" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > To get the title of an external page to put into a link, has somebody did > that already and can give me some hints for this trick > > Robert > > // Your question managed to spark my interes

Re: [PHP] Re: Generate Alphabet

2002-01-02 Thread Daniel Grace
) the expression's value is returned, not before. In other words, it's equivalent to this: print $foo; $foo = $foo + 1; not this: $foo = $foo + 1; print $foo; -- Daniel Grace -- 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] Re: How to convert integers representations of a date to a date format variable

2002-01-01 Thread Daniel Grace
SQL if you want to use that for storing it in the database) mktime(0, 0, 0, $month, $day, $year) should do the trick -- Daniel Grace -- 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] Re: Get PHP Configuration

2002-01-01 Thread Daniel Grace
> > I want to add --with-imap, but have no idea how to determine what the current settings are. > > > Larentium phpinfo() shows you the configure command. If you have the PHP CGI and are running on *nix or something like such, you can also. /path/to/php -i | grep ./configure -- D

[PHP] Re: RESOLVED(maybe):Warning: Cannot send session cookie

2001-12-28 Thread Daniel Grace
"David Jackson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > All -- > It appears that the problem was a table design problems, > my primary index wasn't set to auto-increment? So I was trying to > insert records with duplicate keys !! > This of course leads

Re: [PHP] User Authentication

2001-12-17 Thread Daniel Grace
"Paul Burney" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > on 12/16/01 12:58 PM, Daniel Grace at [EMAIL PROTECTED] wrote: > > > Anyways, though the 401 part works and actually brings up the typical "Enter >

[PHP] Re: PHP4.1.0 & Apache1.3.22 under WinXP

2001-12-16 Thread Daniel Grace
heck to see if that's the problem, short of checking php.ini, is to make a quick and dirty test page: If you can see this, then short_open_tags = off. Of course, if phpinfo() is displayed above, this should be fairly obvious <*/ ?> <% /* >If you can see this, then asp_style_tags =

[PHP] User Authentication

2001-12-16 Thread Daniel Grace
the directory (or any parent dirs for that matter), and no AuthType directives all in my httpd.conf file. I have been unsuccessful in determining what is wrong, and am flat out of ideas. My php.ini and httpd.conf files are available at http://hosting.venura.net/fixme/ Any ideas? -- Daniel Grace

[PHP] HTTP Authentication problems

2001-12-16 Thread Daniel Grace
are no .htaccess files in the directory (or any parent dirs for that matter), and no AuthType directives all in my httpd.conf file. I have been unsuccessful in determining what is wrong, and am flat out of ideas. My php.ini and httpd.conf files are available at http://hosting.venura.net/fixme

[PHP] Re: problem finding out original filename while using php to upload.

2001-12-16 Thread Daniel Grace
NOT the name of the original file. You'll want to use $photo_file_name to determine the original filename, or better yet, $photo_file_type to determine the content type. (a gif is image/gif, for instance). See http://www.php.net/manual/en/features.file-upload.php -- Daniel Grace echo make_witty_

Re: [PHP] Opening/closing a DB

2001-03-10 Thread Daniel Grace
more general info on persistent connections). With persistent connections, the overhead in connecting to the database backend is minimized since the same connection can be shared across multiple pages. This won't work with the CGI version of PHP however. - Daniel Grace <http://dewin.oldbattery.c

Re: [PHP] Nesting 'foreach ()'

2001-03-03 Thread Daniel Grace
=1) echo("fred") else echo("bill"): > should work but doesn't. > if (1==1) echo("fred"); else echo("bill"): --^ You need to have a semicolon before the else. - Daniel Grace <http://dewin.oldbattery.com/> --

Re: [PHP] Undocumented Socket functions?

2001-02-14 Thread Daniel Grace
was once (and still am) interested in developing a MUD (= multi-user text-based game) engine entirely in PHP. This would be nice because powerful scripts and stuff like that could be coded within the mud and executed on-the-fly if proper considerations were taken towards stability and securit

Re: [PHP] File Download Completion

2001-02-01 Thread Daniel Grace
On Wednesday, January 31, 2001 at 12:00 PM, "Boaz Yahav" <[EMAIL PROTECTED]> wrote: > Seems like your theory doesn't stand the reality test :) > > This is the script which for some reason works with Netscape but not with IE > (it used to) : >ignore_user_abort(0); >$filename="test.gz"; >

Re: [PHP] SQL question

2001-01-31 Thread Daniel Grace
mplode(", ", $idlist) . ")"); Making sure $idlist actually contains at least one item (if it doesn't the second query will fail) is left as an exercise to the reader. -- - Daniel Grace <http://dewin.oldbattery.com/> "Space may be the final frontier but

Re: [PHP] File Download Completion

2001-01-31 Thread Daniel Grace
3. If the user aborts right after the file_did_download() function is called but before the script actually terminates, things can go awry. I'm not entirely sure how this would be handled. -- - Daniel Grace <http://dewin.oldbattery.com/> "Space may be the final frontier but its

Re: [PHP] Read Vs. Include

2001-01-31 Thread Daniel Grace
On Tuesday, January 30, 2001 at 3:04 PM, Alexandar Skwar wrote: > So sprach Daniel Grace am Thu, Jan 25, 2001 at 07:18:52PM -0800: > > readfile($filename); > > Why not include? > Because include will execute any PHP code in the included file and readfile will not, it just dum

Re: [PHP] Read Vs. Include

2001-01-26 Thread Daniel Grace
Any of these will work: echo implode("\n", file($filename)); fpassthru(fopen($filename, "r")); readfile($filename); You probably want readfile(). http://www.php.net/manual/en/function.readfile.php -- - Daniel Grace <http://dewin.oldbattery.com/> "Space ma

Re: [PHP] sleep and usleep not working ??

2001-01-24 Thread Daniel Grace
long as you're not inside a table), you'll either need to do: ob_implicit_flush(1); // at the beginning of the script (use 0 to turn it back off) or: flush(); // after the echo and before the sleep. Side note: When you're using PHP for shell scripts (Don't look at me like

[PHP] News gateway question

2001-01-23 Thread Daniel Grace
es to it and have to send them to the mailing list. Is there any easy way to post to the group instead? -- - Daniel Grace <http://dewin.oldbattery.com/> "Space may be the final frontier but its made in a Hollywood basement." - Red Hot Chili Peppers - Californication

Re: [PHP] I love/hate FrontPage - need another HTML editor.

2001-01-17 Thread Daniel Grace
've been doing the last couple weeks.) However, I think NoteTab is written with the html author/developer. DISCLAIMER: The author of this email is in no way shape or form affiliated with NoteTab and/or it's authors, except for happening to love the program. Side note: Out of all th

[PHP] PHP as a MUD engine?

2001-01-16 Thread Daniel Grace
laying games that are run via a message board system -- see http://dewin.oldbattery.com/venura/ )), but I am interested to see what people think. - Daniel Grace <http://dewin.oldbattery.com/> "Space may be the final frontier but its made in a Hollywood basement." - Red Hot Ch