On Monday 29 November 2010, "Ron Piggott" <ron.piggott@xxxxxxxxxxxxxxxxxx> wrote: > I am unable to retrieve the value of $referral_1 from: That's very simple, you are missing the name attribute for your input elements, for example: <input type="text" name="email" maxlength="60" class="referral_5" style="width: 400px;"> Should be: <input type="text" name="email" maxlength="60" class="referral_5" name="referral_5" style="width: 400px;"> Please read the following links: HTML Standards: http://www.w3.org/standards/webdesign/htmlcss PHP Manual: http://cl.php.net/manual/en/ > > $new_email = mysql_escape_string ( $_POST['referral_$i'] ); > > why? > > PHP while lopp to check if any of the fields were populated: > > > > $i=1; > while ( $i <= 5 ) { > > $new_email = mysql_escape_string ( $_POST['referral_$i'] ); > > if ( strlen ( $new_email ) > 0 ) { > .... > } > > } > > > The form itself: > > > <form method="post" action=""> > > <p style="margin: 10px 50px 10px 50px;"><input type="text" name="email" > maxlength="60" class="referral_1" style="width: 400px;"></p> > > <p style="margin: 10px 50px 10px 50px;"><input type="text" name="email" > maxlength="60" class="referral_2" style="width: 400px;"></p> > > <p style="margin: 10px 50px 10px 50px;"><input type="text" name="email" > maxlength="60" class="referral_3" style="width: 400px;"></p> > > <p style="margin: 10px 50px 10px 50px;"><input type="text" name="email" > maxlength="60" class="referral_4" style="width: 400px;"></p> > > <p style="margin: 10px 50px 10px 50px;"><input type="text" name="email" > maxlength="60" class="referral_5" style="width: 400px;"></p> > > <p style="margin: 10px 50px 10px 50px;"><input type="submit" > name="submit" value="Add New Referrals"></p> > > </form> > > > What am I doing wrong? > > Ron > > The Verse of the Day > âEncouragement from Godâs Wordâ > http://www.TheVerseOfTheDay.info Best regards, -- Daniel Molina Wegener <dmw [at] coder [dot] cl> System Programmer & Web Developer Phone: +56 (2) 979-0277 | Blog: http://coder.cl/ |
Attachment:
signature.asc
Description: This is a digitally signed message part.