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] Newbie: Array of objects iteration

2009-10-10 Thread Torben Wilson
2009/10/10 MEM tal...@gmail.com: MEM, http://www.php.net/language.oop5.reflection Regards, Tommy And brand new world opens in from of my eyes... O.O. I will search more info on this on the net... just for the records, as properties names is concern, I couldn't find any better I

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] Can't find the server path when, in http.conf, using Alias and DirectoryIndex

2009-08-27 Thread Torben Wilson
2009/8/26 Paul Gardiner li...@glidos.net: Paul Gardiner wrote: I want to write a simple indexing script to display a directory full of photos as a gallery of thumbnails. (There are various solutions out there for this, but they're all a bit more complicated than I need). I've added a file

Re: [PHP] Can't find the server path when, in http.conf, using Alias and DirectoryIndex

2009-08-27 Thread Torben Wilson
2009/8/27 Paul Gardiner li...@glidos.net: Torben Wilson wrote: 2009/8/26 Paul Gardiner li...@glidos.net: Paul Gardiner wrote: I want to write a simple indexing script to display a directory full of photos as a gallery of thumbnails. (There are various solutions out

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
out Closer, but still not quite there. For encapsulation in the string, it should look like: $where = where ref_is='{$Reference[$x]['ref_id']}'; Someone else mentioned casting to int first as well to sanitize, which is also a good idea. Torben Ash www.ashleysheridan.co.uk -- Torben

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
on a test to try an impress the professor when the semantics call for $i++ :D -nathan p.s. in case you couldnt tell; been there, done that. lol -- Torben Wilson tor...@2powerweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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
://www.designmagick.com/ -- Torben Wilson tor...@2powerweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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
=post is that they won't fit in a URL, for this you'll need to make sure they fit. Warren Vail You could do that, but for one thing, it doesn't handle arrays. The code snippet in the user notes does. -- Torben Wilson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe

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
to take the same (or similar) argument lists and return the same thing, then all you need to do to change from one to the other is replace the old include file with the new one. Hope this helps, Torben Wilson [EMAIL PROTECTED] For example: www.php.net/mime-magic This extension has been deprecated

Re: [PHP] post without form

2004-07-07 Thread Lars Torben Wilson
. Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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
/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- Torben Wilson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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
and this happens very rarely. In any case I will be working on PHP5 so i guess it will not happen again This is explained in the manual section on arrays: http://www.php.net/manual/en/language.types.array.php#language.types.array.donts Sorry if that link wraps. Cheers, -- Torben Wilson [EMAIL PROTECTED

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
methods, and different strengths and weaknesses. Maybe you can turn one of them into something useful to you. Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[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
. :) -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP

Re: [PHP] List Administrator

2003-07-30 Thread Lars Torben Wilson
, phpbuilder.com, and anybody who runs an NNTP web interface which includes this list--just to name a few--have web-accessible archives of this list, and are unaffiliated with the PHP group. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com

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

2003-07-24 Thread Lars Torben Wilson
different version of PHP in many different environments. The good news is that the problem is not with PHP. That means it's the code, which is easy to fix. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com

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
of the problem you're facing, chances are that someone (or several someones, more likely) will provide suggestion to help you out. Feel free to post details if you would like a hand with it. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com

Re: [PHP] PHP should know my data!

2003-07-24 Thread Lars Torben Wilson
--got me. The sad thing is that sometimes things get to a point on the list where this sort of thing would seem likely... -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com

Re: [PHP] Global variable question question

2003-07-23 Thread Lars Torben Wilson
into why you didn't read the manual or just try it, the answer is 'wrong'. ;) If register_globals is off, $_SERVER['PHP_SELF'] is what you will need. Good luck, Torben -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http

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

2003-07-23 Thread Lars Torben Wilson
concrete suggestion on how to get this to work It would be greatly appreciated. In the mean time I have given up on it as I am just totally pissed off at it. TIA -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http

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 http

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

2003-07-23 Thread Lars Torben Wilson
, it's a bug. I'm pretty sure we would have heard about it by now. :) But give it a try and post your results (I don't have a Win PHP box set up right now, myself). -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http

Re: [PHP] list server problem

2003-07-20 Thread Lars Torben Wilson
. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com

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

2003-07-17 Thread Lars Torben Wilson
the array subscripts: $SAVEVARS['headerimage'] = $_POST['headerimage']; etc. See the manual for why: http://www.php.net/manual/en/language.types.array.php#language.types.array.donts Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http

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

2003-07-17 Thread Lars Torben Wilson
that, it's not a huge issue. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http

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

2003-07-17 Thread Lars Torben Wilson
, there are lot of great books on programming which should help--and excellent and easy-to-read book which covers a lot of things which you *don't* want to have to figure out yourself is 'Code Complete', by Steve McConnell. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http

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

2003-07-11 Thread Lars Torben Wilson
the top of my head. -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com

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

2003-07-08 Thread Lars Torben Wilson
Anyone have an idea of what may be causing this? thanks Are you 100% sure that $filename is an array when you give it to foreach? Check to make sure that $filename exists and is an array first. That should help. Good luck, Torben -- Torben Wilson [EMAIL PROTECTED

Re: [PHP] Retaining formatting problem

2003-07-08 Thread Lars Torben Wilson
it into the database the line returns dissapear, eg this little amount of text will enter like this little amount of text will enter like Please help me it is p!!$$!ng me right off :P Cheers in advance Try this: http://www.php.net/nl2br Good luck, Torben -- Torben Wilson [EMAIL PROTECTED

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

2003-07-07 Thread Lars Torben Wilson
the above ideas and see if they help. Good luck, Torben -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott

Re: [PHP] what licence for documentation ?

2003-07-07 Thread Lars Torben Wilson
only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). -- Hope this helps, Torben -- Torben Wilson

  1   2   3   4   >