Re: [PHP] PHP String convention

2009-11-04 Thread Lars Torben Wilson
2009/10/28 Warren Vail war...@vailtech.net: The curly braces look like something from the smarty template engine. Warren Vail Odd. I always thought the curly braces in the Smarty engine looked like something from PHP. :) Torben -Original Message- From: Kim Madsen

Re: [PHP] Re: PHP String convention

2009-11-04 Thread Lars Torben Wilson
2009/11/4 Nathan Rixham nrix...@gmail.com: Nick Cooper wrote: Hi, I was just wondering what the difference/advantage of these two methods of writing a string are: 1) $string = foo{$bar}; 2) $string = 'foo'.$bar; 1) breaks PHPUnit when used in classes (need to bug report that) 2)

Re: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Lars Torben Wilson
2009/10/12 m.hasibuan magda.hasib...@yahoo.co.uk: Newbie question. I need to download a very large amount of xml data from a site using CURL. How to bypass (pipe) curl_exec return value directly to a file, without using memory allocation? set_time_limit(0); $ch = curl_init($siteURL);

Re: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Lars Torben Wilson
2009/10/13 Andrea Giammarchi an_...@hotmail.com: $ch = curl_init($url); $fp = fopen('/tmp/curl.out', 'w'); curl_setopt($ch, CURLOPT_FILE, $fp); curl_exec($ch); Error checking etc. is of course left up to you. :) oops, I sent directly the file name. Let me reformulate the code then:

Re: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Lars Torben Wilson
2009/10/13 Andrea Giammarchi an_...@hotmail.com: curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); I wouldn't recommend setting this to 0 unless you're very sure that the connection will succeed; otherwise, your script will hang indefinitely waiting for the connection to be made. agreed, it's

Re: [PHP] Variable name as a variable?

2009-10-05 Thread Lars Torben Wilson
On Mon, 5 Oct 2009 16:56:48 +0200 Dotan Cohen dotanco...@gmail.com wrote: I need to store a variable name as a variable. Note quite a C-style pointer, but a way to access one variable who's name is stored in another variable. As part of a spam-control measure, a certain public-facing form

Re: [PHP] POST without POSTing

2009-09-30 Thread Lars Torben Wilson
On Thu, 1 Oct 2009 00:16:27 -0400 Paul M Foster pa...@quillandmouse.com wrote: On Wed, Sep 30, 2009 at 11:36:55PM -0400, Daniel Brown wrote: On Wed, Sep 30, 2009 at 23:29, Paul M Foster pa...@quillandmouse.com wrote: I'm not sure how to do this. Please no exotic external libraries

Re: [PHP] POST without POSTing

2009-09-30 Thread Lars Torben Wilson
On Thu, 1 Oct 2009 00:24:41 -0400 Daniel Brown danbr...@php.net wrote: On Thu, Oct 1, 2009 at 00:16, Paul M Foster pa...@quillandmouse.com wrote: However, assuming it *wasn't*, I've found the following example from a google search (thank goodness for google's hinting or I couldn't have

Re: [PHP] Re: Creating file name with $variable

2009-09-21 Thread Lars Torben Wilson
On Mon, 21 Sep 2009 00:43:24 +0200 Ralph Deffke ralph_def...@yahoo.de wrote: Hi Haig, it would be better if u tell us what purpose u want to solf with this approuch. Its hard to understand for a prov why u want to create a filename .php .php files are scrips containing functions or

Re: [PHP] Question: Correcting MySQL's ID colomn when removing an entry

2009-09-20 Thread Lars Torben Wilson
On Sun, 20 Sep 2009 12:07:39 +0430 Parham Doustdar parha...@gmail.com wrote: Hello there, I'm guessing that when a row in a MySQL table is removed, the ID colomns of the rows which come after that row are not changed. For example: 1 2 3 4 Now, if I want to remove the third rows, the ID

Re: [PHP] php.ini in cgi vs php.ini in cli

2009-09-15 Thread Lars Torben Wilson
CGI version is NOT using cgi/php.ini but is using apache2/php.ini instead. Thanks again for your help--you deserve a raise. :-) -Andres Hi Andres, Glad it worked! Regards, Torben Lars Torben Wilson wrote: On Mon, 14 Sep 2009 18:21:11 -0400 Andres Gonzalez and...@packetstorm.com

Re: [PHP] server name that the user agent used

2009-09-14 Thread Lars Torben Wilson
Tom Worster wrote: On 9/13/09 10:24 PM, Tommy Pham tommy...@yahoo.com wrote: --- On Sun, 9/13/09, Tom Worster f...@thefsb.org wrote: From: Tom Worster f...@thefsb.org Subject: [PHP] server name that the user agent used To: PHP General List php-general@lists.php.net Date: Sunday, September

