Mass Undefined Variable/Index Errors

Asked by Johnathon

Hello there. I'm currently a High school student looking to develop a website for himself and friends to use in the future.

Im using WAMPServer2 to run the PHP scripts. However, during and after running the Install.php script I've been plauged with some of the following errors;

For instance, when I view current articles I get,
Notice: Undefined index: v in C:\WampServer\www\news\manage.php on line 33
Notice: Undefined variable: row_bg in C:\WampServer\www\news\manage.php on line 50
Notice: Undefined variable: table_rows in C:\WampServer\www\news\manage.php on line 63
Notice: Undefined variable: cat_list in C:\WampServer\www\news\inc\function.php on line 354
Notice: Undefined variable: selected_ in C:\WampServer\www\news\inc\function.php on line 354
Notice: Undefined index: delete_success in C:\WampServer\www\news\inc\function.php on line 542
Notice: Undefined variable: success in C:\WampServer\www\news\inc\function.php on line 547
Notice: Undefined variable: cat_selected in C:\WampServer\www\news\inc\function.php on line 555
Notice: Undefined variable: a_js in C:\WampServer\www\news\inc\function.php on line 592
Notice: Undefined variable: a_js in C:\WampServer\www\news\inc\function.php on line 592
Notice: Undefined index: page_image in C:\WampServer\www\news\inc\themecontrol.php on line 75
Notice: Undefined index: hide_sessions in C:\WampServer\www\news\inc\themecontrol.php on line 102

Or, while making a New article,
Notice: Undefined variable: cat_list in C:\WampServer\www\news\inc\function.php on line 354
Notice: Undefined variable: selected_ in C:\WampServer\www\news\inc\function.php on line 354
Notice: Undefined index: article_imgid in C:\WampServer\www\news\inc\function.php on line 442
Notice: Undefined index: success in C:\WampServer\www\news\inc\function.php on line 451
Notice: Undefined variable: comment_b in C:\WampServer\www\news\inc\function.php on line 456
Notice: Undefined variable: rank_message in C:\WampServer\www\news\inc\function.php on line 457
Notice: Undefined variable: edit_message in C:\WampServer\www\news\inc\function.php on line 458
Notice: Undefined index: article_title in C:\WampServer\www\news\inc\function.php on line 462
Notice: Undefined index: article_subtitle in C:\WampServer\www\news\inc\function.php on line 463
Notice: Undefined index: article_text in C:\WampServer\www\news\inc\function.php on line 471
Notice: Undefined index: article_exptext in C:\WampServer\www\news\inc\function.php on line 474
Notice: Undefined variable: image_view in C:\WampServer\www\news\inc\function.php on line 479
Notice: Undefined index: start_date in C:\WampServer\www\news\inc\function.php on line 486
Notice: Undefined index: end_date in C:\WampServer\www\news\inc\function.php on line 487
Notice: Undefined index: acchecked_check in C:\WampServer\www\news\inc\function.php on line 488
Notice: Undefined index: achecked_check in C:\WampServer\www\news\inc\function.php on line 489
Notice: Undefined variable: hidden_f in C:\WampServer\www\news\inc\function.php on line 491
Notice: Undefined index: page_image in C:\WampServer\www\news\inc\themecontrol.php on line 75
Notice: Undefined index: new article in C:\WampServer\www\news\inc\themecontrol.php on line 89
Notice: Undefined index: hide_sessions in C:\WampServer\www\news\inc\themecontrol.php on line 102

I'm unsure why I'm getting these errors; I know there's some reason however, and since I have no clue WHY I'm getting them, there's no way for me figure out a way to solve them. Any help or insight into solve this problem would be much appreciated.

Thanks alot,
Johnathon.

Question information

Language:
English Edit question
Status:
Solved
For:
phpns Edit question
Assignee:
No assignee Edit question
Solved by:
alecwh
Solved:
Last query:
Last reply:
Revision history for this message
Best alecwh (alecwh) said :
#1

Hi Johnathon,

This has been documented before (in the bugs section). Those are not
errors, they are notices/warnings. When I first wrote phpns, I didn't
bother initiating my variables--which turned out to be a mistake.

To "workaround" this problem, stick this:
error_reporting("E_ALL");
into the top of /inc/header.php, right below <?php.

Good luck, from a fellow high school student!

Revision history for this message
alecwh (alecwh) said :
#2

I should mention, that this is not an ideal workaround. Ideally, I would go through and initiate all variables used in phpns. This would be massively tedious (there are hundreds upon hundreds of variables used), and implausible with my schedule. (If someone wants to do this, please!)

Keep in mind that you are taking a small security risk when you do this.

Revision history for this message
Johnathon (jholmes1104) said :
#3

Thanks a ton. I'm not familiar with PHP, (Since High Schools in Canada dont teach much more then Turing, Java, and -basic- HTML), so I wasn't sure if they were errors or warning. You've lifted a weight from my chest, however. I was thinking I had done something wrong with the code. Heh.

I'm sorry I may have created another thread about the same topic... I'm limited in Internet access due to my current location (I'm living on a farm 100% of the time now, so I'm limited to Dial up, and searching multiple threads was getting tiresome).

Well, in regards of the Security risk, I'm in development of our Website, so perhaps by the time I'm ready for a release of it, you'll have a new release out. Currently, I see no harm.

Best regards. Once I got it working, works like a charm.
Now to integrate it into my Website...

Revision history for this message
Johnathon (jholmes1104) said :
#4

Thanks alecwh, that solved my question.

Revision history for this message
alecwh (alecwh) said :
#5

The security risk is you not being able to see potential errors in the
phpns system. There is no fix for this... you just turned off
error_reporting!

The proper fix would be to initiate the variables, but, like I said, I'm
unable to dedicate that much time on a somewhat trivial annoyance. (I
say trivial because they are not really errors, and because there is no
real security problem; the variables related to security are indeed
initiated.)