Jump to content

echo and <font style> ---does this look correct?


meltingpoint

Recommended Posts

It looks ok, but i would never do it this way. I like to keep my css seperated instead of inline style.

Instead of this you could make an easy html element with the class report. In Css you make a .report{}.

And in php you just echo an html element with that class. much cleaner and easier to fix.

Link to comment
Share on other sites

Thanks fortnox-  I have done the CSS class before and you're right- I probably should continue to do it that way.  However- with the mixing of text and $variables I wanted to test and inline method. 

 

I was not sure of using the {} around the variable to isolate it rather than using a bunch of " " and having to escape them.

 

 

 

Link to comment
Share on other sites

I was not sure of using the {} around the variable to isolate it rather than using a bunch of " " and having to escape them.

{} is pretty nice to use, even if it's not needed just to make it easier to read. If you just start every project with a standard css folder a JS folder a functions folder etc you will will work much faster.

 

Also this way you can make it much more dynamic. you could maybe make 3 reportclasses with green orange and red.

All you need to do Is fetch reports, with there classnumber and put classnumber in the html element.

like:

 

<echo "<p class="{$color_class}">Report: {$report_number}<br />Date of Incident: {$date}</p>";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.