Re: [PHP] php.ini in cgi vs php.ini in cli

2009-09-14 Thread Lars Torben Wilson
On Mon, 14 Sep 2009 18:21:11 -0400 Andres Gonzalez and...@packetstorm.com wrote: In the php configurations directories /etc/php5, there are 2 subdirectories, one for cgi and one for cli. There is a php.ini file in each of these directories. What would cause a difference of behavior in

Re: [PHP] get an object property

2009-09-13 Thread Lars Torben Wilson
Tom Worster wrote: On 9/12/09 9:50 AM, Tom Worster f...@thefsb.org wrote: On 9/12/09 1:32 AM, Lars Torben Wilson tor...@php.net wrote: Tom Worster wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value

Re: [PHP] get an object property

2009-09-13 Thread Lars Torben Wilson
Tom Worster wrote: On 9/13/09 3:21 AM, Lars Torben Wilson tor...@php.net wrote: On 9/12/09 9:50 AM, Tom Worster f...@thefsb.org wrote: but let me give you a more different example: $a and $b are normally both objects, each with various members including a prop q, but sometimes $a is false

Re: [PHP] get an object property

2009-09-11 Thread Lars Torben Wilson
Tom Worster wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it without setting another variable? to illustrate, here's something that doesn't work, but it

Re: [PHP] safe_mode and inclusion of files don't work as documented

2009-08-31 Thread Lars Torben Wilson
2009/8/31 Nico Sabbi nsa...@officinedigitali.it: Lars Torben Wilson ha scritto: Hi Nico, First the obligatory safe_mode is deprecated and not recommended speech. . .but I guess you've already seen that in the docs and decided to use it anyway. I read it, but I don't know if I have

Re: [PHP] safe_mode and inclusion of files don't work as documented

2009-08-28 Thread Lars Torben Wilson
2009/8/28 Nico Sabbi nsa...@officinedigitali.it: Hi, I'm testing one of my sites in safe_mode, but I'm experiencing some strangeness that is not documented. The settings are: in php.ini: include_path = .:/server/home/apache/php4/:/var/php/5.2/pear/:/usr/php/lib/ezcomponents-2008.2.2/ in

Re: [PHP] Re: page works on public web site, but not on my computer

2009-08-27 Thread Lars Torben Wilson
2009/8/27 mike bode mikebo...@hotmail.com: I understand, but that's not an option. I am not interested in getting into a Linux vs. Windows fight here, let's just say that I am stuck with Windows. Now, somthing's gotta be seriously wrong here. I have tried now 4 or 5 different scripts for the

Re: [PHP] How to output a NULL field?

2009-08-25 Thread Lars Torben Wilson
2009/8/25 David Stoltz dsto...@shh.org: if(empty($rs-Fields(22))){ Hi David, You cannot call empty() on a function or class method like that. From the manual: Note: empty() only checks variables as anything else will result in a parse error. In other words, the following will not work:

Re: [PHP] Re: page works on public web site, but not on my computer

2009-08-25 Thread Lars Torben Wilson
2009/8/25 mike bode mikebo...@hotmail.com: I just de-installed, then re-installed MySQL, Apache and PHP 5.3. No changes. The script does not work on my computer. Now I get in addition to the error message below this: [Tue Aug 25 21:29:11 2009] [error] [client 127.0.0.1] PHP Deprecated:

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Lars Torben Wilson
2009/8/24 Chris Carter chandan9sha...@yahoo.com: Hi, The code below actually takes input from a web form and sends the fields captured in an email. It used to work quite well since past few years. It has stopped now. I used Google's mail servers (google.com/a/website.com) ?  $fName =

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Lars Torben Wilson
2009/8/24 Paul M Foster pa...@quillandmouse.com: On Mon, Aug 24, 2009 at 10:37:11AM -0700, Chris Carter wrote: Is there any alternative method to do this !!! Sending email through PHP? Sure. You can use a class like PHPMailer rather than the built-in mail() function. But it's not going to

Re: [PHP] daemon without pcntl_fork

2009-08-22 Thread Lars Torben Wilson
2009/8/20 Jim Lucas li...@cmsws.com: Lars Torben Wilson wrote: 2009/8/19 Per Jessen p...@computer.org: Jim Lucas wrote: [snip] I probably wouldn't have chosen PHP for the first one, but there's no reason it shouldn't work.  For the second one, did you mean to write serial port?  That's

Re: [PHP] array() returns something weird

2009-08-22 Thread Lars Torben Wilson
2009/8/22 Szczepan Hołyszewski webmas...@strefarytmu.pl: Hello! I am almost certain I am hitting some kind of bug. All of a sudden, array() stops returning an empty array and starts returning something weird. The weird thing behaves as NULL in most circumstances (e.g. gettype() says NULL),

Re: [PHP] array() returns something weird

2009-08-22 Thread Lars Torben Wilson
2009/8/22 Szczepan Hołyszewski webmas...@strefarytmu.pl: What it looks like to me is that something is causing $foo to be a string before the '$foo[] = bar;' line is encountered. What do you get if you put a gettype($foo); just before that line?        $foo=null;        $foo[]=bar;      //

Re: [PHP] array() returns something weird

2009-08-22 Thread Lars Torben Wilson
2009/8/22 Szczepan Hołyszewski webmas...@strefarytmu.pl: Hm. . .it does look odd. Searching the bugs database at http://bugs.php.net does turn up one other report (at http://bugs.php.net/bug.php?id=47870 ) of array() returning NULL in certain hard-to-duplicate circumstances on FreeBSD, Yes,

Re: [PHP] Is there limitation for switch case: argument's value?

2009-08-22 Thread Lars Torben Wilson
; default: break; } Lars Torben Wilson larstor...@gmail.com wrote in message news:36d4833b0908202323p3c858b5fn6a1d6775aa7f8...@mail.gmail.com... 2009/8/20 Keith survivor_...@hotmail.com: Hi, I encounter a funny limitation here with switch case as below: The value for $sum is worked

Re: [PHP] Is there limitation for switch case: argument's value?

2009-08-22 Thread Lars Torben Wilson
Aargh. Slipped on the trigger there--premature Send. See below for what I meant to send: 2009/8/22 Lars Torben Wilson tor...@php.net: 2009/8/22 Keith survivor_...@hotmail.com: Thanks! Torben. I got the point now and it works! :-) I'm doing this because the statements of each cases is quite

Re: [PHP] Is there limitation for switch case: argument's value?

2009-08-21 Thread Lars Torben Wilson
2009/8/20 Keith survivor_...@hotmail.com: Hi, I encounter a funny limitation here with switch case as below: The value for $sum is worked as expected for 1 to 8, but not for 0. When the $sum=0, the first case will be return, which is sum=8. Is there any limitation / rules for switch case?

Re: [PHP] daemon without pcntl_fork

2009-08-20 Thread Lars Torben Wilson
2009/8/19 Per Jessen p...@computer.org: Jim Lucas wrote: [snip] I probably wouldn't have chosen PHP for the first one, but there's no reason it shouldn't work.  For the second one, did you mean to write serial port?  That's a bit of a different animal, I'm not sure how far you'll get with

Re: [PHP] daemon without pcntl_fork

2009-08-18 Thread Lars Torben Wilson
2009/8/17 Jim Lucas li...@cmsws.com: I want this to be a system that works out of the box.  For the most part. I am expecting to have phone system vendors and low-level IT personal trying to install this thing. I don't want to have to field tons of questions on How do I compile this

Re: [PHP] daemon without pcntl_fork

2009-08-18 Thread Lars Torben Wilson
2009/8/18 Per Jessen p...@computer.org: Jim Lucas wrote: Does anybody know how to use PHP as a daemon without the use of pcntl_fork. Sure. Just start it and leave it running. I want to launch a daemon out of the /etc/rc.local when the system starts. Yep, I do that all the time.

Re: [PHP] daemon without pcntl_fork

2009-08-18 Thread Lars Torben Wilson
2009/8/18 Per Jessen p...@computer.org: Lars Torben Wilson wrote: Again, that's not a daemon. If it is sufficient to run a background process then that's fine, but that doesn't make it a daemon (although it shares some things in common with a daemon). The background process still has

Re: [PHP] daemon without pcntl_fork

2009-08-17 Thread Lars Torben Wilson
2009/8/17 Jim Lucas li...@cmsws.com: Does anybody know how to use PHP as a daemon without the use of pcntl_fork. http://php.net/pcntl_fork Hi Jim, AFAIK you can't. Read on. . . I don't want to have to have a person have a special/custom compilation of PHP just to run a simple daemon. My

Re: [PHP] New PHP User with a simple question

2009-01-24 Thread Lars Torben Wilson
2009/1/24 Christopher W cwei...@adelphia.net: At least I hope it is simple... I am trying to get an HTML menu link to set a variable's value. For example, when a user clicks the Home button on my page it would cause $page = home; or clicking the About Us button will set $page=about_us; etc.

Re: [PHP] To check for existing user in database

2009-01-22 Thread Lars Torben Wilson
2009/1/16 Shawn McKenzie nos...@mckenzies.net: Lars Torben Wilson wrote: 2009/1/15 tedd tedd.sperl...@gmail.com: At 9:46 AM -0800 1/15/09, Chris Carter wrote: Chris: That's not the way I would do it. After establishing a connection with the database, I would use the query: $query SELECT

Re: [PHP] distinguish between null variable and unset variable

