-1

I am building out an affiliate site and need to grab the phone number the company puts in the URL and then echo it out on the page. The urls look something like this:

http://www.example.com/?src=Mundo&ph=1-877-626-6326

I am guessing a bunch of regex?

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
Jerry Schrader
  • 57
  • 1
  • 11

1 Answers1

0

Using PHP you can use something as simple as !_GET["ph"]:

<?php
echo 'The phone number is: ' . $_GET["ph"] . '!';
?>

But if you want to accomplish this through something like Javascript, the solution is a bit more complicated (even though it's a small snippet!).

To be more use to you, we'd need to know what sort of site you're working on. Is this an ASP.NET site/application? Plain HTML? Is PHP installed?

Community
  • 1
  • 1
Rein S
  • 889
  • 6
  • 18
  • Sorry, it's a Wordpress site, so PHP. The page will come in from an affiliate, and have a phone number in it. I have to grab that and spit it out on the page, so when someone calls in, they can track it. – Jerry Schrader Jun 18 '15 at 20:37