Jump to content

submit form to category page.


harryuk

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/242869-submit-form-to-category-page/
Share on other sites

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....

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.