Question about wordpress

by 5 replies
6
Ok earlier I had to set up a variable to call the url into a optin form for affiliates. I was wondering if there is a way when i go to my site without calling any variables if it will show my info for my optin instead of it being blank?
#programming #question #wordpress
  • You are using a PHP 'if' statement to check if the variable 'isset' before you assign it. So if it isn't set we can use the php 'else' statement. ie: if this is set do this, if not do this. So add a extra couple lines to each of your variable requests.

    if (isset($wp_query->query_vars['fid'])) {
    //set the fidto a variable for easier use later
    $fid= $wp_query->query_vars['fid'];
    } else {
    //the get variable isn't set so we set it manually
    $fid = 'yourinfohere';
    }

    Do that for each of your variables and replace 'yourinfohere' with what you need.
    • [1] reply
    • Ok I get ya. So if i just type www.blahblahblah.com it will show my variables and if they use their referral then it will show their variables
      • [1] reply
  • Change <input type="hidden"... to <input type="text"... and you can see what is happening.

Next Topics on Trending Feed

  • 6

    Ok earlier I had to set up a variable to call the url into a optin form for affiliates. I was wondering if there is a way when i go to my site without calling any variables if it will show my info for my optin instead of it being blank?