0

Below is an error message. The code works on a different website, but when I used it in another website and changed the column names the variable were undefined? I tried to research before I asked. I used isset and content=
still no luck.

Notice: Undefined variable: film in /Applications/XAMPP/xamppfiles/htdocs/movies/films.php on line 168

<?php if( !empty($_GET['action']) && $_GET['action'] == "edit" ) { ?>
                <legend>Editing Film Listing</legend>
                <form name="frmEditFilm" action="films.php?action=edit" method="POST">
                    <input type="hidden" name="film_id" value="<?php echo $film['film_id']; ?>">
                    <label for="film_title">Film Title</label>
                    <input type="text" name="film_title" class="form-control" value="<?php echo $film['title']; ?>">
                    <label for="film_release">Film Release</label>
                    <input type="text" name="film_release" class="form-control" value="<?php echo $film['release_year']; ?>">
                    <label for="film_description">Film Description</label>
                    <textarea name="film_description" class="form-control"/><?php echo $film['description']; ?></textarea>
                    <button type="submit" class="btn btn-info">Update Film</button>
                </form>
            <?php } ?>
mfro
  • 3,286
  • 1
  • 19
  • 28
  • that's only a notice. You can overpass it with $file=""; at the beginning. – Nik Drosakis May 05 '15 at 20:18
  • I am not well versed in php. where does the $file=""; go? i tried to put it within the php tags before the if statement and I came up with the same problem. – user3574864 May 05 '15 at 20:32
  • do you get the expected result, anyway? – Nik Drosakis May 05 '15 at 20:34
  • no, I expected the records from the fields to be bound to the textboxes. i copied the code into another project of mine and changed all the necessary variable names. I tried isset(). No luck. I pulled this code from my products.php file and changed the necessary criteria and still don't see why it's acting different then my other website. – user3574864 May 05 '15 at 20:36
  • check this, please: http://stackoverflow.com/questions/4261133/php-notice-undefined-variable-and-notice-undefined-index – Nik Drosakis May 05 '15 at 20:39

0 Answers0