Jump to content

entire website has gone down.


otuatail

Recommended Posts

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

 

 

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.