|
|
#1 (permalink) | |
|
Registered User
Join Date: Jan 2003
Location: UK
Posts: 928
|
Another php script problem
hi all,
im trying to get this 'navigation' script working here is the code im using: (this goes in index.php) PHP Code:
Quote:
i cant see what im doing wrong as everything seems to be right... any help appreciated *cough*greffov*cough* thanks
|
|
|
|
|
|
|
#2 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
well, first, discarding what goes really wrong here, your default is seablue, and you want to change the theme to seablue... heh, not weird nothing changes, eh?
Then, PHP is case sensitive, giving you the major problem that 'Seablue' does not equal 'seablue'... There are a number of ways to solve that problem: 1. just use lowercase everywhere (default UNIX behaviour) 2. lowercase your input first, then use a switch with only lowecase cases 3. convert your switch into an if/else statement, where you use PHP's case insensitive string comparisation functions to do find out what you want. It may be clear that the last solution is not only more work, but also more inefficient. If you expect people to enter the name themselves, go for 2. I expect however that you will generate the theme names yourself in some script in the end, thus you best go for option 1. (UNIX roxx)
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#4 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
your site has register globals switched on?
you sure the switch works like you expect it to? (the strings could be your problem IN the switch cases... have you trie replacing the includes by echo commands?)
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Jan 2003
Location: UK
Posts: 928
|
thanks for the help greffov
i found the problem was that i was testing on my local machine.. i uploaded to my host and it all worked fine Although i do have apache server, php4 and mysql all installed so thats why i thought it was a script problem lol
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|