Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 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 November 9th, 2008, 06:08 PM
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Undefined offset: 1 chapter 5 form.php

Guys,
     When i try to run throo the step 2 it gives me an error message:

Undefined offset: 1 in C:\wamp\www\php_sandbox\form4.php on line 61
: Movie: Action

This is my form.php:

<?php
function debugDisplay()
{
    ?>
    <pre>
        $_POST
        <?php
        print_r($_POST);
        ?>
        $_GET
        <?php
        print_r($_GET);
        ?>
        </pre>
    <?php
}

if (!isset($_GET['step']))
{
    require('startform.php');
}
else
{
    switch($_GET['step'])
    {
        case "1":
            $type = explode(":", $_POST['type']);
            if($_POST['Submit'] == "Add")
            {
                require($_POST['Submit'] .$type[0] . '.php');
            }
            else
            {
                if($_POST['type'] == "Movie:Movie" && $_POST['Movietype'] = "")
                {
                    header("Location:form4.php");

                }
            ?>
            <h1>Search Results</h1>
            <p>You are looking for a "<?php echo $type[1]; ?>" named
            "<?php echo $_POST['Name'];?>"</p>
            <?php
            }
            if($_POST['Debug'] == "on")
            {
                debugDisplay();

            }
            break;

    case "2":
        $type = explode(":", $_POST['type']);
        ?>
        <?php

        switch($type[0])
        {
            case "Movie":
                ?>
                <h1> New <?php echo $type[1]; ?> : <?php echo $_POST['Name'];?></h1>
                <p> Released in <?php echo $_POST['MovieYear'];?></p>
                <p><?php echo nl2br(stripslashes($_POST['Desc']));?></p>
                <?php
                break;
            default:
            ?>
            <h2>Quick Bio</h2>
            <p><?php echo nl2br(stripslashes($_POST['Bio']));?></p>
            <?php
            break;
        }

        break;
    default:
    require("startform.php");
    break;

}
}
?>

Please help me out on this.

Thanks,
Harish.C




Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined Offset 7thsense101 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 December 9th, 2009 06:49 AM
undefined offset error trev Beginning PHP 9 January 24th, 2007 04:41 AM
Notice: Undefined offset: ## Herjan BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 November 27th, 2005 12:29 PM
Loops and Arrays - Undefined offset notice dkintheuk Beginning PHP 6 September 12th, 2005 11:38 PM
ImageLine Undefined offset error ss2003 Beginning PHP 3 January 13th, 2004 04:37 PM





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