Just started getting into the use of cookies. The following code will redirect users to a set URL should they view a preset number of pages. I'm a little concerned with the speed in which this executes though. Is there a better way, or this fine?
Code: [Select]public function onPrepareContent(&$article, &$params, $limitstart)
{
global $mainframe;
$content = $article -> text;
$current = JURI::current();
$duration = $this->params->get('duration');
$destination = $this->params->get('destination');
$max_count = $this->params->get('maxcount');
$site_id = 'aseihthaslhetlasiehtlasndlksahdlv';
$value = 1;
if(!(isset($_COOKIE["$site_id"])))
{
setcookie("$site_id", $value, time() + 60 * 60 * 24 * $duration);
}
if(isset($_COOKIE["$site_id"]))
{
$increment = TRUE;
if($_COOKIE["$site_id"] > $max_count)
{
$value = 1;
setcookie("$site_id", $value, time() + 60 * 60 * 24 * $duration);
$increment = FALSE;
header("Location: $destination");
}
if($increment)
{
$value = $_COOKIE["$site_id"];
$value++;
setcookie("$site_id", $value, time() + 60 * 60 * 24 * $duration);
/*$content = $_COOKIE["$site_id"];*/
}
}
$article -> text = $content;
}
Recognising Revenue daily
Hello.
HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane. When the ddl selection is changed, I programatically change the selected index of the accordian to
Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data update current data or delete old data from tempproducts to products then it will delete the
INSERT data problem!
After having an string with apostrophes ', double quotes " or any other special characters, successfully escaped through one of themany php functions availables to escape, what other
Select Rows as Columns..
is there a way to select COLUMN_NAME from user_tab_columns where table_name='TABLENAME';
Help uploading .JPG
I have a problem with upload images when the ending is .JPG capitalized.. I really don't know what causes it to crash but been testing it for some time and it's my retrictions that won't allow it in.
help with database debug pls
Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 13<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Error querying database.
I get the above error when trying to insert some values to a datatable.Here's the code :Code: $dbc = mysqli_connect('127.0.0.1:3306', 'root', 'xxxx', 'aliendatabase') or die('Error connecting to
Upload, SSL and more php help
I recently just installed a ssl cert and do i use https for the whole site or just for the checkout.php and cart.php and login.php files?whats the proper way to use https?I have 2 more questions, when
Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing is that I'm getting a dump after I press de button of my added function; the exception is