473,788 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linking image to URL using PHP

6 New Member
hi,
this is my current php code which displays an image.

[HTML]<span class='floatRig ht'>
Sponsors: <img src='".THEME."i mages/logo1.gif' />

</span>[/HTML]

Now i want that displayed image to link to a certain external URL.
How would i do this?
Nov 13 '07 #1
7 15706
mwasif
802 Recognized Expert Contributor
Put <a></a> around the image
Expand|Select|Wrap|Line Numbers
  1. <span class='floatRight'>
  2.         Sponsors: <a href='http://www.some-domain.com/page.html'><img src='".THEME."images/logo1.gif' /></a>
  3.  
  4.         </span>
Checkout this page for details.
Nov 13 '07 #2
brucehere
6 New Member
i just get the following error when i put that code in:

"Parse error: parse error, unexpected T_STRING in..."

The code in dreamweaver also doesnt look right? like it goes all orange and stuff, not the usual red and black im used to for php code.
so must be another way of writing that code...?

Thanks for trying though, any other suggestions?

ps. i maybe also forgot to add that my image tag is within php code.
Nov 13 '07 #3
mwasif
802 Recognized Expert Contributor
You need to take care of the quotes. If you are facing problem, post your PHP code so that I can suggest something.
Nov 13 '07 #4
brucehere
6 New Member
This is that block of code:
[HTML]$FOOTER = "
</div>
</div>
</div>
<div id='footer'>

<div id='width'>
<span class='floatLef t'>
{SITEDISCLAIMER }
</span>
<span class='floatRig ht'>
Sponsors: <img src='".THEME."i mages/logo1.gif' />

</span>
</div>
</div>
";[/HTML]

thanks, much help appreciated!
Nov 13 '07 #5
mwasif
802 Recognized Expert Contributor
Did you embed the code I suggested? Make sure you keep single quotes around the URL.
Expand|Select|Wrap|Line Numbers
  1. <a href='http://www.some-domain.com/page.html'><img src='".THEME."images/logo1.gif' /></a>
If you still face any problem, then post your code with changes.
Nov 13 '07 #6
brucehere
6 New Member
epic!
it works
thanks alot!!
really appreciate it!
Nov 13 '07 #7
mwasif
802 Recognized Expert Contributor
Welcome!

Glad to help you.
Nov 13 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

13
31765
by: Mike | last post by:
We are using: <!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" xml:lang="en" lang="en"> Using CSS (not html since align=center and <center> are deprecated) I can get it to work in IE6 (but not NS 7 or Firefox) with. <div style="text-align:center; display:block; "><img src="myimg.gif"
1
2689
by: bborden | last post by:
Novice Access programmer here. I would like to display an image using the Toolbox Image object by calling the images file name using: =fPictureFiles(!!,1) in the Picture control. Below is the function which DOES actually returns a valid file
1
16230
by: Prasad More | last post by:
Hello, I am trying to write a text on Multi-page TIFF image using C# and .NET GDI+. I have written following code to do this. When I execute this code I get "Invalid Parameter User. at System.Drawing.Image.Save" error. public void addAnnotationStampOnImage() { string strStamp = Path.GetFileNameWithoutExtension(_ImageFileName); Size dSize; Image iMulti = Image.FromFile(_ImageFileName);
6
2739
by: guassian | last post by:
Hi, I am new to C programming. Is there way to read a 8 bit gray image using C language? Thanks and best regrads, Raj
3
20079
by: Senthil | last post by:
Hi all I'm new in ajax. How to upload a image using ajax..
1
4933
by: basavaraj koti | last post by:
I need to show image using xslt Below provided in my xml and xslt. <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="../xyz.xsl"?> <Grade class="03" subject="Science"> <media id="2809"> <topic>A Bird's Paradise</topic> <category>Concept</category> <type>Animation</type>
2
3785
by: user | last post by:
Hi all... i am trying to print an image using GDI - but the only thing i get is a black rectangle. Does anybody know what is wrong, or how else to get the bitmap on the printer (GDI+ is not possible. it is a POS printer (for restaurants) and the printer internal fonts are a MUST for printing speed. as far as i know printer internal fonts are only accessable through GDI, so all my printing is GDI up to now)
2
1521
by: wingsganesh | last post by:
Hi Guys, I dont know how to send image in windows mobile 6. i captured image using CameraCaptureDialog class and displayed that image in picture box. but still, i need to send this image in one specific link .... can anybody guide me..... how to send image...............
11
5822
by: shapper | last post by:
Hello, I am displaying an image on a few pages. The image size is 50 px height and 50 px width. In some pages I need the image to be 30x30 px in others 40x40 px and in others 50x50px. Can I scale the image using CSS? Thanks,
4
4902
by: neovantage | last post by:
Hey geeks, i want to draw a jpeg image of pattern chess. I can draw solid color image using gd libraray and here is my code //$t_im having image path, $t_wt,$t_ht is specified width and height respectively. $blue = imagecolorallocate($t_im,149,0,0); imagefilledrectangle($t_im,0,0,$t_wt,$t_ht,$blue);
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.