Re: [PHP] what does this mean in plain english?

2002-05-17 Thread Stuart Dallas
On 17 May 2002 at 12:23, Jeff Field wrote: > $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; It's a shortened version of the if...else construct. As in... condition ? this_if_true : this_if_false -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe

Re: [PHP] How to simultaneously send HTML *and* start download?

2002-05-21 Thread Stuart Dallas
On 21 May 2002 at 20:37, D. D. Brierton wrote: > The result I'm looking for is like the CGI script at netscape for > downloading NS6 - it takes you to a page which says aomething like > "The download should start automatically" and then the download > begins. I'm having trouble figuring out how to

Re: [PHP] exec() under win2000 & apache not works?

2002-05-28 Thread Stuart Dallas
Posteingang <[EMAIL PROTECTED]> wrote: > $cmd_commando = "cmd /c xcopy C:\php\INPUT\* C:\php\OUTPUT\* /w /f > /i /s /e /h /y"; You need to escape your backslashes... $cmd_commando = "cmd /c xcopy C:\\php\\INPUT\\* C:\\php\\OUTPUT\\* /w /f /i /s /e /h /y"; Also, make sure the account Apache is

Re: [PHP] Apache query error affecting PHP?

2002-05-28 Thread Stuart Dallas
Weston Houghton <[EMAIL PROTECTED]> wrote: > Apache will actually return the directory listing of the assets/ > directory (assuming you have directory listing enabled, otherwise it > returns the standard forbidden error). It does not seem to matter > what the actual variable name following the "?"

Re: [PHP] mail() source code

2002-05-28 Thread Stuart Dallas
Anthony Rodriguez <[EMAIL PROTECTED]> wrote: > I'm planning to write a "modified" mail() to include the "true" > return-path. In order to do so, I need to communicate directly with > sendmail and, in my newbie's opinion, a good start would be to > review the source code of the mail(). Before yo

Re: [PHP] Parse Error(newbie)

2002-05-29 Thread Stuart Dallas
[EMAIL PROTECTED] wrote: > $query = "SELECT * FROM news ORDER BY id DESC LIMIT 1"; > > I believe that it is an error in the SQL statement Nope, looks fine. Show us the previous few lines, the error is probably in those somewhere. -- Stuart -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Advantages of php

2002-05-29 Thread Stuart Dallas
1LT John W. Holmes <[EMAIL PROTECTED]> wrote: > POST data is sent in the headers I know it's being picky but if the OP is going to be presenting to an audience it would be better if what he says is correct. POST data is not sent in the headers of an HTTP request. It is sent in the data part of t

Re: [PHP] mail() function

2002-05-29 Thread Stuart Dallas
Ed Gorski <[EMAIL PROTECTED]> wrote: > lol.what does that return? Usually a more knowledgable programmer occasionally with a sense of acheivement attached. -- Stuart > At 09:08 PM 5/29/2002 -0700, r wrote: >> That may and may not work, I would suggest you add the RTFM() >> function, then it

Re: [PHP] PLEASE: Second request...

2002-05-29 Thread Stuart Dallas
Shane <[EMAIL PROTECTED]> wrote: > Second request... Please, any help out there for where I can download > the best GD module for PHP 4.0.6 on my WIN 2000 IIS box. A quick (about 2 seconds!!) search on Google found this: http://php.weblogs.com/php_gd Full search results: http://www.google.com/

Re: [PHP] arrays and same index

2002-05-30 Thread Stuart Dallas
Victor Spång Arthursson <[EMAIL PROTECTED]> wrote: > I want to create an array that looks like follows: > > $array["untitled_1.jpg"][] = 0 > $array["untitled_1.jpg"][] = 3 > $array["untitled_1.jpg"][] = 4 > $array["untitled_2.jpg"][] = 0 > $array["untitled_3.jpg"][] = 1 > > What I'm thinking about

Re: [PHP] Apache 2.0.36 and PHP

