The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User refer url
#2
It depends on how secure you want it. If you're doing this kind of modification, you're going to want to copy your join form over to the usersc folder.

Change line 24 to
Code:
<?php require_once '../users/init.php'; ?>

This will stop your modifications from getting overwritten by updates.

Ok...now I will give you the simplest possible version...we will use the user_id of an existing user. Note that if you're going to do this one, you might want your user id's to be higher than just 1,2,3. Don't ever change user number 1...just don't use that one for referrals.

To bump up your user ids by default, go into phpmyadmin, click on your database, click the sql, and type
Code:
ALTER TABLE users AUTO_INCREMENT=10000
Hit go. That will start user numbers at 10,000. Then just leave user 1 alone. Maybe delete user 2.

Ok, so back to usersc/join.php
You will make your referral links (note the c) mysite.com/usersc/join.php?refid=10000

Change line 29, which is just
Code:
<?php
to
Code:
<?php $ref = Input::get('refid');
Code:
$check = $db->query("SELECT id FROM users WHERE id = ?",array($ref))->count();
//looking for users with the ref code
Code:
if ($check < 1){Redirect::to('mydomain.com/index.php?err=Sorry.+Invalid+referral+code.');
Code:
}

Now you could get more creative where instead of using the user id, you could generate a random number for each user and put it somewhere in their users table, but this will get you started.


  Reply


Messages In This Thread
User refer url - by kingnath - 09-08-2017, 11:09 PM
User refer url - by mudmin - 09-09-2017, 12:24 PM
User refer url - by kingnath - 09-10-2017, 10:03 AM
User refer url - by mudmin - 09-10-2017, 12:16 PM
User refer url - by kingnath - 09-10-2017, 03:35 PM
User refer url - by mudmin - 09-10-2017, 04:40 PM
User refer url - by kingnath - 09-10-2017, 06:41 PM
User refer url - by mudmin - 09-10-2017, 08:22 PM
User refer url - by kingnath - 09-10-2017, 11:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)