ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 5th, 2003, 05:38 PM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
help again plz

what ever i do the response is: 'not good'
whats wrong?


set c2=Server.CreateObject("ADODB.connection")
set r2=Server.CreateObject("ADODB.recordset")

c2.Open "DBQ= " & server.MapPath ("forum.mdb")& "; Driver={Microsoft Access Driver (*.mdb)};"
r2.CursorType=adOpenKeyset

r2.open "member", c2,3,3

dim id,un,fn,ln,pass,mal,age,add
id=Request.Form("tetx1")
un=Request.Form("text2")
pass=Request.Form("password1")
mal=Request.Form("tetx1")
fn=Request.Form("text5")
ln=Request.Form("text6")
age=Request.Form("tetx7")
add=Request.Form("text8")

if id<>"" and un<>"" and pass<>"" and mal<>"" and fn<>"" and ln<>"" and age<>"" and add<>"" then

r2.AddNew
r2("userid")=id
r2("nick")=un
r2("password")=pass
r2("email")=mal
r2("fname")=fn
r2("lname")=ln
r2("year")=age
r2("address")=add
r2("dateadd")=date()
r2.Update

Response.Write "good"

else
Response.Write "not good"
end if

r2.Close
set r2=nothing
c2.Close
set c2=nothing

Reply With Quote
  #2  
Old September 5th, 2003, 10:56 PM
suhail_kcr suhail_kcr is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 7 suhail_kcr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi !
U sure these are correct

--- > id=Request.Form("tetx1")
un=Request.Form("text2")
pass=Request.Form("password1")
---> mal=Request.Form("tetx1")
fn=Request.Form("text5")
ln=Request.Form("text6")
---> age=Request.Form("tetx7")
add=Request.Form("text8")

Thanks
Suhail kaleem

Reply With Quote
  #3  
Old September 6th, 2003, 12:36 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
when posting, please use acceptable titles, many are less willing to help with titles like this, read the sticky at the top for more info.

Reply With Quote
  #4  
Old September 6th, 2003, 06:25 AM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i'm sure its correct.
why would it be incorrect?

Reply With Quote
  #5  
Old September 6th, 2003, 10:49 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,957 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 15 h 35 m 19 sec
Reputation Power: 802
If a text field is blank, it won't return "", it will be empty or null, which is <> ""

Reply With Quote
  #6  
Old September 6th, 2003, 11:37 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
when you have HUUUUUGEE if statements like this were it depends on so many values like this and you're not getting the results you want, step one is as doug implies displaying each item to see if one of the values is not coming through as expected and which one to isolate it rather then going, oh crap, my program doesn't work, why?

Reply With Quote
  #7  
Old September 6th, 2003, 12:37 PM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
well, i did what u said, but stilll got probs.

if the condition is :
if id="" then respose.write "not good"
else response.write "good"
no matter what i do, the result is "not good"
and if the condition is:
if id<>"" then response.write "not good"
else response.write "good"
no matter what i do the result is "good"
why?

Reply With Quote
  #8  
Old September 6th, 2003, 12:57 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
huh? just do
response.write Request.Form("tetx1")
response.write Request.Form("text2")
response.write Request.Form("password1")
response.write Request.Form("tetx1")
response.write Request.Form("text5")
response.write Request.Form("text6")
response.write Request.Form("tetx7")
response.write Request.Form("text8")

my other question is why do you assign

id=Request.Form("tetx1")
mal=Request.Form("tetx1")

this value to the a different variable?

Reply With Quote
  #9  
Old September 6th, 2003, 02:39 PM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how does doing it solve my problem?

the variables make the code easier to be understood.

Reply With Quote
  #10  
Old September 6th, 2003, 03:27 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
not really, in fact not at all. You've completely confused yourself and it's plainly obvious if you would just write out what the value of the variable is. Once you do you'll see why you have those results in the if statements you wrote... you have a value associated with id, so of course those values print out what they do.

If you printed the variables out they'd say "bob" or whatever else you assigned to them... it's up to you if you want to do it your way but you've spent a lot of time coding that and messing with your variables when if you just printed out the variables to the screen you'd see which variable is screwing up your if statement. There's really not much more i can do here than say that. And if you want to assign them to variables that's fine, it's just more to remember in my opinion, i think it's easier/safer to work with the response.form("") elements since they're read only and you just have to remember the name of the text box and not the variable as well. I was just recommending you print the variable out to the screen rather than deal with if then 's and good stuff, i'm not sure why you'd want to do that rather then just writing out the variables.

my other point earlier was that you assigned the same value to 2 different variables, that's odd and was making sure you knew you were doing that.

Reply With Quote
  #11  
Old September 6th, 2003, 04:13 PM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i noticed the double thing- thanx.

i changed the code and now it looks like this:

if Request.Form("tetx1")="" then
Response.Write "good"
else
response.write Request.Form("tetx1")
response.write Request.Form("text2")
response.write Request.Form("password1")
response.write Request.Form("tetx4")
response.write Request.Form("text5")
response.write Request.Form("text6")
response.write Request.Form("tetx7")
response.write Request.Form("text8")
end if

but the result is ALWAYS: "good".
its like the if doesnt even exist, why ?

thanx

Reply With Quote
  #12  
Old September 6th, 2003, 04:23 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
ack, we just can't get you off those if statements.

are you posting to this page? Because you have a form maybe it's this one or whatever, but when you hit submit on whatever page, that page HAS to point to this page and it HAS to be a post NOT a get. secondly, make sure you're text field is in fact called tetx1 and not text1 or something like that. i think before the if statement if you would just put
Code:
response.write "TEXT 1:::" & request.form("tetx1") & ":::<br>"

that'd solve ALL of your problems, but you're bent on this if statement for some reason. This value is clearly not being set, this page is not being posted to, or you misspelled the textbox name. i assume you're smart enough to put all this code in <% %> tags and in a .asp extension?

Reply With Quote
  #13  
Old September 6th, 2003, 05:01 PM
anav123 anav123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 17 anav123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanx!!!
the problem was that i wrote 'tetx1' instead of 'text1'. i cant believe i spent the whole day on this.

thank you vey much

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > help again plz


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |