Jump to content

Referral link


HDMICable

Recommended Posts

Hello friends.

 

I'm needing a bit of help with some code.

 

I have this code to show my users their referral link:

(this code goes in the reg.php file)

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 then this one on the user's profile to show their referral URL:

$dp = $do->get_loc()."reg.php/{$signin_username}.html";

 

So the result is "mysite.com/reg.php/referral.html" and I want it to be "mysite.com/reg.php?referral"

I just need to get rid of the "/"

I've seen sites like "thesite.com/?r=referral"

 

How can i do something like that?

 

Thanks!

Link to comment
Share on other sites

The reason the URL can be like that because the index for that directory can be excluded. In most cases the directory is index.php, so a URL like www.site.com/?r=referral is the same as www.site.com/index.php?r=referral. In the same way that if you want to visit the index of a website you don't need to include /index.php (assuming the index is index.php).

Link to comment
Share on other sites

The reason the URL can be like that because the index for that directory can be excluded. In most cases the directory is index.php, so a URL like www.site.com/?r=referral is the same as www.site.com/index.php?r=referral. In the same way that if you want to visit the index of a website you don't need to include /index.php (assuming the index is index.php).

 

Thank you very much for your reply.

 

I will try to add the register page into the index.php ;)

 

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.