2002-05-31 Thread Stuart Dallas
Friday, May 31, 2002, 9:29:52 AM, you wrote: > I simply installed the binary version of Apache 2.0.36 and PHP 4.1.1 does > not work anymore. > I didn't do anything else than installing the binary version of apache, and > start apache. > Apache starts well, I can see the Apache welcome screen. >

Re: [PHP] Class variables and scope

2002-05-31 Thread Stuart Dallas
On Friday, May 31, 2002 at 4:11:42 PM, you wrote: > When I try to work with the first instance of my class, I get an error which > I finally tracked down to it trying to run it's SQL queries against the > database defined in $c2. Now, I was under the impression that class > variables were private

Re: [PHP] Re: Newbie question : PHP variables are not posted by this

2002-05-31 Thread Stuart Dallas
On Friday, May 31, 2002, 5:17:49 PM, you wrote: > Can you send the code that is failing to the list - it will help in working > out the problem... And include your platform details (OS, PHP version, etc). -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

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

2002-05-31 Thread Stuart Dallas
On Saturday, June 1, 2002 at 2:42:40 AM, you wrote: > Is there any way of caryying the login information from one web page to the > next in global variables so that the username and password entered in the > login screen is available to all other web pages in the site or do I have to > ask the use

Re: [PHP] A small question - Mysql_insert_id

2002-06-01 Thread Stuart Dallas
On Sunday, June 2, 2002 at 4:07:31 AM, you wrote: > will this return the row number or the "id" fields value..? > If it returns the row number how do I get the ID number? > The id started at 1500. >From the manual page for mysql_insert_id()... "mysql_insert_id() returns the ID generated for an A

Re: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 4:51:20 PM, you wrote: > I got a simple form addform.html and add.php look like the following. > But everytime I got empty value from firstname and lastname. It seems like > the input value in the html page was not passed on to the php variable > $firstname in add.php.

Re[2]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:00:18 PM, you wrote: > Do you mind telling me where this php.ini is? Create a php script containing just . That page will tell you where your php.ini is (or should be). > And I tried the second attempt like this: > $query = "INSERT INTO friends (id, firstname, sur

Re[4]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:22:02 PM, you wrote: >> Create a php script containing just . That page will tell >> you where your php.ini is (or should be). >> > it told me it's in php/lib, but it's not there. The default php.ini is called php.ini-recommended and will be in the directory where

Re[4]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:35:03 PM, you wrote: > Is there anything I should do to make the php.ini come into effect? I did > put the register_global = On but still got empty values. you may not need to do anything or you may need to restart your http server. Have a look at your phpinfo() pag

Re[6]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:37:37 PM, you wrote: > Sorry. > I restared apache and php.ini came into effect. If you're going to run with register_globals on you should make sure you understand the implications: http://www.php.net/manual/en/security.registerglobals.php. -- Stuart -- PHP Ge

Re[6]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 6:00:22 PM, you wrote: > $query = "INSERT INTO friends (id, firstname, surname) values >(nextval('friends_id_seq'), ".$_POST['firstname'].", ".$_POST['surname'].")"; It's so obvious you're gonna kick yourself (I did!). You need to enclose the two values in quotes, li

Re: [PHP] Possible to convert from Hex string to integer?

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 6:29:59 PM, you wrote: > Does anyone know of a function within PHP that will convert a hexadecimal > string (without the leading 0x) into an integer? FFS!! http://www.php.net/hexdec -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

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

2002-06-02 Thread Stuart Dallas
On Sunday, June 2, 2002 at 2:53:30 PM, you wrote: > I certainly read your reply and tried it with the session_start as the first > line of the php secion. I have since remove the HTML etc. The script > appears to work with out error . session_start must be called before any output in the script

Re[2]: [PHP] opendir security hole

