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
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 02-06-2007, 07:24 PM   #1
Kard63
Confirmed User
 
Kard63's Avatar
 
Join Date: Nov 2003
Location: 237 619 975
Posts: 8,944
embedding CSS in PHP, example, please look

print "<IMG STYLE="position:absolute; TOP:35px; LEFT:170px; WIDTH:50px; HEIGHT:50px" SRC="hair$hair.gif">";



Whats wrong with that line? thanks.
__________________
Kard63 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 07:25 PM   #2
Chio
Confirmed User
 
Chio's Avatar
 
Join Date: Oct 2002
Location: ICQ: 39-183769
Posts: 8,002
Quote:
Originally Posted by Kard63 View Post
print "<IMG STYLE="position:absolute; TOP:35px; LEFT:170px; WIDTH:50px; HEIGHT:50px" SRC="hair$hair.gif">";



Whats wrong with that line? thanks.
I'm not a coder at all but maybe you need to escape out some of those characters?
__________________

I seo'd my hair yesterday and today it's pr7!
RIP Texas Dreams

Are you a content producer or program owner sick of tube sites? Contact me on ICQ: 39-183769
Chio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 07:27 PM   #3
Kard63
Confirmed User
 
Kard63's Avatar
 
Join Date: Nov 2003
Location: 237 619 975
Posts: 8,944
the line:

print "<img src = hair$hair.gif>";

works. but when I try to add CSS it goes to shit.
__________________
Kard63 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 07:29 PM   #4
DjSap
Confirmed User
 
Join Date: Jul 2002
Posts: 3,869
A. You do not fucking do that, all styles go into the CSS file, no hardcoding

print "<IMG class='imgstyle' SRC='hair$hair.gif'>";
__________________
Blog Themes, TGP Design, Writing Services, Grunt Work
ICQ: 66871495
DjSap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 07:30 PM   #5
naitirps
Confirmed User
 
Join Date: May 2004
Location: ...
Posts: 761
try this:

echo "<IMG STYLE=\"position:absolute; TOP:35px; LEFT:170px; WIDTH:50px; HEIGHT:50px\" SRC=\"hair".$hair.".gif\">";
__________________
Programmer
ICQ 44035273 | AIM spritwork | Email spritian at spritian dot com
naitirps is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 07:40 PM   #6
Kard63
Confirmed User
 
Kard63's Avatar
 
Join Date: Nov 2003
Location: 237 619 975
Posts: 8,944
Quote:
Originally Posted by naitirps View Post
try this:

echo "<IMG STYLE=\"position:absolute; TOP:35px; LEFT:170px; WIDTH:50px; HEIGHT:50px\" SRC=\"hair".$hair.".gif\">";
It worked beautifully. Thank you very much!

If you could explain I would cream my pants, but if you cant I am still insanely grateful. Thanks again.
__________________
Kard63 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 07:54 PM   #7
octane
Registered User
 
Join Date: Mar 2006
Posts: 32
you can't use the same type of quotes (in this case double quotes) inside the string you're trying to print without escaping them.

basically your print statement starts at the first double quote and ends at the next one, which was right after STYLE=, and that caused the error.
octane is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 08:44 PM   #8
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally Posted by DjSap View Post
A. You do not fucking do that, all styles go into the CSS file, no hardcoding

print "<IMG class='imgstyle' SRC='hair$hair.gif'>";

or just escape the -> " characters
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2007, 09:08 PM   #9
PHP-CODER-FOR-HIRE
Confirmed User
 
Industry Role:
Join Date: Nov 2006
Posts: 1,090
Quote:
Originally Posted by DjSap View Post
A. You do not fucking do that, all styles go into the CSS file, no hardcoding

print "<IMG class='imgstyle' SRC='hair$hair.gif'>";
If you want to be like that, you shouldn't use single quotes in HTML attributes.

The ultimate correct way is like this:

echo '<img src="whatever.gif" class="super_pic" style="border: 1px solid red;" />';


Print is not required here, nor is escaping quotes.
__________________
PHP-CODER-FOR-HIRE is offline   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



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.