2009-01-21 Thread Lars Torben Wilson
2009/1/21 Daniel Brown danbr...@php.net: On Wed, Jan 21, 2009 at 20:27, Jack Bates ms...@freezone.co.uk wrote: How can I tell the difference between a variable whose value is null and a variable which is not set? Unfortunately, in PHP - like other languages - you can't. A variable is

Re: [PHP] print a to z

2009-01-15 Thread Lars Torben Wilson
2009/1/15 Leon du Plessis l...@dsgnit.com: I used that notation before, and it did not work 100%. Adapt as follows: for ($i = 'a'; $i = 'z'; $i++) if ($i == aa) break; else echo $i; It's weird, but true--the simple '=' breaks the loop. However, in the above example, you don't need the

Re: [PHP] To check for existing user in database

2009-01-15 Thread Lars Torben Wilson
2009/1/15 tedd tedd.sperl...@gmail.com: At 9:46 AM -0800 1/15/09, Chris Carter wrote: Chris: That's not the way I would do it. After establishing a connection with the database, I would use the query: $query SELECT email FROM owners WHERE email = '$emailAddress' : $result =

Re: [PHP] String variable

2009-01-11 Thread Lars Torben Wilson
2009/1/11 Ashley Sheridan a...@ashleysheridan.co.uk: On Sun, 2009-01-11 at 14:36 +, Ashley Sheridan wrote: On Sun, 2009-01-11 at 08:59 -0500, MikeP wrote: Hello, I am trying yo get THIS: where ref_id = '1234' from this. $where=where ref_id=.'$Reference[$x][ref_id]'; but i

Re: [PHP] Re: Re: How to count transfered kBytes in File-Download

2009-01-03 Thread Lars Torben Wilson
2009/1/3 Ashley Sheridan a...@ashleysheridan.co.uk: On Sat, 2009-01-03 at 17:39 -0500, Eric Butera wrote: On Sat, Jan 3, 2009 at 5:19 PM, Michelle Konzack linux4miche...@tamay-dogan.net wrote: Am 2009-01-03 10:16:43, schrieb Eric Butera: On Sat, Jan 3, 2009 at 9:23 AM, Ashley Sheridan I

Re: [PHP] running python in php timeout

2008-12-29 Thread Lars Torben Wilson
2008/12/29 brad bradcau...@gmail.com: Hi, I'm executing a python script from php that runs quite a long time (15+ minutes) and ends up timing out. Is there a way I can execute the python code and move on executing the remaining php code on the page? Thanks! Hi Brad, It's a little tough to

Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread Lars Torben Wilson
2008/12/22 Nathan Nobbe quickshif...@gmail.com: On Mon, Dec 22, 2008 at 3:10 PM, Clancy clanc...@cybec.com.au wrote: On Mon, 22 Dec 2008 10:20:09 +1100, dmag...@gmail.com (Chris) wrote: I'd call this a micro-optimization. If changing this causes that much of a difference in your

Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

2008-12-22 Thread Lars Torben Wilson
2008/12/22 German Geek geek...@gmail.com: agree, ++$i wont save u nething, it just means that the variable is incremented after it is used: You meant . . .before it is used:, right? Torben $i = 0; while ($i 4) echo $i++; will output 0123 while $i = 0; while ($i 4) echo ++$i;

Re: [PHP] Regular expressions (regex) question for parsing

2008-12-22 Thread Lars Torben Wilson
2008/12/22 Jim Lucas li...@cmsws.com: Rene Fournier wrote: Hi, I'm looking for some ideas on the best way to parse blocks of text that is formatted such as: $sometext %\r\n-- good data $otherstring %\r\n-- good data $andyetmoretext %\r\n

Re: [PHP] Variable as an index

2008-12-21 Thread Lars Torben Wilson
2008/12/21 German Geek geek...@gmail.com: Yes, i agree with this. Even if it takes a few nano seconds more to write out more understandable code, it's worth doing it because code management is more important than sqeezing out the last nano second. And then also an $var = Hello; echo $val

Re: [PHP] gethostbyaddr and IPv6

2008-11-21 Thread Lars Torben Wilson
2008/11/21 Glen C [EMAIL PROTECTED]: Hello, Does gethostbyaddr actually work for anyone while looking up an IPv6 address? I can't seem to get it to work. For example: echo gethostbyaddr ( '2001:470:0:64::2' ); should return ipv6.he.net but instead I get the following error:

Re: [PHP] gethostbyaddr and IPv6

2008-11-21 Thread Lars Torben Wilson
2008/11/21 Glen Carreras [EMAIL PROTECTED]: On 11/22/2008 12:10 AM, Lars Torben Wilson wrote: Hi Glen, Works for me. IPv6 support was added in 2001. You didn't say what version of PHP you are having this problem with, so it's hard to say why yours doesn't have support for it. Perhaps

