Re: [PHP] counting records in db

2006-10-26 Thread Dave Goodchild
$query = mysql_query(" SELECT COUNT(*) as NoOfRecords FROM customers WHERE last_name = 'Smith'"); $result = mysql_result($query, 0);

Re: [PHP]

2006-10-26 Thread Dave Goodchild
Wow, pretty aggressive. No reason to EVER use xhtml - hmmm, good attitude, good evolutionary sense. Let's wait and see. I believe the gent was referring to the use of 'selected="selected"' and trying to encourage good habits in someone - which I think is commendable. Why so angry?

Re: [PHP] counting records in db

2006-10-26 Thread Dave Goodchild
Why would you want to do that? Think about what you're trying to do. In the first case you want a COUNT of records in the database, in the second you just want to see if the user/password combination or whatever exist, so just use a normal SELECT query, no need to use the wrong tool for the job...

Re: [PHP] natsort()

2006-10-26 Thread Dave Hamber
natsort() places the array elements in natural order but not the keys. If you want your elements printed using "print" in a loop either reorganise the keys first or use "foreach". The easiest method would be to use: foreach($dl as $filename){ print $filename; } If you insist on using

Re: [PHP] Problem with manual running PHP script

2006-10-27 Thread Dave Goodchild
No, it's running otherwise he wouldn't even see the function error message. I run php scripts on Fedora all the time - all -q does is suppress HTTP headers. The Oracle extension may not be installed?

Re: [PHP] session id contains illegal characters

