[PHP] importNode issue

2010-01-25 Thread Michael A. Peters
I'm experiencing a slight problem with importNODE putting unwanted carriage returns in the the output. Here's my function: // syntax highlighting include_once('Text/Highlighter.php'); function syntaxHighlight($dom,$lang,$code) { $hl = Text_Highlighter::factory($lang); $out =

Re: [PHP] importNode issue

2010-01-25 Thread Michael A. Peters
Michael A. Peters wrote: The only (untried) solution I can think of is to replace each carriage return with a br / and every space with #160; and then replace the pre with a div class='monospace' or some such hackery before running loadXML() on it. But I would rather not do that. Even

Re: [PHP] importNode issue

2010-01-25 Thread Jochem Maas
highlight_string() function might be an easier route? Op 1/25/10 9:55 AM, Michael A. Peters schreef: I'm experiencing a slight problem with importNODE putting unwanted carriage returns in the the output. Here's my function: // syntax highlighting include_once('Text/Highlighter.php');

[PHP] How to change a filename for download (e.g. jpeg, pdf etc.)

2010-01-25 Thread SED
Hi, Can anyone point me to tutorials on how to change a filename for each download? My goal is to give the downloader a random name for a picture or a document, so he will never know what the original filename is. Regards, Summi -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] How to change a filename for download (e.g. jpeg, pdf etc.)

2010-01-25 Thread Lester Caine
SED wrote: Hi, Can anyone point me to tutorials on how to change a filename for each download? My goal is to give the downloader a random name for a picture or a document, so he will never know what the original filename is. http://uk.php.net/manual/en/function.tempnam.php any use ... --

Re: [PHP] importNode issue

2010-01-25 Thread Michael A. Peters
Jochem Maas wrote: highlight_string() function might be an easier route? If I only ever wanted to highlight php it might be. I found a workaround, though I don't like it. add $dom-formatOutput = false; to the function and it displays perfectly, though viewing the generated source isn't as

[PHP] Re: How to change a filename for download (e.g. jpeg, pdf etc.)

