Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.