cookie problem NEED HELP!!!

General discussions related to php

Moderators: macek, egami, gesf

RickyD77
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Oct 23, 2002 5:54 am

cookie problem NEED HELP!!!

Postby RickyD77 » Mon Nov 04, 2002 7:52 pm

ok theres my probleme
i have a survey in a template file this survey was include in this template like this

<?php
if (isset($HTTP_COOKIE_VARS['PnorthSurvey'])){
$cookie=1;
}else{
$cookie=0;
}
if ($cookie==0){
include ('survey.php');
}else{
include ('surveyresult.php');
}
?>

and i have a submit buton in the survey.php

how can i set the cookie and reload the page
note this template was use for all page in the site so the reload need to be on the good page

thx i realy need help

User avatar
webwired
New php-forum User
New php-forum User
Posts: 26
Joined: Sat Nov 23, 2002 5:20 pm
Location: St. Louis, Missouri
Contact:

Postby webwired » Wed Dec 11, 2002 10:45 am

Code: Select all

<?php
if(!isset($COOKIE_SET))
{
   setcookie("testcookie", "Gingersnap");
   header("Location: $PHP_SELF?COOKIE_SET=1");
   exit;
}
?>


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 1 guest