View Full Version : weird issue(for me (: )

06-20-2009, 05:38 AM
i have index.php with this at top:


require_once 'classes/Membership.php';
$membership = New Membership();



<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

on my localhost everything works, but when i put it on my server, i am getting fatal error on line 10:

<?xml version="1.0" encoding="utf-8"?>

when i remove that line everything works. maybe i need to fix that setting in php.ini on my server which is responsable for that shorthand php tags?

06-20-2009, 05:54 AM
Yea well, your web server has the php short open tag setting turned on, which causes the <? in the <?xml tag to be seen as a php opening tag because php never made the parser smart enough to know that <? immediately followed by something other than php or white-space was not an opening php tag.

Either turn off the short open tag setting or you will need to echo the line with the <?xml tag (when the <? is enclosed in a string, it is not seen as a php tag.)

06-20-2009, 06:00 AM
And to turn it off i need to put:

php_flag short_open_tag off

in .htaccess which is in root of web server?

06-20-2009, 06:48 AM
If php is running as an Apache module, then yes. Did you try?

06-20-2009, 06:57 AM
I just needed a confitmation before i test this... ;)

Which i did just now, and it works... :)

I would like to continue this topic with another problem, i have log in page, and it works on my localhost. When i put it on web i am getting:

Fatal error: Class 'mysqli' not found in /******/Mysql.php on line 9

Mysql.php looks like this:


require_once 'includes/constants.php';

class Mysql {
private $conn;

function __construct() {
$this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or
die('There was a problem connecting to the database.');

function verify_Username_and_Pass($un, $pwd) {
$query = "SELECT *
FROM users
WHERE username = ? AND password = ?
if($stmt = $this->conn->prepare($query)) {
$stmt->bind_param('ss', $un, $pwd);

if($stmt->fetch()) {
return true;

Maybe i need to use same hack to make server use php5? What do i need to put into htaccess for that?

06-20-2009, 07:46 AM
Either the mysqli extension is not enabled and/or your php version is not php5 or higher.

In either case you should check with your web host to determine what method they have provided on their servers to enable php5 and/or enable the mysqli extension under php5.