Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: PHP error?

  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP error?

    heres my code;

    if(!isset($mode)) { $mode = 'index'; }

    switch($mode) {
    case 'index':

    ?>

    <FORM ACTION="<?PHP ECHO "$PHP_SELF"; ?>?mode=process" METHOD="post">

    <TABLE cellspacing="3" cellpadding="3" border="1" bordercolor="#000000" WIDTH="100%">

    <TR><TD WIDTH="20%"><STRONG>Item Name:</STRONG> </TD><TD WIDTH="80%"><INPUT TYPE="text" SIZE="50" NAME="itemname"> </TD></TR>
    <TR><TD WIDTH="20%" valign="top"><STRONG>Item Desc:</STRONG> </TD><TD WIDTH="80%"><TEXTAREA COLS="50" ROWS="4" name="itemdesc"></TEXTAREA> </TD></TR>

    </TABLE></FORM>

    <?PHP

    break;


    case 'process':

    $itemname = strip_tags($_POST["itemname"]);
    $itemdesc = strip_tags($_POST["itemdesc"]);

    $query="insert into `item` (itemid,itemname,itemdesc) VALUES ('','$itemname','$itemdesc')";

    $result = mysql_query($querycon) or die (mysql_error());

    if ($result) {

    echo "Item Added";

    }

    break;

    }

    ?>


    heres my error; www.visionstudios.be/ratedata/add.php

    could someone please help? thanks. -cnelson.

    the page is offline right now, but it said it was a pharse error, on line 22?
    Last edited by cnelson; 02-10-2006 at 03:23 AM.

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you'll probably get more help if you post the complete code + if you highlight line 22
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New Coder
    Join Date
    Feb 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that is the complete code.. i've got the error to go away, except now theres no submit button.. ? www.visionstudios.be/ratedata/add.php

  • #4
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    Quote Originally Posted by cnelson
    that is the complete code.. i've got the error to go away, except now theres no submit button.. ? www.visionstudios.be/ratedata/add.php
    theres no submit button in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •