what's wrong with my feedback.html page

Problems with the Windows version of XAMPP, questions, comments, and anything related.

what's wrong with my feedback.html page

Postby MUHAMMAD AJMAL » 15. July 2008 18:39

<!-- feedback.html file -->
<HTML>
<HEAD>
<TITLE> Vinyl Dealers: Feedback </TITLE>

</HEAD>

<BODY>
<H2> FEEDBACK </H2>
<BR>
<FORM ACTION="send_feedback.php" METHOD="POST">
Your Name:
<INPUT TYPE=TEXT NAME="user" MAXLENGTH=40 SIZE=40>
<BR>
Your Email:
<INPUT TYPE=TEXT NAME="email" MAXLENGTH=40 SIZE=40>
<BR><BR>
CAN WE KEEP YOU UPDATED WITH NEWS ABOUT OUR SITE ?
<INPUT NAME="spam" TYPE=RADIO VALUE="1" CHECKED> YES
<INPUT NAME="spam" TYPE=RADIO VALUE="0"> NO
<BR><BR>
COMMENTS:
<BR>
<TEXTAREA COLS=60 ROWS=10 NAME="comments"></TEXTAREA>
<BR>
<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
</BODY>
</HTML>


<!---------------- send_feedback.php --------start hear -->

<HTML>
<HEAD>
<TITLE> Vinyl Dearlers : we approciate your feedback
</TITLE>

<BODY>
<?
if(!$user || !email || !$comments){
?>
<H2> Whoops </H2>
<BR>
Please fill in all fields.
<BR>
<A HREF="feedback.html"> Click hear to go back to the feedback page.</A>
<?
exit;
}
$user=addslashes($user);
$email=addslashes($email);
$comments=addslashes($comments);
$db=mysql_connect("localhost","root","");
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.
</BODY>
</HTML>




============= before this program i made vinyldealer database in which was also made feedback table . i am using xampp although my program is fine but can not insert data into to feedback data base .
mysql database and table as i were made.
mysql> describe feedback;
+------------+------------------------------+------+-----+---------+---
-------------+
| Field | Type | Null | Key | Default | Ex
tra |
+------------+------------------------------+------+-----+---------+---
-------------+
| feedbackID | tinyint(3) unsigned | NO | PRI | NULL | au
to_increment |
| user | varchar(50) | NO | | NULL |
|
| eamil | varchar(50) | NO | | NULL |
|
| spam | tinyint(4) unsigned zerofill | YES | | NULL |
|
| comments | text | NO | | NULL |
|
+------------+------------------------------+------+-----+---------+---
-------------+
5 rows in set (0.05 sec)

mysql> select * from feedback;
Empty set (0.00 sec)


as is mysql shows there is no data after running feedback.html and send_feedback would any body tell me what wrong with my program how would i collect feedback from user . kindly look into my code and resolve my problem .

out which i got is

Whoops

Please fill in all fields.
Click hear to go back to the feedback page.

M.Ajmal
Assalamu Alicum,



Thank you
Regard
M.Ajmal
MUHAMMAD AJMAL
 
Posts: 7
Joined: 07. July 2008 10:23
Location: Karachi

Postby Wiedmann » 15. July 2008 19:49

Values you have send with a POST form, are (only) availibe in the $_POST array.
http://de.php.net/manual/en/language.va ... ternal.php
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 149 guests