foreach($HTTP_POST_VARS as $key => $value)
| From: | Addison Ellis | Date: | Wed, 22 Jan 2003 07:24:32 +0000 |
| Subject: | foreach($HTTP_POST_VARS as $key => $value) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-25034@lists.php.net to get a copy of this message | ||
hello,
i do appreciate your time...
below the code following i don't know where to go. do i need to list each value individually or can i do something with $HTTP_POST_VARS or am i even headed in the right direction? i am trying to point all my forms to this .php file to check for errors, and if they are ok, insert the submitted form values into a table in a database. thank you. addison ellis
foreach($HTTP_POST_VARS as $key => $value) {
if ($key != "") {
if ($value == "") {
$message_new = "<font face=verdana size=1 color=red>Required information missing.\n
Please try again.</font>";
}
} if (ereg("{name)",$key)) {
if (!ereg("^[A-Za-z' -]{1,50}$",$key))
{
$message_new = "<font face=verdana size=1 color=red>Some information not processing.\n
Please try again.</font>";
} }
$$key = strip_tags(trim($value)); }
if (!ereg("^[0-9)(xX -]{7,20}$",$phone)) {
$message_new = "<font face=verdana size=1 color=red>Not a valid phone number.\n
Please try again.</font>"; }
if (!ereg("^.+@.+\\..+$",$email)) {
$message_new = "<font face=verdana size=1 color=red>Not a valid email address.\n
Please try again.</font>";
}
elseif ($message == "") { $query = "insert into ad_columns set -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 addison@bellsouth.net info@smipco.com subsidiaries of small independent publishing co. info@gloabaldog.com info@momandpocentral.com