Content Top
DAL Computer Help » Web Design, Development & Marketing » Web Development Help » PHP Help » What is wrong with this script?

What is wrong with this script?


HEY! You're not logged in which is fine if you simply want to browse for answers, however if you want to post your own Questions and hangout here you need to Register! ...Registration takes 2 minutes and is completely free. If you have already registered simply log in using the form to the right.

Reply
Thread Tools
PHP Help
Old 09-08-2005, 10:15 PM   #1 (permalink)
D-A-L Newbie
 
Status: Newbie
Join Date: Aug 2005
Posts: 1
 dwaynecasey Is a beginner here at D-A-L



dwaynecasey is offline  
What is wrong with this script?

Learing PHP via online couse..but no one to bounce questions off of.
when the form processes it goes to the email verification error even if their is a valid email input. I have had problems with any of the>> !$variable << doing the same thing


Cheers!!


<body>
<?
if(!eregi("^[a-z0-9_]+@[a-z0-9\-]+\.[a-z0-9\-\.]+$", $email)){
?>
<H2>Whoops</H2>
<BR>
Please Enter a valid email adress.
<A HREF="feedback.html">Click here to go back to the feedback page</A>
<?
exit;
}

$user = addslashes($user);
$email = addslashes($email);
$comments = addslashes($comments);
$db = mysql_connect("localhost");
mysql_select_db("vinyldealers", $db);
$addfeedback = "INSERT INTO feedback(user, email, spam, comments)
VALUES ('$user', '$email', '$spam', '$comments')";
$result = mysql_query($addfeedback);
?>
<H2>Thank You</H2>
<BR>
We have added your comments to our database.
<A HREF="feedback.html">Click here to go back to the feedback page</A>



</body>
</html>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Advertisement - Register to remove Ads its free!

Old 09-09-2005, 01:52 PM   #2 (permalink)
D-A-L Newbie
 
Status: Junior Member
Join Date: Sep 2005
Posts: 20
 waylandbill Is a beginner here at D-A-L



waylandbill is offline  
Re: What is wrong with this script?

Did you try escaping the @ symbol in the regular expression test?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-04-2006, 07:48 PM   #3 (permalink)
D-A-L Newbie
 
kortex's Avatar
 
Status: Newbie
Join Date: Mar 2006
Posts: 2
 kortex Is a beginner here at D-A-L

Send a message via ICQ to kortex Send a message via AIM to kortex Send a message via MSN to kortex


kortex is offline  
Re: What is wrong with this script?

this:
$db = mysql_connect("localhost");

usually requires more parameters, specifically the user name and password for the database (at least if the database is mySQL)
__________________
Jeremy Wischusen
Multimedia Web Design and Programming
ActionScript | MDM Script | ASP | PHP | ColdFusion | SQL | XML | JavaScript | VBScript | Java | Graphic Design | Audio and Video
http://www.visualflowdesigns.com

cortex@visualflowdesigns.com
View my ColdFusion Course


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cmos settings wrong jmellosfam General Hardware Issues 2 11-12-2006 06:51 PM
What's script blocking? Curriedbutternutsquash General Internet Issues and Questions 1 29-04-2006 05:49 AM
CMOS settings wrong. stoddy2k01 General Hardware Issues 5 14-04-2005 10:44 PM
Wrong company name in start up screen BADGER55 Desktop / Server Applications 6 01-04-2005 05:13 PM
ie script error when accessing the internet via ISP sgilson Windows XP Help 7 15-09-2004 06:30 PM


All times are GMT +1. The time now is 04:27 AM.

Bottom Corner