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] Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
vividona Posted July 15, 2010 Share Posted July 15, 2010 try to write image full path Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.