View Full Version : Need site to change phone #'s dynamically.
comartg
05-19-2008, 08:23 PM
Hi all,
My boss wants our website to change phone #'s when someone visits from yellowpages.com and also various other sites. We'll have 5 or 6 phone numbers, anyone know how to do this? New at the job and want to help out.
Thanks
Gabe
do you mean,
you need to give a new number to visitors because your listing on yellowpages.com is wrong?
or you want to give them a specific number to call based on which site they come from (or some other criteria)?
I don't quite understand what you want to do.
comartg
05-19-2008, 08:33 PM
we want to give a specific phone # based on how they came to the site.
boogyman
05-19-2008, 08:46 PM
so if they arrive to the site because they used a search engine (google, yahoo, ask...) you want to give a number but if they have the page bookmarked you want to give a different number, and if they come through yellowpages.com you want to give a third (different) number?
I would highly suggest against, this, but rather listing all the possible numbers in a section of the site
I say this because the "referer" or page that was previously visited before coming to the current one can easily be spoofed (tricked) into not being genuine. Also as i stated in my example, someone may come to the site via a search engine, then save it as a bookmark or as their "home page" in which case it wouldn't necessarily be the same referrer type as the original.
if you would like to go against my suggestion the best way to do this is through a server-side language like PHP, because using a client-side language such as Javascript, could be turned off, in which case you will not know what the referrer is even if it wasn't spoofed.
$_SERVER['HTTP_REFERRER'];
will give you the previous page, and which case you can handle what to display from there using some type of validation / looping system.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.