Fwd: [PHP] XHTML Validation problem

2008-05-02 Thread Simon Welsh

Forgot to reply all

Begin forwarded message:


From: Simon Welsh [EMAIL PROTECTED]
Date: 3 May 2008 4:18:04 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] XHTML Validation problem


On 3/05/2008, at 4:13, It Maq wrote:


Hi,

I have a page that displays data entered by the user. There is one  
user that entered the character  inside the text he typed. For  
this case the xhtml validation fails and gives me the following  
error:
character  is the first character of a delimiter but occurred  
as data.


I'm wondering if there is a way to avoid this error. The page  
itself is valid and fails just in the case the user enters the   
character.


Thank you


 


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Pass the input through htmlspecialchars().
---
Simon Welsh
Admin of http://simon.geek.nz/

Who said Microsoft never created a bug-free program? The blue screen  
never, ever crashes!


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e






---
Simon Welsh
Admin of http://simon.geek.nz/

Who said Microsoft never created a bug-free program? The blue screen  
never, ever crashes!


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] OS X 10.5.2

2008-04-18 Thread Simon Welsh


On 19/04/2008, at 2:31, Eric Butera wrote:

On Fri, Apr 18, 2008 at 8:10 PM, Lee Perry [EMAIL PROTECTED] wrote:
Hi, I need pdo_msql and GD2 extension support in my php  
environment, but as
I am sure you are aware the default build that comes with leopard  
on the mac
is lacking these extensions. what I need is a way to either install  
them or
if I really have to compile php with these included. I have never  
had to do
this as I have been using windows until recently. If I need to  
install php
from source it seems I will also have to compile apache, will this  
replace

the versions of php and apache that are bundled with os x 10.5.2. I'm
looking for a clean solution to this problem I don't want multiple  
versions
etc. I have spent over 10 hours on google looking for a solution to  
this

before emailing you and so far there does not seem to be a clear and
consistent way to resolve this. I work as a php developer and just  
got the
MacBook Pro thinking it would be nicer to work with, what a  
nightmare.



Kind Regards,

Lee.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Check out the entropy.ch build.  I use it at work.  I can't remember
if it has pdo support or not though since I don't use it.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




I use the build from entropy.ch as well. You'll want the one in the  
forum (5.2.5b6)


The configure command:

'./configure' '--disable-dependency-tracking' '--prefix=/usr/local/ 
php5' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/ 
local/php5/php.d' '--with-openssl=/usr' '--with-zlib=/usr' '--with- 
zlib-dir=/usr' '--with-gd' '--with-ldap' '--with-xmlrpc' '--enable- 
exif' '--enable-soap' '--enable-sqlite-utf8' '--enable-wddx' '--enable- 
ftp' '--enable-sockets' '--with-bz2=/usr' '--enable-zip' '--enable- 
pcntl' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '-- 
enable-sysvmsg' '--enable-memory-limit' '--enable-mbstring' '--enable- 
bcmath' '--enable-calendar' '--with-ming=shared,/usr/local/php5' '-- 
with-mssql=shared,/usr/local/php5' '--with-mhash=shared,/usr/local/ 
php5' '--enable-memcache' '--with-imap=../imap-2007' '--with-kerberos=/ 
usr' '--with-imap-ssl=/usr' '--with-libxml-dir=shared,/usr/local/php5'  
'--with-xsl=shared,/usr/local/php5' '--with-gettext=/usr/local/php5'  
'--with-curl=shared,/usr/local/php5' '--with-png-dir=/usr/local/php5'  
'--with-jpeg-dir=/usr/local/php5' '--enable-gd-native-ttf' '--with- 
freetype-dir=/usr/local/php5' '--with-mysql=shared,/usr/local/php5' '-- 
with-mysqli=shared,/usr/local/php5/bin/mysql_config' '--with-pdo- 
mysql=shared,/usr/local/php5' '--with-pgsql=shared,/usr/local/php5' '-- 
with-pdo-pgsql=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/ 
local/php5'


