Re: [PHP] List of sessions

2006-05-04 Thread Tony Aldrich
Thanks all for explanations. I'll try to use callback functions. Tony. On 5/4/06, Joe Wollard <[EMAIL PROTECTED]> wrote: If you store your sessions in a database then your could gain a little mode control over your session, but I think what you're asking is if there's a way to tell if a user h

[PHP] Getting the array element

2006-05-04 Thread Jonas Rosling
Hi again all, Here my next PHP newbie question. When I'm building an array as bellow. Is there any way I can get the left element out of the array? $salesperson = array(); while($row=mysql_fetch_array($result)) { $salesperson[$row[1]] = '0'; } If I write: echo $sale

Re: [PHP] Getting the array element

2006-05-04 Thread Jochem Maas
Jonas Rosling wrote: Hi again all, Here my next PHP newbie question. When I'm building an array as bellow. Is there any way I can get the left element out of the array? the 'left element' is the key. $salesperson = array(); while($row=mysql_fetch_array($result)) {

Re: [PHP] List of sessions

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 11:29 pm, Tony Aldrich wrote: > Well, I mean visitors of site. They can open it in several windows or > in > several browsers. I understand that each browser on a machine will be > a > session (in simple explanation). And for all of them I create some > info in > database. Then

Re: [PHP] php script fails when run from cron

2006-05-04 Thread Richard Lynch
It's remotely possible that your database classes are trying to create temp files or cache files or something in the "current working directory" which for cron would be... The home directory of the user running it??? I don't even know what it would be, but I know it can be problematic. The cron

Re: [PHP] Portfolio suggestions

2006-05-04 Thread Paul Scott
On Thu, 2006-05-04 at 00:24 +0200, Rory Browne wrote: > I'd like to rectify this, but I can't think of a suitable project. I'd like > to do something new / useful as opposed to a glorified "Hello World" > demonstration. Depends on your interests. I would say, join an established project and contri

RE: [PHP] Creating an OO Shopping Cart

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 5:15 pm, Chris W. Parker wrote: > Steve > on Friday, April 21, 2006 5:58 PM said: > >> So everyone's aware, I have NO intention of storing credit card #'s. >> I >> don't see why anyone needs to.. especially after reading Richard's >> past post

Re: [PHP] idn-functions in PHP

2006-05-04 Thread Jochem Maas
Marten Lehmann wrote: Hello, is there any function in PHP which binds to libidn? I found only a PEAR-project, but PEAR-projects are often beta and not as stable as PHP-builtin functions. that statement is rather baseless. the extension you refer to may be marked as EXPERIMENTAL but that doe

Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 1:51 pm, Phillip S. Baker wrote: > I have an interesting problem I would like some ideas on for a > solution. > I cannot seem to find any code examples on the net, though I might not > be looking in the right place really. > > I have some articles stored in a MySQL DB. > What I

Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 6:57 pm, Jochem Maas wrote: > a. who said anything about sessions? Jay did. He suggested sucking down the whole article, paginating it all, and cramming the pages into session, presumably so you don't have to suck down the whole article again. Which, by the way, is what I dis

Re: [PHP] Sanity checker?

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 12:51 pm, Ezra Nugroho wrote: > I envision a tool that would audit your php code, and tell you if your > code is good or not, if it has scaling issues, etc, etc. Basically it > tells if your php code is "sane" or not. Oooh. I know what you mean. I call that tool a "Consultant"

RE: [PHP] array insights

