virtualadz Posted June 3, 2006 Share Posted June 3, 2006 i want to align my image as middle in php, this is the code with alt <?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_GO); ?>now can i leave the width and height and make the code like this<?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_GO, IMAGE_ALIGN); ?>is the above code right, should i leave a blank space for width and height and will the browser understand it auto.and it's reference will look like this:define('IMAGE_ALIGN', 'middle'); Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 3, 2006 Share Posted June 3, 2006 (edited) What are you doing actually? Define is for a PHP constant isn't it? But don't you want images in your html document centered or vertically aligned?There isn't even a function called "tep_image"? Is that a user defined function? Edited June 3, 2006 by Dan The Prof Link to comment Share on other sites More sharing options...
virtualadz Posted June 3, 2006 Author Share Posted June 3, 2006 well, i dont know what you are talking, i have all my images set to like this right from the start and it works.now suppose if i want a image with alt, width, height , it would be<?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_ALT, IMAGE_WIDTH, IMAGE_HEIGHT); ?>i want to have the align=middle attribute, i do i have that, is the below code right<?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_ALT, IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_ALIGN); ?> Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 3, 2006 Share Posted June 3, 2006 (edited) I don't know what you are doing, but this is an image: <div style="width:100%; text-align:right"><img src="next.gif" alt="click here to go to next page" width="200" height="50" /></div> What you are doing is printing the same but with loads of PHP constants, why? Edited June 3, 2006 by Dan The Prof Link to comment Share on other sites More sharing options...
virtualadz Posted June 3, 2006 Author Share Posted June 3, 2006 bcoz i use seesions and the links should be in the php format so as the customer doesn't lose his shopping cart itemssorry i didn't mention the image will be a link Link to comment Share on other sites More sharing options...
skym Posted June 3, 2006 Share Posted June 3, 2006 We can't know if the code is right, what can be done with those constants and that function unless we see it. Look for the constants where they are defined and the tep_image() function, and post them. Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 3, 2006 Share Posted June 3, 2006 Yeah, without those pieces this code is useless to us Link to comment Share on other sites More sharing options...
virtualadz Posted June 3, 2006 Author Share Posted June 3, 2006 ok i am searching for that, when i find it will post here, in the meantime can you take a look at what's wrong with this<a href="#top"><?php echo tep_image(DIR_WS_IMAGES . 'top.gif'); ?></a>igonore the image, just look at the anchor link, it's not showing up correctlywww.site.com/folder/file.phpit should make a link to go to the top for this page, but instead shows thiswww.site.com/#top Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 3, 2006 Share Posted June 3, 2006 ok i am searching for that, when i find it will post here, in the meantime can you take a look at what's wrong with this<a href="#top"><?php echo tep_image(DIR_WS_IMAGES . 'top.gif'); ?></a>igonore the image, just look at the anchor link, it's not showing up correctlywww.site.com/folder/file.phpit should make a link to go to the top for this page, but instead shows thiswww.site.com/#top<{POST_SNAPBACK}> Then you should try this:<a href="/folder/file.php#top"><?php echo tep_image(DIR_WS_IMAGES . 'top.gif'); ?></a> Link to comment Share on other sites More sharing options...
virtualadz Posted June 3, 2006 Author Share Posted June 3, 2006 it worked, now i am searching for the image align, will be back tomorrow. Link to comment Share on other sites More sharing options...
virtualadz Posted June 4, 2006 Author Share Posted June 4, 2006 hey dan the anchor link doesn't workwhen visiting the site first time it takes me to the page directlywww.site.com/folder/file.php#top, instead of moving straight to top, does php need any other coding Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now