---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] DateTime... What else ?

2008-04-17 Thread Simon Welsh


On 17/04/2008, at 9:05, David BERCOT wrote:

Hi,

I've got a problem with DateTime. I have a short code which gives an
error :

CODE
$date = new DateTime(date(d/m/Y));
$date-modify(-1 month);
$mois_en_cours1 = $date-format(Y-m);
$date-modify(-1 month);
$mois_en_cours2 = $date-format(Y-m);
$date-modify(-1 month);
$mois_en_cours3 = $date-format(Y-m);
/CODE

ERROR
bFatal error/b:  Class 'DateTime' not found in
b/var/www2/dacg_visio/index.html/b on line b244/bbr /
/ERROR

If I look at the documentation :
http://fr3.php.net/manual/fr/function.date-modify.php
it seems to work if PHP version is above 5.1.0 (I am in 5.1.6 !).

Do you have any idea about this error (Debian/Apache2) ?
Do you have another way to obtain $mois_en_cours1, 2, 3 without
DateTime ?

Thank you very much.

David.


--  
PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php




?php
$mois_en_cours1 = date('Y-m', strtotime('-1 month'));
$mois_en_cours2 = date('Y-m', strtotime('-2 month'));
$mois_en_cours3 = date('Y-m', strtotime('-3 month'));
?

---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] convert a string to integer

2008-03-28 Thread Simon Welsh


On 28/03/2008, at 8:48, Alain Roger wrote:

Hi,

i know this topic is obvious but i have a strange behavior and i'm  
getting

crazy.

my stored procedure returns me a string.
string can be an email or a message error = '-1', '-2', '-3'

when i check if the string contains only digit, i use  
ctype_digit(mystring)
but any way it returns me false... i suppose that for -1, -2, -3 the  
- is

taken as character and not a digit.
i tried also to cast it before into integer thanks
ctype_digit((int)mystring), but it does not work.

so how can i solve this issue ?

thx

--
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


is_numeric() - Finds whether the given variable is numeric. Numeric  
strings consist of optional sign, any number of digits, optional  
decimal part and optional exponential part.

---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date math

2008-03-23 Thread Simon Welsh


On 24/03/2008, at 5:17, Ron Piggott wrote:
I have this math equation this list helped me generate a few weeks  
ago.

The purpose is to calculate how many days have passed between 2 dates.

Right now my output ($difference) is 93.958333 days.

I am finding this a little weird.  Does anyone see anything wrong with
the way this is calculated:

$date1 = strtotime($date1); (March 21st 2008)
$date2 = strtotime($date2); (December 18th 2007)

echo $date1 = 1206072000
echo $date2 = 1197954000

#86400 is 60 seconds x 60 minutes x 24 hours (in other words 1 days
worth of seconds)

$factor = 86400;

$difference = (($date1 - $date2) / $factor);


Depending on what you want, wrap it in round() ceil() or floor()




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Posting Summary for Week Ending 4 January, 2008: php-general@lists.php.net

2008-01-04 Thread Simon Welsh

Your percentages are off by a factor of 100.

On 5/01/2008, at 12:31, Daniel Brown wrote:


On Jan 4, 2008 6:22 PM, PostTrack [Dan Brown]
[EMAIL PROTECTED] wrote:


   Posting Summary for PHP-General List
   Week Ending: Friday, 4 January, 2008

   Messages| Bytes   | Sender
   +-+--
   6 (100%) 8880 (100%)  EVERYONE
   2(0.33%)  1100(0.12%)  Daniel Brown [EMAIL PROTECTED] 

   2(0.33%)  4204(0.47%)  Miren Urkixo [EMAIL PROTECTED] 

   1(0.17%)  1532(0.17%)  TG [EMAIL PROTECTED] 

   1(0.17%)  2044(0.23%)  Jim Lucas [EMAIL PROTECTED] 





   Ignore that.  It's a new script that is going to start running as
