zgkhoo Posted October 17, 2007 Share Posted October 17, 2007 function displaybetbutton($mode){ echo " <input type=submit name=[color=red]$mode+"even"[/color] value=97%> </td> <td> <input type=submit name=[color=red]$mode+"odd"[/color] value=97%> </td> <td> <input type=submit name=[color=red]$mode+"big"[/color] value=97%> </td> <td> <input type=submit name=[color=red]$mode+"small"[/color] value=97%> </td> </tr> <tr>"; } wat is wan is php generate the $mode+"stringThatIwanCombine" anyone know how? thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/ Share on other sites More sharing options...
zgkhoo Posted October 17, 2007 Author Share Posted October 17, 2007 function displaybetbutton($mode){ echo " <input type=submit name=$mode+"even" value=97%> </td> <td> <input type=submit name=$mode+"odd" value=97%> </td> <td> <input type=submit name=$mode+"big" value=97%> </td> <td> <input type=submit name=$mode+"small" value=97%> </td> </tr> <tr>"; } wat is wan is php generate the $mode+"stringThatIwanCombine" anyone know how? thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-371356 Share on other sites More sharing options...
zgkhoo Posted October 17, 2007 Author Share Posted October 17, 2007 *bump* Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-371486 Share on other sites More sharing options...
zgkhoo Posted October 17, 2007 Author Share Posted October 17, 2007 dun have anyone know? ??? Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-371572 Share on other sites More sharing options...
BlueSkyIS Posted October 17, 2007 Share Posted October 17, 2007 i think you want . (dot) $value . "someotherstring" Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-371575 Share on other sites More sharing options...
zgkhoo Posted October 17, 2007 Author Share Posted October 17, 2007 function displaybetbutton($mode){ echo" input type=submit name=$mode."big" value=97%> "; } like this? thanks Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-371993 Share on other sites More sharing options...
zgkhoo Posted October 18, 2007 Author Share Posted October 18, 2007 <input type=submit name=$mode."even" value=97%> the $mode inside the html tags i dun think it valid ,anyone know how? Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-371998 Share on other sites More sharing options...
kenrbnsn Posted October 18, 2007 Share Posted October 18, 2007 This is one way to write the script: <?php function displaybetbutton($mode){ $modes = array('even','odd','big','small'); foreach ($modes as $m) { echo "<td> <input type='submit' name='" . $mode . $m ."' value='97%'> </td>"; } echo "</tr> <tr>"; }?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-372005 Share on other sites More sharing options...
zgkhoo Posted October 18, 2007 Author Share Posted October 18, 2007 y the $mode.$m(variable of php) is valid inside the html tag<input> ?? no need to <? $mode.$m ?> <--which this inside php open n close.. confuse. thanks... Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-372019 Share on other sites More sharing options...
zgkhoo Posted October 18, 2007 Author Share Posted October 18, 2007 opps....u close the echo, sorry for that. $modes as $m <--why u use "as"? Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-372020 Share on other sites More sharing options...
zgkhoo Posted October 18, 2007 Author Share Posted October 18, 2007 *bump* Quote Link to comment https://forums.phpfreaks.com/topic/73600-function-how-to-autogenerate-a-name-for-form-element/#findComment-372373 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.