•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,771 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,277 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 9167 | Replies: 2
![]() |
•
•
Join Date: Sep 2004
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I have tried to modify the PHP in an OSCommerce file, while trying to get my OSCommerce site up. I have apparently created the following Parse error: ....... /create_account_success.php on line 16. I am not a programmer and no very little PHP. Is it acceptable to paste the PHP here and ask how can I restore this to a readable format? This is the entire code. The errored code is the following:
<?php
/*
$Id: create_account_success.php,v 1.9 2002/11/19 01:48:08 dgw_ Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License
*/
define('NAVBAR_TITLE_1', 'Create an Account');
define('NAVBAR_TITLE_2', 'Success');
define('HEADING_TITLE', 'Your Account Has Been Created!');
define('TEXT_ACCOUNT_CREATED', 'Congratulations! Your new account has been successfully created! Please allow 24 hours for Account Activation. <small><b></b></small> <a href="'. tep_href_link(FILENAME_CONTACT_US) '"></a>.<br><br>A confirmation will be sent to the provided email address. If you have not received it within 24 hours, please <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">contact us </a>.');
?>
Can someone please help me correct, whatever is in error? Thank you.
<?php
/*
$Id: create_account_success.php,v 1.9 2002/11/19 01:48:08 dgw_ Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2002 osCommerce
Released under the GNU General Public License
*/
define('NAVBAR_TITLE_1', 'Create an Account');
define('NAVBAR_TITLE_2', 'Success');
define('HEADING_TITLE', 'Your Account Has Been Created!');
define('TEXT_ACCOUNT_CREATED', 'Congratulations! Your new account has been successfully created! Please allow 24 hours for Account Activation. <small><b></b></small> <a href="'. tep_href_link(FILENAME_CONTACT_US) '"></a>.<br><br>A confirmation will be sent to the provided email address. If you have not received it within 24 hours, please <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">contact us </a>.');
?>
Can someone please help me correct, whatever is in error? Thank you.
•
•
Join Date: Aug 2004
Posts: 49
Reputation:
Rep Power: 5
Solved Threads: 1
You appear to have lost a period (.) after tep_href_link(FILENAME_CONTACT_US)
If you add the period before the '" that will fix the parse error.
If you add the period before the '" that will fix the parse error.
•
•
Join Date: Jan 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
<?php
include_once 'config.php';
class Database
{
const server = SERVER;
const username = USERNAME;
const password = PASSWORD;
function connect()
{
return mysql_connect(self::server,self::username,self::password);
}
function insertUserinfo($fname,$lname,$email,$address, $drctory, $contactno, $mname, $gender, $usrdatno)
{
$datno = $this->getMaxDatno('userinfo', 'datno');
$query = "INSERT INTO userinfo(datno, firstname, lastname, email, address, drctory, contactno, middlename, gender, usrdatno)
VALUES($datno, '$fname', '$lname', '$email', '$address', '$drctory', '$contactno', '$mname', $gender, $usrdatno)";
mysql_query($query);
return mysql_affected_rows();
}
function insertUsermas($username, $pwd, $role,$usrdatno)
{
$datno = $this->getMaxDatno('usermas','datno');
$query = "INSERT INTO usermas(datno,usrdatno,createdate,editdate,username,pwd,delflag,role)
VALUES($datno,$usrdatno,NOW(),NOW(),'$username','$pwd',0,$role)";
echo $query." ";
mysql_query($query);
return mysql_affected_rows();
}
function insertFiletbl($usrdatno, $maxsize)
{
$datno = $this->getMaxDatno('filetbl','datno');
$query = "INSERT INTO filetbl(datno,usrdatno,maxsize,usedsize,primaryfile)
VALUES($datno,$usrdatno,$maxsize,1,'default.php')";
mysql_query($query);
return mysql_affected_rows();
}
function getMaxDatno($table,$field)
{
$query = "SELECT count(*) as counter from ".$table;
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
if($aResult['counter']=='0')
{
return "1";
}
else
{
$query = "SELECT max(".$field.") as num from ".$table;
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
$retvalue = $aResult['num'] + 1;
return $retvalue;
}
}
function login($userName, $password)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$pwd = crypt(trim($password), ENKEY);
$query = "SELECT count(*) exist from usermas
WHERE username = '".$user."' AND pwd = '".$pwd."'";
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
//echo $query;
return $aResult['exist'];
}
function getDirectoryFromDB($userName)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$query = "SELECT userinfo.drctory from usermas
INNER JOIN userinfo
ON userinfo.usrdatno = usermas.usrdatno
WHERE usermas.username = '".$user."'";
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
return $aResult['drctory'];
}
function editPrimaryFile($userName, $newfile)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$query = "UPDATE filetbl SET primaryfile = '$newfile'
WHERE usrdatno = (SELECT usrdatno FROM usermas where username = '$user')";
$result = mysql_query($query);
return mysql_affected_rows();
}
function getPrimaryFile($userName)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$query = "SELECT primaryfile FROM filetbl
WHERE usrdatno = (SELECT usrdatno FROM usermas where username = '$user')";
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
return $aResult['primaryfile'];
}
}
?>
include_once 'config.php';
class Database
{
const server = SERVER;
const username = USERNAME;
const password = PASSWORD;
function connect()
{
return mysql_connect(self::server,self::username,self::password);
}
function insertUserinfo($fname,$lname,$email,$address, $drctory, $contactno, $mname, $gender, $usrdatno)
{
$datno = $this->getMaxDatno('userinfo', 'datno');
$query = "INSERT INTO userinfo(datno, firstname, lastname, email, address, drctory, contactno, middlename, gender, usrdatno)
VALUES($datno, '$fname', '$lname', '$email', '$address', '$drctory', '$contactno', '$mname', $gender, $usrdatno)";
mysql_query($query);
return mysql_affected_rows();
}
function insertUsermas($username, $pwd, $role,$usrdatno)
{
$datno = $this->getMaxDatno('usermas','datno');
$query = "INSERT INTO usermas(datno,usrdatno,createdate,editdate,username,pwd,delflag,role)
VALUES($datno,$usrdatno,NOW(),NOW(),'$username','$pwd',0,$role)";
echo $query." ";
mysql_query($query);
return mysql_affected_rows();
}
function insertFiletbl($usrdatno, $maxsize)
{
$datno = $this->getMaxDatno('filetbl','datno');
$query = "INSERT INTO filetbl(datno,usrdatno,maxsize,usedsize,primaryfile)
VALUES($datno,$usrdatno,$maxsize,1,'default.php')";
mysql_query($query);
return mysql_affected_rows();
}
function getMaxDatno($table,$field)
{
$query = "SELECT count(*) as counter from ".$table;
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
if($aResult['counter']=='0')
{
return "1";
}
else
{
$query = "SELECT max(".$field.") as num from ".$table;
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
$retvalue = $aResult['num'] + 1;
return $retvalue;
}
}
function login($userName, $password)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$pwd = crypt(trim($password), ENKEY);
$query = "SELECT count(*) exist from usermas
WHERE username = '".$user."' AND pwd = '".$pwd."'";
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
//echo $query;
return $aResult['exist'];
}
function getDirectoryFromDB($userName)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$query = "SELECT userinfo.drctory from usermas
INNER JOIN userinfo
ON userinfo.usrdatno = usermas.usrdatno
WHERE usermas.username = '".$user."'";
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
return $aResult['drctory'];
}
function editPrimaryFile($userName, $newfile)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$query = "UPDATE filetbl SET primaryfile = '$newfile'
WHERE usrdatno = (SELECT usrdatno FROM usermas where username = '$user')";
$result = mysql_query($query);
return mysql_affected_rows();
}
function getPrimaryFile($userName)
{
$crypttext = mcrypt_ecb(MCRYPT_DES, ENKEY, trim($userName), MCRYPT_ENCRYPT);
$user = base64_encode($crypttext);
$query = "SELECT primaryfile FROM filetbl
WHERE usrdatno = (SELECT usrdatno FROM usermas where username = '$user')";
$result = mysql_query($query);
$aResult = mysql_fetch_array($result,MYSQL_ASSOC);
return $aResult['primaryfile'];
}
}
?>
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
access activation algos api blog blogger blogging blogs code combo competition dani daniweb data debugging development dreamweaver dropdownlist fortitude gdata gentoo google gpl hope html innovation key linux microsoft module net news openbsd php product programming rss security serial source spam struggle tags trial-and-error victory vista web wysiwyg xml
- Parse error in code (PHP)
- Parse Error Assitance Needed (PHP)
- parse error (C++)
- Parse error at last line of page's code (PHP)
- Parse Error in PHP (PHP)
- PHP Parse error: parse error, unexpected T_STRING (PHP)
- Need help with HTMl Table echoing? (PHP)
Other Threads in the PHP Forum
- Previous Thread: Php Sessions
- Next Thread: PHP HTTP Screen-Scraping Class with Caching


Linear Mode