2002-06-03 Thread Stuart Dallas
On Monday, June 3, 2002 at 3:37:48 PM, you wrote: >$dir = preg_replace('/\.\.\/?/', '', $dir); Surely a regular expression is overkill for this? It would be more efficient to use str_replace()... $dir = str_replace('..', '', $dir); -- Stuart -- PHP General Mailing List (http://www.php.n

Re: [PHP] Extracting a time zone from a latitude longitude

2009-11-21 Thread Stuart Dallas
On 21 Nov 2009, at 17:51, Phpster wrote: > This is a simple math problem. Create am array with a start and end longitude > for that timezone and run a comapre from your lay/long co-ords to see where > it falls. It's not that simple because timezones boundaries don't run in straight lines from p

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Stuart Dallas
On 21 Dec 2009, at 19:40, Andy Shellam wrote: >> >> Both at home and at work there are caching DNS on the LAN. So a DNS >> request may come back with a valid IP address when the WAN connection is >> down. I still won't be able to connect to the remote site. > > Dig an external server - e.g. dig

Re: [PHP] trying to launch kate from the browser....

2010-01-08 Thread Stuart Dallas
On 8 Jan 2010, at 12:48, Rene Veerman wrote: > Thanks for the reply.. > > I only need this to work locally on the web-server for now.. > > So i'm calling a script through ajax routines, which would do the exec(). > Since it's on the local webserver, that should work, right? No. When the web ser

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Stuart Dallas
On 8 Jan 2010, at 20:49, LinuxManMikeC wrote: > http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope > "This document provides guidelines for code formatting and > documentation to individuals and teams contributing to Zend > Framework." > > So as far as anythin

Re: [PHP] POLL: To add the final ?> or not...

2010-01-08 Thread Stuart Dallas
On 8 Jan 2010, at 21:38, Ashley Sheridan wrote: > On Fri, 2010-01-08 at 21:30 +0000, Stuart Dallas wrote: >> On 8 Jan 2010, at 20:49, LinuxManMikeC wrote: >> >> > >> http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope &g

Re: [PHP] POLL: To add the final ?> or not...

2010-01-10 Thread Stuart Dallas
On 10 Jan 2010, at 14:44, Michael A. Peters wrote: > Stuart Dallas wrote: > >> That's a massive assumption. There are a number of editors that >> automatically add a blank line to the end of source files. I stand by >> taking the option that requires the leas

Re: [PHP] Do you use a public framework or roll your own?

2010-01-27 Thread Stuart Dallas
On 27 Jan 2010, at 00:17, Daevid Vincent wrote: > And for those interested, here are the results of the last poll: > > "To add the final ?> in PHP or not..." > http://www.rapidpoll.net/show.aspx?id=arc1opy > > I'm relieved to know I'm in the majority (almost 2:1) who close their > opening PHP tag

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
Heh, you guys are funny! On 24 Mar 2010, at 08:58, Rene Veerman wrote: > On Wed, Mar 24, 2010 at 10:47 AM, Per Jessen wrote: >> Rene Veerman wrote: >> >>> popular : facebook youtube etc >>> >> >> Rene, I must be missing something here. That sort of size implies >> millions in advertising rev

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 09:36, Rene Veerman wrote: > unless the actual php development team would like to weigh in on this > matter of course. > > yes, i do consider it that important. > > these nay-sayers usually also lobby the dev-team to such extent that > these features would actually not make it

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 10:24, Tommy Pham wrote: > On Wed, Mar 24, 2010 at 2:58 AM, Stuart Dallas wrote: >> On 24 Mar 2010, at 09:36, Rene Veerman wrote: >> >>> unless the actual php development team would like to weigh in on this >>> matter of course. >>>

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 10:34, Rene Veerman wrote: > On Wed, Mar 24, 2010 at 12:28 PM, Tommy Pham wrote: >> >> Funny you should mention all that. Let's say that you're longer with >> that company, either by direct employment or contract consultant. >> You've implemented C because you need 'thread'.

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 10:38, Tommy Pham wrote: > On Wed, Mar 24, 2010 at 3:31 AM, Stuart Dallas wrote: >> On 24 Mar 2010, at 10:24, Tommy Pham wrote: >>> I did give a real life example, ie e-commerce site mentioned earlier. >>> Amazon has the similar features of my exa

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 10:46, Rene Veerman wrote: > On Wed, Mar 24, 2010 at 11:58 AM, Stuart Dallas wrote: >> On 24 Mar 2010, at 09:36, Rene Veerman wrote: >> >>> unless the actual php development team would like to weigh in on this >>> matter of course. >>>

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 10:48, Tommy Pham wrote: > On Wed, Mar 24, 2010 at 3:39 AM, Stuart Dallas wrote: >> >> On 24 Mar 2010, at 10:34, Rene Veerman wrote: >> >>> On Wed, Mar 24, 2010 at 12:28 PM, Tommy Pham wrote: >>>> >>>> Funny you shoul

Re: [PHP] how to do cloud computing with php

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 11:55, Rene Veerman wrote: > As a way to take a few steps back from the kinda heated "when will php > grow up and support threading" thread, i'm requesting you people list > how you scale from 1 server to many servers; what's called cloud > computing. > > In particular, i'm inte

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 19:35, Rene Veerman wrote: > > take this example, sorry for the crosspost; > > my main concern atm is my own cms (50-100k lines of my own); it's > graphics-heavy, does fairly complicated db based logic, and if it ever > is to be used for a site like facebook, it'll get large da

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 19:42, Tommy Pham wrote: > On Wed, Mar 24, 2010 at 10:18 AM, Sancar Saran > wrote: >> On Wednesday 24 March 2010 03:17:56 Tommy Pham wrote: >>> Let's go back to my 1st e-commerce example. The manufacturers list is >>> about 3,700. The categories is about about 2,400. The pro

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 20:34, Rene Veerman wrote: > > On Wed, Mar 24, 2010 at 10:19 PM, Ashley Sheridan > wrote: > On Wed, 2010-03-24 at 22:15 +0200, Rene Veerman wrote: > Do you have any proof of this 'market trend'? I suggested a vote, but you > 'nay-sayed' it on the basis that you'd lose to peop

Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Stuart Dallas
On 24 Mar 2010, at 20:42, Rene Veerman wrote: > > if you ppl just stop barracading, you'll see that with relatively > minimal effort php can evolve with the times and make such things > possible for us mere mortals. Minimal effort? You clearly have no understanding of what would be involved to g

Re: [PHP] Login using just cookies, bad idea?

2010-07-12 Thread Stuart Dallas
On 08/07/10 17:53, Michael Calkins wrote: I right now have a complete user login and registration system however it uses cookies when you login to store information. Is this a bad thing?$_COOKIE vs $_SESSION for login systems Encrypt the cookie, make sure you don't store the password in there

Re: [PHP] Sorting Help

2012-04-11 Thread Stuart Dallas
second in descending order. I looked at array_multisort but couldn't figure > out how to make work for my needs. Use a custom sorting function, then you can sort any way you want: http://php.net/usort -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www

Re: [PHP] strict nannying ...

2012-04-15 Thread Stuart Dallas
On 15 Apr 2012, at 11:44, Lester Caine wrote: > I've got a machine set up with PHP5.4 and left the strict errors showing, and > I'm falling at the first hurdle :) > > The functions for generating URL's are used both statically and as part of > the class. STRICT complains because they are not ma

