View Full Version : host.sk and php help
HaVoC
April 22nd, 2002, 20:57
I am a complete newb to php and i need to setup a news script for my page. Im trying to get simp news to work but i can't get the db settings to work. Can anyone help me with this pls?
HaVoC
April 23rd, 2002, 13:43
Doesn't anyone know what to do? I really need a news script for my site and this one seems to be the best. If anyone else has any others that they recommend, pls tell me!
cheatpark
April 23rd, 2002, 13:55
What do you mean by you can't get your db settings to work? Do you know how to set them?
server: this is usually localhost but its best to check with your host
username: usually your username for your webspace
password: usually your password for your webspace
database: usually the name of your site
I think host.sk has php in safe mode which could have an impact on how the script works.
HaVoC
April 23rd, 2002, 19:38
No, im completely new to php. Heres the config file unedited:
<?php
// Edit this to fit your needs
// Begin edit
// hostname mysql running on
$dbhost = "localhost";
// name of database
$dbname = "news";
// username for database
$dbuser = "root";
// password for databaseuser
$dbpasswd = "";
// prefix for tables, so you can have multiple instances of
// SimpNews in one database (please set before calling install or update)
$tableprefix= "simpnews";
// prefix for hostcache table, if you also use one of our other PHP scripts
// you can set all hostcache tables to 1 prefix, so you only have 1 hostcache
$hcprefix= "simpnews";
// prefix for ip banlist table, if you also use one of our other PHP scripts
// you can set all banlist tables to 1 prefix, so you only have 1 banlist
$banprefix= "simpnews";
// default language, you can create your own languagefile
// for other languages in ./language
$default_lang = "de";
// language to use for admininterface
$admin_lang = "de";
// URL-Path for SimpNews instance. If you use http://www.myhost.com/simpnews
// this is /simpnews
$url_simpnews = "/simpnews";
// URL-Path for graphics (no trailing slash)
$url_gfx=$url_simpnews."/gfx";
// URL-Path for emoticons (no trailing slash)
$url_emoticons=$url_gfx."/emoticons";
// URL-Path for icons (no trailing slash)
$url_icons=$url_gfx."/icons";
// complete path to directory containing graphics (without trailing slash)
$path_gfx = getenv("DOCUMENT_ROOT")."/simpnews/gfx";
// complete path to directory containing emoticons (without trailing slash)
$path_emoticons = getenv("DOCUMENT_ROOT")."/simpnews/gfx/emoticons";
// complete path to directory containing icons (without trailing slash)
$path_icons = getenv("DOCUMENT_ROOT")."/simpnews/gfx/icons";
// It should be safe to leave this alone. But if you do change it
// make sure you don't set it to a variable allready in use (use a seperate
// name for each instance of SimpNews)
$cookiename = "simpnews";
// It should be safe to leave these alone as well.
$cookiepath = $url_simpnews;
$cookiesecure = false;
// This is the cookie name for the sessions cookie, you shouldn't have to change it
// (for multiple instances use different names)
$sesscookiename = "simpnewssession";
// This is the number of seconds that a session lasts for, 3600 == 1 hour.
// The session will exprire if the user dosn't view a page on the admininterface
// in this amount of time.
$sesscookietime = 600;
// Full url for SimpNews with trailing slash
$simpnews_fullurl = "http://localhost/simpnews/";
// Set this to true if you want to use sessionid passed throught get and put requests
// rathern than by cookie (for details reffer to readme.txt)
$sessid_url=false;
// maximal filesize for attachements by admin
$maxfilesize=1000000;
// Set to true if you want to have password recovery for admin interface enabled
$enablerecoverpw=true;
// Set this to the charset to be used as content encoding
$contentcharset="iso-8859-1";
// Set this to true, if you want to have attachements stored in file system instead of DB
// WARNING: directory with attachements must be world writeable (chmod 777) on most servers
// to allow webserver to write to it. Also mention -> if you delete the attachement only
// in filesystem, the reference in the news still will be present and point to nothing.
// 2nd: If you upload a file with same name as a file allready existing in the directory,
// old file will be overwritten without further notice
$attach_in_fs=false;
// complete path to directory, where attachements should be stored
$path_attach = getenv("DOCUMENT_ROOT")."/simpnews/attachements";
// complete path to directory, where uploaded files should temporary be copied to
// (PHP has to have write permissions on this directory)
// Needed if open_basedir restriction is in effect. If your PHP instance can
// access the default upload directory, you don't need to set it
// $path_tempdir = getenv("DOCUMENT_ROOT")."/simpnews/admin/temp";
// url to directory with attachements
$url_attach = "/simpnews/attachements";
// Set this to true if you want to use authentication by htacces rather then the
// internal version (for details reffer to readme.txt)
$enable_htaccess=false;
// Please set this to the hostname, where your instance of SimpNews is installed
$simpnewssitename="localhost";
// Set to true if you want to try to get the real IP of the user.
// Please note: This may not work for all HTTPDs.
$try_real_ip=false;
// please enter all fileextension your server uses for PHP scripts here
$php_fileext=array("php","php3","phtml");
// leaving this to false is the best.
$testmode = false;
// end edit
// you are not allowed to edit beyond this point
$typerfontstyles=array("plain","bold","italic","bolditalic");
$err_query = '<br><br><br><br><br><font size=+1>An Error Occured</font><hr>Unable to connect'.
' to the database server.<BR>Please try again later.<BR>'; // Database, or querry error
$version ="1.38";
$copyright_url = "<a href=\"http://www.boesch-it.de\">SimpNews V$version</a>";
$copyright_note = "©2002 by Bösch EDV-Consulting";
$copyright_asc = "(c)2002 by Boesch EDV-Consulting";
// Set the error reporting to a sane value:
if(!$testmode)
error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
if(!$db = @mysql_connect($dbhost,$dbuser,$dbpasswd)) die($err_query);
if(!@mysql_select_db($dbname,$db)) die($err_query);
if(!isset($cookiedomain))
{
$cookiedomain = $HTTP_HOST;
if (preg_match("/^(.*):(.*)$/",$cookiedomain,$arr)) {
$cookiedomain = $arr[1];
}
$parts = explode(".",$cookiedomain);
if(count($parts)>=2)
$cookiedomain = ".".$parts[count($parts)-2].".".$parts[count($parts)-1];
else
$cookiedomain = "";
}
?>
HaVoC
April 23rd, 2002, 19:38
After i edit it:
<?php
// Edit this to fit your needs
// Begin edit
// hostname mysql running on
$dbhost = "redp@localhost";
// name of database
$dbname = "redp";
// username for database
$dbuser = "redp";
// password for databaseuser
$dbpasswd = "*************";
// prefix for tables, so you can have multiple instances of
// SimpNews in one database (please set before calling install or update)
$tableprefix= "simpnews";
// prefix for hostcache table, if you also use one of our other PHP scripts
// you can set all hostcache tables to 1 prefix, so you only have 1 hostcache
$hcprefix= "simpnews";
// prefix for ip banlist table, if you also use one of our other PHP scripts
// you can set all banlist tables to 1 prefix, so you only have 1 banlist
$banprefix= "simpnews";
// default language, you can create your own languagefile
// for other languages in ./language
$default_lang = "de";
// language to use for admininterface
$admin_lang = "de";
// URL-Path for SimpNews instance. If you use http://www.myhost.com/simpnews
// this is /simpnews
$url_simpnews = "/simpnews";
// URL-Path for graphics (no trailing slash)
$url_gfx=$url_simpnews."/gfx";
// URL-Path for emoticons (no trailing slash)
$url_emoticons=$url_gfx."/emoticons";
// URL-Path for icons (no trailing slash)
$url_icons=$url_gfx."/icons";
// complete path to directory containing graphics (without trailing slash)
$path_gfx = getenv("DOCUMENT_ROOT")."/simpnews/gfx";
// complete path to directory containing emoticons (without trailing slash)
$path_emoticons = getenv("DOCUMENT_ROOT")."/simpnews/gfx/emoticons";
// complete path to directory containing icons (without trailing slash)
$path_icons = getenv("DOCUMENT_ROOT")."/simpnews/gfx/icons";
// It should be safe to leave this alone. But if you do change it
// make sure you don't set it to a variable allready in use (use a seperate
// name for each instance of SimpNews)
$cookiename = "simpnews";
// It should be safe to leave these alone as well.
$cookiepath = $url_simpnews;
$cookiesecure = false;
// This is the cookie name for the sessions cookie, you shouldn't have to change it
// (for multiple instances use different names)
$sesscookiename = "simpnewssession";
// This is the number of seconds that a session lasts for, 3600 == 1 hour.
// The session will exprire if the user dosn't view a page on the admininterface
// in this amount of time.
$sesscookietime = 600;
// Full url for SimpNews with trailing slash
$simpnews_fullurl = "http://localhost/simpnews/";
// Set this to true if you want to use sessionid passed throught get and put requests
// rathern than by cookie (for details reffer to readme.txt)
$sessid_url=false;
// maximal filesize for attachements by admin
$maxfilesize=1000000;
// Set to true if you want to have password recovery for admin interface enabled
$enablerecoverpw=true;
// Set this to the charset to be used as content encoding
$contentcharset="iso-8859-1";
// Set this to true, if you want to have attachements stored in file system instead of DB
// WARNING: directory with attachements must be world writeable (chmod 777) on most servers
// to allow webserver to write to it. Also mention -> if you delete the attachement only
// in filesystem, the reference in the news still will be present and point to nothing.
// 2nd: If you upload a file with same name as a file allready existing in the directory,
// old file will be overwritten without further notice
$attach_in_fs=false;
// complete path to directory, where attachements should be stored
$path_attach = getenv("DOCUMENT_ROOT")."/simpnews/attachements";
// complete path to directory, where uploaded files should temporary be copied to
// (PHP has to have write permissions on this directory)
// Needed if open_basedir restriction is in effect. If your PHP instance can
// access the default upload directory, you don't need to set it
// $path_tempdir = getenv("DOCUMENT_ROOT")."/simpnews/admin/temp";
// url to directory with attachements
$url_attach = "/simpnews/attachements";
// Set this to true if you want to use authentication by htacces rather then the
// internal version (for details reffer to readme.txt)
$enable_htaccess=false;
// Please set this to the hostname, where your instance of SimpNews is installed
$simpnewssitename="localhost";
// Set to true if you want to try to get the real IP of the user.
// Please note: This may not work for all HTTPDs.
$try_real_ip=false;
// please enter all fileextension your server uses for PHP scripts here
$php_fileext=array("php","php3","phtml");
// leaving this to false is the best.
$testmode = false;
// end edit
// you are not allowed to edit beyond this point
$typerfontstyles=array("plain","bold","italic","bolditalic");
$err_query = '<br><br><br><br><br><font size=+1>An Error Occured</font><hr>Unable to connect'.
' to the database server.<BR>Please try again later.<BR>'; // Database, or querry error
$version ="1.38";
$copyright_url = "<a href=\"http://www.boesch-it.de\">SimpNews V$version</a>";
$copyright_note = "©2002 by Bösch EDV-Consulting";
$copyright_asc = "(c)2002 by Boesch EDV-Consulting";
// Set the error reporting to a sane value:
if(!$testmode)
error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
if(!$db = @mysql_connect($dbhost,$dbuser,$dbpasswd)) die($err_query);
if(!@mysql_select_db($dbname,$db)) die($err_query);
if(!isset($cookiedomain))
{
$cookiedomain = $HTTP_HOST;
if (preg_match("/^(.*):(.*)$/",$cookiedomain,$arr)) {
$cookiedomain = $arr[1];
}
$parts = explode(".",$cookiedomain);
if(count($parts)>=2)
$cookiedomain = ".".$parts[count($parts)-2].".".$parts[count($parts)-1];
else
$cookiedomain = "";
}
?>
I just can't figure this out exactly. I keep getting the database is not accessable at this time try again later.
cheatpark
April 24th, 2002, 16:46
redp@localhost
Are you sure that is right? Try putting in the actual ip address of your host and see if that makes a difference. If you don't know what it is then ping your site and you will get a number in 4 sections. That number is the ip address. It will look something like this:
127.0.0.1
HaVoC
April 24th, 2002, 17:29
yeah, i found out it is supposed to be db.host.sk
Now i have a new problem, and its is with phpbb. Whenever i try to reply (and sometimes even post) i get a weird error that it cannot find server, even though it is there. Sometimes, if i click the back button and try again it works, but only 25% of the time. So, im really getting quite pissed now.
cheatpark
April 24th, 2002, 18:34
You are using phpbb on a free host which is used by many users with many accounts. host.sk have very slow servers...I don't want to think how many scripts they have running at once as its probably quite a scary figure. The pages probably occur because there are a lot of php scripts running on the server or something or it could be there are abusers or something like that. Change host and you should be fine. :)
HaVoC
April 24th, 2002, 20:43
Got any ideas for a good free host then?
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.