TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   4 basic questions (http://www.talkphp.com/absolute-beginners/3319-4-basic-questions.html)

Yoosha 09-04-2008 10:21 PM

4 basic questions
 
Hi,
I have 4 questions:

1- Where i can find function for RGB2Hex/Hex2RGB(Complete)?

2- How can i fix this error:
The Apache service named reported the following error:
[Mon Jun 23 21:32:08 2008] [Notice] [Disabled use of AcceptEx() WinSock2 API.]

3- Also, how can i fix/handle this:
Warning: Unknown: POST Content-Length of 5906500 bytes exceeds the limit of 5242880 bytes in Unknown on line 0
Warning: Cannot modify header information - headers already sent in Unknown on line 0

4- What is diffrence between HTMLEntities V.S. HTMLSpecialChars

Thanks for help ;).

Wildhoney 09-04-2008 10:47 PM

php Code:
function toHexFromRGB($iRed, $iGreen, $iBlue)
{
    return sprintf('%06X', $iRed . $iGreen . $iBlue);
}

function toRGBFromHex($szHex)
{
    $aRGB = array();
   
    for ($iIndex = 0; $iIndex < 3; $iIndex++)
    {
        switch ($iIndex)
        {
            case 0: $szKey = 'red'; break
            case 1: $szKey = 'green'; break;   
            case 2: $szKey = 'blue'; break
        }
       
        $aRGB[$szKey] = hexdec(substr($szHex, (2 * $iIndex), 2));
    }
   
    return (object) $aRGB;
}

$pRGB = toRGBFromHex('00FFEE');

printf
(
    "Red = %s<br />Green = %s<br />Blue = %s<br />Hex = %s",
    $pRGB->red, $pRGB->green, $pRGB->blue,
    toHexFromRGB(255, 0, 0)
);

Yoosha 09-05-2008 09:36 AM

And 2, 3, 4?

Karl 09-05-2008 12:22 PM

2, I don't know.
3, Increase the POST length in php.ini
4, the only difference between htmlspecialchars() and htmlentities() in PHP - SitePoint Forums

sketchMedia 09-05-2008 01:46 PM

Apache :: Disabled use of AcceptEx WinSock2 API

first result of a google search for "Disabled use of AcceptEx() WinSock2 API"

Yoosha 09-06-2008 03:38 PM

Thanks all. Resolved.


All times are GMT. The time now is 01:36 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0