|
| |
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
If...then driving me nuts - 3/31/2001 22:04:00
I have been working on this problem for about 5 hours without any luck. I am using an if...then statement. I want every promoter whose company begins with a * to get a special price (these are comarketers if they have a * before their name). That said, here is my statement:<% If session("x_company")= "*%" then response.write "$4.99" else response.write "$9.99" end if %> I don't get an error message. It just is keeping the 9.99 price no matter what "x_company" is entered. I even tried hard coding by switching "*%" to a real name, and I still had the same problem. Help! I am going crazy. Thanks in advance. ------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: If...then driving me nuts - 3/31/2001 22:49:00
You cant use a wildcard for that.If you are trying to detect "*" then do something like : <% If Instr(session("x_company"),"*") then response.write "$4.99" else response.write "$9.99" end if %>
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: If...then driving me nuts - 3/31/2001 22:55:00
I HAVE GOT TO LEARN TO DO THIS STUFF CORRECTLY!!!! (Caps intentional!) ------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: If...then driving me nuts - 3/31/2001 23:11:00
Still isn't working. It works, but then when I made a change in the "x_company" name to check if it is working in the other direction, my results aren't changing. Could this have something to do with the fact that I am basing this on a session?
------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: If...then driving me nuts - 4/3/2001 20:51:00
Could this problem have anything to do with the code being on a Spooky Login script page?------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: If...then driving me nuts - 4/3/2001 17:04:00
x_company isnt a session (or wasnt) have you made it one or why is it a session?
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: If...then driving me nuts - 4/3/2001 17:18:00
Like I've said befor...I know enough to sound stupid.When someone logs in with their username, x_company is the accompanying company name. ------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: If...then driving me nuts - 4/3/2001 18:49:00
When someone logs in, the user name is kept as a session, but little else. With the default login, I dont fetch company name (or many details) at all.Normally you would identify the user by username or access level. There would be a few extra steps to add company as part of the login information. Is it really whats needed or is there another way?
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: If...then driving me nuts - 4/3/2001 19:09:00
Well, yes. By Promoter name which is on a different table from the Spooky Login User table (as you would know).Here is my goal. 1. A Promoter logs in using User Name 2. A database is now used to display in his company name in a text field off of the PROMOTER table 3. Now, If this Promoter's name begins with a *, that means he gets certain discounts. So: <%If FP_FieldHTML(fp_rs,"Promoter")LIKE "**" then response.write "$4.99" else response.write "$9.99" end if %> (My made up asp) The FP_FieldHTML(fp_rs,"Promoter") falls OUTSIDE of the final databse include This is all being done on a form page being submitted to a database Hope this doesn't confuse things more! ------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: If...then driving me nuts - 4/3/2001 19:53:00
So would it work if you did this inside the DRW?<% If Instr(FP_FieldHTML(fp_rs,"Promoter") ,"*") then response.write "$4.99" else response.write "$9.99" end if %> Is there more than 1 price per page? if so, how/why are you doing it outside the DRW?
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: If...then driving me nuts - 4/3/2001 20:36:00
OK, so far so good. This is working inside the DRW area. Now, how do I have this work "outside" of the DRW (outside of the last include statement)?------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: If...then driving me nuts - 4/4/2001 20:28:00
Add it to a variable?<% DIM sPrice If Instr(FP_FieldHTML(fp_rs,"Promoter") ,"*") then sPrice = "$4.99" else sPrice = "$9.99" end if %> Elsewhere use <%=sPrice%>
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: If...then driving me nuts - 4/4/2001 21:21:00
Excellent. And I learned a new concept! ------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|