I'm designing an e-commerce page and had a few questions.
What is the best way to edit a record? For example, I want to put an admin page together where I can edit an item for sale, change the image of the item, and change any other information.
Here is what I have so far which basically only creates the gui.
Expand|Select|Wrap|Line Numbers
- <?php
- echo "<form action='post'>";
- echo "<table align='center' border='1'>";
- echo "<tr><td align='center' colspan='3' bgcolor='#C0C0C0'><b>Edit Product</b></td></tr>";
- echo "<tr><td><b>Product ID:</b> { product id }</td>
- <td colspan='2'><b>Title:</b> <input type='text' size='50' value='{ title }' /></td></tr>";
- echo "<tr><td colspan='3'><b>Catagory:</b> { catagory }</td></tr>";
- echo "<tr><td><b>List Price:</b> $<input type='text' size='5' name='list' /></td>
- <td><b>Our Price:</b> $<input type='text' size='5' name='price' /> <input type='checkbox' name='taxable' checked>Taxable?</td>
- <td><b>Shipping: $<input type='text' name='shipping' size='5' /></td></tr>";
- echo "<tr><td colspan='3'><br><center><b>Item Picture:</b> <input type='text' size='50' name='picture' /></center><br>
- <b>Description:</b><br><center><textarea rows='10' cols='50' name='description'>{ description }</textarea></center>
- <br><p align='right'>Preview</p></td></tr>";
- echo "</table>";
- echo "</form>";
- ?>
Also, I plan on designing a username and password system. Do I mainly use cookies with that and pass the password along via POST amongst the pages and verify it with the user database everytime? I'd like this to be secure as well, and I know part of that is purchasing an SSL certificate etc...
I may be overthinking a lot of things and it's starting to discourage me.