Need some help on prepopping

by Lukas
13 replies
I have a 3 step process now.

1. My lead-gen site has a person who fills out 9 fields of financial information, submits the php form (which is parsed as it is a app.html extension)

2. They now get redirected to a thank you page.html for their submission ( .html extension)

3. Now, a CPA related offer shows up on this thank youpage for them to click through.

How do I get some of their submitted info (email, first name, last name) from (1.) to go straight into the CPA offer when they click on the CPA offer banner.

Do I put something in the thank you page header area?
Should the thank you page be changed to a .php extension?
I know a little but not how to set it up

I would greatly appreciate your help or anyone else you know with a coded example.

Thanks
#prepopping
  • Profile picture of the author SteveSRS
    I have no idea what 'prepopping' means however

    "Should the thank you page be changed to a .php extension?"
    Yes

    "submits the php form (which is parsed as it is a app.html extension)"
    I have no idea what that means.. you can't 'parse' a form as app.html, that doesn't make any sense at all.

    What you should do:
    Form on html or php page which sends data to a .php page (itself or another page)
    Then on this php page you can process the data and display the CPA offer.

    Then completely depending on how the CPA offer works you might be able to send this data along via the CPA url however I've never seen this be possible with CPA offers.

    I think you need to check out your CPA network documentation and how to send data to a CPA offer. And also I think you need a programmer
    {{ DiscussionBoard.errors[7797953].message }}
  • Profile picture of the author Brandon Tanner
    Is the page that contains the CPA offer forms (name, email, etc), on your website? If so, then this is pretty easy to accomplish with a little bit of PHP. Let me know if this is the case, and I'll show you how.

    If that page is on another website, however, then there's no way to do what you want (whoever owns that website would have to do it).
    Signature

    {{ DiscussionBoard.errors[7797970].message }}
  • Profile picture of the author Andrew H
    This is assuming you can edit both pages:

    <!-- FIRST PAGE -->
    <form method="POST" action="thenextpage.php">
    <input type="text" name="personalinfo">
    </form>

    <!-- NEXT PAGE (thenextpage.php) -->
    <?php
    $personalinfo = htmlspecialchars($_POST['personalinfo']);
    ?>
    <input type="text" name="personalinfo" value="<?php echo $personalinfo; ?>">
    Signature
    "You shouldn't come here and set yourself up as the resident wizard of oz."
    {{ DiscussionBoard.errors[7798018].message }}
    • Profile picture of the author Lukas
      AndrewH,

      Yes, I control the 1st 2 pages on my site.
      FirstPage - OK I get that.

      NextPage is actually Thank you page. SO I'll change that into a .php extension.

      I put what you have below in the header (above the <html> tags? )

      <!-- NEXT PAGE (thenextpage.php) -->
      <?php
      $personalinfo = htmlspecialchars($_POST['personalinfo']);
      ?>
      <input type="text" name="personalinfo" value="<?php echo $personalinfo; ?>">

      and this will carryover to next page (other website) that is a CPA offer upon clicking a link.

      My only concern is the following:
      <input type="text" name="personalinfo">

      How will I know what their name is, if the input field is name.

      I am lost. should it be blank?

      My form has:
      <input name="fname"
      <input name="lname"

      for first and last name and so on.

      should it be this?
      ?php
      $fname = htmlspecialchars($_POST['fname']);
      $lname = htmlspecialchars($_POST['lname']);
      ?>
      <input type="text" name="fname" value="<?php echo $fname; ?>">
      <input type="text" name="lname" value="<?php echo $lname; ?>">

      ////////

      @SteveRSRS - no disrespect but it is done quite often to parse a html page to php so the form sends data. I've used a form-mail like this for years. Like the ex used to say, I probably didn't explain it well.
      {{ DiscussionBoard.errors[7798213].message }}
      • Profile picture of the author Brandon Tanner
        Originally Posted by Lukas View Post

        and this will carryover to next page (other website) that is a CPA offer upon clicking a link.
        If you don't own the "other" website, then it will not carry over. Like I said, whoever owns the website that the actual CPA offer is hosted on would have to make changes on their website in order for it to work.

        If you can get them to agree to do that, then you can simply pass the name/email info to them via the query string (ie OtherWebsite.com/OfferPage.php?name=bob&email=bob@email.com). Then they could extract that info via PHP and use it to pre-poulate their forms.
        Signature

        {{ DiscussionBoard.errors[7798254].message }}
        • Profile picture of the author Lukas
          Brandon,

          Yes, they actually asked me to prepop it with that same url structure.
          OtherWebsite.com/OfferPage.php?name=bob&email=bob@email.com

          but it comes out as prepopping with name, email, phone in those particular fields.

          My CPA rep seems new in this industry but is trying to help me. I am new as well on the sidelines hoping to do great things like Kaepernick given the chance
          {{ DiscussionBoard.errors[7798331].message }}
          • Profile picture of the author Brandon Tanner
            Originally Posted by Lukas View Post

            Brandon,

            Yes, they actually asked me to prepop it with that same url structure.
            OtherWebsite.com/OfferPage.php?name=bob&email=bob@email.com

            but it comes out as prepopping with name, email, phone in those particular fields.

            My CPA rep seems new in this industry but is trying to help me.
            If they already have their webpage set up to accept that info via the query string, then this is easy to do.

            Let's say your landing page has a form like this...

            <form action="YourThankyouPage.php" method="POST">

            First Name: <input type="text" name="fname"><br />
            Last Name: <input type="text" name="lname"><br />
            Email: <input type="text" name="email"><br />
            Phone: <input type="text" name="phone"><br />
            <input type="submit" value="Submit">

            </form>


            Then at the very beginning of YourThankyouPage.php (this page must have a PHP extension), you grab the info that was submitted from your landing page...

            <?php
            $fname = htmlspecialchars($_POST['fname']);
            $lname = htmlspecialchars($_POST['lname']);
            $email = htmlspecialchars($_POST['email']);
            $phone = htmlspecialchars($_POST['phone']);
            ?>


            Then further down on that same page, wherever you link to the CPA offer, you would link to it in this format...

            http://www.OtherWebsite.com/CPAOffer.php?fname=<?php echo $fname; ?>&lname=<?php echo $lname; ?>&email=<?php echo $email; ?>&phone=<?php echo $phone; ?>

            ^^ That line above assumes that the CPA offer page accepts those exact query strings. If any of them are different, then you will have to change the names of your query strings accordingly (for example, if they accept 'firstname' instead of 'fname', then you would do...

            firstname=<?php echo $fname; ?>


            etc etc.
            Signature

            {{ DiscussionBoard.errors[7798435].message }}
  • Profile picture of the author Andrew H
    Yes, they actually asked me to prepop it with that same url structure.
    OtherWebsite.com/OfferPage.php?name=bob&email=bob@email.com
    It looks like you need to transfer the inputs as $_GET variables (ie: appended to the URL) to the CPA hosted page.

    http://www.w3schools.com/php/php_get.asp

    Two options

    If you are posting the info from the first page to the second page (ie: you have a form on the first page that submits to the next page on your server before going to the CPA offer website) you could then append the variables to the URL manually on your second page:
    <a href="www.cpacompany.com/yourCpaOfferPage.php?name=<?php echo $_POST['name'];?>&email=<?php echo $_POST['email'];?">Submit CPA offer</a>

    Or if your making the form to send right to the CPA offer

    <form action="www.cpacompany.com/yourCpaOfferPage.php" method="GET">
    <input type="text" name="name">
    <input type="text" name="email">
    <button type="submit">Submit</button>
    </form>
    Signature
    "You shouldn't come here and set yourself up as the resident wizard of oz."
    {{ DiscussionBoard.errors[7798387].message }}
    • Profile picture of the author Lukas
      That's perfect. I'll give it a try and put that info in the header area and append their url.

      Thanks


      Oh. but I should still put this at the top the NextPage right?
      <?php
      $fname = htmlspecialchars($_POST['fname']);
      $lname = htmlspecialchars($_POST['lname']);
      ?>
      <input type="text" name="fname" value="<?php echo $fname; ?>">
      <input type="text" name="lname" value="<?php echo $lname; ?>">
      {{ DiscussionBoard.errors[7798424].message }}
  • Profile picture of the author Andrew H
    Brandon pretty much broke it down as easy as it's going to get. If you let us know your exact page structure of your website and find out exactly what $_GET variables that the CPA offer page will accept we can help you more. Although its verging more on just doing it for you rather than helping you to learn.
    Signature
    "You shouldn't come here and set yourself up as the resident wizard of oz."
    {{ DiscussionBoard.errors[7798450].message }}
  • Profile picture of the author Lukas
    Thanks Brandon. Yes, I had already changed the fields to what they have on their landing page.
    This is where maybe my form gets me confused.
    I have:
    <form action="formmail.php" method="POST">

    within this formmail.php user gets redirected to thankyoupage.php

    I put
    <?php
    $fname = htmlspecialchars($_POST['fname']);
    $lname = htmlspecialchars($_POST['lname']);
    $email = htmlspecialchars($_POST['email']);
    $phone = htmlspecialchars($_POST['phone']);
    ?>
    at the top and get

    " Disallowed Key Characters."



    Doing the url as the rep told me to do it : hxxp://domain.com/xprr/red/PID/777/SID/OHE,TY?fname=FirstName&lname=LastName&pp1=areacode &pp2=first3digits&pp3=last4digits&email=Email'

    it works but it just populates the fields as: FirstName,LastName .....not the actual submitters info.

    --- In my htaccess file I have "AddHandler server-parsed .html" to process my php formmails.
    {{ DiscussionBoard.errors[7798604].message }}
  • Profile picture of the author KirkMcD
    Well, you actually need to replace FirstName, etc... with the submitters info.
    {{ DiscussionBoard.errors[7798642].message }}
    • Profile picture of the author Lukas
      Hi Kirk,

      I tried .$fname and that didn't work either. A programmer from the CPA company is looking into it now


      FYI - Maybe this can help people. I just typed in a bad url on a site and they have an email opt-in on their 404 page. That's pretty cool for list building. Just trying to give back a little for the help I receive.
      {{ DiscussionBoard.errors[7798680].message }}

Trending Topics