Re: [PHP] strict nannying ...

2012-04-15 Thread Stuart Dallas
On 15 Apr 2012, at 13:30, Lester Caine wrote: > Stuart Dallas wrote: >> On 15 Apr 2012, at 11:44, Lester Caine wrote: >> >>> I've got a machine set up with PHP5.4 and left the strict errors showing, >>> and I'm falling at the first hurdle :) >>&

Re: [PHP] strict nannying ...

2012-04-15 Thread Stuart Dallas
On 15 Apr 2012, at 15:02, Lester Caine wrote: > Stuart Dallas wrote: >> No code duplication but clear separation between static and instantiated >> usage. However, this is not the best way to structure this code IMO. The >> better option would be to extract the static

Re: [PHP] strict nannying ...

2012-04-15 Thread Stuart Dallas
On 15 Apr 2012, at 19:41, Lester Caine wrote: > Stuart Dallas wrote: >>> Stuart Dallas wrote: >>>> >> No code duplication but clear separation between static and >>>> >> instantiated usage. However, this is not the best way to structure this

Re: [PHP] sms class

2012-04-17 Thread Stuart Dallas
On 17 Apr 2012, at 20:17, Marc Guay wrote: > Woah. Is that good luck or bad luck? Inherently? Neither. To you? Whatever. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] sms class

