![]() |
Help with widget code
I have this code that is in a php widget to go and gather up to 5 random images.
But it's placing the images in the header instead of the php box. Any ideas on why that's happening? I did notice all this code is "msql" and my db is "mysqli" not sure if that matters? Code:
$con = mysql_connect("*****.**.*******.hostedresource.com","*******","******"); |
You can't echo your html, you have to set $output. In your code I think you just have to change "echo" to "$output .= ", like:
Code:
$output .= "<a href='{$row['url']}'><img src='{$row['image_path']}' /></a><br/>"; |
Quote:
Nevermind!!! That worked!!! Missed the "=" when I copy and pasted... Thanks a bunch!!! --------------- Added [DATE]1345910120[/DATE] at [TIME]1345910120[/TIME] --------------- Quote:
Code:
<a href='{$row['url']}'" target="_blank"> What did I do wrong? |
You used double quotes in your html. Since you're putting the code in a double quoted string, you either have to escape all double quotes that occur as part ofthe html (by putting a backslash in front on each one) or else use only single quotes (probably the easier option).
|
Quote:
|
Is there something in that code that might stop an animated gif in Google Chrome?
It works fine in IE and FF |
All times are GMT. The time now is 04:48 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|