Reply to Re: $_POST value is set but always = null even if you enter something

Your name:

Reply:


Posted by Ken Robinson on 03/21/06 00:33

comp.lang.php wrote:
> [PHP]
> Other: <input name="school_type_other" size="30" maxlength="75"
> value="<?php
>
> if ($_POST['hasReviewedApplicant']) echo $_POST['school_type_other'];
> else echo str_replace('"', '&quot;', str_replace('\\', '',
> $result[0]->school_type_other));

Just curious... why are you doing this when

if ($_POST['hasReviewedApplicant']) echo $_POST['school_type_other'];
else echo
htmlentities(stripslashes($result[0]->school_type_other),ENT_QUOTES);

Does the same thing,

>
> ?>">
> [/PHP]
>
> I verified via both var_dump() and print_r() that
> $_POST['hasReviewedApplicant'] = 1 and that $_POST['school_type_other']
> = null, even when you enter something into the text field, it's still
> null!

Please post the code for the whole form.

Also, when you first enter the processing script, what does:
<?php echo '<pre>' . print_r($_POST,true) . '</pre>'; ?>
display on the screen?

Ken

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация