I'm trying to connect to my database and getting these two syntax errors :

[21-Apr-2015 07:49:38] PHP Parse error: syntax error, unexpected T_VARIABLE in /home/half/public_html/vsadmin/inc/incfunctions.php on line 2:
<?php
$incfunctionsdefined=TRUE;
@set_magic_quotes_runtime(0);
$magicq = (get_magic_quotes_gpc()==1);
if(@$emailencoding=='') $emailencoding='iso-8859-1';
if(@$adminencoding=='') $adminencoding='iso-8859-1';
if(@$SESSION["languageid"] != "") $languageid=$SESSION["languageid"];

[21-Apr-2015 07:49:53] PHP Parse error: syntax error, unexpected T_VARIABLE in /home/half/public_html/createdb.php on line 1 :
<?php
$sVersion="PHP v5.2.5";
?><html>
<head>
<title>Create Ecommerce Plus mySQL database version <?php print $sVersion?></title>
<STYLE type="text/css">
<!--
p { font: 10pt Verdana, Arial, Helvetica, sans-serif}
TD { font: 10pt Verdana, Arial, Helvetica, sans-serif}
BODY { font: 10pt Verdana, Arial, Helvetica, sans-serif}
-->
</STYLE>
</head>
<body>
<?php include "vsadmin/db_conn_open.php" ?>
<?php

Any help?? I have used this script in the past with no problems.

    Just to add.....When I tried this on my computer with a testing server it worked fine. Made connection to db no problem.

      Welcome to PHPBuilder, Paulb 🙂

      You code excerpts lint just fine - no errors.

      What are the respective PHP versions?

      [man]set_magic_quotes_runtime/man is deprecated, but it should throw a different error. Any chance that the editor/IDE you are using it placing a Byte Order Mark at the top of the file?

        I think my hosting company said php 4. I'm am still to new to php, but I don't believe anything was added to the top.

        The only editing I did was in Dreamweaver, other than design changes, the only changes I made were to the db config file to enter my usrname, dbname and pw. I then uploaded the files to my server.
        Now if I go to my browser and go to www.domain.com/createdb.php and click create database, it should set up the db. But when I go to www.domain.com/createdb.php I get a blank page.

        This is set of php files that I have used in the past with no problems.

          Write a Reply...