[PHP] Re: Php and CSS where to put it

2009-01-13 Thread Al



Terion Miller wrote:

I have this code and the css seems to not work in IE at all, do I need to
put it somewhere different on the page maybe?

link rel=stylesheet type=text/css href=inc/styles.css
?php  include 'inc/dbconnOpen.php' ;

ini_set('error_reporting', E_ALL);
ini_set('display_errors', true);

 $sql = SELECT * FROM `textads` WHERE `expos`  xCount ORDER BY RAND()
LIMIT 3;
$result = mysql_query($sql);

echo 
table class=jobfont width=728 height=90 border=0 align=center
cellpadding=10 bordercolor=#66 background= 'inc/bg.gif' bgcolor=#CC
tr
td
table width=690 height=50 border=0 align=center cellpadding=5
tr;

while ($row = mysql_fetch_array($result)) {
echo 
td  class=col align=center
width=33%{$row['title']}br{$row['blurb']}br
A HREF='{$row['href']}'{$row['href']}/a/td;
//Add to exposure count
$views = $row['xCount'] + 1;
mysql_query(UPDATE `textads` SET `xCount` = '{$views}' WHERE `ID` =
'{$row['ID']}');
}

echo  /tr
/table/td/tr/table;

?



Terion: Install Firefox and the HTML Validator extension. It is a perfect tool 
for you. It will clearly identify all the HTML errors and warnings, AND point 
you to how to fix them. It uses Tidy, which classifies many errors as warnings.


However, you should fix them. Your page has 21 serious warnings many of which 
are errors that will affect rendering. After you've fixed the warnings and 
errors it finds, run the W3C HTML Validator.


Also, install the Firefox extension Validate CSS. Run it on your page. It has 
8 bad errors.


These tools are great learning aids.

Incidentally, I'm not a fan of frames, often causes problems.

Al.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Php and CSS where to put it

2009-01-12 Thread Michelle Konzack
Hello Terion,

Am 2009-01-12 10:42:10, schrieb Terion Miller:
 I have this code and the css seems to not work in IE at all, do I need to
 put it somewhere different on the page maybe?

The CSS must be in the HTML Header like

html
head
  titleCSS Example/title
  link rel=stylesheet type=text/css href=inc/styles.css
  style type=text/css
#body { background-color: magenta; }
  /style
/head
body

...rest of the page

 link rel=stylesheet type=text/css href=inc/styles.css
 ?php  include 'inc/dbconnOpen.php' ;
 
 ini_set('error_reporting', E_ALL);
 ini_set('display_errors', true);
 
  $sql = SELECT * FROM `textads` WHERE `expos`  xCount ORDER BY RAND()
 LIMIT 3;
 $result = mysql_query($sql);
 
 echo 
 table class=jobfont width=728 height=90 border=0 align=center
 cellpadding=10 bordercolor=#66 background= 'inc/bg.gif' bgcolor=#CC

according to W3C any values must be quoted like:

echo 
table class=\jobfont\ width=\728\ height=\90\ border=\0\ 
align=\center\
cellpadding=\10\ bordercolor=\#66\ background= \inc/bg.gif\ 
bgcolor=\#CC\

Do not forget to ESCAPE!  And of course, I would put the stuff into  the
CSS definition and not into the TABLE tag.

 tr
 td
 table width=690 height=50 border=0 align=center cellpadding=5

QUOT the values!

 tr;
 
 while ($row = mysql_fetch_array($result)) {
 echo 
 td  class=col align=center
 width=33%{$row['title']}br{$row['blurb']}br
 A HREF='{$row['href']}'{$row['href']}/a/td;
 //Add to exposure count
 $views = $row['xCount'] + 1;
 mysql_query(UPDATE `textads` SET `xCount` = '{$views}' WHERE `ID` =
 '{$row['ID']}');
 }
 
 echo  /tr
 /table/td/tr/table;
 
 ?

Your HTML page has to be closed with:

/body
/html

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
http://www.tamay-dogan.net/   http://www.can4linux.org/
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Terion Miller
Resolved! Thanks!

