“mobile”/ paypertrail
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

PHP landing pages

Discussion in 'Programming and Scripts' started by DoubleDouble, Jan 14, 2019.

  1. DoubleDouble

    DoubleDouble Moderator moderator affiliate

    141
    104
    43
    Hey fixers, some questions about PHP.

    a) I have a protection script that is in PHP, do I need to convert the whole landing page to PHP for it to work or can i paste teh <php> script to teh top of the page and it will work automatically?

    b) Does anyone have a guide or can tell me how to save a landing page in PHP format and how to use it.
    I took the HTML of a langing page, put it it into a PHP converter, saved the php to the directory and when i went to page: abs.com/index.php it just downloaded the page.

    any advice about this please?
     
  2. CPA Evolution
  3. Graybeard

    Graybeard Well-Known Member affiliate

    4,091
    2,043
    113
    Do you know what SSI is?

    <!--#include virtual /path/file.php -->

    The download issue of a PHP file is for the reason that your server does not have PHP enabled.
    Is the server nginx or Apache2?
    Amazon *bucket* is static HTML I'm told ...

    You can encapsulate the existing code this way;
    PHP:
    <?php
    $landing 
    = <<<OUTPUT
    {HTML here}
    OUTPUT;
    echo 
    $landing;
     
    Last edited: Jan 14, 2019
    tyoussef likes this.
  4. DoubleDouble

    DoubleDouble Moderator moderator affiliate

    141
    104
    43
    Thanks Greybeard! as always appreciate the insight. As it happens I have this on amazon so that might explain the issue.
     
  5. Graybeard

    Graybeard Well-Known Member affiliate

    4,091
    2,043
    113
    I don't know what a *protection* script is -- or how it works.
    does the script detect/and sort > then redirect to the HTML file; or is it intended to be used as part of the HTML document?
     
  6. DoubleDouble

    DoubleDouble Moderator moderator affiliate

    141
    104
    43
    a feature that Binom have, it protects the landing page from direct access. I have seen it a bit not just there. to do so you would use the following:

    <?php $key="ABCDEFGHIJKLMNOP";[email protected]$_GET["lpkey"];$b=substr($a,0,2).substr($a,4,2).substr($a,8,2).substr($a,12,2).substr($a,16,2);$c=substr($a,2,2).substr($a,6,2).substr($a,10,2).substr($a,14,2);$d=md5($key.$_SERVER["REMOTE_ADDR"].$_SERVER["HTTP_USER_AGENT"].$b);$d=substr($d,2,2).substr($d,7,2).substr($d,12,2).substr($d,24,2);if(time()>$b || $d!==$c){exit(0);}?>

    they sate to put this at the top of a landing page, and then append the key to the end of teh url i.e.

    abc.com/index.html?ke=ABCDEFGHIJKL......

    but not sure if this will work on an HTML page or if the whole page needs to be Php
     
  7. Graybeard

    Graybeard Well-Known Member affiliate

    4,091
    2,043
    113
    the easiest way is to try first with SSI (usually not enabled by default on a server --it's voo-doo from way back :p)
    but what it does is $_GET["lpkey"]
    or get the variable lpkey from the URL's query string ? _____
    as is it needs to be on the same page

    Make it a separate script file
    lpkey.php

    then in the now SSI enabled HTML do:
    <!--#include virtual = "/path/lpkey.php" -->
    [domain root]"/path/path/file"
    <head ....

    </html>

    This way is the least work :) *should work

    Or you can do
    ======
    <?php
    your code here
    $landing = <<<OUTPUT
    {HTML here}existing html
    OUTPUT;
    echo $landing;
    note; no space before OUTPUT !important

    *that's less work than making a proper PHP page (copy and paste the old HTML code)

    If you have PHP 7.X or above you don't need the closing ?> anymore ;)

    Or you can use a PHP template with PHP includes that is the normal way
    Using the PHP Include Function to Template Faster « Build Internet
    That's the idea ...
     
    Last edited: Jan 14, 2019
    tyoussef likes this.
  8. Anastasia Stefanuk

    Anastasia Stefanuk Affiliate affiliate

    10
    0
    1
    I like your suggestions. It helpful for all newbies in programming
     
  9. Certified
    tyoussef

    tyoussef Moderator moderator Certified Vendor Service Manager affiliate

    4,172
    3,406
    113
    just take the same index.html file and rename it to index.php and the php code can be put anywhere in the landing.
    page so simple.
    you can past example of your landing page here with the php code you are trying to integrate, and i will help with that if you are confused.
     
  10. awesomesauce

    awesomesauce Active Member affiliate

    365
    123
    43
    Host it as an integrated lander instead of on Amazon.
     
banners