a very simple problem!

J

janet

hi ...

When i click to the submit button, i want to insert value
from the a text box to the mysql db. But when i enter text
in the text box nothing happens on clickign the submit
button. can anyone help me with ..
i am goign crazy

pls see the code below:

<table><tr><td bgcolor="SILVER">
<BIG> <B> <FONT COLOR=blue>
WELCOME 'STUDENT_NAME'

TODAY IS <%=DATE()%></b></td><p></p></tr>
</table><p></p>
<input type = "text" size ="50" maxlength=90 name
= "txtStory"><p></P>
<input type="button" value="DRAFT" name="draft"><p></p>
<input type="button" value="SUBMIT" name="submit">

<%
Dim strStoryContent
DIM RSA
DIM QUERY1
DIM ConnString
DIM Conn

ConnString = "Driver={MySQL ODBC 3.51 Driver};"
ConnString = ConnString & "Port=3306; "
ConnString = ConnString & "DATABASE=test; "
strStoryContent = Request.Form("txtStory")

If(Request.querystring("Submit")) <> "" then
response.write "come1" ....this doesnt get printed!!!!
If Request("txtStory") <> "" then
response.write "come2"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString
set RSA = Server.CreateObject("ADODB.Recordset")
QUERY1 = "INSERT INTO student_content
(student_id,story_id,status_student,story_original_story_wo
rd_count) VALUES
('1','100','draft','"&strStoryContent&"',4)"
Set rsa = conn.Execute(QUERY1)
End If
end if
%>
thanks a lot
 
K

Ken Schaefer

Where is <form></form> tags?

Suggest you *validate* your HTML first:
http://validator.w3.org

Cheers
Ken

: hi ...
:
: When i click to the submit button, i want to insert value
: from the a text box to the mysql db. But when i enter text
: in the text box nothing happens on clickign the submit
: button. can anyone help me with ..
: i am goign crazy
:
: pls see the code below:
:
: <table><tr><td bgcolor="SILVER">
: <BIG> <B> <FONT COLOR=blue>
: WELCOME 'STUDENT_NAME'
:
: TODAY IS <%=DATE()%></b></td><p></p></tr>
: </table><p></p>
: <input type = "text" size ="50" maxlength=90 name
: = "txtStory"><p></P>
: <input type="button" value="DRAFT" name="draft"><p></p>
: <input type="button" value="SUBMIT" name="submit">
:
: <%
: Dim strStoryContent
: DIM RSA
: DIM QUERY1
: DIM ConnString
: DIM Conn
:
: ConnString = "Driver={MySQL ODBC 3.51 Driver};"
: ConnString = ConnString & "Port=3306; "
: ConnString = ConnString & "DATABASE=test; "
: strStoryContent = Request.Form("txtStory")
:
: If(Request.querystring("Submit")) <> "" then
: response.write "come1" ....this doesnt get printed!!!!
: If Request("txtStory") <> "" then
: response.write "come2"
: Set Conn = Server.CreateObject("ADODB.Connection")
: Conn.Open ConnString
: set RSA = Server.CreateObject("ADODB.Recordset")
: QUERY1 = "INSERT INTO student_content
: (student_id,story_id,status_student,story_original_story_wo
: rd_count) VALUES
: ('1','100','draft','"&strStoryContent&"',4)"
: Set rsa = conn.Execute(QUERY1)
: End If
: end if
: %>
: thanks a lot
 
J

janet

hey hi ...

thanks a lot for such a quick response.

u r right i didnt put the form tag! silly on my part. i
made the following changes (see below) but still nothing
happens. I am newbie and maybe asking a silly question for
you to recheck. please see if u suggest something.

thanks a lot again

<form action="aftStSelection.asp" method="post">
<table><tr><td bgcolor="SILVER">
<BIG> <B> <FONT COLOR=blue>
WELCOME 'STUDENT_NAME'