Re: [PHP] Invalid Arguements

2008-11-20 Thread Lars Torben Wilson
2008/11/19 Robert Cummings [EMAIL PROTECTED]: On Wed, 2008-11-19 at 19:49 +, Ashley Sheridan wrote: On Wed, 2008-11-19 at 08:31 -0600, Terion Miller wrote: I am still getting the Invalid arguement error on this implode: if (isset($_POST['BannerSize'])){$BannerSize =

Re: [PHP] in_array breaks down for 0 as value

2008-11-20 Thread Lars Torben Wilson
2008/11/20 Stut [EMAIL PROTECTED]: On 20 Nov 2008, at 06:55, Yashesh Bhatia wrote: I wanted to use in_array to verify the results of a form submission for a checkbox and found an interesting behaviour. $ php -v PHP 5.2.5 (cli) (built: Jan 12 2008 14:54:37) $ $ cat in_array2.php ?php

Re: [PHP] in_array breaks down for 0 as value

2008-11-19 Thread Lars Torben Wilson
2008/11/19 Yashesh Bhatia [EMAIL PROTECTED]: Hi. I wanted to use in_array to verify the results of a form submission for a checkbox and found an interesting behaviour. $ php -v PHP 5.2.5 (cli) (built: Jan 12 2008 14:54:37) $ $ cat in_array2.php ?php $node_review_types = array(

Re: [PHP] Count the Number of Elements Using Explode

2008-11-01 Thread Lars Torben Wilson
2008/10/31 Stut [EMAIL PROTECTED]: On 31 Oct 2008, at 17:32, Maciek Sokolewicz wrote: Kyle Terry wrote: -- Forwarded message -- From: Kyle Terry [EMAIL PROTECTED] Date: Fri, Oct 31, 2008 at 9:31 AM Subject: Re: [PHP] Count the Number of Elements Using Explode To: Alice Wei

Re: [PHP] Dynamically creating multi-array field

2008-10-27 Thread Lars Torben Wilson
2008/10/26 Martin Zvarík [EMAIL PROTECTED]: PHP Version 5.2.4 ? $node = '[5][1][]'; ${'tpl'.$node} = 'some text'; print_r($tpl); // null ? I really don't like to use the EVAL function, but do I have choice?? This sucks. Hi there, While this question can spur some neat solutions, it

Re: [PHP] Dynamically creating multi-array field

2008-10-27 Thread Lars Torben Wilson
2008/10/27 Martin Zvarík [EMAIL PROTECTED]: Hi, I am aware of this, but explaining my problem in this case would take me an hour --- and eventually would lead to a) misunderstanding, b) weird solution, c) no solution... Forgive me if I misunderstand, but it seems like you are willing to trade

Re: [PHP] Disk serial number

2004-07-23 Thread Lars Torben Wilson
of the existing modules. Torben Lars Torben Wilson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Rosen wrote: I can write it to another language ( like C, Delphi ) but I don't know how to integrate this with PHP - i.e. to create it as module for PHP. I would suggest going the simple

Re: [PHP] Disk serial number

2004-07-22 Thread Lars Torben Wilson
Rosen wrote: I can write it to another language ( like C, Delphi ) but I don't know how to integrate this with PHP - i.e. to create it as module for PHP. I would suggest going the simple route for now, then if you need it (for performance or whatever) later on, write it up as a module then. Write

Re: [PHP] exec/system question..

2004-07-21 Thread Lars Torben Wilson
Justin Patrin wrote: On Wed, 21 Jul 2004 13:55:37 -0500, Michael Sims [EMAIL PROTECTED] wrote: Michael Sims wrote: Justin Patrin wrote: On Wed, 21 Jul 2004 10:09:52 -0700, bruce [EMAIL PROTECTED] wrote: 2) i could run the perl script, and have it somehow run in the background this would ba

[PHP] Re: Putting $_POST into string to send to ASP

2004-07-16 Thread Lars Torben Wilson
Jeff Oien wrote: Dumb question, sorry if it's a repeat. I will use PHP for a form with error checking. When there are no errors I need to send all the variables thru something like this: $URL = https://example.com/script.asp?First=JimLast=Smith;; urlencode($URL); header(Location: $URL\n); How

Re: [PHP] Re: Putting $_POST into string to send to ASP

