Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-21 Thread Gautam Bhatia
On Friday 14 May 2010 12:48 PM, Jagdeep Singh wrote: > Hi All! > > I am looking for a solution, I want a user to do a single Login only on a PC > . > > E.g. If a User has logged on my website website.com in Internet explorer, > then he cant login on same website in another browser like Firefox etc

Re: [PHP] localize string (date)

2010-05-21 Thread Ryan Sun
Its either ur title is misleading or I'm misunderstanding is this what u want? $subject = "21-05-2010 Ideo urbs Venerabile superb post 12-02-2010 efferatarum latasque 12-02-10 leges gentium cervicis oppressed and fundamenta libertatis retinacula sempiterne Frugi velut parens and prudent and dives

Re: [PHP] Re: PDO don't know which is mysql server charset?

2010-05-21 Thread cleverpig
really thanks! This is so clear explanation! I'd set anything to utf-8,including server,client,my php PDO. but it didn't work,sounds like my data were encoded (processed) to another character(gbk) before them were saved into mysql. so when i checked data from mysql,i will make a hardcode to decod

Re: [PHP] Using if(isset()) with $_GET and switch and default

2010-05-21 Thread Daniel P. Brown
On Fri, May 21, 2010 at 17:02, MuFei wrote: > Hi Ashley, > Your way works also great, But I have some question thought: > When I only use the first half of the code you suggested: > $question = (isset($_GET['question'])); > then use the $question in the switch it works as I want it. > If I use the

Re: [PHP] Using if(isset()) with $_GET and switch and default

2010-05-21 Thread MuFei
Hi Ashley, Your way works also great, But I have some question thought: When I only use the first half of the code you suggested: $question = (isset($_GET['question'])); then use the $question in the switch it works as I want it. If I use the whole code( $question = (isset($_GET['question']))?$_GET

Re: [PHP] Using if(isset()) with $_GET and switch and default

2010-05-21 Thread MuFei
Thanks, Adam The first option (setting the GET) works great. I already know about taking the default out of the switch and putting it in an else statement, but I want to work with the default inside the switch. And of course I wanted to do it without turning off E_NOTICE warnings Thanks again for

Re: [PHP] Using if(isset()) with $_GET and switch and default

2010-05-21 Thread Ashley Sheridan
On Fri, 2010-05-21 at 16:18 -0400, Adam Richardson wrote: > On Fri, May 21, 2010 at 3:24 PM, MuFei wrote: > > > Hi, > > I'm still new to PHP and everyday I learn something new. > > Today I was trying to make some script using the switch statement but > > I have some issue that I don't know how t

Re: [PHP] localize string (date)

2010-05-21 Thread Ashley Sheridan
On Fri, 2010-05-21 at 21:12 +0200, Mickael MONSIEUR wrote: > Le 21/05/10 21:00, Ashley Sheridan a écrit : > > On Fri, 2010-05-21 at 20:51 +0200, Mickael MONSIEUR wrote: > >> hello > >> I want to find a date in a text how to? format: XX-XX- > >> > >> Example: > >> > >> Ideo urbs Venerabile supe

Re: [PHP] Using if(isset()) with $_GET and switch and default

2010-05-21 Thread Adam Richardson
On Fri, May 21, 2010 at 3:24 PM, MuFei wrote: > Hi, > I'm still new to PHP and everyday I learn something new. > Today I was trying to make some script using the switch statement but > I have some issue that I don't know how to get around it. > It's a simple test script that contain only one file

Re: [PHP] __call for existing methods?

2010-05-21 Thread Adam Richardson
On Fri, May 21, 2010 at 2:46 PM, Maximiliano Churichi wrote: > Is there a way to catch EVERY method of a inheritance class? > something like this... > > class Father > { >public function __call ($name, $args) >{ >$this->doSomethingBefore(); > >if ( m

[PHP] Using if(isset()) with $_GET and switch and default

2010-05-21 Thread MuFei
Hi, I'm still new to PHP and everyday I learn something new. Today I was trying to make some script using the switch statement but I have some issue that I don't know how to get around it. It's a simple test script that contain only one file, it has some questions that I want only one question appe

Re: [PHP] Help, FPDI is changing the size of my PDFs

2010-05-21 Thread Brian Dunning
Solved it. Here's the solution: $pdf = new fpdi(); $pdf->setSourceFile('D:\\DocShare\\'.$filename); $tplidx = $pdf->ImportPage(1); $s = $pdf->getTemplatesize($tplidx); $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L', array($s['w'], $s['h'])); // This gets it the right dimensions $pdf->useTemplate($tp

Re: [PHP] localize string (date)

2010-05-21 Thread Mickael MONSIEUR
Le 21/05/10 21:00, Ashley Sheridan a écrit : On Fri, 2010-05-21 at 20:51 +0200, Mickael MONSIEUR wrote: hello I want to find a date in a text how to? format: XX-XX- Example: Ideo urbs Venerabile superb post 12-02-2010 efferatarum latasque leges gentium cervicis oppressed and fundamenta lib

Re: [PHP] localize string (date)

2010-05-21 Thread Ashley Sheridan
On Fri, 2010-05-21 at 20:51 +0200, Mickael MONSIEUR wrote: > hello > I want to find a date in a text how to? format: XX-XX- > > Example: > > Ideo urbs Venerabile superb post 12-02-2010 efferatarum latasque leges > gentium cervicis oppressed and fundamenta libertatis retinacula > sempiterne

[PHP] localize string (date)

2010-05-21 Thread Mickael MONSIEUR
hello I want to find a date in a text how to? format: XX-XX- Example: Ideo urbs Venerabile superb post 12-02-2010 efferatarum latasque leges gentium cervicis oppressed and fundamenta libertatis retinacula sempiterne Frugi velut parens and prudent and dives Caesaribus tamquam 25-04-2010 li

[PHP] __call for existing methods?

2010-05-21 Thread Maximiliano Churichi
Is there a way to catch EVERY method of a inheritance class? something like this... class Father { public function __call ($name, $args) { $this->doSomethingBefore(); if ( method_exists($this, $name) ) return

[PHP] Help, FPDI is changing the size of my PDFs

2010-05-21 Thread Brian Dunning
I'm using FPDI to add some stuff to some existing PDF documents. Works great, except that it's slightly changing the size of the PDF document (the physical page size, not the file size), which is unacceptable since this is for a high-end print file. I've stripped out all the code to the bare bon

Re: [PHP] Remove blank lines from a file

2010-05-21 Thread Gary
Anton Heuschen writes: > Hi Im trying do something like this, have a function which uploads my > file and returns file pointer ... but at same time ... I want to > remove all Blank lines in a file and update it sed -i '/^$/d' yourFile -- Gary -- PHP General Mailing List (http://www.php.net/)

RE: [PHP] Remove blank lines from a file

2010-05-21 Thread Bob McConnell
From: Anton Heuschen > On 21 May 2010 15:16, Ashley Sheridan wrote: >> On Fri, 2010-05-21 at 14:03 +0200, Anton Heuschen wrote: >> >> Hi Im trying do something like this, have a function which uploads my >> file and returns file pointer ... but at same time ... I want to >> remove all Blank line

Re: [PHP] Question about a security function

2010-05-21 Thread Al
On 5/21/2010 10:36 AM, Jim Lucas wrote: Al wrote: On 5/21/2010 9:24 AM, David Otton wrote: On 20 May 2010 16:51, Al wrote: I'm not being clear. First pass is thru the blacklist, which effectually tells hacker to not bother and totally deletes the entry. If the raw entry gets past the b

Re: [PHP] Question about a security function

2010-05-21 Thread Jim Lucas
Al wrote: > > > On 5/21/2010 9:24 AM, David Otton wrote: >> On 20 May 2010 16:51, Al wrote: >> >>> I'm not being clear. First pass is thru the blacklist, which effectually >>> tells hacker to not bother and totally deletes the entry. >>> >>> If the raw entry gets past the blacklist, it must then

Re: [PHP] Remove blank lines from a file

2010-05-21 Thread Anton Heuschen
On 21 May 2010 15:16, Ashley Sheridan wrote: > On Fri, 2010-05-21 at 14:03 +0200, Anton Heuschen wrote: > > Hi Im trying do something like this, have a function which uploads my > file and returns file pointer ... but at same time ... I want to > remove all Blank lines in a file and update it be

Re: [PHP] Question about a security function

2010-05-21 Thread Al
On 5/21/2010 9:21 AM, Ashley Sheridan wrote: On Fri, 2010-05-21 at 14:24 +0100, David Otton wrote: On 20 May 2010 16:51, Al wrote: I'm not being clear. First pass is thru the blacklist, which effectually tells hacker to not bother and totally deletes the entry. If the raw entry gets past

Re: [PHP] Question about a security function

2010-05-21 Thread David Otton
On 21 May 2010 14:21, Ashley Sheridan wrote: > I still think you might be better off using BBCode, which is used on > websites just for this very purpose. When any input comes back, you can > remove all the HTML completely and replace the BBCode tags that you > allow. This should guarantee that t

Re: [PHP] Question about a security function

2010-05-21 Thread Al
On 5/21/2010 9:24 AM, David Otton wrote: On 20 May 2010 16:51, Al wrote: I'm not being clear. First pass is thru the blacklist, which effectually tells hacker to not bother and totally deletes the entry. If the raw entry gets past the blacklist, it must then only contain my whitelist tags.

Re: [PHP] how to update array keys and keep element order ?

2010-05-21 Thread Richard Quadling
On 21 May 2010 13:34, wrote: > > - Original Message - From: "Richard Quadling" > > To: > Cc: > Sent: Friday, May 21, 2010 1:30 PM > Subject: Re: [PHP] how to update array keys and keep element order ? > > >> On 21 May 2010 10:56,   wrote: >>> >>> How do I update an array key without di

[PHP] Re: how to update array keys and keep element order ?

2010-05-21 Thread Al
On 5/21/2010 5:56 AM, cr.vege...@gmail.com wrote: How do I update an array key without disturbing the element order ? Suppose an existing array("FR", values ...) where I want to change 0 => "FR" to "country" => "FR" and keep the original element order. TIA, Cor I short on time; but, it se

Re: [PHP] Question about a security function

2010-05-21 Thread Ashley Sheridan
On Fri, 2010-05-21 at 14:24 +0100, David Otton wrote: > On 20 May 2010 16:51, Al wrote: > > > I'm not being clear. First pass is thru the blacklist, which effectually > > tells hacker to not bother and totally deletes the entry. > > > > If the raw entry gets past the blacklist, it must then only

[PHP] Re: Remove blank lines from a file

2010-05-21 Thread Al
On 5/21/2010 8:03 AM, Anton Heuschen wrote: Hi Im trying do something like this, have a function which uploads my file and returns file pointer ... but at same time ... I want to remove all Blank lines in a file and update it before it goes to the final location ... What I tried was to do a wr

Re: [PHP] Question about a security function

2010-05-21 Thread David Otton
On 20 May 2010 16:51, Al wrote: > I'm not being clear. First pass is thru the blacklist, which effectually > tells hacker to not bother and totally deletes the entry. > > If the raw entry gets past the blacklist, it must then only contain my > whitelist tags. e.g., the two examples you cited were

Re: [PHP] Remove blank lines from a file

2010-05-21 Thread Ashley Sheridan
On Fri, 2010-05-21 at 14:03 +0200, Anton Heuschen wrote: > Hi Im trying do something like this, have a function which uploads my > file and returns file pointer ... but at same time ... I want to > remove all Blank lines in a file and update it before it goes to the > final location ... > > What

RE: [PHP] How to get input from socket client

2010-05-21 Thread Bob McConnell
From: Ryan Sun > Thanks for your reply You are welcome. >> The other problem has to do with thinking an fread() will always give >> you everything you sent in an fwrite() > Interestingly, I use 'telnet 127.0.0.1 1037' for testing later(on > windows) and everything works, the php server got the

Re: [PHP] how to update array keys and keep element order ?

2010-05-21 Thread cr.vegelin
- Original Message - From: "Richard Quadling" To: Cc: Sent: Friday, May 21, 2010 1:30 PM Subject: Re: [PHP] how to update array keys and keep element order ? On 21 May 2010 10:56, wrote: How do I update an array key without disturbing the element order ? Suppose an existing arr

[PHP] Remove blank lines from a file

2010-05-21 Thread Anton Heuschen
Hi Im trying do something like this, have a function which uploads my file and returns file pointer ... but at same time ... I want to remove all Blank lines in a file and update it before it goes to the final location ... What I tried was to do a write of file and use some regexp replace to remov

Re: [PHP] how to update array keys and keep element order ?

2010-05-21 Thread Richard Quadling
On 21 May 2010 10:56, wrote: > How do I update an array key without disturbing the element order ? > Suppose an existing array("FR", values ...) > where I want to change 0 => "FR" to "country" => "FR" > and keep the original element order. > > TIA, Cor > Something like ... function arrayKeyChan

[PHP] how to update array keys and keep element order ?

2010-05-21 Thread cr.vegelin
How do I update an array key without disturbing the element order ? Suppose an existing array("FR", values ...) where I want to change 0 => "FR" to "country" => "FR" and keep the original element order. TIA, Cor

Re: [PHP] Re: PDO don't know which is mysql server charset?

2010-05-21 Thread Peter Lind
On 21 May 2010 10:47, Lester Caine wrote: > Peter Lind wrote: >>> >>> The problem here is that PHP still does not know how to handle UTF8 >>> >  properly > >> It's not*just*  that PHP isn't handling utf8 perfectly. Encoding >> between database and server is a rather complex issue, you're dealing >

Re: [PHP] Re: PDO don't know which is mysql server charset?

2010-05-21 Thread Lester Caine
Peter Lind wrote: The problem here is that PHP still does not know how to handle UTF8 > properly It's not*just* that PHP isn't handling utf8 perfectly. Encoding between database and server is a rather complex issue, you're dealing with: * database encoding * database connection encoding * ph

Re: [PHP] Re: PDO don't know which is mysql server charset?

2010-05-21 Thread Peter Lind
On 21 May 2010 10:16, Lester Caine wrote: > cleverpig wrote: >> >> thanks Lester! >> >> What's double decode? Your meaning is like What's i said: >> using $ Pdo->   exec ('SET character_set_results = gbk'); >> to make charset_set_results to be gbk? > > http://tikiwiki.org/UTF-8 seems to have docum

Re: [PHP] Re: PDO don't know which is mysql server charset?

2010-05-21 Thread Lester Caine
cleverpig wrote: thanks Lester! What's double decode? Your meaning is like What's i said: using $ Pdo-> exec ('SET character_set_results = gbk'); to make charset_set_results to be gbk? http://tikiwiki.org/UTF-8 seems to have documented everything ;) Basically if the data going into a field

Re: [PHP] Re: PDO don't know which is mysql server charset?

2010-05-21 Thread cleverpig
thanks Lester! What's double decode? Your meaning is like What's i said: using $ Pdo-> exec ('SET character_set_results = gbk'); to make charset_set_results to be gbk? 2010/5/21 Lester Caine : > cleverpig wrote: >> But if I use PDO's query function,there is all right without set charset: >> $res

Re: [PHP] Re: PDO don't know which is mysql server charset?

2010-05-21 Thread Lester Caine
cleverpig wrote: > But if I use PDO's query function,there is all right without set charset: > $result=$myPDO->query("SELECT * FROM guests ORDER BY lname,fname"); > while($row=$result->fetch(PDO::FETCH_ASSOC)){ > echo $row["fname"]." ". $row["lname"]; > } > >> I encountered a problem using t