dennissanche Posted July 15, 2010 Share Posted July 15, 2010 I will try to make this a clear as possible. I am trying to insert an image into a piece of php code in dreamweaver but and only getting )?;> instead of the image. I start with this code: <?php print getOffer(0, '<img src="image.png" alt="my image" />'); ?> the image.png is where i would insert my own image file. when i do this however i get this ')?;> I have attached a screenshot of the code in dreamweaver I know its probably a simple mistake I am making but I cannot for the life of me figure out what it is. Any insight is appreciated [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/207800-cannot-get-my-image-to-work-with-a-php-script-need-help/ Share on other sites More sharing options...
trq Posted July 15, 2010 Share Posted July 15, 2010 Syntax wise there doesn't seem to be much wrong. there are the closing </span> and </p> tags though that don't seem to belong, but there's nothing (syntax wise) wrong with the php. Link to comment https://forums.phpfreaks.com/topic/207800-cannot-get-my-image-to-work-with-a-php-script-need-help/#findComment-1086280 Share on other sites More sharing options...
unlishema.wolf Posted July 15, 2010 Share Posted July 15, 2010 you can always try switching the ' and " around. <?php print getOffer(0, "<img src='image.png' alt='my image' />"); ?> if that doesn't work you can always try it without the '. <?php print getOffer(0, <img src="image.png" alt="my image" />); ?> other than those I wouldn't really know what the problem is. Link to comment https://forums.phpfreaks.com/topic/207800-cannot-get-my-image-to-work-with-a-php-script-need-help/#findComment-1086382 Share on other sites More sharing options...
kenrbnsn Posted July 15, 2010 Share Posted July 15, 2010 If you're seeing the ")'?>" being output, that means that the PHP processor is not being activated for your code. What is happening is that the browser is seeing the "<" as an opening of an HTML tag and is eating everything until the first ">" and then outputing everything else. Is your file's extension ".php" or ".html". It must be ".php" (unless .html files are processed by PHP, which is not likely). Ken Link to comment https://forums.phpfreaks.com/topic/207800-cannot-get-my-image-to-work-with-a-php-script-need-help/#findComment-1086472 Share on other sites More sharing options...
Pikachu2000 Posted July 15, 2010 Share Posted July 15, 2010 What kenrbnsn said, or, since that appears to be a call to the getOffer() function, its possible the function is not being properly used, or has its own issues. Link to comment https://forums.phpfreaks.com/topic/207800-cannot-get-my-image-to-work-with-a-php-script-need-help/#findComment-1086475 Share on other sites More sharing options...
vividona Posted July 15, 2010 Share Posted July 15, 2010 try to write image full path Link to comment https://forums.phpfreaks.com/topic/207800-cannot-get-my-image-to-work-with-a-php-script-need-help/#findComment-1086484 Share on other sites More sharing options...
dennissanche Posted July 15, 2010 Author Share Posted July 15, 2010 Thanks for the response guys. I'll keep working on this. Link to comment https://forums.phpfreaks.com/topic/207800-cannot-get-my-image-to-work-with-a-php-script-need-help/#findComment-1086785 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.