Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2006, 10:14 AM
Registered User
 
Join Date: Apr 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP QueryString ...

can someone tell me what is wrong with the link parameters, I get the first parameter correctly on the page that is called...

<a href="ftp.asp?lok=<%=lokacija%>&dat=<%=ime%>"><img border=0 src=move.JPG></a>

 
Old May 5th, 2006, 11:39 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Very hard to tell from this, what href gets rendered - after the .asp has been processed?

Thanks,

Chris
 
Old May 6th, 2006, 01:24 PM
Registered User
 
Join Date: Apr 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I used the trim string function to remove the blank spaces after the lok querystring, everything is fine with the strings now...
Anyway thanks for the reply...

Next thing I have problems with is how to save the username of a user that has logged in to the site, so I can later pass that value to another to another page which will write that information to the sql database table? I have tried with cookies but no use, if required I can post the code I have so far...

 
Old May 7th, 2006, 12:56 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

IMO you are better to use a server side solution for carry ing a users details from page to page. Personally I carry thier ID from the users table (must be unique. Get it at the time you validate thier login details) then use this ID to get what ever information I wish for what ever page in your SQL. There are several options to carry the value:
1..hidden (or visible of course) form variables
2..Session variable
3..Querystring
These are in my order of preference. Use a QS as a last resort. Simply for the reason users can change these values in the address bar. IMO A security and data integrity risk.

FYI: You should use the trim function around all relavent values. Even if you dont think you need to. If its in place its a possible problem eliminated and generally good practice

Wind is your friend
Matt
 
Old May 7th, 2006, 12:06 PM
Registered User
 
Join Date: Apr 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Matt for the explanation, but I am really a first time user and really inexperienced with the asp, would you care to post a sample of how to do it over IDs or session variables?
Thanks

 
Old May 7th, 2006, 06:21 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;would you care to post a sample of how to do it over IDs or session variables?

To carry the ID in a session variable my method would be to get the unique ID once you have validated a user and assign it to a session variable like so:

session("SomeVaribaleName") = recordSetName("uId")

Form now on what ever page they visit, providing the sesion is still active you can identify a user with this value. For more information have a look at:

http://www.w3schools.com/ASP/asp_sessions.asp

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
using querystring melkin Classic ASP Basics 7 April 1st, 2008 09:07 AM
Problem with QueryString in ASP s.abraham ASP.NET 1.0 and 1.1 Basics 1 March 22nd, 2005 04:43 PM
Querystring in ASP.NET whiterainbow .NET Framework 2.0 4 March 2nd, 2005 02:26 AM
cant make a link with Querystring in ASP zakarya_hazara Classic ASP Basics 6 October 10th, 2004 01:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.