link cloaking problem

11 replies
  • WEB DESIGN
  • |
hi
i'm building my first site as affiliate and,as expected i have one problem. i want to cloak aff link,i followed instructions but seems it doesen't work for me,i'm getting this message when i enter that link itno browser:

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home3/howtobes/public_html/go/fatlossfor.php on line 2

Parse error: syntax error, unexpected ':' in /home3/howtobes/public_html/go/fatlossfor.php on line 2

I did everything step by step.. anybody knows what does that message means?

thanks
#cloaking #link #problem
  • Profile picture of the author Andy Crofford
    Can you show us your code in fatlossfor.php?
    {{ DiscussionBoard.errors[3488304].message }}
    • Profile picture of the author RayFinckle
      Im in the same exact shoes as the OP, same error message. My php code is

      <?php
      header('Location: myaffiliatelink');
      ?>

      (my affiliate link is in there, im not supposed to share that right?)

      Thanks in advance
      {{ DiscussionBoard.errors[3918845].message }}
      • Profile picture of the author andrejvasso
        Originally Posted by RayFinckle View Post

        Im in the same exact shoes as the OP, same error message. My php code is

        <?php
        header('Location: myaffiliatelink’);
        ?>

        (my affiliate link is in there, im not supposed to share that right?)

        Thanks in advance
        You have done a mistake at the end: its ' and not

        @op: post the php code inside fatlossfor.php otherwhise we cant really help you!
        {{ DiscussionBoard.errors[3918867].message }}
        • Profile picture of the author RayFinckle
          Originally Posted by andrejvasso View Post

          You have done a mistake at the end: its ' and not '

          @op: post the php code inside fatlossfor.php otherwhise we cant really help you!
          it unfortunately didnt work, now it says

          Fatal error: Call to undefined function phpheader() in /home/diablo/public_html/bestshowerheadinfo.com/go/revitalizingshowerfilter.php on line 1

          i appreciate the help ive been trying to figure this out for days its driving me crazy. lol
          {{ DiscussionBoard.errors[3919014].message }}
          • Profile picture of the author RayFinckle
            this is what i changed it to

            <?php
            header('Location: myaffiliatelink');
            ?>
            {{ DiscussionBoard.errors[3919030].message }}
            • Profile picture of the author andrejvasso
              Originally Posted by RayFinckle View Post

              this is what i changed it to

              <?php
              header('Location: myaffiliatelink');
              ?>
              This is correct. The error must be somewhere else... if you can, paste the whole php code of the file in question, we might find out what it is.

              Also: do you have any special chars in your URL? That could also cause problems...

              Edit: What editor are you using? Could it be that the white space between <?php and header has been removed by your editor? If you have only copied and pasted the code, make sure there is a whitespace between <?php and header !

              Edit 2: Before you paste the whole code here, try to follow my suggestion in the first edit
              {{ DiscussionBoard.errors[3919036].message }}
              • Profile picture of the author RayFinckle
                Originally Posted by andrejvasso View Post

                This is correct. The error must be somewhere else... if you can, paste the whole php code of the file in question, we might find out what it is.

                Also: do you have any special chars in your URL? That could also cause problems...

                Edit: What editor are you using? Could it be that the white space between <?php and header has been removed by your editor? If you have only copied and pasted the code, make sure there is a whitespace between <?php and header !
                i love you!!!!!, it was the white space, such a relief now i can get back to work. thanks again and have a great day
                {{ DiscussionBoard.errors[3919096].message }}
                • Profile picture of the author andrejvasso
                  Originally Posted by RayFinckle View Post

                  i love you!!!!!, it was the white space, such a relief now i can get back to work. thanks again and have a great day
                  Great to hear! if you encounter another problem, dont hesitate to reply to this thread once again - i will try to keep an eye on it too
                  {{ DiscussionBoard.errors[3919110].message }}
              • Profile picture of the author newbie365
                Remember to put an exit(); after any PHP header redirects not doing this will cause PHP to continue to load the page before redirecting. the exit(); stops this. If I was a hacker (which i choose to not be) I could easily target sites that use only header: location redirect to gain access to content that shouldnt have been viewable. My method of attack would be command line fgets which can stop the redirect completely.

                Just a friendly note.. By the way! Theres great info on this forum! Good stuff guys.
                {{ DiscussionBoard.errors[3921550].message }}
  • Profile picture of the author Magnet4Marketing
    Hey this might help you it works a treat for my affiliate links

    <a href="productname" onmousedown="this.href='affiliate-link-url-here';">Product Name</a>
    Signature

    If you'd like to learn more about me and my awesome traffic building tips eBook check out the following link: http://www.onlineincomejournal.net/s...ic-tips-ebook/

    {{ DiscussionBoard.errors[3919075].message }}
    • Profile picture of the author andrejvasso
      Originally Posted by Magnet4Marketing View Post

      Hey this might help you it works a treat for my affiliate links

      <a href="productname" onmousedown="this.href='affiliate-link-url-here';">Product Name</a>

      Sorry, but how is this supposed to help??? Please stop spamming and just trying to get your post count to 50. And btw. why would you use such a stupid code format when you can simply do <a href="your-aff-url-here">Name</a>. Whats the point of having the product name in the href tag? Anyways, back to topic:

      @op: ignore that comment and try to check for a whitespace
      {{ DiscussionBoard.errors[3919095].message }}

Trending Topics