Go Back   CodingForums.com > :: Client side development > XML

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 06-20-2009, 04:38 AM   PM User | #1
GaVrA
New Coder

 
Join Date: Jun 2009
Posts: 35
Thanks: 4
Thanked 1 Time in 1 Post
GaVrA is an unknown quantity at this point
weird issue(for me (: )

i have index.php with this at top:

PHP Code:
<?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:

PHP Code:
<?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?
GaVrA is offline   Reply With Quote
Old 06-20-2009, 04:54 AM   PM User | #2
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,714
Thanks: 2
Thanked 251 Times in 243 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
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.)
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
CFMaBiSmAd is online now   Reply With Quote
Old 06-20-2009, 05:00 AM   PM User | #3
GaVrA
New Coder

 
Join Date: Jun 2009
Posts: 35
Thanks: 4
Thanked 1 Time in 1 Post
GaVrA is an unknown quantity at this point
And to turn it off i need to put:

Code:
php_flag short_open_tag off
in .htaccess which is in root of web server?
GaVrA is offline   Reply With Quote
Old 06-20-2009, 05:48 AM   PM User | #4
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,714
Thanks: 2
Thanked 251 Times in 243 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
If php is running as an Apache module, then yes. Did you try?
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
CFMaBiSmAd is online now   Reply With Quote
Old 06-20-2009, 05:57 AM   PM User | #5
GaVrA
New Coder

 
Join Date: Jun 2009
Posts: 35
Thanks: 4
Thanked 1 Time in 1 Post
GaVrA is an unknown quantity at this point
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:

PHP Code:
Fatal error: Class 'mysqli' not found in /******/Mysql.php on line 9 
Mysql.php looks like this:

PHP Code:
<?php

require_once 'includes/constants.php';

class 
Mysql {
    private 
$conn;
    
    function 
__construct() {
        
$this->conn = new mysqli(DB_SERVERDB_USERDB_PASSWORDDB_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?
GaVrA is offline   Reply With Quote
Old 06-20-2009, 06:46 AM   PM User | #6
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,714
Thanks: 2
Thanked 251 Times in 243 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
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.
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
CFMaBiSmAd is online now   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 08:21 PM.


Advertisement
Log in to turn off these ads.