Re: Re: [PHP] is_numeric questions - followup

2004-07-28 Thread holmes072000
 From: Jeff Oien [EMAIL PROTECTED]
 
  Does is_numeric include commas decimals and dollar signs?
  
  How do I use this to error check form data? I'm having a hard time 
  figuring out what the correct syntax is for that application. Thanks.
  Jeff
 
 I think what I should have asked is how to tell if something is not 
 numberic.

if(!is_numeric($var))

---John Holmes...

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



Re: Re: [PHP] php5 and object

2004-07-28 Thread holmes072000
 From: Stephen Sadowski [EMAIL PROTECTED]
 Subject: Re: [PHP] php5 and object
 
 http://us4.php.net/manual/en/language.oop5.abstract.php
 
 The short is that you can't do anything more than define a function in
 an abstract class.
 
 IIRC, change abstract to interface, and you'll probably be okay.

Switch that around. Interfaces cannot contain anything but function definitions. 
Abstract classes can contain functions that'll be inherited. 

---John Holmes...

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



Re: [PHP] Problem with $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']

2004-07-28 Thread holmes072000
 From: Mark Collin [EMAIL PROTECTED]

 Does anybody have any ideas on how I can prevent caching of 
 $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'], or clear them?

You can't clear them; they're sent by the browser. It'll keep resending the same 
values and you're script will authenticate. Only way to get rid of it is to close the 
browser.

You could attempt to force the user to log with a known bad username and password by 
using a link or header redirect. 

header('Location: http://username:[EMAIL PROTECTED]');

Your login script should check for these known values and can react accordingly. You 
know they are bad, so you can either present them with another dialog to log back in 
or you can just not send any authentication headers and show them a successfully 
logged out page. 

---John Holmes...

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



Re: [PHP] Urgent..my MYSQL dies..

2004-07-27 Thread holmes072000
 please give me a command line to startup 
 MySQL using safe_mysqld

C:\

---John Holmes...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004


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

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

Re: [PHP] Alternative to stripslashes(htmlentities($textstring))

2004-04-06 Thread holmes072000
 From: gohaku [EMAIL PROTECTED]

 I was just curious if there is another function that
 does the same job as stripslashes(htmlentities($textstring)).

Nope. Do it that way. 

Or you can turn off magic_quotes_gpc, which is probably the reason you have to run 
stripslashes(). 

---John Holmes...

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



Re: RE: [PHP] Validating form field text input to be a specific variable type

2004-04-06 Thread holmes072000
 From: Merritt, Dave [EMAIL PROTECTED]
 
 Okay seems to makes sense, but when I do the following it doesn't appear to
 be working correctly, or I'm viewing my logic incorrectly one:
 
 if ( (int)$PageOptions['Default'] == $PageOptions['Default'] ) {  

This works:

if(strcmp((int)$PageOptions['Default'],$PageOptions['Default'])==0)

---John Holmes...

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



Re: [PHP] For your reference, how to validate dynamic form fields.

2004-04-06 Thread holmes072000
 From: Hawkes, Richard [EMAIL PROTECTED]
 
 Just spent far too long trying to figure out how to do this, so I thought I'd
 pass it on to you great guys, in case you need it for the future.
  
 I used PHP to create multiple form rows, each one numbered:
 
 ?
 for ($i =1; $i = 20; $i++) {
 echo(input type=text name=userId$i maxlength=5/br/);
 }
 ?

Use arrays. It'll make your life easier.

echo input type=\text\ name=\userId[$i]\ maxlength=\5\/br /);

You can still reference the element in Javascript, just by name or whatever you call 
it. 

form.element['userId[1]'] (or something like that).

You show a Javascript validation. Remember that this is easily bypassed so you also 
need to validate the numbers on the PHP side. 

?php
foreach($_POST['inputId'] as $id)
{
  if(!is_numeric($id))
  { echo $id is invalid!; }
}
?

---John Holmes...

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