Issues using $_GET

Status
Not open for further replies.

SaW

Member
Mar 3, 2018
101
15
Trying to set up a refferal system which uses $_GET to pick up the refferer, like , though it doesn't work.
Even this won't output correctly
PHP:
$ref = $_GET['ref'];
echo $ref;
using
Any ideas why this happens, maybe because of .htaccess?
 

SaW

Member
Mar 3, 2018
101
15
If you’re using RevCMS, try doing

Thanks for the reply, but still no results:
You must be registered for see images attach

Should display the result in the 'refferer' tab. Using this code:
PHP:
<input placeholder="
<?php
if($_GET['ref'] != ''){
$ref = $_GET['r'];
echo $ref;
} else {
echo "Refferer";
};
?>">
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
RevCMS uses url rewrite already so

Hotel.com/me
Is actually a rewrite that directs to
/app/tpl/skins/Skin/me.php

You can do it Jerry's way but I suggest rewriting a rule so that you can take
Hotel.com/Referal/User
And rewrite it to
Hotel.com/referrals&ref=User

Otherwise without rewrites you can do
Hotel.com/Referrals&ref=User
 
Thanks for the reply, but still no results:
You must be registered for see images attach

Should display the result in the 'refferer' tab. Using this code:
PHP:
<input placeholder="
<?php
if($_GET['ref'] != ''){
$ref = $_GET['r'];
echo $ref;
} else {
echo "Refferer";
};
?>">
Hotel.com/Register&ref=SaW

Also you are on register?url=register

You need to be on index.php?url=register to get Jerry's method to work
 
  • Like
Reactions: SaW

SaW

Member
Mar 3, 2018
101
15
RevCMS uses url rewrite already so

Hotel.com/me
Is actually a rewrite that directs to
/app/tpl/skins/Skin/me.php

You can do it Jerry's way but I suggest rewriting a rule so that you can take
Hotel.com/Referal/User
And rewrite it to
Hotel.com/referrals&ref=User

Otherwise without rewrites you can do
Hotel.com/Referrals&ref=User
 

Hotel.com/Register&ref=SaW

Also you are on register?url=register

You need to be on index.php?url=register to get Jerry's method to work
Thanks a lot. I've got a hard time wrapping my head around rewriting, but do you mean something like this?
You must be registered for see images attach
 

SaW

Member
Mar 3, 2018
101
15
Probably a PHP error but double check CTRL+ SHIFT+J
Inserts the /ref/ in the stylesheet path.. how do i get around this??
You must be registered for see images attach
:
You must be registered for see images attach


I really appreciate the help.

*EDIT: Nvm, got it working, thank you very much!
 
Status
Not open for further replies.

Users who are viewing this thread

Top