Calling all genius PHP dudes...

9 replies
******************************
Edit: SOLVED because caesargus
is FRIGGIN AWESOME.

******************************

I totally suck at tech stuff.

But there's a ton of info you can find
about how to "echo" affiliate id's into
aWeber custom fields...

And... I can get it to work on STATIC
PAGES sooo easily...

But when it comes to a blog, it doesn't
work and I've been trying to figure it
out for over 6 hours.

I never want to look at a computer
again.

Do you know if there is a solution out
there that I'm missing?

Marc
#calling #dudes #genius #php
  • Profile picture of the author theIMgeek
    Hi Marc,

    If I understand correctly, you're wanting your subscription forms to also tag subscribers with an affiliate referral code. You've figured out how to do that when you are programming a page, but not when you are posting pages through blog software.

    My guess is that you're publishing these forms through some sort of "content management system" (like posting them to a Wordpress page perhaps?) So the likely trouble is that these pages created through the CMS do not process any PHP code.

    If you are in fact using Wordpress, there are plugins that will interpret PHP code. WordPress › PHP Execution WordPress Plugins

    If I've misunderstood, please do explain further.

    -Ryan
    Signature
    FREE WSO: Protect and Automatically Deliver Your Digital Products

    Ask the Internet Marketing Geek
    <-- Happy to help with technical challenges
    MiniSiteMaker.org <-- Free software to make your mini-sites fast and easy
    {{ DiscussionBoard.errors[2687764].message }}
    • Profile picture of the author Marc Rodill
      Yeah I'm using Wordpress and there are
      PHP plugins for the posts, but the particular
      script I'm using sets the session id using
      $redirect before loading the header.

      (I don't know if that makes sense or not.)

      I haven't figured out how I'll be able to set
      the referrer before the php headers are
      "sent," and it's making it totally useless.

      I've thought of a work around which is
      to just direct them to the blog AFTER
      they've subscribed on the home page.

      That's the best I can figure and what I'm
      going to do to save time.

      Thanks if you think of anything.
      Signature
      Long Lost Warriors! The Secret Sales System! Act Now! Buy Now! Right Now!
      {{ DiscussionBoard.errors[2688292].message }}
  • Profile picture of the author jminkler
    No, that does not make sense .. though redirecting to a thank-you page is not all that bad either
    {{ DiscussionBoard.errors[2688958].message }}
  • Profile picture of the author caesargus
    Well, the referrer is set by the browser and is not set by you. Basically the referrer is if someone came through a link then the referer is the page that sent them to you. So for example, someone performs a google search, and brings up one of your pages in the result list, and then goes to your page, then the referer is set to google's search results page.

    If the user is clicking from an email or the user opens a new browser to get to your page, then the referer is not set.

    Redirecting before headers are set is something that occurs normally within php. PHP cannot perform a server side redirect if any information has already been sent to the browser. There are other ways to perform the redirect if the headers are sent, but that does not seem to be your issue.

    Setting the session id before the user actually starts interacting with you, it appears that your script is trying to log a cookie onto your machine, so it can remember any settings that your user performs during that user's visit. If you are using firefox, you can go to preferences -> security -> remove individual cookies -> type in your site name and you should see at least one entry there for your site's cookies. If you're really curious as to what the script is using the cookie for, look for things that call the word $_SESSION or $_COOKIE. These values will be passed around your user's visit (search the entire site structure, the variables could be anywhere in the codebase), to set various things, like user's first name, user's color preferences, etc.

    Without knowing more detail about your script, your site, etc. I'm not sure what other information you might find helpful, so I'll end my post here. But feel free to PM me if you would like additional assistance.
    {{ DiscussionBoard.errors[2690071].message }}
  • Profile picture of the author zeeshi570
    You need to use javascript....
    {{ DiscussionBoard.errors[2691016].message }}
  • Profile picture of the author Evan-M
    you could pass it in the url bar

    url.com?id=943i9443

    then use $_GET[id]; to pull the id from the redirected url.
    Signature

    Evan-M

    Easily The Worlds Best Wordpress Popup plugin

    Visit Website Design Firm For All Your Wordpress Coding Needs

    {{ DiscussionBoard.errors[2691044].message }}
    • Profile picture of the author Marc Rodill
      Originally Posted by caesargus View Post

      Well, the referrer is set by the browser and is not set by you.

      ..

      If the user is clicking from an email or the user opens a new browser to get to your page, then the referer is not set.
      Oh OK. I get what you're saying. I probably used the word "referrer" in the wrong way.

      ...look for things that call the word or Array. These values will be passed around your user's visit...
      It does use $_SESSION actually. (I'll just show you.)

      Redirecting before headers are set is something that occurs normally within php. PHP cannot perform a server side redirect if any information has already been sent to the browser. There are other ways to perform the redirect if the headers are sent, but that does not seem to be your issue.

      ...

      But feel free to PM me if you would like additional assistance.
      I think I'll do that

      Originally Posted by Evan-M View Post

      you could pass it in the url bar

      url.com?id=943i9443

      then use ; to pull the id from the redirected url.
      Yeah I tried that to do that but I can't seem to get it to work.
      Signature
      Long Lost Warriors! The Secret Sales System! Act Now! Buy Now! Right Now!
      {{ DiscussionBoard.errors[2691949].message }}
  • Profile picture of the author espradley
    If you want to do this, you'll probably want to write it as a plugin so you can call hooks.

    function yourPHP(){
    //redirect occurs here
    }
    add_action ( 'wp', 'yourPHP');

    When running your site, it will find add_action and it will call yourPHP() when the WP hook is called. The WP hook is called before any sessions are sent. Avoid using wp_head as it is theme depended...so you've got a 50/50 shot of it sending it before the headers.
    Signature

    Eddie Spradley

    {{ DiscussionBoard.errors[2691991].message }}

Trending Topics