2004-07-16 Thread Lars Torben Wilson
Vail, Warren wrote: How about (probably one of fifty solutions; Foreach($_POST as $k = $v) $vals[] = $k.=.$v; $strvals = urlencode(implode(,$vals)); Header(Location: https://example.com/script.asp?.$strvals); One thing to think about, URL's are limited in length, and one reason for using

Re: [PHP] Re: Putting $_POST into string to send to ASP

2004-07-16 Thread Lars Torben Wilson
Jeff Oien wrote: Thanks for the helpful examples. One other question. Is there an advantage to sending the URL via a header as opposed to doing http_post like this? http://shiflett.org/hacks/php/http_post Jeff As mentioned a couple of times, size is one. But you still need to url-encode the data

[PHP] Re: fread error

2004-07-08 Thread Lars Torben Wilson
Don wrote: Hi, Using a a flat text file based calendar script. Started getting this error after upgrading PHP: Warning: fread(): Length parameter must be greater than 0 Function it is occurring in is: function read_str($fp) { $strlen = $this-bin2dec(fread($fp,4),4); return fread($fp,

[PHP] Re: Worried about PECL

2004-07-08 Thread Lars Torben Wilson
Peter Clarke wrote: Currently the online manual for php is great. My concern is that the documentation for PECL extensions is almost non-existent. Since some php extensions are being moved/replaced by PECL extensions are we going to get non-existent documentation? Hi there, You might want to get

Re: [PHP] post without form

2004-07-07 Thread Lars Torben Wilson
Josh Close wrote: So basically there is no easy way around this. What I'm trying to do is have a page return to a page that was a couple pages back with the same get info. On the second page I can do $return_url = $_SERVER['HTTP_REFERER']; to get the previous url. But then I need to pass it on to

Re: [PHP] post without form

2004-07-07 Thread Lars Torben Wilson
Marek Kilimajer wrote: Lars Torben Wilson wrote: Josh Close wrote: So basically there is no easy way around this. What I'm trying to do is have a page return to a page that was a couple pages back with the same get info. On the second page I can do $return_url = $_SERVER['HTTP_REFERER']; to get

Re: [PHP] Client IP

2004-07-07 Thread Lars Torben Wilson
Rosen wrote: IP adress not send ?!? And how server communicate with client ? [snip] The httpd server might know the remote IP address, but that doesn't mean that it has to tell PHP about it. The SAPI module may or may not set the value, for instance. Even if you could rely on the IP address, in

Re: [PHP] Client IP

2004-07-07 Thread Lars Torben Wilson
Rosen wrote: Ok, I don't understand why IP adress will bi invisible for $_SERVER variable. It should be there, but mostly because the CGI 1.1 spec requires that it be provided to the script. There is no physical requirement for it to be there. Reasons for it not being present could include: o

Re: [PHP] PHP Bug ?

2004-07-05 Thread Lars Torben Wilson
Siddharth Hegde wrote: While we are on this topic, I have noticed that for only some keys, the following does not work $arr[KEY_NAME] but when I change this to $arr['KEY_NAME'] it works. I seriosuly doubt that KEY_NAME is a restricted keyword as dreamweawer highlights these in different colors and

Re: [PHP] Problem with session on first page loaded

2004-07-02 Thread Lars Torben Wilson
Jordi Canals wrote: Angelo, thanks for your comments. session_name must go before session_start. I think register_globals has nothing to do with session cookies. I always work with register_globals = off as recommended. About the cookie params (In PHP.INI) I checked them on the two platforms

[PHP] Re: I'm very curious about the object-orientated thingies in PHP 5.....

2004-07-01 Thread Lars Torben Wilson
Scott Fletcher wrote: Hey everyone, I'm very curious about the object-orientated thingies in PHP 5. Anyone know of a sample scripts I can read it on? And how does it work since the browser-webserver is one sided in communication or one way, not both way? Scott F. Zend.com is absolutely

[PHP] Re: regex problem

2004-07-01 Thread Lars Torben Wilson
Josh Close wrote: I'm trying to get a simple regex to work. Here is the test script I have. #!/usr/bin/php -q ? $string = hello\nworld\n; $string = preg_replace(/[^\r]\n/i,\r\n,$string); First, the short version. You can fix this by using backreferences: $string = preg_replace(/([^\r])\n/i,

[PHP] Re: TAB Syntax

2004-06-30 Thread Lars Torben Wilson
Harlequin wrote: Cheers Lars. So, for example, if I wanted to display some plain text tabbed I'd use: echo prestring1\tstring2\tstring3/pre; There's just one problem though - it formats the text differently to the rest of the page (I'm using CSS to control this). Any thoughts...? Try adding

[PHP] Re: test if $int is integer

2004-06-29 Thread Lars Torben Wilson
Vlad Georgescu wrote: how can test if var $int is integer ? In the manual: http://www.php.net/is_int Another one which might be helpful: http://www.php.net/is_numeric Hope this helps, Torben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: test if $int is integer

2004-06-29 Thread Lars Torben Wilson
Matthew Sims wrote: I recently purchased George Schlossnagle's Advanced PHP Programming and on page 85 in the Error Handling chapter, he made a reference about the is_int function. In the above function example he had: if (!preg_match('/^\d+$/',$n) || $n 0) { In which he mentions: It might be

[PHP] Re: TAB Syntax

2004-06-29 Thread Lars Torben Wilson
Harlequin wrote: I know I'm probably going to get flamed for this but it is only a development site but I am having some trouble getting the syntax right for using the tab when echoing information. My current command is: print_r(Host: $hostbrUser: $userbrPassword: $password); I've tried:

[PHP] Re: Question about executing PHP script

2004-06-28 Thread Lars Torben Wilson
Charlie Don wrote: Hello, I need to have some scripts that do database maintanance on my cron tab. However, some might take more time to execute that the maxtime set on php.ini. These are now web scripts but scripts that I execute on my command prompt or cron tab. I wonder if there is any way

[PHP] Re: Sort a text string by last word before separator

2004-06-24 Thread Lars Torben Wilson
Andre Dubuc wrote: Given a text string: $OK = Joe Blow, William Howard Anser, Hannie Jansen, etc, etc,; [snip] How would I get this 'before_last' function to iterate through the initial string, so I could build a sorted list with both first and last names, sorted by last name? I can't seem to

[PHP] Re: Sort a text string by last word before separator

2004-06-24 Thread Lars Torben Wilson
Lars Torben Wilson wrote: Sorry about following up to myself, but I was really really hungry when I wrote the first one: [snip] This code returns the names in the format in which they are given. You can speed it up a bit by having it return the names in 'lastname, firstname' format

RE: [PHP] List Administrator

2003-07-30 Thread Lars Torben Wilson
On Wed, 2003-07-30 at 11:11, Chris W. Parker wrote: Johnny Martinez mailto:[EMAIL PROTECTED] on Wednesday, July 30, 2003 11:07 AM said: Google spidered the web view to the list and is indexing our email addresses. Any chance you can edit the code to change [EMAIL PROTECTED] to show

Re: [PHP] List Administrator

2003-07-30 Thread Lars Torben Wilson
On Wed, 2003-07-30 at 11:07, Johnny Martinez wrote: List Administrator, Google spidered the web view to the list and is indexing our email addresses. Any chance you can edit the code to change [EMAIL PROTECTED] to show as user at domain dot com as many of the public message boards do? This

RE: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Lars Torben Wilson
On Thu, 2003-07-24 at 20:24, Beauford.2005 wrote: It's obvious though that PHP can not handle it. This is why I am forced to use javascript. I have already spent a week on this and am not going to waste any further time. I have posted all my code and if someone can see a problem I'll look at

Re: [PHP] I'm really getting annoyed with PHP

2003-07-24 Thread Lars Torben Wilson
On Thu, 2003-07-24 at 04:18, Comex wrote: [EMAIL PROTECTED] Lars Torben Wilson: On Wed, 2003-07-23 at 18:21, Daryl Meese wrote: Well, I know I am not running the latest version of PHP but I don't believe this is accurate. I believe PHP case sensitivity is based on the os that processes

Re: [PHP] PHP should know my data!

2003-07-24 Thread Lars Torben Wilson
On Thu, 2003-07-24 at 15:04, John Manko wrote: I just wrote a web app, but I'm completely disgusted with PHP. The application works great, but PHP is not smart enough to know what data belongs in my database. Really, I have to enter the stuff in myself. I spent 2 long days writing this

Re: [PHP] PHP should know my data!

2003-07-24 Thread Lars Torben Wilson
On Thu, 2003-07-24 at 15:24, John Manko wrote: LOL :) - Now that's funny! Robert Cummings wrote: Unfortunately I don't think some people got the joke. Next thing you know their going to complain that PHP should have told them the punchline ;) Cheers, Rob. Oh fer Pete's sake.

Re: [PHP] Global variable question question

2003-07-23 Thread Lars Torben Wilson
On Wed, 2003-07-23 at 12:19, Jason Giangrande wrote: When registered globals is set to off this does not effect the $PHP_SELF variable right? In other words I should be able to call $PHP_SELF with out having to do this $_SERVER['PHP_SELF'], right? Thanks, Jason Giangrande Without going

Re: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Lars Torben Wilson
On Thu, 2003-07-24 at 12:41, Beauford.2005 wrote: Yes, I'm still screwing around with this stupid redirection thing, and either I'm just a total idiot or there are some serious problems with PHP. I have now tried to do it another way and - yes - you guessed it. It does not work. I doubt

RE: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Lars Torben Wilson
On Thu, 2003-07-24 at 15:12, Beauford.2005 wrote: FORM onSubmit=return checkrequired(this) ACTION=season_write.php action=post name=seasons Try ACTION=/season_write.php instead. What happens? -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506

RE: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Lars Torben Wilson
On Wed, 2003-07-23 at 18:21, Daryl Meese wrote: Well, I know I am not running the latest version of PHP but I don't believe this is accurate. I believe PHP case sensitivity is based on the os that processes the file. Can anyone clear this up. Daryl OK: you're mistaken. If you're correct,

Re: [PHP] list server problem

2003-07-20 Thread Lars Torben Wilson
On Sun, 2003-07-20 at 11:04, Andu wrote: --On Monday, July 21, 2003 01:34:11 +0800 Jason Wong [EMAIL PROTECTED] wrote: On Monday 21 July 2003 00:39, Andu wrote: The executive summary is that there is nothing to be fixed. If you're using a less than adequate mail client which does

Re: [PHP] Array key names - can they be called as strings?

2003-07-17 Thread Lars Torben Wilson
On Thu, 2003-07-17 at 14:38, Mike Morton wrote: Perhaps I was not that clear on the subject :) I have the following array: $SAVEVARS[headerimage]=$_POST[headerimage]; $SAVEVARS[backgroundimage]=$_POST[backgroundimage]; I want to iterate through it to save to a database config:

Re: [PHP] Too much of $GLOBALS[] a problem??

2003-07-17 Thread Lars Torben Wilson
On Thu, 2003-07-17 at 18:35, Ow Mun Heng wrote: Hi All, Just a quick question on this. In my scripts, I'm using A LOT Of $GLOBALS['my_parameter'] to get the declared values/string. 1 example below : The only real problem is if you ever want to use that code in anything else. Using

RE: [PHP] Too much of $GLOBALS[] a problem??

2003-07-17 Thread Lars Torben Wilson
On Thu, 2003-07-17 at 21:10, Ow Mun Heng wrote: 'Loosely-coupled' code relied much less on the environment around it. It would typically receive its values through an argument list, array of values it needs, or perhaps by being a method in a class which has attribute values for all of the

Re: [PHP] What did I do wrong to cause a parse error?

2003-07-11 Thread Lars Torben Wilson
Hi there, On Thu, 2003-07-10 at 21:53, Phil Powell wrote: foreach ($profileArray[$i][attributes] as $key = $val) { ^^ You should quote the word 'attributes': http://www.php.net/manual/en/language.types.array.php#language.types.array.donts Sorry...that link

Re: [PHP] error on array loop through foreach?

2003-07-08 Thread Lars Torben Wilson
On Mon, 2003-07-07 at 21:31, Micah Montoy wrote: It did help and I altered the script a bit. It now reads as: [snip] Now I am receiving the error message of: Warning: Invalid argument supplied for foreach() in c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line 43

Re: [PHP] Retaining formatting problem

2003-07-08 Thread Lars Torben Wilson
On Tue, 2003-07-08 at 02:29, [EMAIL PROTECTED] wrote: Hello everyone, I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text. This text box is in a standard input type=text but when I insert it into the

Re: [PHP] error on array loop through foreach?

2003-07-07 Thread Lars Torben Wilson
On Mon, 2003-07-07 at 00:16, Micah Montoy wrote: I'm using the foreach to loop through a array that is passed from a form. The form has a multiple select field and the field sends a list of selected image locations (i.e. c:\\myimages\\rabbit.gif). All the fields are selected by use of

Re: [PHP] what licence for documentation ?

2003-07-07 Thread Lars Torben Wilson
On Mon, 2003-07-07 at 05:49, E.D. wrote: Hi, I'd like to know which licence has the documentation. PHP licence ? free licence ? public domain ? other ? In other words, I want to include some parts in a commercial product, can I ? Please answer only if you *know*, I can't go with

Re: [PHP] Probs with a form

2003-07-05 Thread Lars Torben Wilson
On Fri, 2003-07-04 at 15:02, LPA wrote: Hey, I must send datas threw a form, but I dont want to have a submit button.. Is there a way to 'simulate' the click of a submit button? Thnx for your help Laurent Hi there, This is really an HTML question, and not a PHP question, but use an

Re: [PHP] looping through values from a field? Need hellp.

2003-07-05 Thread Lars Torben Wilson
On Sat, 2003-07-05 at 15:55, Micah Montoy wrote: I have this javascript that enables browsing and selecting of a file. This file location and name are then transferred further down in the form as an option. Multiple files may be chosen as they are just added one below the other. Anyway,

Re: [PHP] looping through values from a field? Need hellp.

2003-07-05 Thread Lars Torben Wilson
On Sat, 2003-07-05 at 17:13, Micah Montoya wrote: Ok. I gave it a shot but have run into one other question that I wasn't able to find that was addressed by the article. My select statement looks like this: select name=imgList[] style=width:350; size=6 multiple/select When I create the

  1   2   3   4   >