Solved

PHP printing CSS error question

Posted on 2013-01-22
4
250 Views
Last Modified: 2013-01-22
Hi everyone,

I know it's not the best practice but we need to print some CSS inside PHP like this

if ( $remind_status == 1 )
	{
		echo "<br><span style="padding:0 0 0 30px;
border-left:#0066cc 12px solid;
background-color:#3FA9F5;
padding:8px;
color:#FFF;
-webkit-border-radius: 0px 6px 6px 0px;
border-radius: 0px 6px 6px 0px;margin-left:30px;">You have an active reminder for every $remind_days days of inactivity!</span>";
	}

Open in new window


but it's giving the following error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/clear555/public_html/jstats.php on line 339 (line that starts with echo)

Could anyone tell us what we're doing wrong here?

Thanks,

D
0
Comment
Question by:TLN_CANADA
[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
  • 3
4 Comments
 
LVL 7

Accepted Solution

by:
rgranlund earned 500 total points
ID: 38807113
it is your use of apostrophe's.
use this:

<?php
if ( $remind_status == 1 )
	{
		echo '<br><span style="padding:0 0 0 30px;
border-left:#0066cc 12px solid;
background-color:#3FA9F5;
padding:8px;
color:#FFF;
-webkit-border-radius: 0px 6px 6px 0px;
border-radius: 0px 6px 6px 0px;margin-left:30px;">You have an active reminder for every $remind_days days of inactivity!</span>';
	}
?>

Open in new window

0
 
LVL 7

Expert Comment

by:rgranlund
ID: 38807142
Thanks for the points and glad I was able to help.
0
 

Author Comment

by:TLN_CANADA
ID: 38807161
Thank you, one other small question with it if I may. The variable $remind_days inside the code is only printing as I guess it thinks its text inside this block. How could I adjust this so it prints the PHP variable here?
0
 
LVL 7

Expert Comment

by:rgranlund
ID: 38807490
You concantonate:
<?php
if ( $remind_status == 1 )
      {
            echo '<br><span style="padding:0 0 0 30px;
border-left:#0066cc 12px solid;
background-color:#3FA9F5;
padding:8px;
color:#FFF;
-webkit-border-radius: 0px 6px 6px 0px;
border-radius: 0px 6px 6px 0px;margin-left:30px;">You have an active reminder for every' . $remind_days.  'days of inactivity!</span>';
      }
?>
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

734 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