GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Any php coders around? (https://gfy.com/showthread.php?t=944879)

goldfish 12-22-2009 10:59 PM

Any php coders around?
 
Here's what I want to do.

First click to video, every subsequent click after that goes to join form.

Would a simple session script work?

start_session();

session_register("clicks")

if ($clicks > 1){

header ("Location: join form");
}
any downfalls of doing it this way?

any way someone could get around it?

GrouchyAdmin 12-22-2009 11:05 PM

You can fill up your session dir and/or have issues with cookies. Remember to destroy your session somewhere, too, and setup a cleanup crontab.

That's ugly, but it'll likely do what you want.

Code:

@start_session();
$_SESSION['clicks'] = (isset($_SESSION['clicks'])) ? (int)$_SESSION['clicks']+1 : 1;
if ($_SESSION['clicks'] > 1){
  header ("location: join form");
}


cyco_cc 12-22-2009 11:12 PM

I second what Grouchy says. You could destroy the session on the join page because at that point, presumably, you don't care about the session value.

goldfish 12-22-2009 11:15 PM

Quote:

Originally Posted by GrouchyAdmin (Post 16675129)
You can fill up your session dir and/or have issues with cookies. Remember to destroy your session somewhere, too, and setup a cleanup crontab.

That's ugly, but it'll likely do what you want.

Code:

@start_session();
$_SESSION['clicks'] = (isset($_SESSION['clicks'])) ? (int)$_SESSION['clicks']+1 : 1;
if ($_SESSION['clicks'] > 1){
  header ("location: join form");
}


and thats where the problem lies, if I destroy the session they can get to more content, right?

I could put the seesion destroy inside the members area but that still leaves a bunch open

cyco_cc 12-22-2009 11:18 PM

Yes, of course they can. So, log the IP of the user and the date of the access. Make that check on page load, if they've accessed content in the last 24 hours (or whatever) redirect them to the join page.

Note, at that point, the SQL query can do cleanup on the log or you can set up cron job to do it.

goldfish 12-22-2009 11:26 PM

Quote:

Originally Posted by cyco_cc (Post 16675152)
Yes, of course they can. So, log the IP of the user and the date of the access. Make that check on page load, if they've accessed content in the last 24 hours (or whatever) redirect them to the join page.

Note, at that point, the SQL query can do cleanup on the log or you can set up cron job to do it.

that might actually work, I am already logging their ip for something else

Killswitch - BANNED FOR LIFE 12-22-2009 11:47 PM

Just put a new field in the database for the ip logging to reflect the views, and that way no matter what, that user comes back they will get sent to the join form.


All times are GMT -7. The time now is 11:26 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123