...

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



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


<?php

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

$membership->confirm_Member();

?>

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

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?

CFMaBiSmAd
06-20-2009, 04: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.)

GaVrA
06-20-2009, 05: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?

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

GaVrA
06-20-2009, 05: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:


<?php

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 = ?
LIMIT 1";
if($stmt = $this->conn->prepare($query)) {
$stmt->bind_param('ss', $un, $pwd);
$stmt->execute();

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

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

CFMaBiSmAd
06-20-2009, 06: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum