harryuk Posted July 26, 2011 Share Posted July 26, 2011 Hello, I am studing PHP & mysql, And have come up stuck on a particular area?? I am designing a admin page to be able to submit info on to a public template. <form action="inventory_list.php" enctype="multipart/form-data" name="myform" id="myform" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Name</td> <td width="80%"><label> <input name="product_name" type="text" id="product_name" size="64" /> </label></td> </tr> <tr> <td height="39" align="right">Category</td> <td><label> <select name="Make"> <option value="-1" selected="selected">Select Category</option> <option value="1">Singers</option> </select></label> <label> Sub-Category <select name="Team"> <option>Steve Brooks</option> <option>Elvis</option> <option>Coolio</option> </select></label> </td></tr> <tr> <td align="right">Details</td> <td><label> <textarea name="details" id="details" cols="64" rows="5"></textarea> </label></td> </tr> <tr> <td align="right">Image</td> <td><label> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Add This Item Now" /> </label></td> </tr> </table> </form> <br /> <br /> </div> </div> </body> </html> Once selected a sub category i want it submitted to a individual page. for example if elvis is selected in sub category in the admin area i would like all the info from the form echoed out in a public template named elvis. Quote Link to comment https://forums.phpfreaks.com/topic/242869-submit-form-to-category-page/ Share on other sites More sharing options...
IrOnMaSk Posted July 26, 2011 Share Posted July 26, 2011 well I would have a elvis.php page in the subcategory form action... then in the elvis.php i would grab the info from the sub category selected using the $_POST[''] and echo it to the page... Quote Link to comment https://forums.phpfreaks.com/topic/242869-submit-form-to-category-page/#findComment-1247480 Share on other sites More sharing options...
harryuk Posted July 26, 2011 Author Share Posted July 26, 2011 thanks for the reply!! What if i wanted to echo them out on the same page but in different areas on the page So for example Evlis <hr> <? 'put admin form info here' ?> <br /> <br /> Coolio <hr> <? ' Or put admin form info here' ?> Quote Link to comment https://forums.phpfreaks.com/topic/242869-submit-form-to-category-page/#findComment-1247485 Share on other sites More sharing options...
IrOnMaSk Posted July 26, 2011 Share Posted July 26, 2011 actually the code is just exactly what you hav given. just have to translate that to php... assuming you have html and php in same page.... <html> <head> <body> say bla bla bla <?php here you grab the info from the form and echo it here like so $name = $_POST['name']; using that to keep grabbing the info afther you done. echo it likewise echo $name; ?> here you continue html stuff... bla bla bla... <?php here you do same as above... grab and echo ?> </body> </html> so yeah you can echo those info to wherever you want to on same page... format is like what you said just use the $_POST[''] and echo in those places.... Quote Link to comment https://forums.phpfreaks.com/topic/242869-submit-form-to-category-page/#findComment-1247513 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.