Re: $_POST value is set but always = null even if you enter something
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

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

From: comp.lang.php <phillip.s.powell@gmail.com>
Date: Tue Mar 21 2006 - 16:12:24 CET

Ken Robinson wrote:
> 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.

Even if I were allowed to do so - which I'm not as it is fed gov't
property and even posting code is considered a federal no-no, it's over
3,000 lines long, sorry :(

And if it gets weirder I can't duplicate the error, even after several
tries, $_POST['school_type_other'] now exists.

Phil
>
> Also, when you first enter the processing script, what does:
> <?php echo '<pre>' . print_r($_POST,true) . '</pre>'; ?>
> display on the screen?
>
> Ken
Received on Mon May 1 02:37:22 2006