On Mon, Jan 12, 2009 at 12:38 PM, Michelle Konzack 
linux4miche...@tamay-dogan.net wrote:

 Hello Terion,

 Am 2009-01-12 10:42:10, schrieb Terion Miller:
  I have this code and the css seems to not work in IE at all, do I need to
  put it somewhere different on the page maybe?

 The CSS must be in the HTML Header like

 html
 head
  titleCSS Example/title
   link rel=stylesheet type=text/css href=inc/styles.css
   style type=text/css
#body { background-color: magenta; }
  /style
 /head
 body

 ...rest of the page

  link rel=stylesheet type=text/css href=inc/styles.css
  ?php  include 'inc/dbconnOpen.php' ;
 
  ini_set('error_reporting', E_ALL);
  ini_set('display_errors', true);
 
   $sql = SELECT * FROM `textads` WHERE `expos`  xCount ORDER BY RAND()
  LIMIT 3;
  $result = mysql_query($sql);
 
  echo 
  table class=jobfont width=728 height=90 border=0 align=center
  cellpadding=10 bordercolor=#66 background= 'inc/bg.gif'
 bgcolor=#CC

 according to W3C any values must be quoted like:

 echo 
 table class=\jobfont\ width=\728\ height=\90\ border=\0\
 align=\center\
 cellpadding=\10\ bordercolor=\#66\ background= \inc/bg.gif\
 bgcolor=\#CC\

 Do not forget to ESCAPE!  And of course, I would put the stuff into  the
 CSS definition and not into the TABLE tag.

  tr
  td
  table width=690 height=50 border=0 align=center cellpadding=5

 QUOT the values!

  tr;
 
  while ($row = mysql_fetch_array($result)) {
  echo 
  td  class=col align=center
  width=33%{$row['title']}br{$row['blurb']}br
  A HREF='{$row['href']}'{$row['href']}/a/td;
  //Add to exposure count
  $views = $row['xCount'] + 1;
  mysql_query(UPDATE `textads` SET `xCount` = '{$views}' WHERE `ID` =
  '{$row['ID']}');
  }
 
  echo  /tr
  /table/td/tr/table;
 
  ?

 Your HTML page has to be closed with:

 /body
 /html

 Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant #
 http://www.tamay-dogan.net/   http://www.can4linux.org/
 Michelle Konzack   Apt. 917  ICQ #328449886
 +49/177/935194750, rue de Soultz MSN LinuxMichi
 +33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)



[PHP] Re: Php and CSS where to put it

2009-01-12 Thread tedd

At 7:38 PM +0100 1/12/09, Michelle Konzack wrote:

Hello Terion,

Am 2009-01-12 10:42:10, schrieb Terion Miller:
  I have this code and the css seems to not work in IE at all, do I need to
  put it somewhere different on the page maybe?

The CSS must be in the HTML Header like

html
head
  titleCSS Example/title
  link rel=stylesheet type=text/css href=inc/styles.css
  style type=text/css
#body { background-color: magenta; }
  /style
/head
body

...rest of the page


Today must be my Arrr day.

Don't embed css in document -- just put what you want in your css file.

If IE has a problem with it, then deal with IE within the css file. 
There are css hacks if you can't find a way around the problem.


But embedding css style rules is a real no-no in my book -- there's 
no reason to do it.


Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Robert Cummings
On Mon, 2009-01-12 at 16:27 -0500, tedd wrote:
 At 7:38 PM +0100 1/12/09, Michelle Konzack wrote:
 Hello Terion,
 
 Am 2009-01-12 10:42:10, schrieb Terion Miller:
I have this code and the css seems to not work in IE at all, do I need to
put it somewhere different on the page maybe?
 
 The CSS must be in the HTML Header like
 
 html
 head
titleCSS Example/title
link rel=stylesheet type=text/css href=inc/styles.css
style type=text/css
  #body { background-color: magenta; }
/style
 /head
 body
 
 ...rest of the page
 
 Today must be my Arrr day.
 
 Don't embed css in document -- just put what you want in your css file.
 
 If IE has a problem with it, then deal with IE within the css file. 
 There are css hacks if you can't find a way around the problem.
 
 But embedding css style rules is a real no-no in my book -- there's 
 no reason to do it.

On my dev sites I embed the CSS, on production it gets exported to an
external version-named file as part of the build process.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Ashley Sheridan
On Mon, 2009-01-12 at 16:27 -0500, tedd wrote:

 At 7:38 PM +0100 1/12/09, Michelle Konzack wrote:
 Hello Terion,
 
 Am 2009-01-12 10:42:10, schrieb Terion Miller:
I have this code and the css seems to not work in IE at all, do I need to
put it somewhere different on the page maybe?
 
 The CSS must be in the HTML Header like
 
 html
 head
titleCSS Example/title
link rel=stylesheet type=text/css href=inc/styles.css
style type=text/css
  #body { background-color: magenta; }
/style
 /head
 body
 
 ...rest of the page
 
 Today must be my Arrr day.
 
 Don't embed css in document -- just put what you want in your css file.
 
 If IE has a problem with it, then deal with IE within the css file. 
 There are css hacks if you can't find a way around the problem.
 
 But embedding css style rules is a real no-no in my book -- there's 
 no reason to do it.
 
 Cheers,
 
 tedd
 
 
 -- 
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com
 

Here's something for fixing IE with hacks:

http://www.ashleysheridan.co.uk/coding_html_comments.php

basically it lets you add in extra IE-only stylesheets using comment
code only recognised by IE, and you can use !important to stress your IE
styles. Best thing though is it validates through the W3C because it is
just an HTML comment.


Ash
www.ashleysheridan.co.uk


Re: [PHP] Re: Php and CSS where to put it

2009-01-12 Thread Paul M Foster
On Mon, Jan 12, 2009 at 09:56:00PM +, Ashley Sheridan wrote:

snip

 
 Here's something for fixing IE with hacks:
 
 http://www.ashleysheridan.co.uk/coding_html_comments.php
 
 basically it lets you add in extra IE-only stylesheets using comment
 code only recognised by IE, and you can use !important to stress your IE
 styles. Best thing though is it validates through the W3C because it is
 just an HTML comment.

Don't move that page; I've bookmarked it. ;-}

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP/Dreamweaver CSS issue

2006-05-12 Thread Jon

The Doctor wrote:

I am trying to modularize a Web Page using one of Dremweaver's CSSes.

It works in Firefox but it falls about in IE.

Is IE at fault or the modularization?



It is neither Firefox's fault nor the concept of modularization.  The 
fault is probably 55% IE's and 45% dreamweaver's.  Both of these 
programs suck and were written by people who neither know about or care 
about good web page style modularization using CSS.


I recommend ditching Dreamweaver and dusting off a plain text editor and 
reading this book: http://www.zeldman.com/dwws/


After you understand the concepts involved, the web has a plethora of 
workarounds for IE's gross misbehavior that will neither violate the 
standards nor the intention behind them.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php and CSS level 2

2004-03-21 Thread Michal Migurski
RD I do wonder if either of the above methods would force the RD
browser to never cache the CSS file locally

You know, I didn't think about that, as I've never personally used this
method.  I've never had a need.  Thinking about it now, I would also
think that you may need to send a content-type header of text/css to
the browser, as well, though I'm not positive on this.

Gecko/Moz based browsers will ignore a stylesheet that lacks the
appropriate Content-Type header, so definitely make sure it's there.
Regarding the caching, I think just setting up the appropriate
cache-control headers should make it indistinguishable from a regular,
static CSS file.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php and CSS level 2

2004-03-20 Thread Aidan Lister
Your question indicates you have very little understanding of what PHP
actually is.

PHP will be parsed anywhere in any script, as long as your webserver is set
to parse that type of file (ie, .php by default).

1. In your webserver config you need to make .css files parsed by php
2. Like you've done in your code snip?

I suggest you a) read the manual b) experiment before asking further
questions.



Andy B [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
was just wondering if php will work inside a CSS level 2 style sheet?? for
example:

?php ?
style type=text/css
?php
if(!empty($name)){ ?
input#name {
display: none }
?php } else { ?
input#name {
font-family: Arial, serif;
font-size: 12pt;
color: blue;
background-color: transparent;
. }
?php } ?

/*rest of style sheet */
/style

if this will work i was wondering 2 things:

