Re: Post variables getting lost
| From: | Binay | Date: | Mon, 27 Oct 2003 05:32:08 +0000 |
| Subject: | Re: Post variables getting lost | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167678@lists.php.net to get a copy of this message | ||
Change 'new' to something else say 'new1' as new is an operator so that
might be causing the problem which in turn affecting the category also ..
Hope this helps
cheers
Binay
----- Original Message -----
From: "Joao Andrade" <joao66br@yahoo.com.br>
To: <php-general@lists.php.net>
Sent: Monday, October 27, 2003 10:30 AM
Subject: [PHP] Post variables getting lost
>
> Hey people,
>
> Something odd is happening :) I've this form on a page:
>
> <form method=post action="\basics\quotation-add">
>
> <table>
> <tr>
> <th>Author
> <td><input type=text size=30 name=author_name>
> </tr>
> <tr>
> <th>New Category
> <td><input type=text size=30 name=new>
> </tr>
> <tr>
> <th>Category
> <td><select name=category>
> <?php
> $categorias = mysql_query("SELECT DISTINCT category FROM quotations");
> $lincat = mysql_fetch_row ($categorias);
> while ($lincat != false){ //loop through the records enquanto ha
linhas
> $cat = $lincat[0];
> echo "<option value=\"".$cat."\">".$cat ; //and place
> it in the
select
> $lincat = mysql_fetch_row ($categorias);# pega uma linha
> }
>
> ?>
> </select>
> </tr>
> <tr>
> <th>Quotation
> <td><textarea name=quote cols=50 rows=8></textarea>
> </tr>
> </table>
> <center>
> <input type=submit value=Add>
> </center>
> </form>
>
> And then I have in quotations-add:
>
> echo $_POST['category'];
> echo $_POST['new'];
> echo $_POST['author_name'];
>
> echo $_POST['quote'];
>
> And what I get ist:
>
> Notice: Undefined index: category in C:\Programme\Apache
> Group\Apache2\htdocs\basics\quotation-add.php on line 85
>
> Notice: Undefined index: new in C:\Programme\Apache
> Group\Apache2\htdocs\basics\quotation-add.php on line 86
> asdasdasdasd
>
> Where the 'author_name' and 'quote' POST variables are ok, why
> aren't
> 'new' and 'category' coming?
>
> Thanks again,
>
> Joao Penna Andrade
> Undergraduate, Mechanical Engineering
> UNICAMP, Brazil
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php