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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-01-2009, 03:08 PM   #1
halfpint
GFY's Halfpint
 
halfpint's Avatar
 
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;
__________________

Get FREE website listings on Cryptocoinshops.net
halfpint is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:09 PM   #2
Killswitch - BANNED FOR LIFE
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.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:10 PM   #3
Trev_UK
Registered User
 
Join Date: Aug 2003
Location: UK
Posts: 83
you need to define $vars
Trev_UK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:14 PM   #4
halfpint
GFY's Halfpint
 
halfpint's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: UK
Posts: 15,223
Quote:
Originally Posted by Killswitch View Post
What's $vars['url'] set as?

Edit: I'm confused at what you're doing, that's CSS with a PHP echo.
yes it is css, is there a way I can do this using the css file ? link the image to an url
__________________

Get FREE website listings on Cryptocoinshops.net
halfpint is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:14 PM   #5
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
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;
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:15 PM   #6
halfpint
GFY's Halfpint
 
halfpint's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: UK
Posts: 15,223
Quote:
Originally Posted by Trev_UK View Post
you need to define $vars
how do I do that
__________________

Get FREE website listings on Cryptocoinshops.net
halfpint is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:16 PM   #7
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
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.
__________________

Last edited by Serge Litehead; 03-01-2009 at 03:19 PM..
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:18 PM   #8
Trev_UK
Registered User
 
Join Date: Aug 2003
Location: UK
Posts: 83
Quote:
Originally Posted by halfpint View Post
how do I do that

<?php $vars = 'http://www.somedomain.com'; ?>
Trev_UK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:18 PM   #9
nation-x
Confirmed User
 
nation-x's Avatar
 
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
buttsecks is good for your balls
nation-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:19 PM   #10
halfpint
GFY's Halfpint
 
halfpint's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: UK
Posts: 15,223
Quote:
Originally Posted by Trev_UK View Post
<?php $vars = 'http://www.somedomain.com'; ?>
thank you
__________________

Get FREE website listings on Cryptocoinshops.net
halfpint is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:20 PM   #11
Trev_UK
Registered User
 
Join Date: Aug 2003
Location: UK
Posts: 83
Quote:
Originally Posted by holograph View Post
php must be able to interpret php code in css first though
indeed, not sure if writing the css as a php file and using a mod rewrite would work, in my head it would lol
Trev_UK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:26 PM   #12
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
Quote:
Originally Posted by Trev_UK View Post
indeed, not sure if writing the css as a php file and using a mod rewrite would work, in my head it would lol
it can be done the same way as .html being inturpreted by php engine
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:28 PM   #13
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Am I missing something or are you all insanely stupid?
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:31 PM   #14
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
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>
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:31 PM   #15
Trev_UK
Registered User
 
Join Date: Aug 2003
Location: UK
Posts: 83
Quote:
Originally Posted by holograph View Post
it can be done the same way as .html being inturpreted by php engine
.htaccess
Trev_UK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:38 PM   #16
Trev_UK
Registered User
 
Join Date: Aug 2003
Location: UK
Posts: 83
Quote:
Originally Posted by Libertine View Post
Am I missing something or are you all insanely stupid?
Feel free to give an answer...
Trev_UK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:39 PM   #17
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by Trev_UK View Post
<?php $vars = 'http://www.somedomain.com'; ?>
Would throw an error as $vars is an array according to his current code, unless he removes the array bit from it so it's just a regular variable.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:42 PM   #18
Trev_UK
Registered User
 
Join Date: Aug 2003
Location: UK
Posts: 83
Quote:
Originally Posted by Killswitch View Post
Would throw an error as $vars is an array according to his current code, unless he removes the array bit from it so it's just a regular variable.
a simple echo $vars would work a treat
Trev_UK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:44 PM   #19
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by Trev_UK View Post
a simple echo $vars would work a treat
test it...

<?php
$vars = 'http://www.somedomain.com';
echo $vars['url'];
?>

I get this returned, 'h'
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:45 PM   #20
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
<?php
$vars = array('url' => 'http://www.somedomain.com');
echo $vars['url'];
?>

That works though ;)
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:47 PM   #21
Trev_UK
Registered User
 
Join Date: Aug 2003
Location: UK
Posts: 83
Quote:
Originally Posted by Killswitch View Post
<?php
$vars = array('url' => 'http://www.somedomain.com');
echo $vars['url'];
?>

That works though ;)
me likes, you da hero lol ;)
Trev_UK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:51 PM   #22
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Quote:
Originally Posted by Trev_UK View Post
Feel free to give an answer...
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})/

Last edited by Libertine; 03-01-2009 at 03:53 PM..
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2009, 03:54 PM   #23
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by Trev_UK View Post
me likes, you da hero lol ;)
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.