Hi. I have been trying to get this to work for hours. I can't see what I am doing wrong. I am working on php4 on godaddy shared hosting. I am trying to get the php function getimagesize working in a test php program so I can apply the logic to another program.
I displayed the file variable with an img tag to confirm the path to the image file was correct.
Thanks, Dave. You are right. The problem was with the path. When I tried putting the image in the same folder, it worked. Apparently the routines don't like when you use the path from root. I changed the path to start from the current folder, and then it worked. Here's the change below that worked for both displaying the image and giving the width and height.
$filename = "/webadmin/uploads_for_emails/smileyface.jpg";
to
$filename = "uploads_for_emails/smileyface.jpg";
I'm not sure why godaddy doesn't accept the other path but I'm glad to know how to get it to work.
Thank you again for your awesome help.
Alexis
Dave Baldwin
You're welcome. I think it's just that PHP routine, not Godaddy.
alexisbr
ASKER
Thanks, Dave but I thought you said my original program worked fine as is on your system and on your host. That's why I was saying the problem must be on godaddy's end that I had to change the way I did the paths.
The first thing I did with your code is change the image link to one in the same directory. Then I changed it to an image on my web site. Both worked fine so I figured it must be the path. But your path worked to display the image but not with the getimagesize() function. So the path worked in an <img> tag but not in the PHP function. Both are still coming from Godaddy so I don't think it's a Godaddy problem. Just some oddity in the way PHP was trying to use the path.
alexisbr
ASKER
OK I understand now. Thanks for the details. I appreciate it.
$filename = "/webadmin/uploads_for_ema
to
$filename = "uploads_for_emails/smiley
I'm not sure why godaddy doesn't accept the other path but I'm glad to know how to get it to work.
Thank you again for your awesome help.
Alexis