2012-04-17 Thread Stuart Dallas
On 17 Apr 2012, at 20:50, Lester Caine wrote: > Ignoring the wallies I'd rather be a wally surrounded by fishmongers than a fishmonger surrounded by wallies. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vis

Re: [PHP] Variable Question

2012-04-19 Thread Stuart Dallas
27;word_'.$i} = stripslashes( eval ("echo $row['word_$i']") ); Eww, nasty. Why the eval? Why not just stripslashes($row['word_'.$i])? Variable variables have their uses, but this seems to be one of those cases where you're trying to get the square peg thr

Re: [PHP] SqLite INSERT want not write

2012-04-19 Thread Stuart Dallas
can run php -l script.php to see those errors, but it would be better to set the error_reporting and display_errors values in php.ini on your development system/server. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] SqLite INSERT want not write

2012-04-19 Thread Stuart Dallas
On 19 Apr 2012, at 18:54, Silvio Siefke wrote: > On Thu, 19 Apr 2012 18:39:00 +0100 > Stuart Dallas wrote: > >> The script has syntax errors in it. You won't see those errors because PHP >> won't run a script with syntax errors, so it won't modify the &

Re: [PHP] SqLite INSERT want not write

2012-04-19 Thread Stuart Dallas
opaste.info/63fe0a9148.html Using date() is not valid there. It's possible now() might work (don't use PDO so I dunno for sure), otherwise you'll need to bind that parameter in the same way you're binding the others. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PH

Re: [PHP] SqLite INSERT want not write

2012-04-19 Thread Stuart Dallas
7;, :autor, :title, :teaser, :content);"; Incidentally, the time() in the date call is unnecessary since that's the default value for that parameter. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] SqLite INSERT want not write

2012-04-19 Thread Stuart Dallas
$ ls -l > insgesamt 4 > -rw-rw-rw- 1 siefke siefke 4096 19. Apr 21:25 silviosiefke.db What does the script output? The only path through your script that doesn't display something is if there are missing $_POST elements, and the PDO errors you've shown previously suggest that they&#x

Re: [PHP] preg_replace_callback

2012-04-20 Thread Stuart Dallas
Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] session lost problem

2012-04-23 Thread Stuart Dallas
you're describing is as designed. When you call session_commit() you are saving and closing the session, so nothing done to $_SESSION after that point will be saved, even if you call session_commit() again. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] session lost problem

2012-04-23 Thread Stuart Dallas
Please don't top-post, and please include the list when replying. On 24 Apr 2012, at 06:35, bug zhu wrote: > 2012/4/24 Stuart Dallas >> On 24 Apr 2012, at 05:58, bug zhu wrote: >> >> > there are tow php files a.php and b.php, >> > >> > cont

Re: [PHP] What is wrong here?

2012-04-25 Thread Stuart Dallas
e developing with notices switched off. This is a very bad idea because it hides simple errors like this. See the manual for details: http://php.net/error_reporting. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Find/count different word in a text

2012-04-25 Thread Stuart Dallas
a go and if you have problems post the code and we can help you some more. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] url string being split

2012-04-26 Thread Stuart Dallas
e > giving someone an open invitation. A "query string" has nothing to do with databases. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] undefined offset