of 4:00p EST on 11 January, 2008.  It will summarize the number of
messages to the list, then tell who posted how many, what size, et
cetera.

   There may be one or two more messages that will wind up getting
sent because I accidentally manually ran the live script while testing
it for the cron.

   Once it settles down, it will run every Friday at 4:00p to
summarize the week.  For bragging rights, to keep track of how much
time you've spent doing community service or whatever else.


--
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Posting Summary for Week Ending 4 January, 2008: php-general@lists.php.net

2008-01-04 Thread Simon Welsh

I seem to be getting one every two minutes.

On 5/01/2008, at 12:31, Daniel Brown wrote:


On Jan 4, 2008 6:22 PM, PostTrack [Dan Brown]
[EMAIL PROTECTED] wrote:


   Posting Summary for PHP-General List
   Week Ending: Friday, 4 January, 2008

   Messages| Bytes   | Sender
   +-+--
   6 (100%) 8880 (100%)  EVERYONE
   2(0.33%)  1100(0.12%)  Daniel Brown [EMAIL PROTECTED] 

   2(0.33%)  4204(0.47%)  Miren Urkixo [EMAIL PROTECTED] 

   1(0.17%)  1532(0.17%)  TG [EMAIL PROTECTED] 

   1(0.17%)  2044(0.23%)  Jim Lucas [EMAIL PROTECTED] 





   Ignore that.  It's a new script that is going to start running as
of 4:00p EST on 11 January, 2008.  It will summarize the number of
messages to the list, then tell who posted how many, what size, et
cetera.

   There may be one or two more messages that will wind up getting
sent because I accidentally manually ran the live script while testing
it for the cron.

   Once it settles down, it will run every Friday at 4:00p to
summarize the week.  For bragging rights, to keep track of how much
time you've spent doing community service or whatever else.


--
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with OOPHP

2007-10-31 Thread Simon Welsh


On 1/11/2007, at 5:48, Andrew Peterson wrote:


I'm hoping you guys can help me out.

I'm not sure if you can do this, but i'm trying to create a class  
that is build of another class.  I also want to be able to do  
functions on the class1 from within class2.



example:

class fruitBasket{

private $fuit = array();  //this is a class


mispelt variable? you use $fruit later on.




public function addFruit($newFruit)
{
$this-fruitBasket[] = $newFruit();


a) you're using the wrong variable.
b) you're calling the function with the name stored in $newFruit.  
Maybe you want to use:


$this-fruit[] = new fruit($newFruit);



}

public makeAllApples()
{
foreach($this-fruit AS $value)
{   
$value-changeName(apple);
}   
}

}



class fruit{

private $name;

public __construct($name)
{
$this-name = $name;
}

public changeName($newName)
{
$this-name = $newName;
}
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] returning an array from a function?

2007-10-26 Thread Simon Welsh

$mve_array = convert( $latitude, $longitude );

or, in convert(), before the first call to $mve_array:

global $mve_array;


On 26/10/2007, at 8:09, [EMAIL PROTECTED] wrote:


Hello all,

function convert( $latitude, $longitude ) {

$mve_latitude = $latitude; // actually other processing within this  
function determines this
$mve_longitude = $longitude // actually other processing within  
this function determines this

$mve_both = $mve_latitude . ,  . $mve_longitude;
// prepare return values
$mve_array[0] = $mve_latitude;
$mve_array[1] = $mve_longitude;
$mve_array[2] = $mve_both;

return $mve_array;
} // function

$latitude = 23.263400;
$longitude = 80.110030
convert( $latitude, $longitude );

print_r( $mve_array );

.. the above does not return a value in the array. What do I have  
to change to receive an array with global scope from this function?  
I read several pages of docs on php.net but the light didn't go on...


Sincerely,
Rob.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





---
Simon Welsh
Admin of http://simon.geek.nz/

Windows is a joke operating system. Hell, it's not even an operating  
system. NT is Not Tough enough for me either. 95 is how may times it  
will crash an hour.


http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php