help please....
Posted: Fri Mar 07, 2003 11:47 am
can someone please tell me why this is'nt working ?
What im wanting is for it to stop when it comes across an error, then display the error. If no errors then show the users input. After the `} else {` is the html to display then after the html i close the curly bracket. Im using a free PHP hosting provider, if that helps?
Thanks for the help.
- node
Code: Select all
<?
$date = date("M n, Y");
$time = date("g:ma");
$font ='<font face="verdana" size="2">';
if(empty($_POSTї"domname"])) {
$error = "<center><B>Error!</B><BR>You must enter your Domain Name.</center><P>";
}
if(! empty($_POSTї"email"])) {
$result = eregi("^ї_a-z0-9-]+(\.ї_a-z0-9-]+)*@їa-z0-9-]+(\.їa-z0-9-]+)*$", $_POSTї"email"] );
if(! $result) {
$error .= "<center><B>Error!</B><BR>You must enter a vaild Email.(ex: joe@yourdomain.com)</center><P>";
} else {
return true;
}
}
if(empty($_POSTї"comp_name"])) {
$error .= "<center><B>Error!</B><BR>You must enter your Company Name. If no company name, just use your First and Last name.</center><P>";
}
if(empty($_POSTї"fname"])) {
$error .= "<center><B>Error!</B><BR>You must enter your First Name.</center><P>";
}
if(empty($_POSTї"lname"])) {
$error .= "<center><B>Error!</B><BR>You must enter your Last Name.</center><P>";
}
if(empty($_POSTї"addr"])) {
$error .= "<center><B>Error!</B><BR>You must enter your Address.</center><P>";
}
if(empty($_POSTї"city"])) {
$error .= "<center><B>Error!</B><BR>You must enter your City.</center><P>";
}
if(empty($_POSTї"state"])) {
$error .= "<center><B>Error!</B><BR>You must enter your State in its 2 letter abriviation. (Ex: TX)</center><P>";
}
if($_POSTї"country"] == "no") {
$error .= "<center><B>Error!</B><BR>You must choose a Country from the drop-down box</center><P>";
}
if(empty($_POSTї"zip"])) {
$error .= "<center><B>Error!</B><BR>You must enter your Zip Code in the format: <B>90210</B></center><P>";
}
if(empty($_POSTї"phone"])) {
$error .= "<center><B>Error!</B><BR>You must enter your Phone Number.</center><P>";
}
if(empty($_POSTї"os"])) {
$error .= "<center><B>Error!</B><BR>You must enter your Operating System.</center><P>";
}
if(! $_POSTї"racked"]) {
$error .= "<center><B>Error!</B><BR>You must enter whether or not your server is rackable.</center><P>";
}
if($_POSTї"racked"] == "no") {
if( empty($_POSTї"dem_w"]) OR empty($_POSTї"dem_h"]) OR empty($_POSTї"dem_l"])) {
$error .= "<center><B>Error!</B><BR>You must enter you boxes Deminsions.</center><P>";
}
}
if(! $_POSTї"game"]) {
$error .= "<center><B>Error!</B><BR>You must specify whether your running a Game Server.</center><P>";
}
if(! $_POSTї"irc"]) {
$error .= "<center><B>Error!</B><BR>You must specify whether your running a IRC Server</center><P>";
}
if(! $_POSTї"iso"]) {
$error .= "<center><B>Error!</B><BR>You must specify whether your serving .ISO files.</center><P>";
}
if(! $_POSTї"mirror"]) {
$error .= "<center><B>Error!</B><BR>You must specify whether you act as a Mirror for popular sites.</center><P>";
}
if(! $_POSTї"srv"]) {
$error .= "<center><B>Error!</B><BR>You must specify whether any of your customers server files.</center><P>";
}
if(empty($_POSTї"hosted"])) {
$error .= "<center><B>Error!</B><BR>You must list the sites you currently host.</center><P>";
}
if($error) {
echo $error;
exit;()
} else {
?>Thanks for the help.
- node