2006-05-04 Thread Ford, Mike
On 03 May 2006 18:27, Jason Gerfen wrote: > I am looking for some information on how to do this the correct way, > here is the data I am working with: > > Array > ( > [hostname-0] => hostname > [mac-0] => 00:0a:b3:aa:00:5d > [ip-0] => 192.168.0.1 > [subnet] => MMC-Subnet > [gr

Re: [PHP] printf and number_format rounding

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 12:25 pm, Duffy, Scott E wrote: > Are printf and number_format supposed to round? > > echo ($hcount-$lcount)/$hilow." "; > echo number_format(($hcount-$lcount)/$hilow,2,'.',''); > > > 0.208333 0.21 > 0.145833 0.15 > 0.17 0.

Re: [PHP] Polymorphism [was] [Fwd: Re: [PHP] Parents constructor]

2006-05-04 Thread Richard Lynch
On Wed, May 3, 2006 9:17 am, Jochem Maas wrote: > BUT there is a fourth form of polymorphism - one I would argue if the > most common form when speaking about polymorphism with respect to > programming, > namely the ability to derive a subclass from more than one base class > (simutaneously), > thi

Re: [PHP] Re: Imagemagick Displaying Images

2006-05-04 Thread Richard Lynch
> Ray Hauge wrote: >> convert -resize 800x600 AR-M455N_20060420_130446.pdf[0] - >> >> The '-' makes it display the contents of the image to stdout. I >> want to >> caputre that binary data and somehow display the images inline with >> the >> website. Is this possible, or am I living in a dream wo

Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread Jochem Maas
Richard Lynch wrote: On Wed, May 3, 2006 6:57 pm, Jochem Maas wrote: a. who said anything about sessions? Jay did. dang - I didn't read properly - apologies go out to Edward for that! He suggested sucking down the whole article, paginating it all, and cramming the pages into session, pr

Re: [PHP] XSLT issue

2006-05-04 Thread Richard Lynch
$xml = "blah balh blah"; $tournaments = explode("", $xml); $tournaments = array_slice($tournaments, 0, 3); //maybe 4 $xml = implode("", $tournaments); $xml .= "\n"; "Crude, but effective Captain" -- Spock On Wed, May 3, 2006 5:40 am, Dave Goodchild wrote: > Hi all, maybe slightly off list but

Re: [PHP] printf and number_format rounding

2006-05-04 Thread Barry
Richard Lynch schrieb: On Wed, May 3, 2006 12:25 pm, Duffy, Scott E wrote: Are printf and number_format supposed to round? echo ($hcount-$lcount)/$hilow." "; echo number_format(($hcount-$lcount)/$hilow,2,'.',''); 0.208333 0.21 0.145833 0.15 0.16

[PHP] Removing key and value

2006-05-04 Thread Jonas Rosling
How's the best way to remove a key and it's value from an array? Like in the code bellow where I would like to remove AK and it's value. $salesperson = array( 'AK' => '1000', 'AT' => '1500', 'BT' => '2000' )

Re: [PHP] Removing key and value

2006-05-04 Thread Jyry Kuukkanen
On Thu, 4 May 2006, Jonas Rosling wrote: > How's the best way to remove a key and it's value from an array? Like in the > code bellow where I would like to remove AK and it's value. > > $salesperson = array( > 'AK' => '1000', > 'AT' => '1500', >

[PHP] Mail and hotmail

2006-05-04 Thread Peter Lauri
Best group member, I am sending email to a hotmail thru PHP. When I send it like this it arrives (in the junk mail, but it arrives): mail('[EMAIL PROTECTED]', 'A nice subject', 'Some text'); It works well, but I want to change the FROM header so I do this: mail('[EMAIL PROTECTED]', 'A nice subj

Re: [PHP] XSLT issue

2006-05-04 Thread Dave Goodchild
Why would I want to mess with the xml file like that? I use it in other places. The actual xslt solution I came up with (with assistance) is the preferred one. On 04/05/06, Richard Lynch <[EMAIL PROTECTED]> wrote: $xml = "blah balh blah"; $tournaments = explode("", $xml); $tournaments = array

Re: [PHP] Mail and hotmail

2006-05-04 Thread Paul Scott
On Thu, 2006-05-04 at 17:37 +0700, Peter Lauri wrote: > mail('[EMAIL PROTECTED]', 'A nice subject', 'Some text', 'From: Peter > Lauri <[EMAIL PROTECTED]>'); > > This email does not arrive to the Hotmail inbox. This has been discussed ad nauseum on this list. I suggest going through the list arch

Re: [PHP] Mail and hotmail

2006-05-04 Thread Angelo Zanetti
Peter Lauri wrote: Best group member, I am sending email to a hotmail thru PHP. When I send it like this it arrives (in the junk mail, but it arrives): mail('[EMAIL PROTECTED]', 'A nice subject', 'Some text'); It works well, but I want to change the FROM header so I do this: mail('[EMAIL PRO

RE: [PHP] Mail and hotmail

2006-05-04 Thread Peter Lauri
Paul, I did make a search on this. However, as you understand, searching for "hotmail mail header" will generate to much junk because it will be replies from hotmails that also will be included. /Peter -Original Message- From: Paul Scott [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04,

RE: [PHP][Solved] Mail and hotmail

2006-05-04 Thread Peter Lauri
Sending email to hotmail using mail(); > you need to set your mail headers for the mail to be assumed valid, namely: X-Sender From Date Subject Delivered-to MIME-Version Reply-To Content-type X-Priority Importance Return-Path X-Mailer HTH Angelo -- PHP General Mailing List (http://www.php.

RE: [PHP] Mail and hotmail

2006-05-04 Thread Paul Scott
On Thu, 2006-05-04 at 17:51 +0700, Peter Lauri wrote: > Paul, > > I did make a search on this. However, as you understand, searching for > "hotmail mail header" will generate to much junk because it will be replies > from hotmails that also will be included. Try the mail function on http://za2.ph

[PHP] php and ssl

2006-05-04 Thread Schalk
Greetings All, I am currently implementing a form for a client that will run over https. Now, all is good and well except, for some reason when the form loads in IE the lock in the status bar displays for a short while and then goes away, it is fine in Firefox though. The way I have the form

[PHP] Re: php and ssl

2006-05-04 Thread Barry
Schalk schrieb: Greetings All, I am currently implementing a form for a client that will run over https. Now, all is good and well except, for some reason when the form loads in IE the lock in the status bar displays for a short while and then goes away, it is fine in Firefox though. The way

RE: [PHP] Mail and hotmail

2006-05-04 Thread Peter Lauri
The only one I do not know what to set it to is "Importance". What values are possible there? Is it the same as for X-priority? Regards, Peter -Original Message- From: Angelo Zanetti [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 5:53 PM To: Peter Lauri Cc: php-general@lists.php

Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread Paul Novitski
At 11:51 AM 5/3/2006, Phillip S. Baker wrote: I have some articles stored in a MySQL DB. What I want is if the article is above a certain length in characters, to page article through a few pages for site readability. So I would want to print X number of words/characters. Save the where the po

Re: [PHP] Avoiding user refresh of pages with forms

2006-05-04 Thread John Wells
On 5/3/06, Satyam <[EMAIL PROTECTED]> wrote: I used that method initially, some months ago, but finally dropped it. It looked nice at first, but then I started getting into problems and required too many special cases to make it work. In the end, it wasn't a clean nor elegant solution. Satya

Re: [PHP] Re: php and ssl

2006-05-04 Thread Schalk Neethling
Barry wrote: Schalk schrieb: Greetings All, I am currently implementing a form for a client that will run over https. Now, all is good and well except, for some reason when the form loads in IE the lock in the status bar displays for a short while and then goes away, it is fine in Firefox th

Re: [PHP] mod_rewrite help

2006-05-04 Thread John Wells
On 5/3/06, Jay Blanchard <[EMAIL PROTECTED]> wrote: [aha moment] I finally get it. PHP developers are the smartest people on the planet and therefore we know and use everything. JavaScript, Java, C++, SQL, network management, Apache internals, women and even PHP. That is why people come on this l

Re: [PHP] Avoiding user refresh of pages with forms

2006-05-04 Thread chris smith
Also, with regards to sending success/failure messages across the redirection of your forms, I'd recommend considering sessions for passing the data. It keeps your URLs clean, and allows you to send complex data a bit easier (IMHO). For example if a user makes an error on a few different form el

RE: [PHP] php script fails when run from cron

2006-05-04 Thread Jay Blanchard
[snip] The code then goes on to move some data from a remote SQL Server db to the local mysql. When finished, the log stops at "got two classes". I am trying to debug now to see which of the two classes it seems to be failing on. I don't have anything in the php error log. The MSSQL connection

[PHP] Echo a value from an arrays position

2006-05-04 Thread Jonas Rosling
Is there any way to call for an element value in an array by the position? Like position 2 in the array and not the key name. // Jonas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] Is there any way to call for an element value in an array by the position? Like position 2 in the array and not the key name. [/snip] I hate to say this, but you really need to RTFM http://www.php.net/array To get a value from position 2 in an array you use $arrayName[1] (all array element

Re: [PHP] Sanity checker?

2006-05-04 Thread John Wells
On Wed, May 3, 2006 12:51 pm, Ezra Nugroho wrote: > I envision a tool that would audit your php code, and tell you if your > code is good or not, if it has scaling issues, etc, etc. Basically it > tells if your php code is "sane" or not. No, but If you're in a team environment, the best ad

[PHP] can't work out the syntax error

2006-05-04 Thread Ross
Hi, The line was this. echo " View Delete\n"; I have registered globals off so tried this... echo " View What is the problem with it? R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Brad Bonkoski
Will this also work with an associative array? If this is what he is talking about, I tried it and it does not work I put this together though and it works, not sure if it is the *best* way though... $colors = array('white'=>'#ff','black'=>'#00','blue'=>'#ff');

RE: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread Jay Blanchard
[snip] There's a fundamental problem with trying to slice text into resizable web pages the same way it's sliced on paper. Paper pages work because they're set in a fixed font size. When you change the ratio of font size to column width, the places where lines of text wrap changes. Because o

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jonas Rosling
Seem like your missunderstanding me. I'm not using an orignal array. I'm using an "map-array". $array = ('element' = 'value'); // Jonas Den 06-05-04 14.29, skrev "Jay Blanchard" <[EMAIL PROTECTED]>: > [snip] > Is there any way to call for an element value in an array by the > position? > Like

[PHP] session cookie and domains

2006-05-04 Thread Merlin
Hi there, I am operating 3 sites where I would like to be able to login cross site. Means with one login have a valid session on all 3 domain. Currently I do set the cookie like this: setcookie($cookiename,$sessid,0,'/','.'.$domain[name],0); That makes is available for all subdomains.

Re: [PHP] can't work out the syntax error

2006-05-04 Thread Brad Bonkoski
Ross wrote: Hi, The line was this. echo " HREF=\"javascript:open_window('$PHP_SELF?action=view_record&userid=$userid');\">View onClick=\"return confirm('Are you sure?');\">Delete\n"; I have registered globals off so tried this... echo " HREF=\"javas

RE: [PHP] Sanity checker?

2006-05-04 Thread Jay Blanchard
[snip] If you're in a team environment, the best advice I've heard is to have the team share accountability. Meaning, if you write a piece of code, you _must_ have a colleague double-check it and sign off on it. Then if a bug is discovered down the road, _both_ of you will be held responsible. T

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] $colors = array('white'=>'#ff','black'=>'#00','blue'=>'#ff'); [/snip] What happens when you echo $colors[1]? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Brad Bonkoski
I get nothing do you get something different? Jay Blanchard wrote: [snip] $colors = array('white'=>'#ff','black'=>'#00','blue'=>'#ff'); [/snip] What happens when you echo $colors[1]? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] I get nothing do you get something different? [/snip] Not even 'array'? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jonas Rosling
Nothing. // Jonas Den 06-05-04 14.40, skrev "Jay Blanchard" <[EMAIL PROTECTED]>: > [snip] > $colors = > array('white'=>'#ff','black'=>'#00','blue'=>'#ff'); > [/snip] > > What happens when you echo $colors[1]? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Brad Bonkoski
Nope... dead air. Of course getting an indexed value into an associative array seems a bit odd to me... maybe Jonas could shed some light on why he would go this route... Jay Blanchard wrote: [snip] I get nothing do you get something different? [/snip] Not even 'array'? -- PHP

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread Dave Goodchild
This may clarify - in php, integer and associate arrays are created arbitrarily, ie keys can be numbers or strings. So, either create an array like this: array('1' => 'first element', '2' => 'second element'); and call by the key! On 04/05/06, Jonas Rosling <[EMAIL PROTECTED]> wrote: I

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread John Wells
On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote: Will this also work with an associative array? If this is what he is talking about, I tried it and it does not work I think you're correct. This is because PHP arrays are a "mash-up" (as Jochem put it) of numerical indexes/hashtables/as

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] Of course getting an indexed value into an associative array seems a bit odd to me... maybe Jonas could shed some light on why he would go this route... [/snip] Exactly [snip] To get a value from position 2 in an array you use $arrayName[1] (all array elements start numbering at 0,

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] Seem like your missunderstanding me. I'm not using an orignal array. I'm using an "map-array". $array = ('element' = 'value'); [/snip] It is called an associative array, a value is associated with a key. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.p

RE: [PHP] session cookie and domains

2006-05-04 Thread Jay Blanchard
[snip] That makes is available for all subdomains. Is there a possiblity to make it available for all domains like example: .domainname. [/snip] Are you trying to share a cookie across domain names? If so that cannot be done. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vis

Re: [PHP] PHP Upgrade Question

2006-05-04 Thread John Nichel
Tom Ray wrote: Ok so I can't find apxs on the server at all, even though the 4.3.4 phpinfo claims to have been configured with --with-apxs2=/usr/sbin/apxs2-prefork. I did some search via google and I reconfigured using --enable-cli and --disable-cgi but I still had to use --with-apache2=/usr/sbi

[PHP] preg_replace_callback

2006-05-04 Thread tJey
Hi. I have problem with preg_replace_callback. It seems that my pattern is bad, but I can't find any error. Pattern : \[\s*((\d|\w|_)+)\s*\] this pattern is intended to find strings like "[field]", "[ fi12_eld]"... but every time I get warning message "Warning: preg_replace_callback(): Delimite

Re: [PHP] Removing key and value

2006-05-04 Thread John Nichel
Jonas Rosling wrote: How's the best way to remove a key and it's value from an array? Like in the code bellow where I would like to remove AK and it's value. $salesperson = array( 'AK' => '1000', 'AT' => '1500', 'BT' =>

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] Lasso can do the following, can PHP? Size; Output: '' + $Colors->(Get: Loop_Count),-EncodeNone; /Loop; ?> This outputs; ff 00ff00 ff I'm new at PHP but not Lasso that's why I'm for you asking odd questions. [/snip] 1. Always respond to the list as a single use

Re: [PHP] mod_rewrite help

2006-05-04 Thread John Nichel
John Wells wrote: On 5/3/06, Jay Blanchard <[EMAIL PROTECTED]> wrote: [aha moment] I finally get it. PHP developers are the smartest people on the planet and therefore we know and use everything. JavaScript, Java, C++, SQL, network management, Apache internals, women and even PHP. That is why pe

Re: [PHP] session cookie and domains

2006-05-04 Thread John Nichel
Merlin wrote: Hi there, I am operating 3 sites where I would like to be able to login cross site. Means with one login have a valid session on all 3 domain. Currently I do set the cookie like this: setcookie($cookiename,$sessid,0,'/','.'.$domain[name],0); That makes is available for all s

RE: [PHP] preg_replace_callback

2006-05-04 Thread Jay Blanchard
[snip] Hi. I have problem with preg_replace_callback. It seems that my pattern is bad, but I can't find any error. Pattern : \[\s*((\d|\w|_)+)\s*\] this pattern is intended to find strings like "[field]", "[ fi12_eld]"... but every time I get warning message "Warning: preg_replace_callback(): De

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Jay Blanchard
[snip] > $colors = > array('white'=>'#ff','black'=>'#00','blue'=>'#ff'); > foreach($colors AS $key => $value){ > echo $value . "\n"; > } > But I don't get anything out of this code. Why? Doesn't echo anything? [/snip] Seriously? Works fine here. -- PHP General Mailing List (http://w

Re: [PHP] can't work out the syntax error

2006-05-04 Thread John Wells
On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote: try this: echo " View ---^---^ concatenate the $_SERVER variable to the string... Or wrap the variables with curly braces so that PHP knows what's a variable a

RE: [PHP] Echo a value from an arrays position

2006-05-04 Thread Ford, Mike
On 04 May 2006 13:52, John Wells wrote: > On 5/4/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote: > > Will this also work with an associative array? If this is what he > > is talking about, I tried it and it does not work > > > > I think you're correct. This is because PHP arrays are a "mash-u

RE: [PHP] preg_replace_callback

2006-05-04 Thread Ford, Mike
On 04 May 2006 14:04, tJey wrote: > Hi. I have problem with preg_replace_callback. It seems that my > pattern is bad, but I can't find any error. > > Pattern : > this pattern is intended to find strings like "[field]", "[ > fi12_eld]"... > > but every time I get warning message > "Warning: pre

[PHP] causing HTTP error status

2006-05-04 Thread Nic
I'm having trouble with setting HTTP error status from PHP4. The PHP docs say that if I have this : ErrorDocument 400 /mydir/error.html then the script /mydir/test.php: will cause the page /mydir/error.html to be displayed. But that's not what I get. I just get the error header a

Re: [PHP] Echo a value from an arrays position

2006-05-04 Thread John Wells
On 5/4/06, Ford, Mike <[EMAIL PROTECTED]> wrote: They're not even that. They're pure associative arrays, or maps -- it's just that integer keys are treated somewhat specially so that an array with *only* integer keys will look like a traditional array. True true, thanks for making it crystal

Re: [PHP] Avoiding user refresh of pages with forms

2006-05-04 Thread Satyam
- Original Message - From: "John Wells" <[EMAIL PROTECTED]> On 5/3/06, Satyam <[EMAIL PROTECTED]> wrote: I used that method initially, some months ago, but finally dropped it. It looked nice at first, but then I started getting into problems and required too many special cases to mak

Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread tedd
At 4:30 AM -0700 5/4/06, Paul Novitski wrote: At 11:51 AM 5/3/2006, Phillip S. Baker wrote: I have some articles stored in a MySQL DB. What I want is if the article is above a certain length in characters, to page article through a few pages for site readability. So I would want to print X n

Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread Edward Vermillion
On May 4, 2006, at 4:16 AM, Richard Lynch wrote: On Wed, May 3, 2006 6:57 pm, Jochem Maas wrote: a. who said anything about sessions? Jay did. He suggested sucking down the whole article, paginating it all, and cramming the pages into session, presumably so you don't have to suck down the w

[PHP] Array Sorting

2006-05-04 Thread James Nunnerley
Hi All, I've got an array which has the following properties: $file_array[$filename] = array ("Date" => $Date, "size" => $size, "permissions" => $permissions); I can quite happily sort the array by filename (using natksort and natkrsort), which I found on the php manual - and for reference have

Re: [PHP] Re: Imagemagick Displaying Images

2006-05-04 Thread Al
Richard Lynch wrote: Ray Hauge wrote: convert -resize 800x600 AR-M455N_20060420_130446.pdf[0] - The '-' makes it display the contents of the image to stdout. I want to caputre that binary data and somehow display the images inline with the website. Is this possible, or am I living in a dream

Re: [PHP] Array Sorting

2006-05-04 Thread Stut
James Nunnerley wrote: I've got an array which has the following properties: $file_array[$filename] = array ("Date" => $Date, "size" => $size, "permissions" => $permissions); I can quite happily sort the array by filename (using natksort and natkrsort), which I found on the php manual - and fo

[PHP] Re: preg_replace_callback

2006-05-04 Thread Al
tJey wrote: Hi. I have problem with preg_replace_callback. It seems that my pattern is bad, but I can't find any error. Pattern : \[\s*((\d|\w|_)+)\s*\] this pattern is intended to find strings like "[field]", "[ fi12_eld]"... but every time I get warning message "Warning: preg_replace_callbac

RE: [PHP] Array Sorting

2006-05-04 Thread James Nunnerley
I think I may have written down my variable structure incorrectly in the first place, which even has me confused... The $file_array[$filename] is I don't think a further array. The "sub" values are created as follows: $file_array[$filename]["Date"] = ... $file_array[$filename]["Size"] = ... Lo

[PHP] Problem with usort

2006-05-04 Thread Jon Earle
Hi folks, Config is Apache/1.3.34 (Unix) PHP/4.4.1 mod_ssl/2.8.25 OpenSSL/0.9.7i. If my usort callback has in it: if ($aday == $bday) {return 0;} else {return ($aday < $bday) ? -1 : 1;} everything works - lots of sort operations happen on the array (three elements) and it sorts correctly.

Re: [PHP] Array Sorting

2006-05-04 Thread Stut
James Nunnerley wrote: I think I may have written down my variable structure incorrectly in the first place, which even has me confused... The $file_array[$filename] is I don't think a further array. The "sub" values are created as follows: $file_array[$filename]["Date"] = ... $file_array[$fi

Re: [PHP] Problem with usort

2006-05-04 Thread Stut
Jon Earle wrote: $ret_val = 0; if ($aday == $bday) {$ret_val = 0;} else {$ret_val = ($aday < $bday) ? -1 : 1;} return ret_val; I could be wrong, but I think you need some extra brackets on the else line... else {$ret_val = (($aday < $bday) ? -1 : 1);} -Stut -- PHP General Mailing L

[PHP] htmlentities() with utf8

2006-05-04 Thread Marten Lehmann
Hello, I want to use htmlentities() with UTF-8, which I can set with the third parameter. But to use the third parameter, I have to provide the second parameter. Currently the default for the second parameter is ENT_COMPAT. But as this might change, I don't want to call htmlentities with htm

RE: [PHP] Creating an OO Shopping Cart

2006-05-04 Thread Chris W. Parker
Richard Lynch on Thursday, May 04, 2006 2:06 AM said: > Contact the bank with which you already HAVE a merchant account for > your point-of-sale credit card swiper thingies. Already have the info in front of me. :) > If you're re-doing it anyway, you might as well

[PHP] Geting feet wet with REGEX and url rewriting (maybe a bit 0T)

2006-05-04 Thread Ryan A
Hey all, Every now and then I start on using REGEXs and URL rewriting as needed then stop again, this is one of those times :-) I have a simple url rewite that goes like this: RewriteRule ^blog-([0-9]+).html$ index.php?act=blog&id=$1 and I send urls to the page like this: mysite.com/blog/blog-2.h

Re: [PHP] Problem with usort

2006-05-04 Thread Rabin Vincent
On 5/4/06, Jon Earle <[EMAIL PROTECTED]> wrote: $ret_val = 0; if ($aday == $bday) {$ret_val = 0;} else {$ret_val = ($aday < $bday) ? -1 : 1;} return ret_val; You're missing the $ for ret_val on the return line. PHP thus understands the return value as a string, "ret_val", which would b

Re: [PHP] Problem with usort

2006-05-04 Thread John Wells
On 5/4/06, Stut <[EMAIL PROTECTED]> wrote: Jon Earle wrote: > $ret_val = 0; > if ($aday == $bday) {$ret_val = 0;} > else {$ret_val = ($aday < $bday) ? -1 : 1;} > return ret_val; > > I could be wrong, but I think you need some extra brackets on the else line... else {$ret_val = (($aday < $b

Re: [PHP] Problem with usort

2006-05-04 Thread Stut
John Wells wrote: Not true actually, it's a quick "if/else" using the ternary operator. It's also difficult to read all on one line: $ret_val = 0; if ($aday == $bday) { $ret_val = 0; } else { // what this does is test if $aday is less than $bday. // If so, it sets $ret_val to -1. If

Re: [PHP] Problem with usort

2006-05-04 Thread John Wells
On 5/4/06, Stut <[EMAIL PROTECTED]> wrote: Anyway, as someone else has pointed out, there is a missing $ on the return value. -Stut Yup, missed that one too. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Geting feet wet with REGEX and url rewriting (maybe a bit 0T)

2006-05-04 Thread Rabin Vincent
On 5/4/06, Ryan A <[EMAIL PROTECTED]> wrote: RewriteRule ^blog-([0-9]+).html$ index.php?act=blog&id=$1 This is fine, but you should really be escaping the "." (by writing it as "\."). Otherwise, it matches any character, not just the literal period. mysite.com/blog/blog-2-the_great_escape.ht

Re: [PHP] Problem with usort

2006-05-04 Thread Martin Alterisio \"El Hombre Gris\"
Rabin Vincent escribió: On 5/4/06, Jon Earle <[EMAIL PROTECTED]> wrote: $ret_val = 0; if ($aday == $bday) {$ret_val = 0;} else {$ret_val = ($aday < $bday) ? -1 : 1;} return ret_val; You're missing the $ for ret_val on the return line. PHP thus understands the return value as a string,

Re: [PHP] php script fails when run from cron

2006-05-04 Thread blackwater dev
I finally got it working and Chris was correct. It appears that cron was using the wrong php. Pumping the errors of even logging them wouldn't have helped as I was tweaking the ini for the php I thought it was using. When I explicitly tell it which one to use, it seems to work fine. Thanks! O

Re: [PHP] Re: php and ssl

2006-05-04 Thread Schalk
Schalk Neethling wrote: Barry wrote: Schalk schrieb: Greetings All, I am currently implementing a form for a client that will run over https. Now, all is good and well except, for some reason when the form loads in IE the lock in the status bar displays for a short while and then goes away,

Re: [PHP] Geting feet wet with REGEX and url rewriting (maybe a bit 0T)

2006-05-04 Thread Ryan A
Works perfectly, thank you! Just got a bit confused after all the reading. Regards, Ryan > > You just need to add another pair of parenthesis > to get the second match. For your case, it'll be > something like (untested): > > RewriteRule ^blog-([0-9]+)-([^\.]+)\.html$ > index.php?act=blog&id=$1

Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-04 Thread Paul Novitski
At 07:12 AM 5/4/2006, tedd wrote: If the text is organized into paragraphs, which I can't imagine it not being, then the solution can be found in using a combination of javascript and php. Javascript can detect the size (height & width) of window the user is currently using and the web site h

[PHP] What editor do you use?

2006-05-04 Thread Nicolas Verhaeghe
I am currently looking for a good PHP editor for Windows. I know, the question must have been asked so many times, but I thought I could ask it again now that a few editors have evolved, others have appeared. Before I used something called Ultraedit but I was disappointed by the lack of features,

RE: [PHP] What editor do you use?

2006-05-04 Thread Jay Blanchard
[snip] I am currently looking for a good PHP editor for Windows. I know, the question must have been asked so many times, but I thought I could ask it again now that a few editors have evolved, others have appeared. [/snip] Eclipse. You could also STFA -- PHP General Mailing List (http://www.php

Re: [PHP] Mail and hotmail

2006-05-04 Thread Christian Heinrich
Hi Peter, RFC 2156 (http://www.faqs.org/rfcs/rfc2156.html) defines the importance header as following: importance = "low" / "normal" / "high" Which means that you can either use the values low, normal or high HTH, Christian The only one I do not know what to set it to is "Importance"

[PHP] Maximum URL length (Pretty much 0T)

2006-05-04 Thread Ryan A
Hey, When i started on the net I was told that if sending than 256 characters via a form to use a POST instead of a GET method, now that I am playing with URL rewriting I wanted to know if member served me right, but searching via google I see that IE takes up to 2040-2083 characters in a GET, ano

RE: [PHP] Maximum URL length (Pretty much 0T)

2006-05-04 Thread Jay Blanchard
[snip] - Anything else you wish to add pertaining to the above. [/snip] People who use GET requests are lazy. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Maximum URL length (Pretty much 0T)

2006-05-04 Thread Chris W. Parker
Ryan A on Thursday, May 04, 2006 10:38 AM said: > - Anything else you wish to add pertaining to the > above. You could try sending an insanely long value to a script on your page and see how much of the actual data it received before being truncated or causing an er

RE: [PHP] Maximum URL length (Pretty much 0T)

2006-05-04 Thread Chris W. Parker
Jay Blanchard on Thursday, May 04, 2006 10:42 AM said: > [snip] > - Anything else you wish to add pertaining to the > above. > [/snip] > > People who use GET requests are lazy. What does... Edit User #241241 ...have to do with being lazy? Chris. -- PHP Genera

  1   2   >