Author |
Topic  |
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 11 July 2007 : 11:29:27
|
OK I will try to explain this a best I can.
There is a site that has like 100 stores and they want one contact form for all the stores. There site is set up like this www.somesite.com/3190/default.asp the number being the store number.
Now when you are at one of the store sites with the id in the url they want to click a contact link that will take them to like www.somesite.com/contact.html but they want this store number to be carried over so when someone submits the form on this page it will carry the store number in the contact form so they know which site it goes to.
How would I go about doign this I am guessing its a get/post function but not sure.
If you need more info I can provide it.
Thanks Jeff |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 11 July 2007 : 11:41:15
|
Does the contact page have to be HTML? Can it be ASP? If so then just pass the store id through the querystring.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 11 July 2007 : 11:44:50
|
The easiest way would be for you to get the ID value from the querystring and add it in a hidden field of the form... I see sometimes you're using .asp pages but the contact one is HTML? With HTML I don't see how you can do it... If it's an asp page, just do as I said, get the value and put it in a hidden form field. You could also add it to the target tag for the form, in the querystring, but the previous one is probably easier. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 11 July 2007 : 11:50:11
|
Sorry both can be .asp pages. Do you have some example code how I would do this? Everytime i have searched this I can only find .net and I can't seem to find example codes in classic asp. |
Edited by - JJenson on 11 July 2007 11:59:30 |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 11 July 2007 : 12:06:37
|
Either that or to keep from having to change the links on all the stores you could parse the referrer since the store ID is in the referring URL. Just a different perspective.  |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 11 July 2007 : 14:32:18
|
Mixing vbscript with HTML...
<%
strID = Request.QueryString("ID")
%>
<form name="demoForm" action="formProcess.asp" method="post">
<input type="hidden" name="ID" value="<%=strID%>">
...
</form>
You can then just retrieve the value in the "formProcess.asp" page. Be sure to sanitize it, though... |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 11 July 2007 : 14:46:54
|
Great thanks Rui. I am going to try and put this together on one of my sites with like 10 pages because I can't get their info for about 2 more weeks
Thanks and will post back if I have any issues. Thanks as always |
 |
|
PPSSWeb
Junior Member
 
312 Posts |
Posted - 11 July 2007 : 15:00:39
|
I like AnonJr's suggestion. If the store ID is referenced in the URL, then I would let the contact page handle the differences via the referrer value. That way if a store ID changes for some reason, you will only have to modify the contact page and not all the links to it from that store. |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 11 July 2007 : 15:12:28
|
hmm how would I go about doing that PPSSWEB I am new to these areas and am learing as I go.  |
 |
|
PPSSWeb
Junior Member
 
312 Posts |
Posted - 11 July 2007 : 15:28:34
|
quote: Originally posted by JJenson
hmm how would I go about doing that PPSSWEB I am new to these areas and am learing as I go. 
This should do it:
<% If Instr(Request.ServerVariables("HTTP_REFERER"), "/3190/") <> 0 Then [do stuff for this store ID] End If %> |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 11 July 2007 : 15:35:32
|
But with this code I would have to add everystore number in on the contact.asp page correct? |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 11 July 2007 : 17:23:41
|
With that method, yes. Are all the store nubmers identical in lenght? i.e. do they use leading zeros? |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 11 July 2007 : 17:31:10
|
Honestly I am not sure as of yet I am waiting for all the info from them. Let me see what I can get from them. What is the base information I need to ask of them to know which is a better route to take?
Thanks Jeff |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 11 July 2007 : 17:36:10
|
The better route here is a matter of preference, really. I like to use the querystring, it's a standard method do pass info between the pages and IDs are usually database record ids that do not change that often (usually don't change at all)! |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 11 July 2007 : 19:10:37
|
Yeah I am sure theses won't change but will be added too. |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 11 July 2007 : 20:52:47
|
quote: Originally posted by ruirib
The better route here is a matter of preference, really. I like to use the querystring, it's a standard method do pass info between the pages and IDs are usually database record ids that do not change that often (usually don't change at all)!
I'll ditto the preference comment. I'm just inherently lazy efficient, and since the ID was already in the URL why add it to the form?   |
 |
|
Topic  |
|