Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Retreiving populated data from dropdown form
Old 07-05-2010, 02:44 PM Retreiving populated data from dropdown form
Junior Talker

Posts: 1
Trades: 0
I am able to to populate the dropdown form, but I am facing diffuclty with writing data selected by user to its repective text file. Could you please bring out some faults with following code or an easy to understand alternative.


PHP Code:
$drpdown = array();
print 
'<form action="drpdwn.php" method="post">'
[
URL="http://www.webmaster-talk.com/#"]print[/URL'<select name="drpdwn[]" multiple>'

for(
$i=0;$i<$countsep;$i++)
{
print
"<option value=test.$i>$arraydiff[$i]</option>"
}
print 
'<input type="submit" value="Submit">'
print 
'</form>'

$drpdwn=$_POST['drpdwn'];
if(
is_array($drpdwn))
{
while (list (
$key$pluscpu) = each ($drpdwn)) 
{
if(
strstr($pluscpu,"dsllinux"))
{
if(
$pluscpu=="dsllinux5"||$pluscpu=="dsllinux6"||$pluscpu=="dsllinux7"||$pluscpu=="dsllinux8"||$pluscpu=="dsllinux9"||$pluscpu=="dsllinux10"||$pluscpu=="dsllinux11"||$pluscpu=="dsllinux13"||
$pluscpu=="dsllinux14"||$pluscpu=="dsllinux15"||$pluscpu=="dsllinux16"||$pluscpu=="dsllinux22"||$pluscpu=="dsllinux23")
{
$server_a1=fopen("bldhost.i686","a");
fwrite($server_a1,"\n".$pluscpu);
fclose($server_a1); 

$server_a2=fopen("bldhost_pbuild.i686","a");
fwrite($server_a2,"/n".$pluscpu);
fclose($server_a2);

$server_a3=fopen("bldhost_host.i686","a");
fwrite($server_a3,"\n".$pluscpu);
fclose($server_a3);
}

else
{
$server_a4=fopen("bldhost_pbuild.i686","a");
fwrite($server_a4,"/n".$pluscpu);
fclose($server_a4);

$server_a5=fopen("bldhost.i686","a");
fwrite($server_a5,"\n".$pluscpu);
fclose($server_a5);
}
}

else
{
$server_a6=fopen("bldhost.sun4","a");
fwrite($server_a6,"/n".$pluscpu);
fclose($server_a6);

}


Last edited by chrishirst; 07-05-2010 at 03:57 PM..
sarbjyot is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-08-2010, 08:49 AM Re: Retreiving populated data from dropdown form
Average Talker

Posts: 22
Trades: 0
Please let us know , where is the issue in the present alternative i.e. where it fails.
what is the result of <?php print_r($drpdwn); ?>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
katierosy is offline
Reply With Quote
View Public Profile Visit katierosy's homepage!
 
Reply     « Reply to Retreiving populated data from dropdown form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09839 seconds with 12 queries