View previous topic :: View next topic |
Author |
Message |
blackarib -
Joined: 19 Jun 2004 Posts: 48
|
Posted: Mon Sep 20, 2004 4:33 pm Post subject: disabling errors |
|
|
I am making a web page with themes set by cookies with a different file of variables loaded by what is contained in a cookie. I am using the switch statemant with the cokie the name and the theme is the value of the cookie. I have got it working but my only problem is that if there is no cookie it displays an error message saying thet that veriable dosn't exist.Is there any way to disable this for this one bit of script or is there a way around it.
My current code I have made is
Code: | <?php
switch ($_COOKIE["theme"])
{
case "grey":
require ("theme=grey.php");
break;
case "gold":
require ("theme=gold.php");
break;
default:
require ("theme=grey.php");
}
?>
|
|
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Mon Sep 20, 2004 11:16 pm Post subject: |
|
|
Add the following after the opening PHP tag.
Code: |
ini_set('display_errors', 0); |
|
|
Back to top |
|
 |
blackarib -
Joined: 19 Jun 2004 Posts: 48
|
Posted: Tue Sep 21, 2004 4:27 pm Post subject: |
|
|
thanks, this has been really annoying me |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Sep 22, 2004 1:00 am Post subject: |
|
|
No problem , what are PHP programmers for :) |
|
Back to top |
|
 |
|