Jump to content

session cookie question


adv

Recommended Posts

hello

i have a problem ... i have some input text

 

 

 <input name="about" value="" type="text"   >
<input name="about1" value="" type="text" > 

and in that file i`m trying to store the value of the text with cookie

i`ve tried

<?php
$about=$_POST['about'];
$about1=$_POST['about1'];
if (!empty($about)&&!empty($about1)){
setcookie("abb1",$about,time()+3600);
setcookie("abb2",$about1,time()+3600);
}
?>

 

and in another page i tried to request that cookie like this

<?php
$info1=$_COOKIE['abb1'];
$info2=$_COOKIE['abb2'];
?>

i tried to send the cookie to an email

<?php
$message="info1:$info1\ninfo2:$info2\n";
mail("[email protected]","test",$message);

but sometimes it doesn`t work

it sends the cookie empty

info:

info1:

 

 

and i have another question

does $_SESSION and $_COOKIE conflict??

Link to comment
https://forums.phpfreaks.com/topic/90261-session-cookie-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.