otuatail Posted February 27, 2008 Share Posted February 27, 2008 Can anyone help here. I have a website with several satalite websites. ALL have gone down, and I need some help as to where the problem lies. This has satalite website has worked for ages. http://www.des-otoole.co.uk/musicalshop Desperate for a reason. TIA Desmond Quote Link to comment Share on other sites More sharing options...
trq Posted February 27, 2008 Share Posted February 27, 2008 The first place you ought look is in your error logs, we can't really be of much help without code. Quote Link to comment Share on other sites More sharing options...
otuatail Posted February 27, 2008 Author Share Posted February 27, 2008 I don't manage my own server. I pay for it to a company. called streemlinenet.co.uk. I don't know where the error log is. all I see in the root is. .bash_history .bash_logout .bash_profile .bashrc http://www.des-otoole.co.uk/musicalshop/login.php <?php // login.php D O'Toole 21-12-2005 session_start(); //require_once (functions_page); //connectDB(); if($_GET['counter'] == "0"); // <------------- This is line 6 ------------ $_SESSION['loging'] = "NO"; ?> Browser displays Notice: Undefined index: counter in /home/fhlinux190/d/des-otoole.co.uk/user/htdocs/musicalshop/login.php on line 6 Quote Link to comment Share on other sites More sharing options...
otuatail Posted February 27, 2008 Author Share Posted February 27, 2008 I have found a root folder called log and lots of files ending in.log, but they look like they are just a collection of the error messages that I get in the browser. I have supplied one in my last post. It dose not make sense. It does not like $_GET['counter'] Notice: Undefined index: counter in /home/fhlinux190/d/des-otoole.co.uk/user/htdocs/musicalshop/login.php on line 6 Quote Link to comment Share on other sites More sharing options...
haku Posted February 27, 2008 Share Posted February 27, 2008 If you are paying for a company to manage your server, shouldn't they be fixing your problem? Quote Link to comment Share on other sites More sharing options...
trq Posted February 27, 2008 Share Posted February 27, 2008 Those are notices, not errors. They are simply caused by poor coding practices. You fail to check that $_GET['counter'] actually exists before trying to use it. eg; <?php if (isset($_GET['counter'])) { if ($_GET['counter'] == "0") { $_SESSION['loging'] = "NO"; } } ?> I would say what has happended is your servers configuration has been changed and is now set to display errors. You can either a) fix your code, or b) place the following in the top of all your scripts. <?php ini_set('display_errors','0'); ?> I recommend option a. Quote Link to comment Share on other sites More sharing options...
otuatail Posted February 27, 2008 Author Share Posted February 27, 2008 Ok it would appear that the hosting company has changed the configuration to show warnings on oages. This used to work but now I get an error. Liine 9: define (hostname10, 'mysql10.streamline.net'); Use of undefined constant hostname10 - assumed 'hostname10' in /home/fhlinux190/d/des-otoole.co.uk/user/htdocs/news/config.inc on line 9 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 27, 2008 Share Posted February 27, 2008 That is more incorrect coding. Read this for the proper syntax for a define() statement (the first parameter is a string and requires quotes) - http://php.net/define FYI - most/all of these problems causing the notices and warnings were present in the code before the host changed the error reporting and/or display settings. Once you find and fix all the problems causing them, you code will run faster because php won't be doing so much churning through the error detection and error response code every time it encounters a problem in the code. Quote Link to comment Share on other sites More sharing options...
drewbee Posted February 27, 2008 Share Posted February 27, 2008 Correct. Always define variables before there use. I wish PHP shipped standard with error_reporting(E^ALL) set. This isn't a personal attack on you, because it accounts for a huge percentage of PHP developers who have had no experience with other languages. It is always good practice to initialize variables before use. One technique I use for POST or GET variables is the following: <? $_GET['var'] = isset($_GET['var']) ? $_GET['var'] : ''; ?> This way, if the variable is not set on page load, it will have a default value of '' (empty string) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.