Re: Php Problem Parsing or so I think

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Thus wrote Carinus Carelse:
> variables I get an error message in the browser Illegitimate format.  I
> am including a copy of the link I click on to call the page below. I
> wonder if someone on the list can may be help me.  Have I compiled PHP
> wrong or is the code itself wrong. Or is there a better way to do the
> below.
> 
>  http://localhost.domain.com/mailrelease/Release.php?id=1CwdBD-0002z8-1K&date=20050203&name=user@xxxxxxxxxx
> 
> <html>
> <head>
> <title> Releasing <?php echo($_GET['id']); ?> to all recipients </title>
> 
> <body>
> <p> Releasing email message <b> <?php echo($_GET['id']); ?> </b> to <b>
> <?php echo ($HTTP_GET_VARS['name']); ?> </b>
> </p>
> <?php
> 
> $file = $_GET['id'];
> $date = $_GET['date'];
> $name = $_GET['name'];
> if(preg_match("/^[a-zA-Z0-9]+$/",$file)
>    && preg_match("/^[0-9]+$/",$date)
>    && preg_match("/^[a-zA-Z0-9\_\.\-]+@[a-zA-Z0-9\.\-]+$/",$name))
> 
> {

The $file expression is ignoring -'s, use:

  if(preg_match("/^[a-zA-Z0-9-]+$/",$file)


Curt
-- 
Quoth the Raven, "Nevermore."

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux