php-windows Digest 18 Oct 2003 02:43:37 -0000 Issue 1961
Topics (messages 21805 through 21808):
Re: Check mail format
21805 by: Ignatius Reilly
21806 by: MeAndI
21807 by: Luis Moreira
Re: $_POST in MySQL query issue...
21808 by: Socheat
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
You can use the following regex:
/[EMAIL PROTECTED]/
Ignatius
_________________________
----- Original Message -----
From: "MeAndI" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 2:51 PM
Subject: [PHP-WIN] Check mail format
> Hi,
>
> I just want to know how I can recognize that the e-mail address inserted
by
> the user is correct or not.
>
> E.g.
> [EMAIL PROTECTED] -> correct e-mail address
> [EMAIL PROTECTED] or user-server.com -> incorrect email addresses
>
> please help
> Thanks
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I wrote:
if (eregi("[EMAIL PROTECTED]", $Email))
but the PHP always recognized the e-mail address as right! Why?
"Ignatius Reilly" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
> You can use the following regex:
>
> /[EMAIL PROTECTED]/
>
> Ignatius
> _________________________
> ----- Original Message -----
> From: "MeAndI" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, October 17, 2003 2:51 PM
> Subject: [PHP-WIN] Check mail format
>
>
> > Hi,
> >
> > I just want to know how I can recognize that the e-mail address inserted
> by
> > the user is correct or not.
> >
> > E.g.
> > [EMAIL PROTECTED] -> correct e-mail address
> > [EMAIL PROTECTED] or user-server.com -> incorrect email addresses
> >
> > please help
> > Thanks
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--- End Message ---
--- Begin Message ---
As far as I know, there is no direct way.
You have to parse the address, looking for the "@" character, at least.
Then check for the presence of characters before and after the "@", and at
least a dot "." on the right side (after "@").
Luis
----- Original Message -----
From: "MeAndI" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 1:51 PM
Subject: [PHP-WIN] Check mail format
> Hi,
>
> I just want to know how I can recognize that the e-mail address inserted
by
> the user is correct or not.
>
> E.g.
> [EMAIL PROTECTED] -> correct e-mail address
> [EMAIL PROTECTED] or user-server.com -> incorrect email addresses
>
> please help
> Thanks
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Dear all ,
Could anyone help me to use crypt() function on window system ? , I want
to use all libraries that currently not support in PHP like crypt(), but I
want to use it.How could i make it work?
-----Original Message-----
From: Lang Sharpe [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 6:45 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP-WIN] Re: $_POST in MySQL query issue...
> $sql="insert into $table set Name = '$_POST["elementName"]'";
The problem with this is that you need to use curly braces around the
variable being substituted in the string. Also use single quotes around the
array index.
$sql="insert into $table set Name = '{$_POST['elementName']}'";
See the manual.. (Variable parsing section)
http://php.net/manual/en/language.types.string.php
Lang
Adam Reiswig wrote:
> Greetings to all. I am trying for the life of me to place a $_POST[]
> variable in my MySQL query. I am running the latest stable versions of
> PHP, MySQL and Apache 2 on my Win2kPro machine. My register_globals are
> set to off in my php.ini. My code I am attempting create is basically
> as follows:
>
> $table="elements";
> $sql="insert into $table set Name = '$elementName'";
>
> This works with register_globals set to on. But, I want to be able to
> turn that off. My code then, I am guessing, be something as follows:
>
> $table="elements";
> $sql="insert into $table set Name = '$_POST["elementName"]'";
>
> Unfortunately this and every other combination I can think of,
> combinations of quotes that is, does not work. I believe the source of
> the problem is the quotes within quotes within quotes. I also tried:
>
> $sql='insert into $table set Name = '.$_POST["elementName"];
> or
> $sql="insert into $table set Name = ".$_POST['elementName'];
>
> and several other variations.
>
> Can anyone give me some pointers to inserting $_POST[] statements inside
> of query statements? I am sure there must be a way but I have spent a
> lot of time on this and am really stumped here. Thanks for any help.
>
> -Adam Reiswig
>
> PS if anything here is not clear to you, please let me know and I'll
> clarify as I can. Thanks again.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---