2012-04-26 Thread Stuart Dallas
the same size naturally. So - what is it telling me? For every iteration of the loop or just once? If it's just once then you're not handling the possibility of a blank line. If more than once then the file doesn't contain what you think it contains. -Stuart -- Stuart Dallas

Re: [PHP] code deployment through php

2012-05-01 Thread Stuart Dallas
ol. I know it can look complicated, but it's really not, and it will make it far easier to keep track of what you're doing and what changes are deployed where than the system you described. I strongly recommend you reconsider. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/

Re: [PHP] howto get pgUp, pgDn, delete, home and end keycodes in CLI PHP script

2012-05-04 Thread Stuart Dallas
t; > Anybody here know how to do this? As far as I know you can't do this through any of the built-in functions. However, the ncurses extension may give you what you need: http://php.net/ncurses -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] regexp novice

2012-05-18 Thread Stuart Dallas
t; have a fix for that I'd appreciate it - otherwise I'll have to devote some > book-time to mastering this string and come up with a fix myself. Based on your requirements, 00:40 is completely valid. Why do you think it should be invalid? -- Stuart Dallas 3ft9 Ltd http://3ft9.com/

Re: [PHP] regexp novice

2012-05-18 Thread Stuart Dallas
On 18 May 2012, at 14:41, Jim Giner wrote: > "Stuart Dallas" wrote in message > news:cc22e241-c1df-48e9-bf06-8a638a356...@3ft9.com... >> On 18 May 2012, at 14:32, Jim Giner wrote: >> >>> OK - I don't yet understand how this works, but it seems to wo

Re: [PHP] regexp novice

2012-05-18 Thread Stuart Dallas
personal, just my opinion, which is all I have to offer. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/

Re: [PHP] Need help on increment date

2012-05-24 Thread Stuart Dallas
"2008-02-28" this code give output 2012-03-01. But it > should be 2008-02-29. Where I am getting wrong. Works fine for me: http://dev.stut.net/php/increment_date.php Have you extracted the above from other code, or are you seeing this behaviour with just those two lines? -Stuart

Re: [PHP] Function size

2012-05-29 Thread Stuart Dallas
g job. If you think being able to deal with a large block of code makes you a better programmer, YOU are in the wrong job. A good programmer, in my opinion, knows that the simpler and more discrete each block of code is the less room there is for errors. An excellent programmer knows that 100-line functions are generally impossible to adequately unit test. The bottom line is to use your common sense rather than sticking to some arbitrarily prescribed, measurable target. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function size

2012-05-29 Thread Stuart Dallas
On 29 May 2012, at 14:38, Tedd Sperling wrote: > On May 29, 2012, at 7:17 AM, Stuart Dallas wrote: >> >> It's a theory, yes, and for many people it may be valid, but it's not for >> me. The resolution of your screen; the size of your font; the colour scheme &g

Re: [PHP] Simple Email System (SES) Provider

2012-06-02 Thread Stuart Dallas
rks in your universe, but 4 * 150 != 350 in the one in which I live :) Don: Options... * Switch to a dedicated server, or a VPS host that doesn't have that limit. * Use Gmail or another hosted email provider (may have a similar limit but I've never run into it with Gmail). * Use a service like http://sendgrid.com/. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] A problem about sessions

2012-06-07 Thread Stuart Dallas
_SESSION get saved to disk only > at the end of the script, after the "very long code" has been executed. > There is a way to save the session manually just after ob_end_flush()? http://php.net/session_write_close -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] reload page without use header

2012-06-17 Thread Stuart Dallas
a page using a meta tag in your HTTP head block -- http://en.wikipedia.org/wiki/Meta_refresh -- but if you're wanting to redirect the user to another page you really should use an HTTP header. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/

Re: [PHP] database hell

2012-07-12 Thread Stuart Dallas
multiple hosts you will want to add that to every single mysql_* function call that supports it, otherwise you could end up running queries on the wrong database. You may also want to note that using the mysql_* functions is now discouraged in favour of MySQLi or PDO: http://php.net/mysqlinfo.api.choosing -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/

