Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 6th, 2007, 02:35 PM
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/sitcomsoldiers.com/user/htdocs/admin/news/edit.php 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;
        reset($data);
        $fp = fopen('news.txt','w');
        foreach($data as $element) {



Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined Variable aspire Beginning PHP 4 July 12th, 2006 07:00 AM
XSLT & PHP -undefined variable- is . a culprit? underdog XSLT 3 May 8th, 2006 10:04 AM
Chapter 7 check_image.php, undefined variable Ron_Bingham BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 3rd, 2005 10:31 PM
Undefined variable majidnakit Beginning PHP 2 April 16th, 2005 11:23 PM
Undefined Variable fpolan Beginning PHP 9 July 15th, 2004 06:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.