![]() |
PHP gurus I need your help please ...
Im trying to link this code and image to a url so that when a surfer clicks on the image it takes the surfer back to the homepage.. and I am stuck.. Anybody know how to do this..
Any help appreciated thanks Code:
background:white url(<?php echo $vars['url']; ?>mod/brighton_boat/graphics/cz4.jpg)no-repeat left top; |
What's $vars['url'] set as?
Edit: I'm confused at what you're doing, that's CSS with a PHP echo. |
you need to define $vars
|
Quote:
|
so whats is the problem?
by looking at your code all seems normal, maybe a slash is missing between closing php tag and "mod/bri..." ? background:white url(<?php echo $vars['url']; ?>/mod/brighton_boat/graphics/cz4.jpg)no-repeat left top; |
Quote:
|
php must be able to interpret php code in css first though if that code is applied in css file.. if its in php..
look at the source and see what $vars['url']; output there or print it somewhere else. |
Quote:
<?php $vars = 'http://www.somedomain.com'; ?> |
buttsecks is good for your balls
|
Quote:
|
Quote:
|
Quote:
|
Am I missing something or are you all insanely stupid? :eek7
|
to link the image directly to url it can be done this way:
in styles: #link1 { background:white url(mod/brighton_boat/graphics/cz4.jpg)no-repeat left top; } /* just make sure to set width and height of an actual image */ in html source <a id="link1" href="http://URL"></a> |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
<?php $vars = 'http://www.somedomain.com'; echo $vars['url']; ?> I get this returned, 'h' |
<?php
$vars = array('url' => 'http://www.somedomain.com'); echo $vars['url']; ?> That works though ;) |
Quote:
|
Quote:
However, even in my current clouded state of mind, most of the posts in this thread seem way off. First, the .htaccess thing... a far better solution is to rename the .css file to .php, and simply reference that as the style sheet. Works just fine. Second, the php thing. Why use php if you're going to hardcore the variable, anyway? Third, the php thing again. His question (as well as his code) had absolutely nothing to do with that piece of php. The url() in the background is the location of the background picture, nothing to do with clickable hyperlinks. Fourth, the actual question. It makes very little sense. The clickable link is never the background, but the element it's the background of. Since the OP didn't specify what the element is, the entire thread is pointless. But, again, I'm in a fever-induced state of semi-consciousness, so I may well be talking jibberish which only makes sense to me. |
Quote:
|
All times are GMT -7. The time now is 05:08 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123