TODAY IS <%=DATE()%></b></td><p></p></tr>
</table><p></p>
<input type = "text" size ="50" maxlength=90 name
= "txtStory"><p></P>
<input type="button" value="DRAFT" name="draft"><p></p>
<input type="button" value="SUBMIT" name="submit">
</form>

<%
Dim strStoryContent
DIM RSA
DIM QUERY1
DIM ConnString
DIM Conn

ConnString = "Driver={MySQL ODBC 3.51 Driver};"
ConnString = ConnString & "Port=3306; "
ConnString = ConnString & "DATABASE=test; "
strStoryContent = Request.Form("txtStory")

If(Request.querystring("Submit")) <> "" then
response.write "come1"
If Request("txtStory") <> "" then
response.write "come2"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString
set RSA = Server.CreateObject("ADODB.Recordset")
QUERY1 = "INSERT INTO student_content
(student_id,story_id,status_student,story_original_story_wo
rd_count) VALUES
('1','100','draft','"&strStoryContent&"',4)"
Set rsa = conn.Execute(QUERY1)
End If
end if
%>
 
K

Ken Schaefer

Change:

If Request.querystring("Submit") <> "" then

to

If Request.Form("Submit") <> "" then

Cheers
Ken

: hey hi ...
:
: thanks a lot for such a quick response.
:
: u r right i didnt put the form tag! silly on my part. i
: made the following changes (see below) but still nothing
: happens. I am newbie and maybe asking a silly question for
: you to recheck. please see if u suggest something.
:
: thanks a lot again
:
: <form action="aftStSelection.asp" method="post">
: <table><tr><td bgcolor="SILVER">
: <BIG> <B> <FONT COLOR=blue>
: WELCOME 'STUDENT_NAME'
:
: TODAY IS <%=DATE()%></b></td><p></p></tr>
: </table><p></p>
: <input type = "text" size ="50" maxlength=90 name
: = "txtStory"><p></P>
: <input type="button" value="DRAFT" name="draft"><p></p>
: <input type="button" value="SUBMIT" name="submit">
: </form>
:
: <%
: Dim strStoryContent
: DIM RSA
: DIM QUERY1
: DIM ConnString
: DIM Conn
:
: ConnString = "Driver={MySQL ODBC 3.51 Driver};"
: ConnString = ConnString & "Port=3306; "
: ConnString = ConnString & "DATABASE=test; "
: strStoryContent = Request.Form("txtStory")
:
: If(Request.querystring("Submit")) <> "" then
: response.write "come1"
: If Request("txtStory") <> "" then
: response.write "come2"
: Set Conn = Server.CreateObject("ADODB.Connection")
: Conn.Open ConnString
: set RSA = Server.CreateObject("ADODB.Recordset")
: QUERY1 = "INSERT INTO student_content
: (student_id,story_id,status_student,story_original_story_wo
: rd_count) VALUES
: ('1','100','draft','"&strStoryContent&"',4)"
: Set rsa = conn.Execute(QUERY1)
: End If
: end if
: %>
:
:
:
: >-----Original Message-----
: >Where is <form></form> tags?
: >
: >Suggest you *validate* your HTML first:
: >http://validator.w3.org
: >
: >Cheers
: >Ken
: >
: >: >: hi ...
: >:
: >: When i click to the submit button, i want to insert
: value
: >: from the a text box to the mysql db. But when i enter
: text
: >: in the text box nothing happens on clickign the submit
: >: button. can anyone help me with ..
: >: i am goign crazy
: >:
: >: pls see the code below:
: >:
: >: <table><tr><td bgcolor="SILVER">
: >: <BIG> <B> <FONT COLOR=blue>
: >: WELCOME 'STUDENT_NAME'
: >:
: >: TODAY IS <%=DATE()%></b></td><p></p></tr>
: >: </table><p></p>
: >: <input type = "text" size ="50" maxlength=90 name
: >: = "txtStory"><p></P>
: >: <input type="button" value="DRAFT" name="draft"><p></p>
: >: <input type="button" value="SUBMIT" name="submit">
: >:
: >: <%
: >: Dim strStoryContent
: >: DIM RSA
: >: DIM QUERY1
: >: DIM ConnString
: >: DIM Conn
: >:
: >: ConnString = "Driver={MySQL ODBC 3.51 Driver};"
: >: ConnString = ConnString & "Port=3306; "
: >: ConnString = ConnString & "DATABASE=test; "
: >: strStoryContent = Request.Form("txtStory")
: >:
: >: If(Request.querystring("Submit")) <> "" then
: >: response.write "come1" ....this doesnt get printed!!!!
: >: If Request("txtStory") <> "" then
: >: response.write "come2"
: >: Set Conn = Server.CreateObject("ADODB.Connection")
: >: Conn.Open ConnString
: >: set RSA = Server.CreateObject("ADODB.Recordset")
: >: QUERY1 = "INSERT INTO student_content
: >:
: (student_id,story_id,status_student,story_original_story_wo
: >: rd_count) VALUES
: >: ('1','100','draft','"&strStoryContent&"',4)"
: >: Set rsa = conn.Execute(QUERY1)
: >: End If
: >: end if
: >: %>
: >: thanks a lot
: >
: >
: >.
: >
 
J

janet

hey thanks ken for at least posting in some options.

i had already tried this thing before. I feel i am doign
some very silly mistake.

its still doesnt work!
 
K

Ken Schaefer

Can you add this:

<%
If Request.Form("Submit") <> "" then
' your existing stuff here
Else
Response.Write("Submit is a zero length string")
End If
%>

and tell us what you see on the screen?

(When you say: "You tried this before, and it didn't work" - it didn't work
before because you had no <form></form> tags right?)

Cheers
Ken


: hey thanks ken for at least posting in some options.
:
: i had already tried this thing before. I feel i am doign
: some very silly mistake.
:
: its still doesnt work!
:
: >-----Original Message-----
: >Change:
: >
: >If Request.querystring("Submit") <> "" then
: >
: >to
: >
: >If Request.Form("Submit") <> "" then
: >
: >Cheers
: >Ken
: >
: >: >: hey hi ...
: >:
: >: thanks a lot for such a quick response.
: >:
: >: u r right i didnt put the form tag! silly on my part. i
: >: made the following changes (see below) but still nothing
: >: happens. I am newbie and maybe asking a silly question
: for
: >: you to recheck. please see if u suggest something.
: >:
: >: thanks a lot again
: >:
: >: <form action="aftStSelection.asp" method="post">
: >: <table><tr><td bgcolor="SILVER">
: >: <BIG> <B> <FONT COLOR=blue>
: >: WELCOME 'STUDENT_NAME'
: >:
: >: TODAY IS <%=DATE()%></b></td><p></p></tr>
: >: </table><p></p>
: >: <input type = "text" size ="50" maxlength=90 name
: >: = "txtStory"><p></P>
: >: <input type="button" value="DRAFT" name="draft"><p></p>
: >: <input type="button" value="SUBMIT" name="submit">
: >: </form>
: >:
: >: <%
: >: Dim strStoryContent
: >: DIM RSA
: >: DIM QUERY1
: >: DIM ConnString
: >: DIM Conn
: >:
: >: ConnString = "Driver={MySQL ODBC 3.51 Driver};"
: >: ConnString = ConnString & "Port=3306; "
: >: ConnString = ConnString & "DATABASE=test; "
: >: strStoryContent = Request.Form("txtStory")
: >:
: >: If(Request.querystring("Submit")) <> "" then
: >: response.write "come1"
: >: If Request("txtStory") <> "" then
: >: response.write "come2"
: >: Set Conn = Server.CreateObject("ADODB.Connection")
: >: Conn.Open ConnString
: >: set RSA = Server.CreateObject("ADODB.Recordset")
: >: QUERY1 = "INSERT INTO student_content
: >:
: (student_id,story_id,status_student,story_original_story_wo
: >: rd_count) VALUES
: >: ('1','100','draft','"&strStoryContent&"',4)"
: >: Set rsa = conn.Execute(QUERY1)
: >: End If
: >: end if
: >: %>
: >:
: >:
: >:
: >: >-----Original Message-----
: >: >Where is <form></form> tags?
: >: >
: >: >Suggest you *validate* your HTML first:
: >: >http://validator.w3.org
: >: >
: >: >Cheers
: >: >Ken
: >: >
: >: >: >: >: hi ...
: >: >:
: >: >: When i click to the submit button, i want to insert
: >: value
: >: >: from the a text box to the mysql db. But when i enter
: >: text
: >: >: in the text box nothing happens on clickign the
: submit
: >: >: button. can anyone help me with ..
: >: >: i am goign crazy
: >: >:
: >: >: pls see the code below:
: >: >:
: >: >: <table><tr><td bgcolor="SILVER">
: >: >: <BIG> <B> <FONT COLOR=blue>
: >: >: WELCOME 'STUDENT_NAME'
: >: >:
: >: >: TODAY IS <%=DATE()%></b></td><p></p></tr>
: >: >: </table><p></p>
: >: >: <input type = "text" size ="50" maxlength=90 name
: >: >: = "txtStory"><p></P>
: >: >: <input type="button" value="DRAFT"
: name="draft"><p></p>
: >: >: <input type="button" value="SUBMIT" name="submit">
: >: >:
: >: >: <%
: >: >: Dim strStoryContent
: >: >: DIM RSA
: >: >: DIM QUERY1
: >: >: DIM ConnString
: >: >: DIM Conn
: >: >:
: >: >: ConnString = "Driver={MySQL ODBC 3.51 Driver};"
: >: >: ConnString = ConnString & "Port=3306; "
: >: >: ConnString = ConnString & "DATABASE=test; "
: >: >: strStoryContent = Request.Form("txtStory")
: >: >:
: >: >: If(Request.querystring("Submit")) <> "" then
: >: >: response.write "come1" ....this doesnt get
: printed!!!!
: >: >: If Request("txtStory") <> "" then
: >: >: response.write "come2"
: >: >: Set Conn = Server.CreateObject("ADODB.Connection")
: >: >: Conn.Open ConnString
: >: >: set RSA = Server.CreateObject("ADODB.Recordset")
: >: >: QUERY1 = "INSERT INTO student_content
: >: >:
: >:
: (student_id,story_id,status_student,story_original_story_wo
: >: >: rd_count) VALUES
: >: >: ('1','100','draft','"&strStoryContent&"',4)"
: >: >: Set rsa = conn.Execute(QUERY1)
: >: >: End If
: >: >: end if
: >: >: %>
: >: >: thanks a lot
: >: >
: >: >
: >: >.
: >: >
: >
: >
: >.
: >
 
K

Ken Schaefer

Change:

<input type="button" value="SUBMIT" name="submit">

to

<input type="submit" value="submit">

You have two normal buttons, either of which is submitting the form.

Cheers
Ken


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: yes ...it is goign to the else part???but why is this
: happening????????????????
: >-----Original Message-----
: >Can you add this:
: >
: ><%
: >If Request.Form("Submit") <> "" then
: > ' your existing stuff here
: >Else
: > Response.Write("Submit is a zero length string")
: >End If
: >%>
: >
: >and tell us what you see on the screen?
: >
: >(When you say: "You tried this before, and it didn't
: work" - it didn't work
: >before because you had no <form></form> tags right?)
: >
: >Cheers
: >Ken
 
J

janet

thanks ken ... no progress..i have now divided the code
into 2 pages. let me post a fresh query to have fresh
feedback....its sickening !!!!!!!!!!

thanks
 
G

Guinness Mann

Change:

If Request.querystring("Submit") <> "" then

to

If Request.Form("Submit") <> "" then

Would someone remind me again what is evil about "Request("Submit")"?

-- Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top