External links in. Stored monitored and actioned

This is a discussion on "External links in. Stored monitored and actioned" within the Classic ASP section. This forum, and the thread "External links in. Stored monitored and actioned are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 8th, 2005, 09:48
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
External links in. Stored monitored and actioned

The website I am working on has arranged deals with several companies to have a link from their website into ours.

Here are the requirments:
  • The link will open up our site in a new window - no problem.

    The link needs to activate the relevent company's logo to appear on our site somewhere - ???

    The link source needs to be stored - using cookies?

    The source ref then needs to be added to the details sent in the enquiry form - so commision can be paid to the relevent source.
    I have an enquiry form set up using ASP so adding another variable should not be much of a problem.

Its just fitting all the pieces together . .

Any advice would save my balls!>! Im not after code at this stage, just direction

Andy
Reply With Quote

  #2 (permalink)  
Old Jul 8th, 2005, 12:35
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Using ASP:

1. Get the other site to link to yours with a ref ID like:

http://[yourdomain]/[page].asp?ref=4

2. use request.querystring("ref") to get the number

3. use SELECT CASE to decide which logo to show depending on the number sent

4. use request.servervariables("HTTP_REFERER") to get the other webpage they came from

5. place the HTTP_REFERER value in the form as a hidden field
Reply With Quote
  #3 (permalink)  
Old Jul 8th, 2005, 13:13
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,951
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Of course... if you are using HTTP_REFERER then you may not even need to link with a reference number... a straight link would be much better... specially for SEO reasons.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #4 (permalink)  
Old Jul 8th, 2005, 13:41
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks D3mon that is a great help > U.R.A.Legend!

About the Select Case

Would I use code like this:
Code: Select all
<%

mylogo = request.querystring("ref")

Select Case mylogo
<% Case 1 %> 
[img]logo1.gif[/img]
<% Case 2 %> 
[img]logo2.gif[/img] 
<% Case 3 %> 
[img]logo3.gif[/img] 
End Select%>
Then where I want the logos to appear on each page i would put something like:

Code: Select all
response.write("mylogo")
? - I guess this is almost right but not quite ?

AK
Reply With Quote
  #5 (permalink)  
Old Jul 8th, 2005, 13:58
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,951
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Hi Andy...

use this code:-
Code: Select all
<% 

mylogo = cint(request.querystring("ref")) 'Forces to an integer

Select Case mylogo 
   Case 1  Img = "image1.gif"
   Case 2  Img = "image2.gif"
   Case 3  Img = "image3.gif"
End Select
%>
[img]<%=img%>[/img]"
Hope this helps.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #6 (permalink)  
Old Jul 8th, 2005, 14:12
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Cheers Rob

Quote:
response.write("great help!")
I will keep this topic posted with my progress, no doubt it will be useful to others.

In the mean time U-ALL feel free to add any comments

cheers
AK
Reply With Quote
  #7 (permalink)  
Old Jul 8th, 2005, 18:22
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Of course, bear in mind that some surfers have applications that block the referrer...
Reply With Quote
  #8 (permalink)  
Old Jul 12th, 2005, 09:34
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
In which case if I define the 'ref' id numbers with the company names, I could use the 'ref' id on the form, and not bother using the HTTP_REFERER value.
Reply With Quote
  #9 (permalink)  
Old Jul 12th, 2005, 11:01
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Sounds fine, so long as you don't need to know exactly which page of the company website the visitor came from.
Reply With Quote
  #10 (permalink)  
Old Jul 12th, 2005, 11:20
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
I have set up test links using ref numbers linking to the Home page. I have placed the Select Case code mentioned above at the top of the Home page and saved this: home.asp

It works fine to reveal the relevent logos. Only problem is when you click onto another page the ref number goes and so the logo disappears. How can I retain the ref number please?

I am placing the same asp code to the top of each page. it has crossed my mind to create and external asp page and link this in, but will this retain the ref number?

Do I need to add the 'ref' value to each link somehow?
Reply With Quote
  #11 (permalink)  
Old Jul 12th, 2005, 12:07
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
You could add the ref# to the url of each page in your site, but it would probably be easier to use a session variable to store it.
Reply With Quote
  #12 (permalink)  
Old Jul 12th, 2005, 15:02
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Ok i have sorted the Session variable, here is my code on the opening page:

Code: Select all
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252" %>
<% 
Dim ref, mylogo

Session ("refer") = cint(request.querystring("ref"))

mylogo = Session ("refer") 

Select Case mylogo 
   Case 1  Img = "Logo.gif" 
   Case 2  Img = "Logo.gif" 
   Case 3  Img = "Logo.gif" 
End Select 
%>
Then I remove the linebelow) on all the other pages, and the logo stays on throughout.
Code: Select all
Session ("refer") = cint(request.querystring("ref"))
I am using a Template and the logo appears within a Optional Region. if viewing the pages without following a weblink, the img src is shown as an error (white square red cross) . I know it is possible to show/hide Optional Regions but i am finding it tricky.

Instead I set Case 0 Img (ref=0) to a tiny square image
Reply With Quote
  #13 (permalink)  
Old Jul 12th, 2005, 16:48
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
The last hurdle. . . I hope!

I can add the 'ref' number/ Session variable to the end of the form email like this:

Code: Select all
FullForm= FullForm & "

Estate Agent Lead: " & Session ("refer")   & "</p>"
For example for var=2 This gives a line in the email of:
Estate Agent Lead: 2

But I want the numbers to be referenced to names. I have tried to do this by setting a new variable 'nlogo' but it is wrong, making Errors on Page:

Code: Select all
<%
nlogo = session ("refer")
if nlogo = 1 Then
nlogo = "Logoone"
if nlogo = 2 Then
nlogo = "Logotwo"
if nlogo = 3 Then
nlogo = "Logothree"
End if
%>
1. How can I assign text to the numbers ?

2. If necessary, where do I script if statments. In the body or above the head ?

AK
Reply With Quote
  #14 (permalink)  
Old Jul 13th, 2005, 08:30
Reputable Member
Join Date: May 2005
Location: Sheffield
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts

just worked it out.

I used Select Case quite easy really,

Code: Select all
nlogo = Session ("refer") 

Select Case nlogo 
   Case 0  nameL = ("none")
   Case 1  nameL = ("logo1") 
   Case 2  nameL = ("logo2") 
   Case 3  nameL = ("logo3") 
End Select
Then put this in the email line:

Code: Select all
FullForm= FullForm & "

Estate Agent Lead: " &  (nameL)   & "</p>"
Reply With Quote
Reply

Tags
external, links, stored, monitored, actioned

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
stored proc neoandzuco Databases 1 Feb 14th, 2007 14:39
Internal/External links hart084 Starting Out 3 Jan 29th, 2007 14:10
Email stored in db tazek0 Classic ASP 1 Mar 3rd, 2006 12:20
Stored proc kebi Databases 0 Oct 28th, 2005 11:17
ASP and DB2 Stored Procedures cruza Classic ASP 4 Dec 1st, 2003 17:24


All times are GMT. The time now is 20:58.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43