User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,680 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,510 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 251 | Replies: 2 | Solved
Reply
Join Date: Nov 2007
Location: WASHINGTON, USA
Posts: 7
Reputation: cmgdev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
cmgdev cmgdev is offline Offline
Newbie Poster

Newbie Needs You - Linking image in PHP

  #1  
Jun 12th, 2008
Please help. I can not figure out how to add a simple link to an image when the image is called through PHP. I have tried making it work a number of ways but I am only intermediate in HTML and still trying to learn PHP basics.

The code is:

  1. <div id="mainleft">
  2. <h2>Place CMG Title Header Here</h2>
  3. <img src="<?php echo get_bloginfo('url') ?>/serv67/cmg2/img/blog2.jpg" >

Thank you for your help! I just want to use the image as a link to another page.

Respects,
cmgdev
Last edited by peter_budo : Jun 16th, 2008 at 7:57 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Arkansas
Posts: 364
Reputation: buddylee17 will become famous soon enough buddylee17 will become famous soon enough 
Rep Power: 2
Solved Threads: 70
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Whiz

Re: Newbie Needs You - Linking image in PHP

  #2  
Jun 12th, 2008
I guess you mean this:
<a href="http://www.google.com">
<img src="<?php echo get_bloginfo('url') ?>/serv67/cmg2/img/blog2.jpg" alt="pic" />
</a>
Reply With Quote  
Join Date: Nov 2007
Location: WASHINGTON, USA
Posts: 7
Reputation: cmgdev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
cmgdev cmgdev is offline Offline
Newbie Poster

Re: Newbie Needs You - Linking image in PHP

  #3  
Jun 12th, 2008
Thank you buddylee17. It is sad how easy it is to be so ignorant of something so simple. I was trying to link from inside the php tag and I didn't ever think to place it right outside of it.

I appreciate your help.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 7:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC