Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-23-2013, 06:34 AM   PM User | #1
TFlan
New Coder

 
Join Date: Dec 2012
Location: USA
Posts: 82
Thanks: 3
Thanked 17 Times in 17 Posts
TFlan is an unknown quantity at this point
highlight_string only using #000000 - INI File shows otherwise

The line of code in question is:

PHP Code:
$content[$i] = highlight_string($content[$i], true); 
However every single color hex is #000000 as seen here http://tristification.com/chit-chat/2/3

I have checked the INI file and the default values are the normal colors, and php_info reveals that to be true aswell. I have also set them at the start of the page using ini_set() however every single color is #000000.

Any thoughts? This is truly puzzling.
TFlan is offline   Reply With Quote
Old 02-23-2013, 08:33 AM   PM User | #2
Arcticwarrio
Regular Coder

 
Arcticwarrio's Avatar
 
Join Date: May 2012
Location: UK
Posts: 597
Thanks: 15
Thanked 67 Times in 67 Posts
Arcticwarrio is on a distinguished road
whats the code for setting them and also whats the code for displaying this?
__________________
There are 10 types of people on CodingForums,
Those who understand Binary and those who dont.
Arcticwarrio is offline   Reply With Quote
Old 02-23-2013, 03:53 PM   PM User | #3
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Looks fine to me. I see the red, green, blue and orange as I would expect for that.
The only thing I can suggest is perhaps your original didn't have the opening <?php in it. That is required for highlight string to work.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
TFlan (02-23-2013)
Old 02-23-2013, 07:11 PM   PM User | #4
TFlan
New Coder

 
Join Date: Dec 2012
Location: USA
Posts: 82
Thanks: 3
Thanked 17 Times in 17 Posts
TFlan is an unknown quantity at this point
Yea there were two problems that I found.

For my code lines, I have to have <code>...</code> around each individual line. It uses CSS. Which I then applied highlight_string() to each individual line, so it thought it was all HTML and thus #000000 was applied.

Also, I forgot the <?php ?>.

Thanks for the responses, I didn't think I would've been able to figure it out, leading me to post it here. But I got it
TFlan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:37 PM.


Advertisement
Log in to turn off these ads.