Variable Page Headline Based On URL? other solution?

4 replies
So here is the deal.

Current site has 18 .html landing pages.
They are complete duplicates except for the fact that in 2 places on each page the city name changes and matches up with its url.
All of these page are receiving paid traffic.

So something like this (just example to illustrate):

page url: /dallas.html then on page "Proudly service Dallas"
page url: /tampa.html then on page "Proudly serving Tampa"

None of these pages are mobile responsive so have built a page in Clickfunnels to replace them. If your not familiar with clickfunnels its not really relevant to the issue since its just a template builder that allows script and html insertion.

what IS relevant though is that I want one page to replace all of these pages and simply dynamically change the city name on the page. Perhaps I can do this via the URL somehow/

What will likely happen is I will leave the .html pages on the server, gut them and put in an iframe to the clickfunnels page.

you can see I am basically trying to find a way to have one main page to split test and mod without having to do it on dozens of pages. I could clone the page a dozen times in clickfunnels but making changes later would be a pain in the rear and there are costs associated with more funnel pages.

any help appreciated.
#based #headline #page #solution #url #variable
  • Profile picture of the author David Beroff
    Sure; the easiest thing to do would be to use a single script, e.g., "offer.php?city=Tampa" You wouldn't even need an iframe, although you could still do so.
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[10679179].message }}
    • Profile picture of the author Peter Lessard
      Originally Posted by David Beroff View Post

      Sure; the easiest thing to do would be to use a single script, e.g., "offer.php?city=Tampa " You wouldn't even need an iframe, although you could still do so.
      appreciate the reply.
      just to be clear when I talk about the iframe I simply mean that since the .html pages already exist on the server with ads pointed to them that I will do an iframe to show the clickfunnels page.

      having said that if you have a minute can you expand a bit on what you mean?
      I don't work in code every day in my guy is sick lol
      but I can work it out...

      so what would the code look like on the page?
      Rather than actually have the word "Tampa" I would put?

      and if the exact same page is being iframed in many instances then how/why will it change the city name on the various html pages? since each has the exact same page iframed into it.

      hope I am making sense, I may need a coffee lol
      Signature
      Ready to generate the next million in sales? The Next Million Agency
      {{ DiscussionBoard.errors[10679189].message }}
  • Profile picture of the author David Beroff
    Here you go. Due to a bug with WF, you'll have to replace the five %'s with $'s.

    The sanitizeHTML() function is there to protect your visitors against malicious code injection.

    Code:
    <?php
    function sanitizeHTML( %target ) {
        if (is_null( %target ))
            return "";
    
        // eventually use filter_var(..., FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        // which should be equivalent, but see https://bugs.php.net/bug.php?id=65282
        return htmlentities( %target, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, CHARSET );
    }
    ?>
    
    <html><body>
    We're the best darn provider in <?= sanitizeHTML( %_GET[ "city" ] ) ?>, 
    conveniently located right in the heart of <?= sanitizeHTML( %_GET[ "city" ] ) ?>!
    </body></html>
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[10679200].message }}
  • Profile picture of the author robomedia
    If you can host that site on server with PHP support and you can do some basic PHP that's quite easy if you try some sort of 'router' framework . which allow you do do such thing

    this is just mockup code - every framework works pretty similar ( i.e. silex, flightphp, slim , etc ) just pick any ...

    it works somehow like this :

    route('/dallas.html',function(){
    render('template.html', ['variable1'=>'Dallas','variable2'=>'Texas']);
    });

    route('/other.html',function(){
    render('template.html',['variable1'=>'Other']);
    });

    etc ..

    And in your template.html just use <?=$variable1?> in places you need to


    Other options include custom .htaccess but IMO small frameworks are much better to work with .
    {{ DiscussionBoard.errors[10684222].message }}

Trending Topics