Re: [PHP] Regex

2012-07-27 Thread Stuart Dallas
On 27 Jul 2012, at 18:07, Ethan Rosenberg wrote: > I've tried everything and am still stuck. > > A regex that will accept numbers, letters, comma, period and no other > characters /^[0-9a-zA-Z,\.]+$/ -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General M

Re: [PHP] syntax error breaking in and out of php into html code

2012-08-26 Thread Stuart Dallas
; the content that code was intended to add. Let me guess, line 356 is the last line of the file? That error is only caused by mis-matched braces, so the code you are deleting *must* contain either an errant opening brace or be missing a closing brace. -Stuart -- Stuart Dallas 3ft9 L

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Stuart Dallas
t to provide several classes then I'd require an init.php in each plugin folder and have that register the class names with the class loader. It could also then pass along some meta information such as a description of what each class does. If this is for use in web requests you might want to stick to what you currently have as there's a lot less overhead. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Stuart Dallas
On 27 Aug 2012, at 14:29, Mark wrote: > On Mon, Aug 27, 2012 at 12:41 PM, Stuart Dallas wrote: >> On 26 Aug 2012, at 19:42, Mark wrote: >> >>> 2. Let the plugin itself (so in this case PluginOne.php) open itself >>> and register it to the PluginLoader. >>

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Stuart Dallas
On 27 Aug 2012, at 14:52, Mark wrote: > On Mon, Aug 27, 2012 at 3:46 PM, Stuart Dallas wrote: >> On 27 Aug 2012, at 14:29, Mark wrote: >> >>> On Mon, Aug 27, 2012 at 12:41 PM, Stuart Dallas wrote: >>>> On 26 Aug 2012, at 19:42, Mark wrote: >>>

Re: [PHP] ksort by value

2012-09-03 Thread Stuart Dallas
oes, with a column for whether they "maintain key association." In this case you want http://php.net/asort -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array.sorting.php

2012-09-04 Thread Stuart Dallas
http://php.net/uksort -- Sent from my leaf blower On 4 Sep 2012 18:39, "John Taylor-Johnston" wrote: > > David OBrien wrote: > >> On Tue, Sep 4, 2012 at 1:15 PM, John Taylor-Johnston < >> jt.johns...@usherbrooke.ca >> > >> wrote: >> >> Hi, >> Sortin

Re: [PHP] a little trickery

2012-09-08 Thread Stuart Dallas
23456789_R13_1.jpg > > My goal: get the MSL_No out of the DB and concatenate anything after it so I > would end up with the whole image name.. > > I hope this all made sense. :-/ Is there just one image in the folder that starts with the 9 digit number? In that case it's

Re: [PHP] a little trickery

2012-09-09 Thread Stuart Dallas
t; >> > function completeImageFilename($prefix) >> { >>$matches = glob('images/property_pics/'.$prefix.'*'); >>return $matches[0]; >> } >> >> echo ''; >> ?> >> >> If you need to extract more than one image filename you should be able to >> modify that pretty easily. > > YEOW! LOL I looked at this and I'm very stumped on 1 thing. How in the world > did you get $prefix to contain the image name without first assigning it to > $prefix? I understand the rest, but. Holy smokes, that's blown my mind. > :-/ I really can't tell whether you're being sarcastic, so I'll assume you're not. Read about function arguments: http://php.net/functions.arguments -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to limit source IP in PHP

2012-09-14 Thread Stuart Dallas
Sorry for the top post but I don't have my laptop with me and, well frankly I'm too tired to be arsed! I think the confusion is coming from the word bind. I don't think man people at aware of he difference between binding a socket and having it listen on the port to which it's bound. People... wh

Re: [PHP] Static constructor support

2012-09-26 Thread Stuart Dallas
On 26 Sep 2012, at 22:13, Yves Goergen wrote: > I couldn't find out whether PHP supports static constructors, and how > the syntax is. The web and the PHP manual don't mention it. So is it not > supported? If it is, is there a PHP version restriction? If you mean what C# calls a static construct

