homepage Welcome to WebmasterWorld Guest from 54.227.12.4
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Hi all, need help with something, PHP
php else etc etc
Acecool




msg:1293288
 6:44 am on Jan 7, 2003 (gmt 0)


<h3><?echo ("$page")?></h3>
and top menu
<p>
<?php
if(!@include("website/games/Atari/$review.php")
)
IF ELSE {
if(!@include("website/games/Atari/$walkthrough.php")
)
{
include("website/games/info/Atari.php");
}}
?>
<p>
and bottom menu

Well Im confused ORiginal code is


<h3><?echo ("$page")?></h3>
and top menu
<p>
<?php
if(!@include("website/games/Atari/$walkthrough.php")
)
{
include("website/games/info/Atari.php");
}
?>
<p>
and bottom menu

I want to know how i can add another else
so

if somone goes to index.php?page=Atari (working)
that it will show the info "website/games/info/Atari.php"

IF somone goes to index.php?page=Atari&walkthrough=gamename

info isnt shown, but that page is

index.php?page=Atari&review=gamename

if they go there, info isnt shown, game review is shown

if they try index.php?page=Atari&review=gamename&walkthrough=gamename it shows info because i dont want it to show 2 on page

Well I hope im clear enough, Thanks

 

andreasfriedrich




msg:1293289
 1:07 pm on Jan 7, 2003 (gmt 0)

I want to know how i can add another else

Have a look at php.netīs documentation for elseif [php.net] and else [php.net].

BTW you might want to think about changing your URIs to a more SE friendly format.

Andreas

Acecool




msg:1293290
 1:24 pm on Jan 7, 2003 (gmt 0)

Thanks for the reply,
I actuatly like this format because if someone tries to download my site with any download tool, they get a huge mes jumble index.php.htm

anyway the main site/news etc is index.php if I have the meta in there then it should be fine, or?

Acecool




msg:1293291
 1:39 pm on Jan 7, 2003 (gmt 0)

didnt work :-(

ukgimp




msg:1293292
 2:07 pm on Jan 7, 2003 (gmt 0)

Ace

Dont worry about someone downloading your site. They wont see anything but html. PHP is processed server side. The only way someone will realistically be able to download your site is with ftp access.

If you want to get along with any scritping language write "readable" code. You need to be able to see where you have been and what you have been doing. If you produce an epic bit of code, how are you going to ammend that later. Use comments and structure it you will thank yourself.

Use elsif's

Cheers

andreasfriedrich




msg:1293293
 2:37 pm on Jan 7, 2003 (gmt 0)

Use elsif's

In PHP it is elseif, in Perl elsif.

ukgimp




msg:1293294
 2:39 pm on Jan 7, 2003 (gmt 0)

Good spot Andreas, but I expect nothing less form the php guru :)

Typo on my part

andreasfriedrich




msg:1293295
 2:45 pm on Jan 7, 2003 (gmt 0)

Brett should add some code highlighting features to this board. ;)

I often confuse those little syntax differences but XEmacs always helps me figure them out really fast. If the color does not change then it is the wrong syntax.

Andreas

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved