Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 100 pages 1 Contact Form?
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

JJenson
Advanced Member

USA
2121 Posts

Posted - 11 July 2007 :  11:29:27  Show Profile  Visit JJenson's Homepage
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  Show Profile
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.”
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 July 2007 :  11:44:50  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 11 July 2007 :  11:50:11  Show Profile  Visit JJenson's Homepage
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
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 11 July 2007 :  12:06:37  Show Profile  Visit AnonJr's Homepage
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.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 July 2007 :  14:32:18  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 11 July 2007 :  14:46:54  Show Profile  Visit JJenson's Homepage
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
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 11 July 2007 :  15:00:39  Show Profile
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.
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 11 July 2007 :  15:12:28  Show Profile  Visit JJenson's Homepage
hmm how would I go about doing that PPSSWEB I am new to these areas and am learing as I go.
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 11 July 2007 :  15:28:34  Show Profile
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
%>
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 11 July 2007 :  15:35:32  Show Profile  Visit JJenson's Homepage
But with this code I would have to add everystore number in on the contact.asp page correct?
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 11 July 2007 :  17:23:41  Show Profile  Visit AnonJr's Homepage
With that method, yes. Are all the store nubmers identical in lenght? i.e. do they use leading zeros?
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 11 July 2007 :  17:31:10  Show Profile  Visit JJenson's Homepage
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
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 July 2007 :  17:36:10  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 11 July 2007 :  19:10:37  Show Profile  Visit JJenson's Homepage
Yeah I am sure theses won't change but will be added too.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 11 July 2007 :  20:52:47  Show Profile  Visit AnonJr's Homepage
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?
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07