Jump to content

show #of forms as requested in dropdown


Recommended Posts

well im VERY new to php and im starting small and hopefully going to end up with a cms;

back to the question (i do realize that my coding will be very incorect but since im realy new to this , newer then you could possibly imagine bare with me)

 

lets say i want the person that is submiting something to have the option to select the number of text forms they might need

wouldent you go about this by creating a drop down calling it like name=numb[] then have lets say 8 variables (1-8 for the dropdown selection)

 

they pick 4 and in the php code you would do

 

<select name="numb[]">

<option value="1">1

<option value="2">2

<option value="3">3

<option value="4">4

<option value="5">5

<option value="6">6

<option value="7">7

<option value="8">8

</select>

 

<form name="form1" method="post" action="">

 

 

<br>

<br>

Character Name:<br>

<input name="name" type="text" size="30" maxlength="30">

<br>

Character Biography<br>

:

<textarea cols=30 rows=10 name="bio"></textarea>

<br>

<input type="submit" name="submit" value="submit">

<br>

<br>

<table width="33%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td>

<?php

$blah=

$name=$_POST['name'];

$bio=$_POST['bio'];

 

if(isset($name) && isset($bio)){

echo $name. ": " .$bio;

}

?>

</td>

</tr>

</table>

</form>

 

<?

$numb=count['numb[]'];

$form=$_request['numb[]+form1']

if ($numb);

then (show $numb of $form);

echo then;

}

 

?>

 

 

 

PS: i also have little to no clue as to what i was trying to do in that little piece of code :rolleyes:

 

for the best thingi have done in php so far go look at www.addpower.com/betaone/test.php (the dropdown is usless rightnow just put in something in first line and a discription about it in second text box) i also dont have a clue what isset is that iused a friend said that was better to use then the if($submit)

echo "$name:$bio"

 

 

www.addpower.com/betaone/test.phps.txt for code

Link to comment
https://forums.phpfreaks.com/topic/1878-show-of-forms-as-requested-in-dropdown/
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.