A n00b and Xpert met : See what happens ;)


®0L¥ Wrote

I have a littli application in PHP that I do with appserv, in my local server work ok but when I upload de page.php to the hosting server don’t work, the hosting say in your page that support php and the web server is apache because the directory is httpdocs, and why my page dond;t work in the hosting and work ok in my local server ??

<form action="find.php" method="post">
<tr>
<td height="24" valign="top" class="menu"
 style="text-align: left">
<table width="210" border="0" cellspacing="0"
 cellpadding="0">
<tr>
<td width="7" height="23"
 class="text_1"></td>
<td width="105"><span class="text_1">Your Company
> Name:</span></td>
<td width="98" valign="top"><input name="cname"
 type="text" size="11" maxlength="20" align="right"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="22" valign="top">
<table width="210"
 border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7" height="22"
 class="text_1"></td>
<td width="105"><span class="text_1">Your E-Mail
 Address:</span></td>
<td width="98" valign="top"><input name="email"
 type="text" size="11" maxlength="40" align="right"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="42" valign="top">
<table width="210"
 border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="text_1" width="124" height="27"> Find by
 Zip Code:</td>
<td width="86"><input name="zip" type="text"
 size="9" maxlength="5" align="right"/></td>
</tr>
</table>
<table width="210" border="0" cellspacing="0"
 cellpadding="0">
<tr>
<td class="text_1" width="90" height="22"></td>
<td width="79"></td>
<td width="41" valign="bottom"><input type="image"
 src="images/find.jpg" width="33" height="20"/></td>
</tr>
</table>
</td>
</tr>
</form>
< ?
               if (!$cname)
               {
                   echo "<font color=\"maroon\">Enter your Company
Name.";
               }
               elseif
(!ereg("^[a-zA-Z0-9_\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
               {
                   echo "<font color=\"maroon\">Enter a Valid E-Mail
Address.</font>";
               }
               elseif (strlen($zip)&lt;5)
               {
                   echo "<font color=\"maroon\">Enter a Valid Zip
Code.</font>";
               }
               elseif (ereg("[^0-9]", $zip))
               {
                   echo "<font color=\"maroon\">Enter a Valid Zip
Code.</font>";
               }
               else
               {
                   echo "<font color=\"maroon\">Find an Agent close to
you.</font>";
               }
 ?>

Thanks to all.


salu2 ®0L¥

Now Jan G. B Answers:

Do yourself a favour:

* remove that 1337 hax0r name – it makes you look like a dumbass
* buy a PHP related book
* change your code to work with register_globals OFF
* don’t rely on regular expressions to validate an email without
reading the email RFC nor knowing regular expressions
* don’t use ereg! preg is what you want
instead you can check out filter_input() on http://php.net/manual ..
Look out for FILTER_VALIDATE_EMAIL

* Have a nice day [optional]
>:-)

[The above is a mail conversation in the PHP-Generals Mailing list]

A more hilarious link here I have to share with you, which is regarded as the best portfolio ever for any web-developer😉 : http://tr.im/jmeu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s