|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help in Submitting Feedback Form
Can someone kindly help me in sloving the problem below
. I am unable to link the feedbackform.htm to the acknowledge.asp :feedbackform.htm ============== <form method="POST" action="acknowledge.asp"> <p><strong>Enter your comments in the space provided below:</strong></p> <dl> <dd><textarea name="Comments" rows="5" cols="42"></textarea></dd> </dl> <p><strong>Tell us how to get in touch with you:</strong></p> <dl> <dd> <table> <tr> <td>Name</td> <td><input type="text" size="35" maxlength="256" name="Username"></td> </tr> <tr> <td>E-mail</td> <td><input type="text" size="35" maxlength="256" name="UserEmail"></td> </tr> <tr> <td>Tel</td> <td><input type="text" size="35" maxlength="256" name="UserTel"></td> </tr> </table> </dd> </dl> <p><input type="submit" value="Submit Comments"> <input type="reset" value="Clear Form"></p> </form> acknowledge.asp ============= <% 'Retrieve form fields into variables Email=Replace(Request.Form("Email"),"'","''") Contents=Replace(Request.Form("Contents"),"'","''") 'Check for empty content IF Email="" THEN Email="Unknown" IF Contents="" THEN Contents="None" 'Grab the user's IP address UserIP=Request.ServerVariables("Remote_ADDR") 'Create the SQL command string MySQL="INSERT Feedback(comments,userEmail, userName, userTel) VALUES('"&comments&","&userEmail&"','"&userName&";,'"&userTel&"')" 'Insert the form data into the Feedback table Set Conn = Server.CreateObject("ADODB.Connection") Connstr = "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=username;pwd=password ;database=databasename;option=NUM" Conn.Open Connstr Conn.Execute("SELECT * FROM Feedback") %> <HTML> <HEAD><TITLE>THANK YOU</TITLE> <BODY> <H2>Thank you! </H2> </BODY> </HTML> display.asp ========== <% 'Create ADO Objects Set Conn = Server.CreateObject("ADODB.Connection") Set RS=Server.CreateObject("ADODB.RecordSet") Connstr = "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=username;pwd=password ;database=databasename;option=NUM" Conn.Open Connstr 'Set the maximum number of records to return RS.MaxRecords=25 'Retrieve the records RS.Open "SELECT * FROM Feedback ORDER BY Feed_Date DESC", Conn %> <HTML> <HEAD><TITLE>Display Feedback</TITLE></HEAD> <BODY> <FORM> <% 'Display the records WHILE NOT RS.EOF %> <BR><B>Date Entered:</B> <%RS("comments")%> <BR><B>Email: </B><%RS("userEmail")%> <BR><B>IP Address: </B><%RS("userName")%> <BR><TEXTAREA COLS=30 ROWS=10><%RS("UserTel")%></TEXTAREA> <HR> <% RS.MoveNext WEND %> </FORM> </BODY> <HTML> <% ' Close the Recordset and Connection RS.Close Conn.Close %> |
|
#2
|
||||
|
||||
|
hi wecome to this forum....can u explain in detail..what is your problem??
are u getting any error..
__________________
Nothing is Impossible bcoz IMPOSSIBLE itself says.. I M POSSIBLE........................ Be cool !!!!!!!!
|
|
#3
|
|||
|
|||
|
Hi Guddu,
Thanks for welcoming. Yes, I am facing a problem at acknowledge.asp. It did not display the "Thank you" page after submitting the feedback.form. Can you advise me what should I do? |
|
#4
|
||||
|
||||
|
try this at acknowledge.asp
Code:
<%
'Retrieve form fields into variables
userEmail=Replace(Request("userEmail"),"'","''")
comments=Replace(Request("Comments"),"'","''")
userName=Replace(Request("Username"),"'","''")
userTel=Replace(Request("UserTel"),"'","''")
'Check for empty content
IF Email="" THEN Email="Unknown"
IF Contents="" THEN Contents="None"
'Grab the user's IP address
UserIP=Request.ServerVariables("Remote_ADDR")
'Create the SQL command string
MySQL="INSERT Feedback(comments,userEmail, userName, userTel)VALUES('"&comments&"','"&userEmail&"','"&userName&",'"&userTel&"')"
'response.Write(mysql)
'response.end
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=username;pwd=password ;database=databasename;option=NUM"
conn.execute(mysql)
%>
<HTML>
<HEAD><TITLE>THANK YOU</TITLE>
<BODY>
<H2>Thank you! </H2>
</BODY>
</HTML>
Last edited by Guddu : March 2nd, 2006 at 12:29 AM. |
|
#5
|
|||
|
|||
|
Thanks Guddu for your fast reply. However, it doesn't work.
The feedback.htm displayed an error message right at the bottom of the form - "Error: Unable to read footer file. " When I click submit, the acknowledge.asp showed that "There is a problem with the page you are trying to reach and it cannot be displayed." What should I do next? |
|
#6
|
||||
|
||||
|
viplet u first do what i m saying..
in your browser window click on tools menu-->internetoptions-->advanced->uncheck show friendly http errors u unchecked the checkbox show hriendlly http errors.. and refresh your browser..it will show actual error.. one more thing i had edited my previous post...so again copy my previous post contents and paste it over your code.. |
|
#7
|
||||
|
||||
|
viplet u first do what i m saying..
in your browser window click on tools menu-->internetoptions-->advanced->uncheck show friendly http errors u unchecked the checkbox show friendly http errors.. and refresh your browser..it will show actual error.. one more thing i had edited my previous post...so again copy my previous post contents and paste it over your code.. |
|
#8
|
|||
|
|||
|
Hi Guddu,
I have followed your instruction, and amended mysql to version 5.0, instead of 3.51 as I double-check the database should be 5.0 driver. However, I still recieved this problem displaying "Microsoft OLE DB Provider for ODBC Driverserror '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /scripts/acknowledge.asp, line 20 " What should I do? |
|
#9
|
||||
|
||||
|
|
|
#10
|
|||
|
|||
|
Thanks Guddu for all your effort and help! Really appreciated.
![]() But, my problem linking to the database is still remain unsloved. Hope that I can get a solution as I already email the web hosting in-charge to find out from them. |
|
#11
|
||||
|
||||
|
what is your database name..cross check it..check u have latest driver installed or not..have any problem...free to ask here
Code:
conn.open "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=username;pwd=password ;database=databasename;option=NUM"
|
|
#12
|
|||
|
|||
|
Help Need Urgently
Hi,
I am sorry. However the script is not working. I really in need of help in this. After submitting the feedback form, the acknowledge.asp display an error: Last edited by Viplet : March 7th, 2006 at 09:08 PM. Reason: Editing script |
|
#13
|
|||
|
|||
|
<%
'Retrieve form fields into variables Email=Replace(Request.Form("Email"),"'","''") Contents=Replace(Request.Form("Contents"),"'","''") 'Check for empty content IF Email="" THEN Email="Unknown" IF Contents="" THEN Contents="None" 'Grab the user's IP address UserIP=Request.ServerVariables("Remote_ADDR") 'Create the SQL command string MySQL="INSERT Feedback(comments,userEmail, userName, userTel) VALUES('"&comments&","&userEmail&"','"&userName&";,'"&userTel&"')" 'Insert the form data into the Feedback table Set Conn = Server.CreateObject("ADODB.Connection") Connstr = "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=servername;pwd=passwo rd;database=database;option=NUM" Conn.Open Connstr Conn.Execute("MySQL") %> <HTML> <HEAD><TITLE>THANK YOU</TITLE> <BODY> <H2>Thank you! </H2> </BODY> </HTML> |
|
#14
|
|||
|
|||
|
The error displayed at the acknowledge.asp is:
Microsoft VBScript compilation error '800a0409' Unterminated string constant /Scripts/acknowledge.asp, line 14 MySQL="INSERT Feedback(comments,userEmail, userName, userTel)-------------------------------------------------------------^ |