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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 2nd, 2003, 09:32 AM
Jonny5uk Jonny5uk is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 62 Jonny5uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 10 sec
Reputation Power: 6
Complications with variable passing

Hi there,

I'm having problems with passing variables to another asp page.
This is due to the fact that the variables I want to pass are getting captured in an email (this is fine) but are not going to the next page.(not fine !)

Ok, so heres what I want to do....

Basically I have 2 pages and on the first is a form, which currently has it variables being captured and emailed using POST and a CGI action which sends them to an email address. This stuff can't be changed as the action is on an external server, which I don't have access to.

What I want to do is to duplicate the variables I need so they get passed the the next page, aswell as going off in the email. At the moment, they just get captured and no variables come to the next page.

I was thinking maybe I could add some sort of hidden form, that has the same hidden fields names, but doesn't get emailed, it just goes to the next page, but wasn't sure how it would duplicate the information that has been entered into the visual form. The only fields I was to pass are 'First_Name', 'Last_Name' and 'Email'

If anyone has any ideas on how to do this, that would be much appreciated.

I did see a similar post, but couldn't quite get it to do what I wanted.

Thanks in advance....

Jon

Reply With Quote
  #2  
Old July 2nd, 2003, 12:55 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
If the *only* fields you need are 'First_Name', 'Last_Name' and 'Email'

Then why not use cookies ?

Put them into cookies then, on your second page retrieve the values from the cookies? no?

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old July 2nd, 2003, 01:40 PM
Shad Shad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 24 Shad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Putting the values into Session variables would be more efficient and more robust.

Code:
Session("myvalue") = Request.Form("myformfield")

...

strMyValue = Session("myvalue")
Use Session.Abandon to clear all sessions once you're done using them.

Reply With Quote
  #4  
Old July 2nd, 2003, 01:57 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
How would that be *would be more efficient* then cookies ?

I'm curious(besides the fact that a cookie can only hold a small amount of data) but since the poster only wanted the 'First_Name', 'Last_Name' and 'Email' then cookies is efficient enough!


But its definitely not *more robust* in fact, each time you declare/use a Session variable it uses a chunk of memory on the server(Ya ok a small chunk) but its still a chunk.

Multiply that chunk of memory by 1000 users a day for example and what if the user goes out for lunch, comes back an hour later. No activity on the site for an hour, decides to cotinue with what he/she was doing, you've completely lost the content of the data inside the Session variables(Of course you could always set the timeout to 5 hours if you wanted but wouldn't that be *less robust*?)

For small jobs/data stick with cookies(unless you want to pass the data via the QueryString)

Oh and if someone says "But what if the user's browser don't support cookies?" well in that case, Session variables wont work either...try it!

I'm curious that's all

Vlince

Reply With Quote
  #5  
Old July 2nd, 2003, 03:08 PM
Shad Shad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 24 Shad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by Vlince
Oh and if someone says "But what if the user's browser don't support cookies?" well in that case, Session variables wont work either...try it!
That was my reasoning... is this behaviour documented?

Reply With Quote
  #6  
Old July 2nd, 2003, 03:23 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Here is a good article:

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=30

The last paragraph says it all

Of course, if, on another page, the value of Session("Message") is referenced, only those users who have cookies enabled will have a value of "Hello, World!" there.

Vlince

Reply With Quote
  #7  
Old July 2nd, 2003, 03:40 PM
Shad Shad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 24 Shad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I didn't know that

Even so, less bandwidth used with a session so it should be quicker (less i/o as a result). If cookies are disabled neither method would work.

Reply With Quote
  #8  
Old July 2nd, 2003, 06:03 PM
Jonny5uk Jonny5uk is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 62 Jonny5uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 10 sec
Reputation Power: 6
Quote:
Originally posted by echolalia
I'm not quite clear on what you're trying to achieve, do you need to capture the form data in an ASP script before it goes to an external CGI script?


Hi there, thanks for all the replies, much appreciated !

echolalia - I'm basically trying to pass the form variables to the second page, but at present they get captured in a cgi script and emailed without being passed to the next page. I think what I need to do, is somehow save them (as suggested by the other guys, maybe using cookies or session variables), or duplicate them so that one set of information is emailed, and the other (duplicate) is also passed to the next page.

Shad & Vlince, - thanks for your suggestions here guys, I haven't done much with either cookies or session variables, but will definitely investigate both options as hadn't considered them before.

Many thanks for all replies

Jon

Reply With Quote
  #9  
Old July 3rd, 2003, 05:47 AM
Jonny5uk Jonny5uk is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 62 Jonny5uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 10 sec
Reputation Power: 6
Hi guys,

I'm still not having much luck with this,

echolalia- I tried your code, but can't quite follow it, where do I need to put the ;

<body onLoad="document.getElementById('form1').submit()">

and I'm presuming the above, shouldn't be in asp tags?

I noticed that you then have the form request code, but I have this code on my second page, where I want to display the data.

If you might be able to give me a few more pointers for the code, that would be great (my coding is not that great !)




Shad - I have tried but, with no avail to get session variables to work.

On my first page (I'm using dreamweaver MX) I have my 3 input boxes for first_name, surname, email and have created session variables to match these.... i.e.

<input name="first_name" type="text" id="first_name" value="<%= Session("first_name") %>">

I can only get these to show on the next page if I remove the email function, as it still seems to be capturing the code and not passing it to the next page. So my variables are empty on the other page.

My code to display the variables is simply...

<%= Session("first_name") %>

I just put this on the page and it works fine, when the email function is disabled.


On another note, I'm wondering if it might be worth trying to use a mail program such as CDONTS, as maybe this might allow variables to be passed, rather than just capturing them and emailing them, without passing to the next page? If anyone has any ideas, that would be appreciated !

Many thanks

Jon

Reply With Quote
  #10  
Old July 4th, 2003, 04:11 AM
Jonny5uk Jonny5uk is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 62 Jonny5uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 10 sec
Reputation Power: 6
Hi echolalia,

Thanks for clarifying that, I'm trying to implement the code, but where I have entered the;

<body onLoad="document.getElementById('form1').submit()">

it is within my other onload content, i.e....

onLoad="document.getElementById('theForm').submit()","MM_preloadImages('images/over/leftmenu_02.gif'

,'images/over/leftmenu_04.gif','images/over/leftmenu_05.gif','images/over/leftmenu_06.gif">

However, as soon as the page then loads, my form gets submitted before I have a chance to enter anything in it? I can only assume that I have entered this code at the wrong stage of the page?

If you have any ideas, that would be much appreciated, as I'm a bit stuck at the moment !

Thanks

Jon

Reply With Quote
  #11  
Old July 4th, 2003, 05:39 AM
Jonny5uk Jonny5uk is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 62 Jonny5uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 10 sec
Reputation Power: 6
Hi echolalia,

Don't worry about the previous comment, I have managed to fix it using CDONTS, and removing the CGI email function. This works as CDONTS passes the variables to the second page, and then sends them, rather than sending on the first page.

Many thanks for your (and others) replies, all of which, much appreciated.

Kind Regards

Jon

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Complications with variable passing


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway