Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Flip a script around

Reply  
Thread Tools
dudeking's Avatar
Member with 483 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: Advanced
27-May-2007, 11:40 AM #1
Flip a script around
PHP Code:
<?php
    error_reporting
(E_ALL E_NOTICE);
    
$gallerys file('gallerys.txt');
    if(
array_key_exists($_GET['gallery'], $gallerys)){
        
$forinclude $gallerys[$_GET['gallery']];
        
$included trim($forinclude);
        include(
$included);
    }else{
        echo 
'<h1>Select a Gallery</h1>';
    }foreach(
$gallerys as $key => $value){
        
printf('<a href="?gallery=%s"><img src="/images/gallerys/thumbs/%s.png" border="0" /></a>'$key$key);
    }
?>
Right I want

PHP Code:
$forinclude $gallerys[$_GET['gallery']];
$included trim($forinclude);
include(
$included); 
to be bellow the other bit, how can I do it?
dudeking's Avatar
Member with 483 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: Advanced
28-May-2007, 06:57 AM #2
Is there such thing as if isnt? lol or something along those lines.
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,637 posts.
 
Join Date: Oct 2006
28-May-2007, 07:47 AM #3
Why do you want to flip it?
harmor's Avatar
Senior Member with 117 posts.
 
Join Date: Mar 2007
Experience: Intermediate
28-May-2007, 07:49 AM #4
Quote:
Originally Posted by dudeking
Is there such thing as if isnt? lol or something along those lines.
Just change this line
PHP Code:
if(array_key_exists($_GET['gallery'], $gallerys)){ 
To
PHP Code:
if(!array_key_exists($_GET['gallery'], $gallerys)){ 
dudeking's Avatar
Member with 483 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: Advanced
07-Jun-2007, 04:41 PM #5
really? thats soo easy!! thanks mate
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:53 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.