![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
GFY's Halfpint
Industry Role:
Join Date: Jun 2007
Location: UK
Posts: 15,223
|
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; |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Guest
Posts: n/a
|
What's $vars['url'] set as?
Edit: I'm confused at what you're doing, that's CSS with a PHP echo. |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Registered User
Join Date: Aug 2003
Location: UK
Posts: 83
|
you need to define $vars
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
GFY's Halfpint
Industry Role:
Join Date: Jun 2007
Location: UK
Posts: 15,223
|
yes it is css, is there a way I can do this using the css file ? link the image to an url
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
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;
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
GFY's Halfpint
Industry Role:
Join Date: Jun 2007
Location: UK
Posts: 15,223
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
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.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Registered User
Join Date: Aug 2003
Location: UK
Posts: 83
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
|
buttsecks is good for your balls
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
GFY's Halfpint
Industry Role:
Join Date: Jun 2007
Location: UK
Posts: 15,223
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Registered User
Join Date: Aug 2003
Location: UK
Posts: 83
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
it can be done the same way as .html being inturpreted by php engine
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
Am I missing something or are you all insanely stupid?
![]()
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
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>
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Registered User
Join Date: Aug 2003
Location: UK
Posts: 83
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Registered User
Join Date: Aug 2003
Location: UK
Posts: 83
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Guest
Posts: n/a
|
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Registered User
Join Date: Aug 2003
Location: UK
Posts: 83
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Guest
Posts: n/a
|
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Guest
Posts: n/a
|
<?php
$vars = array('url' => 'http://www.somedomain.com'); echo $vars['url']; ?> That works though ;) |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Registered User
Join Date: Aug 2003
Location: UK
Posts: 83
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
I'm not entirely sure. I have the flu, and am constantly on the verge of hallucinating due to my fever.
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.
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Guest
Posts: n/a
|
|
![]() ![]() ![]() ![]() ![]() |