Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 03-27-2005, 02:41 PM read cookies via php
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
okay i have my cookies being saved... both of them... from the following file.

final.php
PHP Code:
<?php
if ($_POST['age'] == "<16" || $_COOKIE['age'] == "too_young") {
    
setcookie("age""too_young"time()+60*60*24*30);
    include 
'http://192.168.0.1/test/sorry.php?p=young';
} else {
    
setcookie("join""completed"time()+60*60*24*30);
    include 
'/sendmail.php';
}
?>

the problem of reading them
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Join The AMW Clan</title>
</head>
<body>
<?php
include 'http://jonspcrepair.com/inc/header.php';

if (!empty(
$_COOKIE['too_young'])) {
    include 
'sorry.php?p=young';
} elseif (!empty(
$_COOKIE['completed'])) {
    include 
'sorry.php?p=completed';
} else {
    include 
'form.php';
}
?>
</body>
</html>
the cookies i think are not even read as it still shows the form

to try this script out your self click here
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
 
Register now for full access!
Old 03-27-2005, 06:43 PM
Experienced Talker

Posts: 36
Trades: 0
Do some variable debugging to see what's gone wrong;

PHP Code:
echo '<pre>';var_dump($_COOKIE);echo '</pre>'
tress is offline
Reply With Quote
View Public Profile
 
Old 03-27-2005, 09:05 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
after a good 6 1/2 hours of looking i finally got it right.... finally.... now to convert it from private lan to internet use! fun.
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Reply     « Reply to read cookies via php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.48565 seconds with 12 queries