PDA

View Full Version : Passing Hidden Variables in ASP


ppatwari
05-31-2003, 02:27 PM
Hi

I have two asp pages: x.asp & y.asp .

Now user comes and fills out form in x.asp. He fills out his name, address and book title, then presses submit and y.asp gets executed. It sends an email to the user with his name and address he entered. On y.asp there is one button which will again take user to x.asp and carries his name, address as hidden fields. Again user fills out his book title and presses submit and y.asp sends him an email. But this time in the email his name is cut-off. i.e. first time he entered John Smith, but when this name is passed as a hidden variable to x.asp again, it appears as "John". After a space everything is trncated. How can I go around it?

Thanks for your help.

skriptkiddie
05-31-2003, 10:46 PM
I think I know what the problem is but need to see the relevant code for the form. If it's what I think it is you probably didn't put the hidden form field *value* in quotes.

ppatwari
05-31-2003, 10:50 PM
I got it working. Quotes were the reason.

Thanks

Bullschmidt
06-02-2003, 12:33 AM
<<
I got it working. Quotes were the reason.
>>

Can we quote you on that? :)

ppatwari
06-02-2003, 02:09 AM
Yes, you can. I put value='value_of_the_variable' instead of value=value_of_the_variable and it worked fine. Strings stopped truncating.

Bullschmidt
06-02-2003, 06:20 AM
That makes sense - I get it!

freejoe76
06-02-2003, 01:01 PM
Hi,

Working on an light ASP shopping cart of my own, have a login page ( login.asp ) that redirects to the item selection page ( menu.asp) .

The login script checks if login and password match the database entry, if so then the user is redirected to menu.asp. However, I want to pass the login name to menu.asp ( and store it in menu.asp as a hidden field ) ... and so far, I can't do it.

Any ideas why / any workarounds?

Thanks,
Joe

Bullschmidt
06-02-2003, 01:52 PM
Well you might try Sever.Transfer instead of Response.Redirect.

http://www.tek-tips.com/viewthread.cfm?SQID=564410&SPID=333&page=1

freejoe76
06-02-2003, 02:08 PM
thanks for the server.transfer tip, unfortunately, the tektips link redirects you to the home page ( I'm assuming its a referrer matter, but haven't found the right page to hit your link from ) . . .

Bullschmidt
06-02-2003, 02:16 PM
You might try the other link again (believe it or not) and here's another link too which MIGHT touch on the same thing:

New Directions in Redirection: Microsoft Internet Information Services 5.0 Provides Two New Methods for Redirection by Ram Papatla
http://msdn.microsoft.com/msdnmag/issues/0400/redir/redir.asp