Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Callin an Image in PHP and setting it's dimensions
Old 07-01-2008, 01:06 AM Callin an Image in PHP and setting it's dimensions
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 679
Name: Lashtal
Trades: 0
echo ("<img src=IMAGE.png>");

I use this code to call an image from the appropriate folder and the image shows up just fine.

My question is:

How do I determine the image's dimensions within the parameters of my script?

I want to center it on the page, and I want to link the image to a webaddress.

Thank you
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-01-2008, 02:47 AM Re: Callin an Image in PHP and setting it's dimensions
Extreme Talker

Posts: 189
Trades: 0
try this code

PHP Code:
<?php

echo '<a href="'.$url.'"><img src="'.$image.'.png" class="center" /></a>';

?>
$url and $image are variables so set them higher up.

and in your css put

Code:
.center {
text-align: center;}
this code should work I think.
simster is offline
Reply With Quote
View Public Profile
 
Old 07-01-2008, 04:20 AM Re: Callin an Image in PHP and setting it's dimensions
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 679
Name: Lashtal
Trades: 0
the image was called just fine, but it wouldn't link to an external address.

I am trying to place that linkable image in this particular script:

PHP Code:
<?
  session_start
();
  include 
"../affconfig.php";
  include 
"./lang/$language";
  if(!
aff_check_security())
  {
    
aff_redirect('index.php');
    exit;
  }
 
  include 
"header.php"
 
  print 
"<p><br>".AFF_C_CONTACT." <a href=mailto:";
  print 
$emailinfo;
  print 
">";
  print 
$emailinfo;
  print 
"</a>.";
  include 
"footer.php"
?>
I'm posting it to see if that gives you guys more insight as to why your recommendation wasn't working for me.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 07-01-2008, 06:00 AM Re: Callin an Image in PHP and setting it's dimensions
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 679
Name: Lashtal
Trades: 0
it works when I call the image with:

PHP Code:
<?php
 
echo ("<img src=IMAGE.png>");

 
?
php>
but it doesn't allow me to link that image to an external website, or position it upon the page to my desired dimension.

Any ideas?
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Callin an Image in PHP and setting it's dimensions
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13242 seconds with 12 queries