5 Replies - 5397 Views - Last Post: 27 January 2002 - 03:26 PM Rate Topic: -----

#1 Quik  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2
  • View blog
  • Posts: 3,750
  • Joined: 06-March 01

Custom Header Script HELP! PHP

Posted 26 January 2002 - 11:06 PM

i have 4 or 5 images i want for headers.. theres a big discussion of which is best so ima let ppl choose which one is used.. like "Customize: 1 2 3 4 5" and it will cookie which one they pick

I scripted it myself, but then somthing went corrupt, and bag im in those moods where the prob is staring you in the face yet you've tried everything.

So if anyone can write one up or find one it would be great!

Is This A Good Question/Topic? 0
  • +

Replies To: Custom Header Script HELP! PHP

#2 Sargant  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 30-November 01

Re: Custom Header Script HELP! PHP

Posted 27 January 2002 - 06:06 AM

Could you put up the bit of the script that's givin you the grief, and the error?
Was This Post Helpful? 0
  • +
  • -

#3 Quik  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2
  • View blog
  • Posts: 3,750
  • Joined: 06-March 01

Re: Custom Header Script HELP! PHP

Posted 27 January 2002 - 10:25 AM

Sure

<?
if(isset($image)) {
setcookie("header",$image,time()+36000);
}

if(!isset($HTTP_COOKIE_VARS["header"])) {
$image = "header1.gif";
setcookie("header","header1.gif",time()+36000);
}
?>

<img src="
<?
if(isset($image)) { echo $image; } else { echo $HTTP_COOKIE_VARS["header"]; }
?>
">

The problem Im having is that when I reload the site its not showing the "new" header. LIke it wont show whats in the cookie. check it

Was This Post Helpful? 0
  • +
  • -

#4 Quik  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2
  • View blog
  • Posts: 3,750
  • Joined: 06-March 01

Re: Custom Header Script HELP! PHP

Posted 27 January 2002 - 10:31 AM

BAH! I GOT IT TO WORK
YAY
Now, Just one question, instead of
time()+36000);  Which means it timesout in +36000 how would I make it so it will never time out?

You can try my custom header @ http://techmechanic.net/mine/

Was This Post Helpful? 0
  • +
  • -

#5 Sargant  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 30-November 01

Re: Custom Header Script HELP! PHP

Posted 27 January 2002 - 03:14 PM

There isn't a way to set an infinite-time cookie, although you can come close.  Try setting the timeout as being:

time()+(60*60*24*365*10)

Which'll give you a 10-year cookie - long enough, I think :D

The longest cookie's I've ever seen set are for Dec 31, 2039.  I've seen that a few times, but never further.  Is that like the upper limit or something?

Was This Post Helpful? 0
  • +
  • -

#6 Quik  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2
  • View blog
  • Posts: 3,750
  • Joined: 06-March 01

Re: Custom Header Script HELP! PHP

Posted 27 January 2002 - 03:26 PM

Heh heh.. IM pretty sure thats long enough! lol
THanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1