Why wont this work? |
Author: |
Message: |
Val
Senior Member
Posts: 698 Reputation: 45
31 / /
Joined: Jun 2004
|
O.P. Why wont this work?
Hey guys I wanted a way for users to select the style sheet they want to use for my site and save their selection in a cookie so my friend Ezra wrote this up for me but it dosent work becouse the code just gives me and error "unexpected { on line 4"
so here is the code its not all of it just the part that gives the error
code: <?php
//Setting the cookie
if(!isset($_COOKIE['css']){
if(isset($_GET['style']) && $_GET['style'] != ""){
setcookie("css", htmlspecialchars($_GET['style'], ENT_QUOTES), time()+11156);
header("/");
}
}
?>
if you need more code just request it
Menthix:
Anonymous doesn\'t have a leader.
Anonymous is the leader of ShawnZ.
Max:
True. But deep down, we all know.
ShawnZ is incharge.
he is /b/ in human form.
|
|
01-05-2006 04:11 PM |
|
|
L. Coyote
Senior Member
Captain Obvious
Posts: 981 Reputation: 49
39 / /
Joined: Aug 2004
Status: Away
|
RE: Why wont this work?
quote: Originally posted by ValSpy
if(!isset($_COOKIE['css']){
There is a ) missing at the end, between the ) and the {
Hack, hack, hack!
Finally became a Systems Analyst!
|
|
01-05-2006 04:25 PM |
|
|
Val
Senior Member
Posts: 698 Reputation: 45
31 / /
Joined: Jun 2004
|
O.P. RE: Why wont this work?
quote: Originally posted by Leo
There is a ) missing at the end, between the ) and the {
Thanks leo but now I get a 500 error check it out, http://valspy.net/V2/set.php and if you click on in the header of this page it gives same error http://valspy.net/V2/index.php
Menthix:
Anonymous doesn\'t have a leader.
Anonymous is the leader of ShawnZ.
Max:
True. But deep down, we all know.
ShawnZ is incharge.
he is /b/ in human form.
|
|
01-05-2006 05:05 PM |
|
|
Plik
Veteran Member
Posts: 1489 Reputation: 46
35 / / –
Joined: Jun 2004
|
RE: Why wont this work?
quote: Originally posted by ValSpy
quote: Originally posted by Leo
There is a ) missing at the end, between the ) and the {
Thanks leo but now I get a 500 error check it out, http://valspy.net/V2/set.php and if you click on in the header of this page it gives same error http://valspy.net/V2/index.php
that would most likely be this line:
quote: Originally posted by ValSpy
header("/");
I assume you're trying to do a header relocation? if you are then you need to do this:
header("Location: the place you are relocating to");
and im not sure if you can use / as the location, you will probably need to use the file, eg, index.php, although im not sure about this
|
|
01-05-2006 05:11 PM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
RE: Why wont this work?
yeah, I was tired when I made that
But I gave him a new working & tested version
|
|
01-05-2006 05:21 PM |
|
|
L. Coyote
Senior Member
Captain Obvious
Posts: 981 Reputation: 49
39 / /
Joined: Aug 2004
Status: Away
|
RE: Why wont this work?
quote: Originally posted by Madman
and im not sure if you can use / as the location, you will probably need to use the file, eg, index.php, although im not sure about this
Yes, you can.
Edit: meh, I didn't see the header("/"); when I replied before (my first reply to this thread). Anyway, in this post I meant you can put header("Location: /");
This post was edited on 01-05-2006 at 05:26 PM by L. Coyote.
Hack, hack, hack!
Finally became a Systems Analyst!
|
|
01-05-2006 05:21 PM |
|
|
Val
Senior Member
Posts: 698 Reputation: 45
31 / /
Joined: Jun 2004
|
O.P. RE: Why wont this work?
Thanks guys for all your help and if you want to test it out go here http://valspy.net/V2/ and I have 3 colors blue, pink, orange if anyone wants to suggest a color please do so here in this thread
Menthix:
Anonymous doesn\'t have a leader.
Anonymous is the leader of ShawnZ.
Max:
True. But deep down, we all know.
ShawnZ is incharge.
he is /b/ in human form.
|
|
01-05-2006 06:09 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: Why wont this work?
Red+Black would go pretty nicely!
Overall good start
|
|
01-05-2006 06:31 PM |
|
|
|