Jump to content

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

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' ?>

 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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