Results 1 to 12 of 12
  1. #1
    Full Member dak142's Avatar
    Join Date
    January 18th, 2005
    Posts
    386
    I found the example jump script below. I undestand it, however, I am not understanding how a record number get passed into this code from a link. What would be an example of a link that would be able to pass a record number into it. The file name that this code resides in is called jump.php.

    I have also read in this forum (quote below)that putting &afsrc=1 at the end of a link will help click through, how might this also be implemented?

    "Recently, I put the &afsrc=1 on all my links across my largest sites. Damned if sales have not increased by 10-20% since then. (it has been about 2 weeks at about 13000 clicks a day)"


    <?php

    $link = mysql_connect ("localhost", "user", "pass");
    mysql_select_db ("datebase");

    $result = mysql_query ("SELECT link FROM id WHERE number=$locn");
    $row = mysql_fetch_array($result);

    header("Location: " . $row["link"]);

    mysql_close ($link);
    ?>

    DAK

  2. #2
    Affiliate Manager
    Join Date
    January 18th, 2005
    Posts
    1,056
    I am going to take a guess and hope this is what you are referring to.

    1. You want to redirect to (example):
    http://www.yahoo.com

    So in your database you would have 2 fields, one for the url and one for the link id of the url:
    <pre class="ip-ubbcode-code-pre">1 | http://www.yahoo.com</pre>

    So you will want to make your jump.php script like such:

    <pre class="ip-ubbcode-code-pre">
    &lt;?
    // Assuming jump.php?id=1 is called

    $sql = "SELECT link
    FROM Link_Table
    WHERE id = '1'
    ";
    $query = mysql_query($sql);
    $fetch = mysql_fetch_array($query);

    // Do the redirect below

    header("Location: $fetch[0]");

    // Or if you want to use that "&afsrc=1" code

    header("Location: $fetch[0]&afsrc=1");

    ?&gt;
    </pre>

    Hope that helps.

  3. #3
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    ÄúsTrálíĺ
    Posts
    1,372
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Dak142:
    I am not understanding how a record number get passed into this code from a link. <HR></BLOCKQUOTE>

    your link would be blah.com/jump.php?id=1

    $link_id = $_GET['id'];

    then, Chet's code

    $sql = "SELECT link
    FROM Link_Table
    WHERE id = '$link_id'";
    etc

  4. #4
    Full Member dak142's Avatar
    Join Date
    January 18th, 2005
    Posts
    386
    You guys rock, it worked! One more question, is it better to have the link open in a new window or the same window. I would like a new window, but I am not sure if all the pop up blockers out there today would hinder my pages.

    Also, to start tracking link access, I thought of adding another integer field called 'track' to the mysql database and each time the link gets clicked, have a small script add 1 to that field. Am I at least in the right ball park?

  5. #5
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    ÄúsTrálíĺ
    Posts
    1,372
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Dak142:
    have a small script add 1 to that field. Am I at least in the right ball park? <HR></BLOCKQUOTE>
    Yes.

    Something like :
    $result = mysql_query("UPDATE Link_Table SET track=track+1 WHERE id='$link_id'");

  6. #6
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    I cannot get my head around this
    This script will (with the right coding) pick up a products id and the url from the regular merchants database? I've tried and tried and I cannot get it to work I was up till 4:35 am this morning Pauline will bloody kill me if I dont go to bed tonight
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  7. #7
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    I've still not gone to bed ....if I'm not here tomorrow you all know why

    I'm getting this error below and this is the line in question, what do I put where it says "LOCATION" Also could someone please explain to me what a header is or what it means? In my ancient computer language it is the top of a web page.

    error message
    Warning: Cannot modify header information - headers already sent by (output started at /home/a1canoes/public_html/ulinks2/ul-config.php:2) in /home/a1canoes/public_html/ulinks2/uc.php on line 17

    line 17 in question
    HEADER( "LOCATION: $f[LinkURL]" );

    thanks in advance
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  8. #8
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    ÄúsTrálíĺ
    Posts
    1,372
    Headers must be output before any other output.

    From your errors, you have output in both those 2 files before the header code is reached.

    See here for some more info

  9. #9
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    I've read it over and over pete and I still dont get it I guess I must be going senile already thanks for the help anyway.
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  10. #10
    Full Member dak142's Avatar
    Join Date
    January 18th, 2005
    Posts
    386
    Gorden, are you trying to accs the merchants database or your own?

  11. #11
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    Sorry Dak142 I only just saw your post, I was in fact trying to access my own database but thanks to a good English guy called wayder we solved it.
    I spent 2 days looking for something that did not exist, I could not get my head round the fact that headers in php are totaly different than headers in html. Why can these programing guys not speak english?
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  12. #12
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Gordon:
    Why can these programing guys not speak english? <HR></BLOCKQUOTE>

    I think I found the problem, English isn't an option.

    <pre class="ip-ubbcode-code-pre">
    ...
    302 function Choose_Language($object){
    303 if(communication_needed($object) === TRUE){
    304 $language = ("PHP", "PERL", "SQL", "TCL", "C");
    305 return $language[ mt_rand(0,count($language)-1) ];
    306 }
    307 return "ERROR: Just Stare till they leave.";
    308 }
    ...</pre>
    Lead, Follow or Get Out of the Way!

  13. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Need PHP Affiliate Jump Script for CJ
    By trev0006 in forum Commission Junction - CJ
    Replies: 0
    Last Post: October 27th, 2006, 04:58 AM
  2. PHP/mySQL-based affiliate data feed parsing script?
    By AlpineZone in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: June 17th, 2005, 07:02 PM
  3. Best to use - Web Merge or another PHP/MySQL script
    By aprillougheed in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: February 13th, 2004, 06:43 PM
  4. Jump.php type code... help!
    By TJ in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: July 23rd, 2003, 04:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •