Forum Moderators: coopster

Message Too Old, No Replies

PHP Image Map

PHP Image Map

         

cannonsconcept

10:48 pm on Aug 30, 2010 (gmt 0)

10+ Year Member



I am not a php person yet, I only know html. I was told that images maps were very hard to do in php. I am trying to add an image to a website and then cut it like an html image map into different links all over the images. Is this something hard to do? is it possible to use html code where I want this to happen inside of the php code or does it not work.

I dont quite understand what php is for besides calling a database to fill in information.

thanks for any help, I hope this makes since.

Mr. Concept

morehawes

9:30 am on Aug 31, 2010 (gmt 0)

10+ Year Member



Hello and welcome to Webmaster World!

It does indeed seem that you are a little confused as to what PHP is. Perhaps try reading around the subject a little. There are some great resources out there.

PHP (PHP Hypertext Preprocessor) is a scripting language that can be used to output HTML so it can only output the HTML for an image map to the browser. Is there some limitation with HTML image maps that has made you look for a more powerful solution? Perhaps you could give some more specifics?

cannonsconcept

6:19 pm on Aug 31, 2010 (gmt 0)

10+ Year Member



Thanks!

Oh I see. Well I was just curious to see how complicated creating an image map would be in php. I may not have to go that route though. Is it possible to have html pages mixed with php pages.. Have the front end of a website all .html and perhaps have links in the main website to .php pages like login.php?

How is this against SEO? Would it be wise to add a rel no follow to the php links?

sorry I'm a noob when it comes to PHP on the web. I need to take some courses on it.

IntegrityWebDev

3:10 pm on Sep 1, 2010 (gmt 0)

10+ Year Member



"PHP Pages" are just HTML pages with PHP code in them. If you are on a server that supports PHP, you could rename your index.html to index.php (without changing any code) and it would run just fine. Adding any HTML into the page would be fine too. A site can have HTML and PHP pages mixed together if needed.

IntegrityWebDev

3:13 pm on Sep 1, 2010 (gmt 0)

10+ Year Member



Here's a simple PHP page that displays the day of the week...notices that all the code is HTML except for one line that displays the day of the week dynamically.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
What day of the week is it?
[b]<?php echo date("l"); ?>[/b]
</body>
</html>


Hope this helps.

rocknbil

4:58 pm on Sep 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was just curious to see how complicated creating an image map would be in php.


I think you're getting the idea that an imagemap is a product of (X)HTML output, not PHP, so your output from PHP (or, the html portion of the php page) would manage the map.

<img src="someimage.jpg" usemap=#mymap" alt="My ImageMap">

<map id="mymap">
<area shape="rect" coords="0,0 25,50" href="some-page.html" alt="Some Page">
<area shape="default" nohref>
</map>

The only reason I can think of to call PHP into the game is if you are dynamically creating an image, which is likely beyond you at this point.

I need to take some courses on it.


Once good place to start [w3schools.com].