Page MenuHomec4science

commonPhpFunctions.php.wml
No OneTemporary

File Metadata

Created
Mon, Dec 2, 12:50

commonPhpFunctions.php.wml

## $Id$
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002 CERN.
##
## The CDSware is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## The CDSware is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDSware; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## read config variables:
#include "config.wml"
#include "configbis.wml"
<?
<protect>
## $Id$
## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
</protect>
## load config variables:
define("DOCS_DATABASE", "<DBNAME>");
define("MYSQLDOCMACHINE","<DBHOST>");
define("MYSQLDOCUSERID","<DBUSER>");
define("MYSQLDOCPASSWORD","<DBPASS>");
define("AUTHENTICATION","<AUTHENTICATE>");
define("ADMIN_EMAIL","<ADMINEMAIL>");
define("SUMMARYON","<SUMMARYON>");
define("SUPPORTEMAIL","<SUPPORTEMAIL>");
define("TEST","FALSE");
$IMAGES="<WEBURL>/img";
$URLPATH="<WEBURL>/submit";
$ACCESSURL="<WEBURL>/search.py";
$ARCHIVE="<ARCHIVE>";
$COUNTERS="<COUNTERS>";
$LINKMANAGER="<WEBURL>/archive.php";
$STORAGE="<STORAGE>";
$LYNX="<LYNX>";
$GFILE="<GFILE>";
$GZIP="<GZIP>";
$TAR="<TAR>";
$GUNZIP="<GUNZIP>";
$ACROREAD="<ACROREAD>";
$DISTILLER="<DISTILLER>";
$TMPDIR="<TMPDIR>";
$BIBUPLOAD="<BINDIR>/bibupload";
$BIBFORMAT="<BINDIR>/bibformat";
$BIBWORDS="<BINDIR>/bibwords";
$BIBCONVERT="<BINDIR>/bibconvert";
$BIBCONVERTCONF="<WEBDIR>/submit/bibconvert/config";
$HTDOCSURL="<WEBURL>";
## okay, config variables loaded, the script can continue:
/********************Includes*************************/
include("<WEBDIR>/sessinit.inc.php");
require_once("<LIBDIR>/php/cdsware/errors/errorHandling.php");
// ******************************
function connectDB($dbname, $host = MYSQLDOCMACHINE, $username = MYSQLDOCUSERID, $password = MYSQLDOCPASSWORD)
{
/******************************************************************
This function is a very simple function that allows a user to
connect to a mySQL server of their choice. The function uses the
mysql_connect function provided by php to attempt to connect to
the server. If connection fails, an appropriate error message is
displayed, otherwise the connection link is returned.
Function modified on 28/09/2000 to add </td>, </tr>, and </table>
tags, as the message wasn't being printed due to the fact that
when the die() function was executed, it stopped processing,
hence the table that contains the pages data was never being
closed, resulting in it being impossible to display anything in
this table.
Author: Nicholas Robinson
Email: Nicholas.Robinson@cern.ch
Created: 21/08/2000
Last Modified: 28/09/2000
*****************************************************************/
# Make a connection to the database server...
mysql_connect($host, $username, $password) or
die('<BR><P><H3 ALIGN="center">Unable To '
. 'Connect To SQL Server. Try Reload Of Page.'
. '</H3></P></TD></TR></TABLE></BODY>'
. '</HTML>');
mysql_select_db($dbname);
} // END function connectDB($host, $username, $password)
// ******************************
/*************End of header file commonPhpFunctions.php*************/
?>

Event Timeline