Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Can You Spot the Problem? (PHP)

Can You Spot the Problem? (PHP)
Thread Tools
Professional Poster
Join Date: Apr 2002
Location: New York City
Status: Offline
Reply With Quote
Jul 19, 2003, 01:25 PM
 
[PHP]
<?php
$guts = "index";

if (isset($HTTP_GET_VARS['setguts'])) {
$guts = $HTTP_GET_VARS['setguts'];

setcookie("guts",$guts,time() + 31536000,"/",".domain.com",0);
}

if (isset($HTTP_COOKIE_VARS["guts"])) {
$guts = $HTTP_COOKIE_VARS["guts"];
}

if (isset($HTTP_GET_VARS['guts'])) {
$guts = $HTTP_GET_VARS['guts'];
}
?>
[/PHP]

I'm getting the following error:
Parse error: parse error, unexpected ',' in /home/aqua-sol/public_html/yeah.php on line 48
there is nothing on line 48 that could possibly be causing the problem.
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 19, 2003, 03:43 PM
 
that code works on my web server, is there something else that might be the problem (i changed the code slightly but nothing major)
[php]
<?php
$guts = "index";
if (isset($HTTP_COOKIE_VARS["guts"])) {
$guts = $HTTP_COOKIE_VARS["guts"];
}
if (isset($HTTP_GET_VARS['setguts'])) {
$guts = $HTTP_GET_VARS['setguts'];
setcookie("guts",$guts,(time() +
31536000),"/test/","mydomain.com");
}
if (isset($HTTP_GET_VARS['guts'])) {
$guts = $HTTP_GET_VARS['guts'];
}
echo($guts);
?>
[/php]
it works for me
*shrug*
i changed the setcookie a bit (took out the . in ".domain.com" and the redundant no security...)

--will
edit: example not needed
(Last edited by clam2000; Jul 19, 2003 at 04:37 PM. )
     
Axo1ot1  (op)
Professional Poster
Join Date: Apr 2002
Location: New York City
Status: Offline
Reply With Quote
Jul 19, 2003, 04:29 PM
 
Thanks. I figured out what I was doing wrong. I'm really no good with the code, but with a lil' help I can sometimes manage
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 19, 2003, 04:37 PM
 
what was it?

--will
     
Axo1ot1  (op)
Professional Poster
Join Date: Apr 2002
Location: New York City
Status: Offline
Reply With Quote
Jul 19, 2003, 05:44 PM
 
pretty mundane really, I was just working with the wrong document, so the code at the top was not referring to the code toward the bottom. I'll post what I've done with it when my site is a bit more presentable.
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:11 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2