Solved

Define CSS in PHP

Posted on 2006-06-26
1
408 Views
Last Modified: 2012-08-14
Hi Experts,

I've got the following line in a PHP document which is sitting inside a table:

<p><?PHP echo $USER_NAME ?> : </p>

How can I define a style for the  $USER_NAME variable? I've tried the following but it does not work :

<p class="body"><?PHP echo $USER_NAME ?> : </p>

I've also assigned a style to the table but this does not work either.

Your help would be much apprecaited!
0
Comment
Question by:avdvyver
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 13

Accepted Solution

by:
rhickmott earned 250 total points
ID: 16982627
PHP will just echo anything thats non php (enclosed in tags) directly so I would suggest this is a HTML/CSS bug rather than a PHP bug.

Try

<p style="color: #FF0000"><?PHP echo $USER_NAME ?> : </p>

If it appaears in red then I would imagine this is somethig to do with your HTML/CSS.
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question