Re: [PHP] Static constructor support

2012-09-26 Thread Stuart Dallas
On 26 Sep 2012, at 22:29, Yves Goergen wrote: > On 26.09.2012 23:20 CE(S)T, Stuart Dallas wrote: >> If you mean what C# calls a static constructor, no that does not >> exist in PHP, but you can fake it. > > Okay, thank you for the quick info. > > How do other

Re: [PHP] php can't insert data mysql table

2012-10-01 Thread Stuart Dallas
echo 'Please enter all of the information to add > your high score.'; >} > } > ?> > > > > >Name: > >Score: > > >Screenshot: > > > > > > > > Results in this output:

Re: [PHP] select function

2012-10-25 Thread Stuart Dallas
(true) { case $Auth == 0: break; case $A == 1: echo('$Aprint_list'); break; case $B == 1: echo('$Bprint_list'); break; case $A == 2: echo('$Aprint_list'); echo('$Aprint_list'); break; case $B == 2: echo('$Bprint_list'); echo('$Bprint_list'); break; default: break; } -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Differentiate Line breaks and Paragraphs

2012-11-02 Thread Stuart Dallas
e user wrote > only one new line character. Something like this should work… '.str_replace($str, '\r\n\r\n', '').''); ?> Untested but that should do what you're looking for. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/

Re: [PHP] Rest Authentication

2012-11-11 Thread Stuart Dallas
menting http authentication and the hassle of apache > configurations? HTTP auth doesn't need to involve the web server at all: http://stut.net/2012/11/11/snippet-http-authentication/ -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsu

Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-11 Thread Stuart Dallas
example is at http://www.lakesidesurrey.co.uk/test.php. > > You can also me what I am doing wrong? Compare timestamps instead, i.e. time() for the current time, and what you get back from strtotime for the end date. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/

Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-11 Thread Stuart Dallas
ill outputting the wrong thing. > > I just can't figure out what's wrong. Your comparison is backwards: if ($todaydate > $showenddate): should be if ($todaydate < $showenddate): -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ > On 11 November 2012 18:48, shiplu wro

Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-11 Thread Stuart Dallas
rrent time is later than the end date of the show, tell them the date of the show hasn't arrived yet. What you mean is: if the current time is later than the end of the show, tell them the show has ended. if ($todaydate < $showenddate): echo "The date of the show has not yet arr

Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-11 Thread Stuart Dallas
On 11 Nov 2012, at 19:24, "Terry Ally (Gmail)" wrote: > I reversed it as you suggested and every future show is displaying as having > ended. In that case the code you're showing us is not the code you're running, because that's the obvious error in test.php.

Re: [PHP] Re: Switch - Case Statement Questions

2012-11-17 Thread Stuart Dallas
lance providing a fast, efficient, correct solution and minimising maintenance issues. I see neither side being compromised by using a switch statement in this manner, in fact I see both sides potentially getting a boost. Just because the usage is unfamiliar or even surprising to you doesn't mean it's wrong. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Switch - Case Statement Questions

2012-11-19 Thread Stuart Dallas
a lot of > people did 30 years ago on 280), not 100, and to make judgements accordingly. > Equally, I have certain expectations when I see a switch statement; it trying > hard to look like if-elseif-etc is not one of them. Why is it their fault for doing 100mph and not yours for assuming they're only doing 70mph? I'm not saying they're right to be doing 100mph, but I'm definitely saying you're wrong for assuming they're only doing 70mph. Assumptions are the mother of all f*** ups. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: shared memory on php servers?

2012-12-04 Thread Stuart Dallas
are separate daemons so you can access them from multiple servers. Also, as Sebastian says, a database is another option unless you have a good reason to want the data in shared memory rather than a DB. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Can't use the SNMP class

2012-12-04 Thread Stuart Dallas
The class is only available in PHP 5.4+. http://php.net/snmp.construct -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

<    1   2   3   4   5   6   >