LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 06-12-2005, 03:59 AM   #1
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Rep: Reputation: 15
Question How to display graphics?


Hi

Need to display different graphic on the same page based on different countries from the database table. If the country extracted from the table is America, how can I relate this in PHP code to show the graphic america.jpg in this page? When Australia is extracted, this same page will show australia.jpg. Any help how I can write the PHP code to have the same page display based on the country extracted from the database table ?

Thanks!
 
Old 06-12-2005, 05:15 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
well you appear to already be pulling out a variable from a database, e.g. "america", "japan" etc... so you'd just have a bunch of files, america.png, japan.png and just insert that string into the HTML with PHP, nothing tricky.
 
Old 06-12-2005, 06:54 AM   #3
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi

The search is like this :

http://www.mydomain.com/query.php?state=<? echo urlencode($RegionID)>; ?>&mes=1

and the result can be:

http://www.mydomain.com/queryresult....ustralia&mes=1

http://www.mydomain.com/queryresult.php?state=USA&mes=1

How do I insert the graphic for individual country since the php page is queryresult.php ?

Thanks!
 
Old 06-12-2005, 08:57 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
right so you have that "state" value, so you just use that in your script... as i'd assume you already are...

<img src="images/<? echo $_POST["state"] ?>.jpg">

_POST? _GET? i never remember which is which...
 
Old 06-12-2005, 09:38 AM   #5
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi acid_kewpie

Thanks alot!

It works!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unusual graphics display problem findmana Linux - General 3 11-04-2008 04:36 AM
Dual Monitor Display on two graphics cards jojotx0 Linux - Hardware 5 08-26-2005 09:28 PM
How many graphics cards being used for display? chijacky Linux - Hardware 1 05-05-2005 10:03 AM
graphics card and display suseuser Linux - Hardware 1 05-05-2004 03:36 PM
Dell 500m Problems with display and graphics shockWAPs Linux - Laptop and Netbook 3 01-18-2004 06:38 AM


All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration