Validate::uri doesn't seem to work
| From: | Pat Wong | Date: | Sun, 26 Dec 2004 07:59:40 +0000 |
| Subject: | Validate::uri doesn't seem to work | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16467@lists.php.net to get a copy of this message | ||
I'm pretty much a newbie to PEAR, trying to run some code from a book which utilizes the
Validate package. Two of the form fields validate just fine, but uri does not. Is this a
problem with the package, or am I doing something wrong?
Here is the relevant code from my script:
$errors =
array('name'=>'','email'=>'','uri'=>'');
if ( !Validate::uri($_POST['uri']) ) {
$errors['uri']=' class="error"';
}
and from the HTML form that uses the above code:
<div>
<label<?php echo ($errors['uri']); ?>>Website:</label>
<span>
<input type="text" name="uri" value="<?php
echo(@$_POST['uri']);?>">
</span>
</div>
~8^) Pat Wong
http://www.napathon.net/ - Music Around The World
For collecting tips, trade and want lists, album reviews and more.
http://www.techtipscentral.net/CDTrusteeIntro.asp
- Showcase your
music collection on your website.