Breaking News
Home / Web / PHP (page 5)

PHP

How do you serve a image file using PHP?

Code Snippet Lets say you have to build and image server using PHP. The image filename to be severed is specified with the file GET parameter and this script is called as get-image.php which is located in the root of your website. e.g. http://yoursite.com/get-image.php?file=logo.png The following snippet reads the file …

Read More »

PHP Warning : Cannot send session cache limiter – headers already sent

Issue The PHP script script gives an error the following error 1) [[25-Dec-2011 01:16:21] PHP Warning:  session_start() [<a href=’function.session-start’>function.session-start</a>]: Cannot send session cache limiter – headers already sent (output started at /Users/mvohra/workspace/infuzee/projects/webservices/common/subscriptions/edit-upload.php:24) in /Users/mvohra/workspace/infuzee/projects/webservices/admin/header.php on line 2 2) [25-Dec-2011 01:17:14] PHP Notice:  A session had already been started – ignoring …

Read More »

PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE

Issue The PHP script script gives an error the following error [27-Dec-2011 19:48:20] PHP Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Users/jake/Sites/projects/webservices/projects/uploader/index.php on line 227 echo”<option value=”$rows[‘id’]” $selected]]>$rows[‘name’]</option>”; Solution Please make sure the double quotes and quotes are matching properly. If there are double …

Read More »

PhpMyAdmin error – Cannot start session without errors

Issue On login, PhpMyAdmin gives the following error Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Solution This error is not related to PhpMyAdmin as such but it is due to the Web Browser cache/cookie issue. …

Read More »