Jump to content

Recommended Posts

hi, im getting problems with my php script, can someone please help me?

 

its in a text file, so you can view the php script better.

 

http://h1.ripway.com/1111ab/main.txt

 

the problems that are occuring:

 

Notice: Undefined index: ava_username in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 364

 

Notice: Undefined index: ava_userid in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 368

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 293

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 293

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 295

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 295

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 297

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 297

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 299

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 299

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 301

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 301

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 303

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 303

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 305

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 305

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 307

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 307

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 309

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 309

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 311

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 311

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 313

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 313

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 318

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 318

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 12

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 12

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 15

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 15

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 18

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 18

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 21

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 21

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 24

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 24

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 27

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 27

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 30

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 30

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 33

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 33

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 36

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 36

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 39

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 39

 

Notice: Use of undefined constant task - assumed 'task' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 42

 

Notice: Undefined index: task in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 42

 

Notice: Use of undefined constant cat_id - assumed 'cat_id' in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 46

 

Notice: Undefined index: cat_id in /www/1111mb.com/c/h/r/chrisrulez/htdocs/gamestest/includes/main.php on line 46

Link to comment
https://forums.phpfreaks.com/topic/53309-php-problems/
Share on other sites

Abit off topic here, but I noticed you have loads of

 

if ($_GET['task'] == 'whatever')
{
include("whatever.php");
}

Try removing them all and adding:

 

if ($_GET['task'] && file_exists($_GET['task'] . ".php"))
{
include($_GET['task'] . ".php");
}

 

Just something to cut down on the size. I cant help with the problem at hand though, no clue...

Link to comment
https://forums.phpfreaks.com/topic/53309-php-problems/#findComment-264396
Share on other sites

do not use $HTTP_COOKIE_VARS that has been depreciated.

 

Instead use $_COOKIE['cookiename']; And before you call that cookie do a nice check like so:

 

<?php
$username = isset($_COOKIE['username'])?$_COOKIE['username']:'';
?>

 

Whaat I did there is called the ternary operator the ? and : which is like a shortened if statement, if the index username  is defined in the array $_cookie than assign $username the value. Else assign $username ''

 

Hope that helps.

 

 

Link to comment
https://forums.phpfreaks.com/topic/53309-php-problems/#findComment-265070
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.