View Single Post
Old December 6th, 2007, 02:35 PM
benappease benappease is offline
Registered User
Join Date: Dec 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default php question, undefined variable

I set up this code ages ago so I could upload news to my website, I just changed hosting plans and uploaded all the same files.. but my admin section is now all messed up. I presume some of the code was too ald for my new server

Can anyone please help.. it would be much appreciated...

I get

Notice: Undefined variable: action in /home/fhlinux160/s/ on line 33

here's the code line 33 in red

if($action == "edit" && isset($HTTP_POST_VARS['password'])) {
    if($HTTP_POST_VARS['password'] == "skills") {
      $line = $HTTP_POST_VARS['date'] . "|" . $HTTP_POST_VARS['name'];
        $line .= "|" . $HTTP_POST_VARS['news'];
        $line = str_replace("\r\n","<BR>",$line);
        $line .= "\r\n";
        $data = file('news.txt');
        $data[$id] = $line;
        $fp = fopen('news.txt','w');
        foreach($data as $element) {