Current location: Hot Scripts Forums » Programming Languages » PHP » PHP theme selection script


PHP theme selection script

Reply
  #1 (permalink)  
Old 09-20-03, 09:34 AM
TMD TMD is offline
New Member
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile PHP theme selection script

Hey im pretty new to this but i figured out how to do a php theme selection script without copying an pasting anything finally :-) and it sort of worked before but then i tried to get it going the way it should be but i keep having a problem with something and i cannot figure it out for the life of me so heres the code and the error i get.

<?
$theme2 = $_GET['red'];
$headfoot2 = include("index.php");
$theme = $_GET['green'];
$headfoot = include("green_index.php");
if($theme == $_GET['green'])
{
$headfoot;
}
else($theme2 == $_GET['red'])
{
$headfoot2;
}

?>

The idea of this script is so people can choose bettween different themes on my website. And yes the names of the 2 selections from the drop down box are named green and red, so thats not the prob and here is the error message.

Parse error: parse error, unexpected '{' in C:\Documents and Settings\Ad\My Documents\apache_server\theme.php on line 11

any help would be greatly appreciated, and no im not asking for to write another theme selection script that works, just help me to fix mine because im sik of copying an pasting code an i want to actually learn something about php.
Reply With Quote
  #2 (permalink)  
Old 09-21-03, 07:25 PM
Patriarch Patriarch is offline
Newbie Coder
 
Join Date: Sep 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
- TMD

I do not believe you can have any conditions in an else statement. That's what elseifs are for.

Your code does not need to redefine the variable theme2, so cutting that out should allow your code to work.
Reply With Quote
  #3 (permalink)  
Old 09-22-03, 03:43 AM
!!BUBBLES!! !!BUBBLES!! is offline
Newbie Coder
 
Join Date: Sep 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
TMD is right, the condition in the else statement causes the error, substitute it with an elseif, then it should work.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
error when creating database tables with php script spiroth10 PHP 4 01-06-04 03:59 PM
PHP script required Mickey Job Offers & Assistance 8 09-07-03 03:00 PM
Advance print selection script vaseline Script Requests 1 09-07-03 09:41 AM
I need help with my first php script NeverMind PHP 4 08-01-03 01:27 PM
30% off Hosting - Free PHP Script Autoinstaller cyberwisdom General Advertisements 0 07-06-03 01:47 PM


All times are GMT -5. The time now is 06:13 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.