2006-10-27 Thread Dave Goodchild
Also, why are you assigning the result of session_id() into a variable that is then passed into $_SESSION. Seems overcomplex and redundant - why not just call session_id() when you need it? Just a thought.

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Dave Hamber
Sorry, slight adjustment, make that $t=time()-31; in the first line so that the script runs immediately. > You could run the script as a daemon. man daemon. > > The sloppy way of running the script every 30 seconds would be to use sleep(30), but that would cause the script to run at 30 seconds

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Dave Hamber
You could run the script as a daemon. man daemon. The sloppy way of running the script every 30 seconds would be to use sleep(30), but that would cause the script to run at 30 seconds + execution time. If you make a loop like this you could get around that: $t=time()+31; while(true){

Re: [PHP] need help with foreach

2006-10-31 Thread Dave Hamber
Its not very clear what you want to achieve with that code snippet. If you are pulling database rows out of your database with mysql_fetch_array(), then you do not need a foreach loop. I think you may want something like this, but without knowing your database table structure and the query yo

Re: [PHP] Re: [BULK] [PHP] why so slow?

2006-11-01 Thread Dave Goodchild
The guys are right, there are many variables that could be affecting this. However, get rid of those tags before and clean up your code - it does not validate as html 4.01. The DOCTYPE should be the very first thing in the page. Once you have amended these, revalidate (validator.w3c.org). Trust m

Re: [PHP] why so slow?

2006-11-01 Thread Dave Goodchild
Take out the comment before the DOCTYPE. There should be nothing before it.

Re: [PHP] Changing the Action attribute of Form

2006-11-01 Thread Dave Goodchild
Example HTTP redirect: header('Location: http://www.google.com";);

Re: [PHP] Frameworks

2006-11-02 Thread Dave Goodchild
I am using Code Igniter on two projects at the moment and I am loving it. All the tedious, repetitive elements are reduced, security is increased and code organised in a clean fashion (you can of course mis-use frameworks but with effort they can promote and facilitate a cleaner, more modular appr

Re: [PHP] WAP?

2006-11-02 Thread Dave Goodchild
You could try creating a stylesheet for media type="handheld", not sure how stable support is.

Re: [PHP] why so slow?

2006-11-02 Thread Dave Goodchild
Better still, keep them outside the docroot. If you do insist on having them inside and insist on calling them *.inc, create an .htaccess file that stops download of *.inc files.

Re: [PHP] Permanent Links - Blog

2006-11-08 Thread Dave Goodchild
Are you writing the blog from scratch? I think you will have to get to grips with mod_rewrite (Apache).

Re: [PHP] CSS / PHP / Javascript

2006-11-15 Thread Dave Goodchild
Good responses here - I tend to use MS conditional comments as I only resort to hacks when there (seems) to be no other way, and although conditional comments are proprietary they are ignored as comments by other browsers and are hence pretty harmless. Yes, for example Opera identifies itself as

Re: [PHP] Regular expressions

2006-11-15 Thread Dave Goodchild
Is there a way to make a regular expression to match on a particular way the letters are arranged? For instance, if you had a word: THAT It could match on any word in the dictionary that had the form: 1231 preg_,match('/^(\w){1}\w\w\1$/'); would match the above on a single line for example,

Re: [PHP] cURL uses

2006-11-15 Thread Dave Goodchild
You would use cURL to achieve the things cURL is built to achieve?

[PHP] Sorting multidimensional arrays

2006-11-16 Thread Dave Goodchild
Hi all. I have a multidimensional array here: array(6) { [0]=> array(25) { [0]=> string(1) "7" ["eventid"]=> string(1) "7" [1]=> string(2) "17" ["cat_id"]=> string(2) "17" [2]=> string(13) "Tits And Bums" ["name"]=> string(13) "Tits And Bums" [3]=> string(19) "The Pleasure Centre" ["venue"]=> str

Re: [PHP] Sorting multidimensional arrays

2006-11-16 Thread Dave Goodchild
Result. Cheers! On 11/16/06, Robert Cummings <[EMAIL PROTECTED]> wrote: On Thu, 2006-11-16 at 15:28 +, Dave Goodchild wrote: > Hi all. I have a multidimensional array here: > > Bums" ["name"]=> string(13) "Tits And Bums" [3]=> string(19) "

Re: [PHP] Looping through array

2006-11-16 Thread Dave Goodchild
If you know the array elements, you may not need to loop. Why not just echo the particular array elements i.e. for example?

Re: [PHP] Re: Space in regex

2006-11-16 Thread Dave Goodchild
I ran this expression through Regex Coach: \[([A-Za-z0-9\'.-:underscore:\s]+)\|([A-Za-z0-9\'. -:underscore:]+)\] ...and it matched the patterns your describe.

Re: [PHP] PHP Programmers

2006-11-18 Thread Dave Goodchild
I charge £20(approx $40) per hour or by the job, code in php, use mysql, and produce front end in xhtml/css. Recent example: dontjustsitthere.co.uk/stage/. On 11/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Does anyone know of a good website, which rates PHP programmers? or Does anyone

Re: [PHP] security question

2006-11-23 Thread Dave Goodchild
There are a few ways of working you should adpot early as they protect against a range of security problems. Some examples: 1. Always initialised your variables. 2. If you can, turn off register_globals, or code defensively if you can't. 3. Always mistrust incoming data, validate, check contents

Re: [PHP] what settings I have to use in php 5.1.2?

2006-11-23 Thread Dave Goodchild
Also, turn off display_errors before going into production, at which stage enable error logging. On 11/23/06, Jochem Maas <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: >> [EMAIL PROTECTED] wrote: >>> hi! >>> >>> the company I work for moves our web server to other hosting company >>> (ded

[PHP] Detecting naughty sites

2006-11-28 Thread Dave Goodchild
Hi all. I am building a web app and as part of it advertisers can upload their ad image and website URL to go with their ad. Is there a good way to detect whether that site is a porn site via php? -- http://www.web-buddha.co.uk

Re: [PHP] Maybe an HTML prob?

2006-11-29 Thread Dave Goodchild
Indeed. A good habit to get into to avoid that is the write it like this: if ('yes' == $Permission) that way, if you write = rather than == you catch the error On 11/29/06, Brad Fuller <[EMAIL PROTECTED]> wrote: if ($Permission = "Yes") should be if ($Permission == "Yes") It's one of those

Re: [PHP] Preg_match - Find URL and convert to lower case

2006-11-30 Thread Dave Goodchild
Why not use strtolower on the string after the replacements have been made? -- http://www.web-buddha.co.uk

Re: [PHP] Re: Preg_match - Find URL and convert to lower case

2006-12-01 Thread Dave Goodchild
In that case you could use the /e trailing option to use strtolower on the subpattern.

Re: [PHP] Include problem

2006-12-06 Thread Dave Goodchild
Use ini_set or an .htaccess file - try the first, and if that doesn't work use an .htaccess file if you have them enabled in the server (and it's Apache of course!). On 12/6/06, Ashley Hales <[EMAIL PROTECTED]> wrote: I am trying to use includes on a free php server but I cannot set the include

Re: [PHP] Ensuring that variable contains a number

2006-12-07 Thread Dave Goodchild
is_numeric will return true for a positive or negative number.

[PHP] Sendmail issue

2006-03-02 Thread Dave Goodchild
lias after editing but when I send the email nothing happens. Am I missing something. I understand that this is a php/Linux question rather than a pure php inquiry but wonder if anyone has tried to do the same thing. Thanks in advance, dave goodchild (web-buddha.co.uk)

Re: [PHP] Parsing variables within string variables

2006-04-07 Thread Dave Goodchild
Use double quotes/ On 07/04/06, David Clough <[EMAIL PROTECTED]> wrote: > > I've been bashing my head against the wall on this, and would be glad of > help to stop. > > I have a variable containing a string that contains the names of > variables, and want to output the variable with the variables

Re: [PHP] What does this mean:

2006-04-08 Thread Dave Goodchild
...is a concise, if less readable way, to echo the value of arse. It is only used to echo a value. To do anything else, for example, call a method, use the second approach you describe. In fact, you already seem to know the difference, so why the question? Are you trying to replace this notation

Re: [PHP] What is best way to do handle audio files?

2006-04-09 Thread Dave Goodchild
You will probably find a great deal of list members well versed in mysql as it meshes so well with php, so ask away old bean. On 09/04/06, Nicholas Couloute <[EMAIL PROTECTED]> wrote: > > Yea, okay looks like I am going to be using mysql cause I want an > organized site by genre, author etc. I goi

Re: [PHP] how to assign a value to a variable inside a class

2006-04-10 Thread Dave Goodchild
use a setter function. Direct var assignments must be simple constants. A setter function enforces encapsulation. On 10/04/06, Merlin <[EMAIL PROTECTED]> wrote: > > > Hi there, > > I would like to assign a value inside a class like this: > > var $db_username = $old_name; > > Unfortunatelly this do

Re: [PHP] RSS Generation

2006-04-10 Thread Dave Goodchild
If you want to serve .xml files as php, make the relevant change in the http.conf file (if you are using apache). On 10/04/06, Michael Crute <[EMAIL PROTECTED]> wrote: > > On 4/10/06, Robbert van Andel <[EMAIL PROTECTED]> wrote: > > First off, and I'm sorry that this isn't a PHP specific question,

[PHP] Offshore hosting

2006-04-20 Thread Dave Goodchild
Hi all, I AM a PHP developer and I KNOW this is off topic, so apologies, but don't respond if you don't feel like it. One of my clients has a poker site which we have to move to an offshore dedicated server located in Cyprus, Malta, Isle Of Man, Alderney or Costa Rica. I am finding it hard to find

Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-23 Thread Dave Goodchild
Tiresome. On 23/04/06, Brian V Bonini <[EMAIL PROTECTED]> wrote: > > On Sat, 2006-04-22 at 14:16, Jochem Maas wrote: > > with regard to Suresh - do you, Brian, know how many times he has posted > similar > > question to this list this year? (this is the first time he has even > given > > an indica

Re: [PHP] PHP Standard style of writing your code

2006-04-25 Thread Dave Goodchild
Chcek out the PEAR site for a pretty good style, but then again it is a matter of preference and I code any way I choose unless I am working within a team where some kind of consistency makes sense. On 25/04/06, Martin Zvarík <[EMAIL PROTECTED]> wrote: > > Hi, > I see everyone has its own way

Re: [PHP] Re: forms and dynamic creation and unique field names

2006-04-27 Thread Dave Goodchild
Foreach. Please try and read the manual, this is very basic stuff that could be gleaned in 5 minutes. On 27/04/06, Barry <[EMAIL PROTECTED]> wrote: > > Jason Gerfen schrieb: > > I have come upon a problem and am not sure how to go about resolving > > it. I have an web form which is generated dyna

[PHP] Bug madness

2006-04-27 Thread Dave Goodchild
Hi all, I have been mashing my head trying to debug a web app I have written, the deadline is tomorrow and after implementing some changes a subtle and difficult-to-pin-down bug has emerged. I am not going to include code as there is too much of it, but here is the general issue: The app consists

[PHP] Help!

2006-04-28 Thread Dave Goodchild
Hi all - I am attempting to solve some maddening behaviour that has me totally stumped and before I take a blade to my throat I thought I would pick the brains of the group/hive/gang. I am working on a viral marketing application that uses multipart emails to notify entrants of their progress in

[PHP] Help!

2006-04-28 Thread Dave Goodchild
Hi all - I am attempting to solve some maddening behaviour that has me totally stumped and before I take a blade to my throat I thought I would pick the brains of the group/hive/gang. I am working on a viral marketing application that uses multipart emails to notify entrants of their progress in

Re: [PHP] Help!

2006-04-28 Thread Dave Goodchild
when I submit is a white page - no errors (display_errors is on and error reporting set to the default level) and no html. Nada. When I try and view source I am given the browser re-post warning. On 28/04/06, T.Lensselink <[EMAIL PROTECTED]> wrote: Hey Dave, Besides from example two bei

Re: [PHP] Help!

2006-04-28 Thread Dave Goodchild
e browser re-post warning. > > On 28/04/06, T.Lensselink <[EMAIL PROTECTED]> wrote: >> >> Hey Dave, >> >> Besides from example two being the correct way to call array elements. I >> think it has something todo with error reporting. It's the onl

Re: [PHP] Help!

2006-04-28 Thread Dave Goodchild
, Barry <[EMAIL PROTECTED]> wrote: Dave Goodchild schrieb: > I would do but there are 5000+ lines and no indication of where the > error is > occurring. I have just copied the demo version into the same dir and it > works fine - and that version calls the same classes (includes). The p

Re: [PHP] Help!

2006-04-28 Thread Dave Goodchild
Misleading to who? I own the app and am the only person who will ever use it. Rather anal. On 29/04/06, Martin Alterisio <[EMAIL PROTECTED]> wrote: 2006/4/28, Barry <[EMAIL PROTECTED]>: > > Martin Alterisio schrieb: > > 2006/4/28, Dave Goodchild <[EMAIL PROTECTED

Re: [PHP] Help!

2006-04-29 Thread Dave Goodchild
29/04/06, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, April 28, 2006 8:11 am, Dave Goodchild wrote: > I am working on a viral marketing application that uses multipart > emails to > notify entrants of their progress in the 'game'. I have a demo version > which > w

Re: [PHP] Help!

2006-04-29 Thread Dave Goodchild
Wrong - both versions run on the same server (virtual hosts but same php.ini). I will check the values however, thanks! On 29/04/06, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, April 28, 2006 8:57 am, T.Lensselink wrote: >> In the demo version the script accesses the $_GET array - an examp

Re: [PHP] we are looking for experienced php programmers full time freelance...

2006-04-29 Thread Dave Goodchild
Hear hear. This is not the place for this kind of poison. Open source - open mind. On 29/04/06, Paul Novitski <[EMAIL PROTECTED]> wrote: At 10:46 AM 4/29/2006, tedd wrote: ... >"I have found" it is simply a waste of my time to try to find >profitable common ground. They are concerned with one t

Re: [PHP] c99shell

2006-04-30 Thread Dave Goodchild
Hey. That is not a good php.ini configuration. 1. display_errors should be disabled in production as it may output path info to the browser. 2. register_globals should be disabled (default in php5) as it allows scripts to be polluted with tainted data. 3. I would also disabled short_open_tags - n

Re: [PHP] Filesystem or database

2006-05-01 Thread Dave Goodchild
Also, try using mysql_pconnect rather than mysql_connect to set up a persistent database connection. On 01/05/06, Wolf <[EMAIL PROTECTED]> wrote: Personally I would do the DB option and timestamp that sucker as well. I use it to set/copy :IP, user, SessionID, timestamp. I found it simpler and

Re: [PHP] Re: php mysql problem

2006-05-02 Thread Dave Goodchild
Exactly - I don't think you really understand how a relational database works. The ids are retained as they may relate to records in another table. Internal sorting order is of no relevance at the application level. I think you need to rethink your design a little. On 02/05/06, T.Lensselink <[EMA

[PHP] Question regarding apc

2006-05-02 Thread Dave Goodchild
Hi all. I have heard that functions like apc_define_constants and apc_load-constants are useful in speeding up mass definition of constants but could someone tell me how many constants you would have to have before this became appropriate. I am writing an app that loads a number of constants into

Re: [PHP] Syntax Oddity

2006-05-02 Thread Dave Goodchild
Hmmm. The only time I ever use anything remotely like that is in a loop or other code are where I don't want anything to happen ie for ($foo=0;$foo<=10;$foo++) { On 02/05/06, Martin Alterisio <[EMAIL PROTECTED]> wrote: 2006/5/2, Richard Lynch <[EMAIL PROTECTED]>: > > Does anybody have a ratio

[PHP] XSLT issue

2006-05-03 Thread Dave Goodchild
Hi all, maybe slightly off list but I AM using php and Sablotron to generate xslt. I have a live poker games feed that takes the following format: 10035522 Texas Holdem Texas Holdem Poker 5 0.5 USD Running 110 Normal NL 1 Regular No Limit 2006-04-24T07:00:00

Re: [PHP] XSLT issue

2006-05-03 Thread Dave Goodchild
Thanks for our help. Tried both methods and I get this: *Warning*: Sablotron error on line 31: XML parser error 4: not well-formed (invalid token) in */home/stevemas/public_html/dg/xslt/xslt_processor.php*on line *14* On 03/05/06, T.Lensselink <[EMAIL PROTECTED]> wrote: > Hi all, maybe slightl

Re: [PHP] XSLT issue

2006-05-03 Thread Dave Goodchild
On 03/05/06, Dave Goodchild <[EMAIL PROTECTED]> wrote: Thanks for our help. Tried both methods and I get this: *Warning*: Sablotron error on line 31: XML parser error 4: not well-formed (invalid token) in */home/stevemas/public_html/dg/xslt/xslt_processor.php*on line *14

Re: [PHP] XSLT issue

2006-05-03 Thread Dave Goodchild
;starttime" /> > > > > > > > On 03/05/06, Dave Goodchild <[EMAIL PROTECTED]> wrote: >> >> Thanks for our help. Tried both methods and I get this: >> >> *Warning*: Sablotron

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

2006-05-03 Thread Dave Goodchild
That is not polymorphism - that is multiple inheritance. Java can't do that either, and uses a much cleaner method - interfaces. And interfaces are supported in php5. So php does allow it. Not polymorphism - multiple inheritance. Not multiple inheritance - interfaces. On 03/05/06, Jochem Maas <[E

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

2006-05-03 Thread Dave Goodchild
Not multiple inheritance. Inheritance. Not multiple orgasm. Intercourse. On 03/05/06, Jochem Maas <[EMAIL PROTECTED]> wrote: Dave Goodchild wrote: > That is not polymorphism - that is multiple inheritance. Java can't do well that clears up my misuse of the terminology! >

Re: [PHP] array insights

2006-05-03 Thread Dave Goodchild
use: $new_array = array_chunk($input_array, 3)); this will split your original array into a number of arrays with three elements in each and trash the original keys. If you want to preserve the keys pass a third paramater (true). Hope this helps. On 03/05/06, Jason Gerfen <[EMAIL PROTECTED]>

Re: [PHP] XSLT issue

2006-05-04 Thread Dave Goodchild
quot;, $xml); $tournaments = array_slice($tournaments, 0, 3); //maybe 4 $xml = implode("", $tournaments); $xml .= "\n"; "Crude, but effective Captain" -- Spock On Wed, May 3, 2006 5:40 am, Dave Goodchild wrote: > Hi all, maybe slightly off list but I AM using php and Sa

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

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

Re: [PHP] Quotation marks considered harmful

2006-05-04 Thread Dave Goodchild
You can: list item for example On 04/05/06, John Hicks <[EMAIL PROTECTED]> wrote: John Wells wrote: > Personally, I get tired (and confused) when having to escape all of > those quotes like in the string you're trying to echo above. Perhaps > you'd consider HEREDOC as an alternative

Re: [PHP] Quotation marks considered harmful

2006-05-04 Thread Dave Goodchild
Surely you can't then interpolate the variables? On 04/05/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: You can simplify usi single instead double quotes: echo ' view delete '; :) -afan > John Wells wrote: >> Personally, I get tired (and confused) when having to escape all of >> tho

Re: [PHP] heredoc question

2006-05-05 Thread Dave Goodchild
Or just use str_replace On 05/05/06, John Nichel <[EMAIL PROTECTED]> wrote: Al wrote: > How can I include "place holders" for variables in a heredoc such that > after the heredoc is declared, I can assign the variables? > > I have a config file with a heredoc string declared. I'd like to keep

Re: [PHP] PHP URL query

2006-05-10 Thread Dave Goodchild
register_globals is disabled on your system, which is a good thing. So you have to reference all values sent via a form using GET with the $_GET superglobal array as follows: "Welcome to our web site, {$_GET[var]}" or 'Welcome to our web site, ' . $_GET['var'] etc etc On 10/05/06, IraqiGeek <

Re: [PHP] remove html tags in text?

2006-05-11 Thread Dave Goodchild
strip_tags On 11/05/06, Bing Du <[EMAIL PROTECTED]> wrote: Hello everyone, Say, if I have a paragraph like this: == John Smith Dr. Smith is the directory of http://some.center.com";>Some Center . His research interests include Wireless Security == Any functions that can help remove all

Re: [PHP] PHP and mySQL getting smashed...

2006-05-17 Thread Dave Goodchild
I have a site that is getting 30K+ traffic daily and it is smashing mySQL - any ideas on what to do to make the mysql connections more efficient, or anything in general. No bandwidth issue here, just the server getting killed. ...I may be wrong but using persistent connections (mysql_pconnect) m

Re: [PHP] Re: PHP & JavaScript

2006-05-19 Thread Dave Goodchild
Could you not use an id for the object as well as a name?

Re: [PHP] PHP & JavaScript

2006-05-19 Thread Dave Goodchild
I think it's a case of using id for javascript, not for css... -- http://www.web-buddha.co.uk dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css) look out for project karma, our new venture, coming soon!

Re: [PHP] Group date with category

2006-05-22 Thread Dave Goodchild
On 22/05/06, Jonas Rosling <[EMAIL PROTECTED]> wrote: Anyone know any good why to group date in a recordset in any good way? As if you categorize it in columns. Like: Category 1 Row1 -> DataData Row2 -> DataData Row3 -> DataData Category 2 Row1 -> Da

[PHP] date iteration

2006-05-23 Thread Dave Goodchild
Hi all, I am writing an app that runs a prize draw, wherein the admin chooses the duration by adding a start date and number of days for the draw to run. These values are passed into a small function that generates an array holding the start date, end date and all dates in between as follows: fun

Re: [PHP] Escaping double quotes

2006-05-25 Thread Dave Goodchild
On 25/05/06, Pavleck, Jeremy D. <[EMAIL PROTECTED]> wrote: So I'm writing this page (PHP Newbie here) and it checks to see if a var is set, if it isn't it spits out the form info like so: echo ""; Now is there a way to 'wrap' that so I don't have to escape quotes? Something like perls 'qq' funct

Re: [PHP] problems with regex

2006-05-27 Thread Dave Goodchild
On 27/05/06, Merlin <[EMAIL PROTECTED]> wrote: Hi there, I am somehow lost when it comes to regex. I am trying to remove ! and ? characters from a string. Could somebody please help me to get a working regex running for that? I tried: $str = preg_replace('/\!\?\./', ' ', $str); How about $s

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Dave Goodchild
On 30/05/06, Phil Martin <[EMAIL PROTECTED]> wrote: Hi everyone, I've made a very basic and small function to suit my needs in monitoring some hosts services. I've noticed that the script is a little bit slow because of the number of hosts and services to monitor. Is there a way to execut

Re: [PHP] regex problem

2006-06-01 Thread Dave Goodchild
On 01/06/06, Merlin <[EMAIL PROTECTED]> wrote: Hi there, I do work on following regex: ^(.*)_a[0-9](.*).htm$ This should be valid for "test_a9393.htm", but not for "9393.htm" as ther is no leading _a infront of the number. Unfortunatelly this also works for the 9393.htm file. Can somebody giv

Re: [PHP] HTML form

2006-06-01 Thread Dave Goodchild
On 01/06/06, John Meyer <[EMAIL PROTECTED]> wrote: Martin Marques wrote: > Sorry for the OT, but this is PHP output anyway :-) > > I have a bunch of code to input and modify data through an HTML form. > When I modify the options, some are in text, others > in textarea, and some are in select opt

Re: [PHP] If value is odd or not

2006-06-02 Thread Dave Goodchild
On 02/06/06, Jonas Rosling <[EMAIL PROTECTED]> wrote: Hi all, is there any easy why to check if a value is odd or not? Thanks // Jonas Yep, use the modulo operator like so: if ($value % 2 ==0) $odd = false; -- http://www.web-buddha.co.uk dynamic web programming from Reigate, Surre

Re: [PHP] Running Scripts from the Command Line in Linux

2006-06-08 Thread Dave Goodchild
On 08/06/06, OOzy Pal <[EMAIL PROTECTED]> wrote: How can I run a .php script from the command in Linux? 1. run /usr/local/bin/php (or wherever the php binary is, run which php to find out) scriptname 2. add the hash bang to the start of the script and run it by typing the scriptname. --

Re: [PHP] order of elements in $_POST super global

2006-06-08 Thread Dave Goodchild
On 08/06/06, Ben Liu <[EMAIL PROTECTED]> wrote: Hello All, I'm using a form (method="POST") to collect 30 boolean values from the end user using a series of checkboxes in the form. The form is arranged in a table so that the 30 check boxes are not a long list but rather three columns (with rela

Re: [PHP] parsing out quoted text

2006-06-09 Thread Dave Goodchild
$str='bass "electric organ" bagpipes'; $parser($str); $query="SELECT * FROM table WHERE tb_instr = "bass" > AND tb_instr = "electric organ" //< AND tb_instr = "bagpipes"; Anybody know where I can just copy code that will do the above? thanks Why will there be a quoted string in the

Re: [PHP] arrays

2006-06-09 Thread Dave Goodchild
Hola Jesus. Hablo un pocitio espanol, pero en ingles no estoy seguro que quieres decir. Si te ayudara, envia el mensaje otra vez en espanol y tratare comprender. On 09/06/06, Jesús Alain Rodríguez Santos <[EMAIL PROTECTED]> wrote: if I have two arrays, example: $a = array ("one", "two", "three

Re: [PHP] Skip first 4 array values

2006-06-09 Thread Dave Goodchild
On 09/06/06, Jonas Rosling <[EMAIL PROTECTED]> wrote: Is there any way you can skip for example the first 4 array values/posisions in an array no matter how many values it contains? Thanks // Jonas Skip $array[0], $array[1], $array[2], $array[3] if you are talking about integer-indexed arrays.

Re: [PHP] Tables vs. databases

2006-06-09 Thread Dave Goodchild
On 09/06/06, Antonio Bassinger <[EMAIL PROTECTED]> wrote: Hi gang, Situation: I've a HTTP server. I intend to run a file upload service. There could be up to 1 subscribers. Each saving files up to 10 MB. I made a proof-of-concept service using PHP & MySQL, where there is a single database

[PHP] Curio

2006-06-10 Thread Dave Goodchild
Just a question out of curiousity for the language lawyers out there. Why is it illegal to begin a variable name with a number in php? -- http://www.web-buddha.co.uk dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css) look out for project karma, our new venture, coming soon

Re: [PHP] Short writage of clauses

2006-06-12 Thread Dave Goodchild
On 12/06/06, Barry <[EMAIL PROTECTED]> wrote: Hi everyone! Well i do know that you can write IF as ( ? : ) but what i am asking about is something like this: if (a = 1 OR a = 2) is it anyway possible to write it like: if (a = 1 OR 2) I know this is wrong because "2" will always be true ...

Re: [PHP] weird problem in php

2006-06-12 Thread Dave Goodchild
On 12/06/06, weetat <[EMAIL PROTECTED]> wrote: Hi all , I have using php 4.3.2 and mysql database. I have a form which have tag which have the value for example "-New York". When use submit the form , i need to find the first occurence of "-" , i use strpos function as shown below : $

Re: [PHP] php->html "rendering"

2006-06-12 Thread Dave Goodchild
On 12/06/06, Ryan A <[EMAIL PROTECTED]> wrote: Hey all, heres the short explanation of what I am supposed to do, I need to render/convert the entire site to normal html pages so that it can be loaded onto a cd and given out. The good news is that the whole site has not yet been built so i can

Re: [PHP] preg_replace \\1 yIKES!

2006-06-13 Thread Dave Goodchild
On 13/06/06, tedd <[EMAIL PROTECTED]> wrote: At 11:33 AM -0700 6/13/06, sam wrote: >Wow this is hard I can't wait till I get the hang of it. > >Capitalize the first letter of a word. Why not use ucfirst(), that is what the function is for. -- ---

Re: [PHP] Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Dave Goodchild
On 15/06/06, Micky Hulse <[EMAIL PROTECTED]> wrote: Hi, I am looking for a very simple blog software... I would prefer something that functions well with CSS and is standards compliant. I am getting tired of setting-up the bigger full-featured blogging packages for small/quick/simple sites. It

Re: [PHP] basic php problem

2006-06-15 Thread Dave Goodchild
On 15/06/06, Ross <[EMAIL PROTECTED]> wrote: I want to set a page number of a page if(!isset($_REQUEST['page'])) { $page =$_REQUEST['page'] + 1; echo "page is ".$page; // this echos out page is 1 } The problem is when I try and use $page further down in the body $page is 0 Question

Re: [PHP] templating

2006-06-22 Thread Dave Goodchild
On 22/06/06, Miles Thompson <[EMAIL PROTECTED]> wrote: At 08:10 AM 6/22/2006, Ryan A wrote:>Hi,>>A pal of mine needed some help on his project, he is>using a "header" and "footer" file to "template" his>project... but its gotten a bit complicated as he has >a few dynamic parts in the header and foo

[PHP] Accessibility problem with delegates

2008-10-20 Thread Dave Kok
other class can call them. This seems rather strange as the callback functions have no meaning when invoked arbitrarily. So I was wondering whether I am doing something wrong. Could someone comment? Regards, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

[PHP] Show Results one at a time ?

2004-01-29 Thread Dave Carrera
is has to be a combo between js and php. Thank you in advance for any help or examples with the issue. Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004 -- PH

RE: [PHP] Show Results one at a time ?

2004-01-29 Thread Dave Carrera
Wherever I put sleep(1), notice the comments, in the func all it dose is wait 10 seconds then shows the full output and not each result 1 at a time to the screen. Any further guidance is very much appreciated. Dave C -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]

[PHP] General Function usage question (simple)

2004-02-13 Thread Dave Carrera
the brackets of a function. What do they do ? Why are they in there ? And how are they used within an application ? I am very sorry for the basic question but I am new to the world of functions. Thank you in advance for any explanations, help or explanatory urls that you may impart. Dave C

<    2   3   4   5   6   7   8   9   10   11   >