2010-01-25 Thread Richard
Hi, Can anyone point me to tutorials on how to change a filename for each download? My goal is to give the downloader a random name for a picture or a document, so he will never know what the original filename is. Try adding a Content-Disposition header: ?php header('Content-disposition:

Re: [PHP] How to change a filename for download (e.g. jpeg, pdf etc.)

2010-01-25 Thread Ashley Sheridan
On Mon, 2010-01-25 at 10:03 +, SED wrote: Hi, Can anyone point me to tutorials on how to change a filename for each download? My goal is to give the downloader a random name for a picture or a document, so he will never know what the original filename is. Regards, Summi I

Re: [PHP] Re: Enforce a constant in a class.

2010-01-25 Thread Pete Ford
Richard Quadling wrote: 2010/1/22 Pete Ford p...@justcroft.com: IMHO, a constant is not the correct beastie in this case - if you want it to be different depending on the implementation then it ain't a constant! You should probably have protected static variables in the interface, and use the

Re: [PHP] How to change a filename for download (e.g. jpeg, pdf etc.)

2010-01-25 Thread Mourad Boufarguine
take a look at this : http://www.phpclasses.org/browse/package/3220.html On Mon, Jan 25, 2010 at 11:32 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Mon, 2010-01-25 at 10:03 +, SED wrote: Hi, Can anyone point me to tutorials on how to change a filename for each download?

Re: [PHP] Re: Enforce a constant in a class.

2010-01-25 Thread Richard Quadling
2010/1/25 Pete Ford p...@justcroft.com: Richard Quadling wrote: 2010/1/22 Pete Ford p...@justcroft.com: IMHO, a constant is not the correct beastie in this case - if you want it to be different depending on the implementation then it ain't a constant! You should probably have protected

[PHP] Recursion issue with Zend_Soap_AutoDiscovery.

2010-01-25 Thread Richard Quadling
Hi. I'm in the process of building a web service which incorporates the ability for the server to inform the client that a particular call has been superseded by another. So, cut down (I've removed all the other details), ... class ServiceDetails { /** * Superseded by

[PHP] Re: Recursion issue with Zend_Soap_AutoDiscovery.

2010-01-25 Thread Nathan Rixham
Richard Quadling wrote: Hi. I'm in the process of building a web service which incorporates the ability for the server to inform the client that a particular call has been superseded by another. So, cut down (I've removed all the other details), ... class ServiceDetails {

Re: [PHP] memory efficient hash table extension? like lchash ...

2010-01-25 Thread J Ravi Menon
PHP does expose sys V shared-memory apis (shm_* functions): http://us2.php.net/manual/en/book.sem.php If you already have apc installed, you could also try: http://us2.php.net/manual/en/book.apc.php APC also allows you to store user specific data too (it will be in a shared memory). Haven't

[PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Parham Doustdar
Hello there, A friend called me today and was wondering what happens if the ID colomn of an MYSQL database, set to autoinc reaches the int limit. Will it return and begin choosing the ID's that have been deleted, or... what? Thanks! -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Nathan Rixham
Parham Doustdar wrote: Hello there, A friend called me today and was wondering what happens if the ID colomn of an MYSQL database, set to autoinc reaches the int limit. Will it return and begin choosing the ID's that have been deleted, or... what? you change it to bigint before that happens

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Joseph Thayne
It will continue to use the max number which of course will cause an error. Joseph Parham Doustdar wrote: Hello there, A friend called me today and was wondering what happens if the ID colomn of an MYSQL database, set to autoinc reaches the int limit. Will it return and begin choosing the

Re: [PHP] Re: MySQL ID -- what happens when you run out of range?

2010-01-25 Thread John Meyer
On 1/25/2010 1:19 PM, Nathan Rixham wrote: Parham Doustdar wrote: Hello there, A friend called me today and was wondering what happens if the ID colomn of an MYSQL database, set to autoinc reaches the int limit. Will it return and begin choosing the ID's that have been deleted, or... what?

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Robert Cummings
Parham Doustdar wrote: Hello there, A friend called me today and was wondering what happens if the ID colomn of an MYSQL database, set to autoinc reaches the int limit. Will it return and begin choosing the ID's that have been deleted, or... what? Thanks! Ask Slashdot... I believe they hit

Re: [PHP] Cookies sessions

2010-01-25 Thread Nisse Engström
On Thu, 21 Jan 2010 08:43:58 +1100, clanc...@cybec.com.au wrote: When you are working with sessions, provided you start your program with session_id(), you can then do anything you like with session variables at any point in your program. In my original question I asked if there was a

Re: [PHP] Cookies sessions

2010-01-25 Thread Ashley Sheridan
On Mon, 2010-01-25 at 22:13 +0100, Nisse Engström wrote: On Thu, 21 Jan 2010 08:43:58 +1100, clanc...@cybec.com.au wrote: When you are working with sessions, provided you start your program with session_id(), you can then do anything you like with session variables at any point in your

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Camilo Sperberg
On Mon, Jan 25, 2010 at 17:15, Parham Doustdar parha...@gmail.com wrote: Hello there, A friend called me today and was wondering what happens if the ID colomn of an MYSQL database, set to autoinc reaches the int limit. Will it return and begin choosing the ID's that have been deleted, or...

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Ryan Sun
For such a large data set, they would split into several sub tables, otherwise the performance will be horrible On Mon, Jan 25, 2010 at 3:39 PM, Robert Cummings rob...@interjinn.comwrote: Parham Doustdar wrote: Hello there, A friend called me today and was wondering what happens if the ID

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Joseph Thayne
That is incorrect. What will happen is as follows: 1. The value will be incremented by 1 causing the value to be greater than the maximum integer allowed. 2. MySQL will see this as a problem and truncate it to the closest value. 3. MySQL will then try and insert the new row with the

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Camilo Sperberg
On Mon, Jan 25, 2010 at 18:51, Joseph Thayne webad...@thaynefam.org wrote: That is incorrect. What will happen is as follows: 1. The value will be incremented by 1 causing the value to be greater than the maximum integer allowed. 2. MySQL will see this as a problem and truncate it to the

Re: [PHP] Cookies sessions

2010-01-25 Thread Nisse Engström
On Mon, 25 Jan 2010 21:26:05 +, Ashley Sheridan wrote: On Mon, 2010-01-25 at 22:13 +0100, Nisse Engström wrote: The HTTP spec allows cookies to be sent after the content, in trailing headers, but it's not usable practically. Few browsers support it, and PHP certainly doesn't. You'd have

[PHP] Upload file on IE8

2010-01-25 Thread Ernie Kemp
Good Day, I'm having an issue with IE8, when I go to load a file the program is not filling the $_FILES['user_file']['type'] . When I display echo Start.$_FILES['pix']['type'].End; in IE8 I get StartEnd with nothing in between. I expected image/pjpeg.

[PHP] Re: Enforce a constant in a class.

2010-01-25 Thread Colin Guthrie
'Twas brillig, and Richard Quadling at 22/01/10 11:33 did gyre and gimble: Hello, One of the aspects of an interface is to enforce a public view of a class (as I see it). Within PHP, interfaces are allowed to have constants, but you cannot override them in a class implementing that

Re: [PHP] Upload file on IE8

2010-01-25 Thread Ashley Sheridan
On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote: Good Day, I’m having an issue with IE8, when I go to load a file the program is not filling the $_FILES['user_file']['type'] . When I display “echo Start.$_FILES['pix']['type'].End;” in IE8

[PHP] XAMPP PHP 4/5

2010-01-25 Thread Alberto García Gómez
124 __ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 4805 (20100125) __ ESET NOD32 Antivirus ha comprobado este mensaje. http://www.eset.com

Re: [PHP] Upload file on IE8

2010-01-25 Thread Eric Lee
On Tue, Jan 26, 2010 at 6:41 AM, Ernie Kemp ernie.k...@sympatico.ca wrote: Good Day, I’m having an issue with IE8, when I go to load a file the program is not filling the $_FILES['user_file']['type'] . When I display “echo

Re: [PHP] memory efficient hash table extension? like lchash ...

2010-01-25 Thread D. Dante Lorenso
J Ravi Menon wrote: PHP does expose sys V shared-memory apis (shm_* functions): http://us2.php.net/manual/en/book.sem.php I will look into this. I really need a key/value map, though and would rather not have to write my own on top of SHM. If you already have apc installed, you could

Re: [PHP] Upload file on IE8

2010-01-25 Thread Ashley Sheridan
On Tue, 2010-01-26 at 07:33 +0800, Eric Lee wrote: On Tue, Jan 26, 2010 at 6:41 AM, Ernie Kemp ernie.k...@sympatico.ca wrote: Good Day, I’m having an issue with IE8, when I go to load a file the program is not filling the $_FILES['user_file']['type'] .

RE: [PHP] Upload file on IE8

2010-01-25 Thread Ernie Kemp
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: January-25-10 5:53 PM To: Ernie Kemp Cc: 'PHP General List' Subject: Re: [PHP] Upload file on IE8 On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote: Good Day, I’m having an issue with IE8,

RE: [PHP] Upload file on IE8

2010-01-25 Thread Ashley Sheridan
On Mon, 2010-01-25 at 19:21 -0500, Ernie Kemp wrote: From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: January-25-10 5:53 PM To: Ernie Kemp Cc: 'PHP General List' Subject: Re: [PHP] Upload file on IE8 On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote:

[PHP] Creating an Entire .html page with PHP

2010-01-25 Thread deal...@gmail.com
Hi Folks, I would like to create an entire .html page gathered from database content mixed with html etc. and be able to save the page... like: --- save all this pre made content as .html page html head ... stuff /head body ... stuff ... stuff with database query results... ...

Re: [PHP] Creating an Entire .html page with PHP

2010-01-25 Thread Ashley Sheridan
On Mon, 2010-01-25 at 17:00 -0800, deal...@gmail.com wrote: Hi Folks, I would like to create an entire .html page gathered from database content mixed with html etc. and be able to save the page... like: --- save all this pre made content as .html page html head ... stuff

Re: [PHP] Creating an Entire .html page with PHP

2010-01-25 Thread Angus Mann
- Original Message - From: deal...@gmail.com To: PHP-General php-general@lists.php.net Sent: Tuesday, January 26, 2010 11:00 AM Subject: [PHP] Creating an Entire .html page with PHP Hi Folks, I would like to create an entire .html page gathered from database content mixed with html

[PHP] Re: Creating an Entire .html page with PHP

2010-01-25 Thread Al
On 1/25/2010 8:00 PM, deal...@gmail.com wrote: Hi Folks, I would like to create an entire .html page gathered from database content mixed with html etc. and be able to save the page... like: --- save all this pre made content as .html page html head ... stuff /head body ... stuff ...

Re: [PHP] memory efficient hash table extension? like lchash ...

2010-01-25 Thread J Ravi Menon
values were stored, the APC storage began to slow down *dramatically*. I wasn't certain if APC was using only RAM or was possibly also writing to disk. Performance tanked so quickly that I set it aside as an option and moved on. IIRC, i think it is built over shm and there is no disk backing

Re: [PHP] Creating an Entire .html page with PHP

2010-01-25 Thread deal...@gmail.com
On Jan 25, 2010, at 4:59 PM, Ashley Sheridan wrote: $fh = fopen(page.html,w); fwrite($fh, $htmlcode); Thanks so much Ashley and ALL, this looks like it will work fine. BTW: Sorry if I didn't make myself clear - I just wanted to grab some data like a person from a contacts file and be

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Shawn McKenzie
Joseph Thayne wrote: That is incorrect. What will happen is as follows: 1. The value will be incremented by 1 causing the value to be greater than the maximum integer allowed. 2. MySQL will see this as a problem and truncate it to the closest value. 3. MySQL will then try and insert

Re: [PHP] Creating an Entire .html page with PHP

2010-01-25 Thread Shawn McKenzie
deal...@gmail.com wrote: On Jan 25, 2010, at 4:59 PM, Ashley Sheridan wrote: $fh = fopen(page.html,w); fwrite($fh, $htmlcode); Thanks so much Ashley and ALL, this looks like it will work fine. BTW: Sorry if I didn't make myself clear - I just wanted to grab some data like a

Re: [PHP] Creating an Entire .html page with PHP

2010-01-25 Thread deal...@gmail.com
On Jan 25, 2010, at 6:23 PM, Shawn McKenzie wrote: file_put_contents() is s much easier. Thanks Shawn I'll check that out ... - I see it says : This function is identical to calling fopen(), fwrite() and fclose() successively to write data to a file. my newbie brain likes that!

[PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread John Taylor-Johnston
I am reading the manual: http://ca.php.net/manual/en/ref.strings.php $mydata-restored = -00-00; How do I express this? If the first four characters are , then do {} What I am looking for is in strpos(), no? if () { } -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread Daniel Brown
On Mon, Jan 25, 2010 at 21:36, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: I am reading the manual: http://ca.php.net/manual/en/ref.strings.php $mydata-restored = -00-00; ?php $o[] = '0942-23-23'; $o[] = '-00-00'; $o[] = '1238-00-00'; $o[] = '0001-23-45';

Re: [PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread Angus Mann
- Original Message - From: John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca To: PHP-General php-general@lists.php.net Sent: Tuesday, January 26, 2010 12:36 PM Subject: [PHP] If the first four characters are , then do {} I am reading the manual:

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Michael A. Peters
Shawn McKenzie wrote: Joseph Thayne wrote: That is incorrect. What will happen is as follows: 1. The value will be incremented by 1 causing the value to be greater than the maximum integer allowed. 2. MySQL will see this as a problem and truncate it to the closest value. 3. MySQL will then

Re: [PHP] Php-cli, scripts freeze on exit

2010-01-25 Thread Camilo Sperberg
On Sun, Jan 24, 2010 at 16:16, David W. Allor da...@artisanpath.com wrote: Hi! I'm using php-cli 5.3.1. When I run php from the command line, the script does not return me to the command prompt when exited. The script always completes, but it has to be killed to release it's resources.

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread APseudoUtopia
On Mon, Jan 25, 2010 at 10:00 PM, Michael A. Peters mpet...@mac.com wrote: Shawn McKenzie wrote: Joseph Thayne wrote: That is incorrect.  What will happen is as follows: 1.  The value will be incremented by 1 causing the value to be greater than the maximum integer allowed. 2.  MySQL will

[PHP] In need of better __FILE__, __LINE__ and __FUNCTION__ magic variables

2010-01-25 Thread Daevid Vincent
Like you, I have many little functions that are useful for debugging in a page. The problem is that when you start to pepper them around, whilst debugging, you can often times forget where you left them. A search isn't always helpful since I sometimes leave them in the code, but commented out, so

[PHP] strip out repeated ocurrence of a string

2010-01-25 Thread Camilo Sperberg
Hello list :) I have this problem, a certain string can contain the following information: $string = ' hi{value1;value2} bye{value1;value3} hi{value1;value4} hi{value1;value2} bye{value1;value2} '; What I want is to be able to get this result: $string = ' hi{value1;value2} bye{value1;value3}

RE: [PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread Daevid Vincent
-Original Message- From: paras...@gmail.com [mailto:paras...@gmail.com] On Behalf Of Daniel Brown Sent: Monday, January 25, 2010 6:43 PM To: John Taylor-Johnston Cc: PHP-General Subject: Re: [PHP] If the first four characters are , then do {} On Mon, Jan 25, 2010 at 21:36,

[PHP] SQL question

2010-01-25 Thread Skip Evans
Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/ format and two database fields, start_date and no_donations. The start date is mm/dd/ format and no_donations is an integer that represents the number of months from

Re: [PHP] In need of better __FILE__, __LINE__ and __FUNCTION__ magic variables

2010-01-25 Thread Robert Cummings
Daevid Vincent wrote: Like you, I have many little functions that are useful for debugging in a page. The problem is that when you start to pepper them around, whilst debugging, you can often times forget where you left them. A search isn't always helpful since I sometimes leave them in the

[PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-25 Thread Angus Mann
Hi all. I'm currently using the phpmailer class from phpmailer.worxware.com to send datatbase -populated emails to clients. At the moment I'm runninng PHP on Windows and using the built-in sendmail equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by prior logging into

Re: [PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread Paul M Foster
On Mon, Jan 25, 2010 at 09:36:50PM -0500, John Taylor-Johnston wrote: I am reading the manual: http://ca.php.net/manual/en/ref.strings.php $mydata-restored = -00-00; How do I express this? If the first four characters are , then do {} What I am looking for is in strpos(), no? if

Re: [PHP] In need of better __FILE__, __LINE__ and __FUNCTION__ magic variables

2010-01-25 Thread Paul M Foster
On Mon, Jan 25, 2010 at 10:59:43PM -0500, Robert Cummings wrote: Daevid Vincent wrote: Like you, I have many little functions that are useful for debugging in a page. The problem is that when you start to pepper them around, whilst debugging, you can often times forget where you left them.

RE: [PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread Daevid Vincent
-Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: Monday, January 25, 2010 8:05 PM To: php-general@lists.php.net Subject: Re: [PHP] If the first four characters are , then do {} On Mon, Jan 25, 2010 at 09:36:50PM -0500, John Taylor-Johnston wrote:

Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-25 Thread Paul M Foster
On Tue, Jan 26, 2010 at 02:02:18PM +1000, Angus Mann wrote: Hi all. I'm currently using the phpmailer class from phpmailer.worxware.com to send datatbase -populated emails to clients. At the moment I'm runninng PHP on Windows and using the built-in sendmail equivalent packaged with

Re: [PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread Andrew Ballard
On Mon, Jan 25, 2010 at 11:12 PM, Daevid Vincent dae...@daevid.com wrote: From what I understand, strpos() faster than a lot of other similar string functions and much faster than regexps. You could do: if (strpos($mydata-restored, '') === 0) {       do_stuff(); } Ah. Clever use of the

Re: [PHP] SQL question

2010-01-25 Thread Paul M Foster
On Mon, Jan 25, 2010 at 09:54:40PM -0600, Skip Evans wrote: Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/ format and two database fields, start_date and no_donations. The start date is mm/dd/ format and no_donations

Re: [PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread Paul M Foster
On Mon, Jan 25, 2010 at 08:12:43PM -0800, Daevid Vincent wrote: -Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: Monday, January 25, 2010 8:05 PM To: php-general@lists.php.net Subject: Re: [PHP] If the first four characters are , then do {}

Re: [PHP] SQL question

2010-01-25 Thread Michael A. Peters
Paul M Foster wrote: Typically, coders try to store dates in unix timestamps internally, and then add 86400 seconds for every day to calculate intervals and such. This is often inaccurate. Julian days are far more accurate.) Paul I use seconds from epoch in the database simply because it

Re: [PHP] SQL question

2010-01-25 Thread Michael A. Peters
Michael A. Peters wrote: If you need something where Julian day really is better, I assume it isn't that hard to convert between posix and julian day, though it seems odd to me that it isn't part of the date() function. It probably should be. Looks like unixtojd() and jdtounix() do it.