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;
}
need help in php variable
i have a php variable on one pageCode: [Select]$lastId = mysql_insert_id($db);echo $lastId;i want to send this variable and the value in it to second page when i click on submit buttoni already tried
Creation of Raw Exposure manually
SAP Gurus
Cursor statement failed with errors
Following statement failed with the errors.
Are sessions secure at all?..
I haven't really gotten into yet, but I was just thinking of something weird..Lets say you have a session element $_SESSION['is_admin']..Is that easy to modify the cookie or whatnot and change it to
whats wrong with my code please help!!!
this is the errorWarning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line Code: [Select]<?php$srch = $_REQUEST["srch"];if
getting Vars to pass to next page.
Hello all, I have a confusing situation on my hands, i am a member of a gaming community and we are setting up a website (yay i get to be teh techie!!) im not exactly a noob with php but i am by far
[function.file]: failed to open stream: No such file or directory
Okay I wrote this little script to upload a csv file that is located on my webhosts server to a mysql database. Something is wrong because I am getting the following error:Warning:
Edit MySQL Row Using PHP and HTML Form
Hello,Here's what I'm trying to do. Build a page where a user enters a MySQL row number in. Then, a new page appears with an HTML form where the user can edit the information in that row. Like for
Impact of movement type 412 E on MAP
Hi
Update Database
Hi All,I have a problem with this:Code: [Select]<?phpsession_start();include('../common/dbconnect.php');$stock_id = $_GET['stock_id'];$query='SELECT * FROM users_stocks WHERE user_id ="' .