HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
hard time using multiple selection in a php/xhtml form
Post new topic   Reply to topic    HTML Help Forum -> HTML Form
View previous topic :: View next topic  
Author Message
planetek



Joined: 08 Jul 2009
Posts: 2

PostPosted: Wed Jul 08, 2009 4:16 pm     hard time using multiple selection in a php/xhtml form Reply with quote

everything is set, its just that when i click for multiple selection in one of my form boxes (toppings) it only emails me one selection as oppose to multi ??


example html code

<select name="toppings" multiple size="4">
<option value="mushrooms">mushrooms </option>
<option value="greenpeppers">green peppers</option>
<option value="onions">onions</option>
<option value="tomatoes">tomatoes</option>
<option value="olives">olives</option>
</select>

php code ---

<form method="post" action="sendeail4.php">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
sticks464



Joined: 31 Dec 2006
Posts: 2627

PostPosted: Wed Jul 08, 2009 7:59 pm     Reply with quote

Not a real php guru but give this a try
Code:
<select name="toppings[]" multiple size="4">


This tells the PHP interpreter to accept multiple values.
planetek



Joined: 08 Jul 2009
Posts: 2

PostPosted: Thu Jul 09, 2009 6:03 pm     Reply with quote

this is what it looks like in my email

Toppings: Array
sticks464



Joined: 31 Dec 2006
Posts: 2627

PostPosted: Thu Jul 09, 2009 8:14 pm     Reply with quote

Like I said I am no php guru. You can post in the php section of this forum but IMHO you would be better off going to this forum and posting in the php section of the Server Side Programming.

This link might help.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> HTML Form All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial