Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to make a referral link

    Hello friends!

    I have a question.

    I need to make a referral link for my site so members can get referrals.
    I want it to be like "mysite.com/?r=referral"

    How do I do that?

    Thanks!

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    $r $_GET['r']

    if( 
    $r == $username ) {

        echo 
    $username.' is your referrer';


    You need to be a bit more specific but you should be able to work with the code above.

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Developr View Post
    PHP Code:
    $r $_GET['r']

    if( 
    $r == $username ) {

        echo 
    $username.' is your referrer';


    You need to be a bit more specific but you should be able to work with the code above.
    Thanks for your reply!

    But that's not what I'm looking for I think.

    Here is the code i have.
    This one goes in the reg.php file

    Code:
    if($_COOKIE['referido'])
    {
    $ref = $_COOKIE['referido'];
    } else {
    $ref = $do->get_r_file_url();
    $ref = str_replace(array(".html", "/"), "", $ref);
    if(eregi('.php', $ref)) { $ref=false; }
    
    setcookie("referido", $ref, time()+60*60*24*30);
    }

    And this one goes in the user's profile to show their referral URL:
    Code:
    $dp = $do->get_loc()."reg.php/{$signin_username}.html";
    So that code shows the URL like "mysite.com/reg.php/referral.html"
    But I want it to be like "mysite.com/reg.php?referral" or something like that without the "/"

    How can I do that?

    Thanks!

  • #4
    New Coder
    Join Date
    Aug 2010
    Location
    India
    Posts
    42
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Though you can do it by changing this line
    $dp = $do->get_loc()."reg.php/{$signin_username}.html";
    to
    $dp = $do->get_loc()."reg.php?{$signin_username}";


    But I guess that would need change at other places also (to address this new change).


    I suggest you go for .htaccess file. That way you don't change anything in your code.
    save it in a text file and name it .htaccess and upload it to your home directory on the server,

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^reg.php/(.*)\.html$ http://www.mysite.com/reg.php?$1
    Last edited by PradeepKr; 08-30-2010 at 08:12 AM.

  • Users who have thanked PradeepKr for this post:

    iambuxer (08-30-2010)

  • #5
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by PradeepKr View Post
    Though you can do it by changing this line
    $dp = $do->get_loc()."reg.php/{$signin_username}.html";
    to
    $dp = $do->get_loc()."reg.php?{$signin_username}";


    But I guess that would need change at other places also (to address this new change).


    I suggest you go for .htaccess file. That way you don't change anything in your code.
    save it in a text file and name it .htaccess and upload it to your home directory on the server,

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^reg.php/(.*)\.html$ http://www.mysite.com/reg.php?$1
    Thank you very much for your reply.
    It changed to www.mysite.com/reg.php?referral but I have a problem now.
    On the input field the referral name won't appear.
    The code is:
    Code:
    <input size='3' id='referral' type='text' name='6' value='{$ref}'></td>
    Maybe there is a little mistake that I'm missing. I will keep checking the code, if I can fix it I will edit this post.

    Thank you!
    Last edited by iambuxer; 08-31-2010 at 08:28 PM.

  • #6
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to make if url username change and the same time username in form change.

    How to make if url username change and the same time username in form change.

    Example
    www.fezadgreatnetwork.com/username

    link to this form (location form url - www.fezadgreatnetwork.com/daftar.html)

    <iframe allowfullscreen="" frameborder="0" height="550" src="http://username.stiforpmovie.com/index/?SOURCE=SimpleBisnes" width="680"></iframe>

    username in form will change if url username change. And where i must put that code.


  •  

    Posting Permissions

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