There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display driver drivers email error excel explorer firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware network networking nvidia outlook outlook 2003 outlook express partition printer problem ram router slow sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
If Command


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
bob121's Avatar
Senior Member with 188 posts.
 
Join Date: Sep 2006
28-Sep-2007, 03:39 PM #1
If Command
I was woundering if someone could help me on a code along theese lines that works because i wrote that and cant get it to work
HTML Code:
$link = "if ($garage->car == \"Peugeot 106\"){
echo (\"../images/106.jpg\"); } "
?>
dudeking's Avatar
Computer Specs
Senior Member with 350 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: I'm Pro...
29-Sep-2007, 03:22 AM #2
PHP Code:
<?php
    $link 
= if($garage->car == "Peugeot 106"){
        echo 
'<img src="../images/106.jpg">';
    }
?>
bob121's Avatar
Senior Member with 188 posts.
 
Join Date: Sep 2006
29-Sep-2007, 07:22 AM #3
Error Message
Parse error: syntax error, unexpected T_IF in /fpgs2/users/northeast-gangs/game/garage2.php on line 6
dudeking's Avatar
Computer Specs
Senior Member with 350 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: I'm Pro...
29-Sep-2007, 07:32 AM #4
PHP Code:
<?php
    
if($garage->car == "Peugeot 106"){
        echo 
'<img src="../images/106.jpg">';
    }
?>
I don't under stand what $link is doing but removing it and the if will work.
bob121's Avatar
Senior Member with 188 posts.
 
Join Date: Sep 2006
29-Sep-2007, 08:10 AM #5
Because its for a garage on my game , and i want it to link to that image when its in the garage so $link gives it the options from all the different cars
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
29-Sep-2007, 11:42 AM #6
PHP Code:
<?php
$link 
= ($garage->car == "Peugeot 106");
if(
$link) {
    echo 
'<img src="../images/106.jpg">';
}
?>
Excellent is the correct spelling for "exelent".
bob121's Avatar
Senior Member with 188 posts.
 
Join Date: Sep 2006
29-Sep-2007, 11:45 AM #7
Thank you for your assistance MMJ your such a good help to people

I am on doing a MYSQL method now i thought off, if that does not work ill try what you posted if neither works ill get back to yous

James
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,250 posts.
 
Join Date: Oct 2006
29-Sep-2007, 12:38 PM #8
np.
Closed Thread

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.


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 help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


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:35 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.