1. how would i have to set it up to work right with the style sheet with php
in it to work as a seperate file from the html file
and
2. how would i set the style sheet up to work inside the original html/php
file that contained the original html code...





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php and CSS level 2

2004-03-20 Thread Ben Ramsey
Why not just make your CSS script end with the .php extension instead of 
.css?  Then, the server will automatically parse it (most likely it 
will--depending on your server setup, of course).  You can link to it 
from your HTML page like you would your CSS:

style type=text/css
!--
@import url(/path/to/css.php);
--
/style
or

link href=/path/to/css.php rel=stylesheet type=text/css /



Aidan Lister wrote:

Your question indicates you have very little understanding of what PHP
actually is.
PHP will be parsed anywhere in any script, as long as your webserver is set
to parse that type of file (ie, .php by default).
1. In your webserver config you need to make .css files parsed by php
2. Like you've done in your code snip?
I suggest you a) read the manual b) experiment before asking further
questions.


Andy B [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
was just wondering if php will work inside a CSS level 2 style sheet?? for
example:
?php ?
style type=text/css
?php
if(!empty($name)){ ?
input#name {
display: none }
?php } else { ?
input#name {
font-family: Arial, serif;
font-size: 12pt;
color: blue;
background-color: transparent;
. }
?php } ?
/*rest of style sheet */
/style
if this will work i was wondering 2 things:

1. how would i have to set it up to work right with the style sheet with php
in it to work as a seperate file from the html file
and
2. how would i set the style sheet up to work inside the original html/php
file that contained the original html code...



--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: php and CSS level 2

2004-03-20 Thread Richard Davey
Hello Ben,

Sunday, March 21, 2004, 4:02:40 AM, you wrote:

BR style type=text/css
BR !--
BR @import url(/path/to/css.php);
--
BR /style

BR or

BR link href=/path/to/css.php rel=stylesheet type=text/css /

Just out of interest Ben, I do wonder if either of the above methods
would force the browser to never cache the CSS file locally, forcing
it to download it every single time? I can think of instances when
this would be a desirable result, but they are far and few between :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php and CSS level 2

2004-03-20 Thread Ben Ramsey
RD I do wonder if either of the above methods would force the
RD browser to never cache the CSS file locally
You know, I didn't think about that, as I've never personally used this 
method.  I've never had a need.  Thinking about it now, I would also 
think that you may need to send a content-type header of text/css to 
the browser, as well, though I'm not positive on this.

OT -- Consequently, I've had a lot of trouble with IE caching any CSS 
file for a site I'm working on.  Works perfectly in Mozilla, but IE has 
all sorts of bugs.  It's loading the page before the CSS every time, so 
you get this flash of unformatted data.  The client and most of their 
site users use IE, so I have to make it work.  My boss found an odd 
work-around, though.  If you put script type=text/javascript 
/script at the very top, just inside the head tag, then it will 
work just fine and load in the CSS first every time.  I don't know the 
logic behind it, but, if it's IE, does there have to be any logic?  ;-)

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP with CSS

2002-06-30 Thread CC Zona

In article 001101c220b8$5338fc30$768c3841@c3,
 [EMAIL PROTECTED] (Bruce Karstedt) wrote:

 Quick question?
 
 Is their anything in Apache or PHP that would keep styles from working. Both
 external (CSS) and inline styles are ignored.

If it was the only the external stylesheet that wasn't working, the first 
thing to do would be to check that Apache is configured to the right 
content type (text/css) for it and that the PHP code isn't doing anything 
silly like sending the dynamically-generating the *.css page with a 
header() declaring a different content type; but with the inline styles 
also not working, that scenario would either be unlikely or only part of 
the story.

Have the HTML and CSS both been validated yet?  If the output of your PHP 
includes syntactically-flawed HTML, that could lead to problems with the 
CSS rendering as well.  And of course, invalid CSS will not render as 
expected.  This final thought may already be obvious to you, but is there 
any chance that the styles you're using are either not supported by your 
browser, or that your page's doctype has accidentally triggered the 
browser's less-forgiving standards mode? (If any of this sounds 
unfamiliar, you can follow-up with a newsgroup or list where CSS is 
on-topic, such as news:comp.infosystems.www.authoring.stylesheets.)

Good luck!

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php