Jump to content

Saving an HTML table for multiple users


Recommended Posts

I have created a checklist using HTML tables, however I want different people to be able to use the checklist and be able to come back to it and check things off as they are acquired or completed. I'm pretty sure I will need to use PHP and I know how to create a login page, and I think to be able to save the checkboxes for individual people I would use a PHP form but I'm not sure how to incorporate the table I have already created. Any help would be appreciated.

Link to post
Share on other sites

HTML tables have nothing to do with how the data is stored on the server. What you do is sstore data into a MySQL table. Data is extracted to PHP in the form of one PHP array for each row in the table. Then you can print out the HTML code for each table cell.

Link to post
Share on other sites

The problem I had with PHP was loading the images into the database and then being able to have them populate the page correctly so I changed it to an HTML table, if someone could help me out on how to handle the images I would be able to use PHP no problem.The Html code for my page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Dragonvale Checklist</title><link href="main.css" rel="stylesheet" type="text/css" media="screen" /></head><body><div class="wrapper"><br/><div class="character"><div class="banner"><img src="images/logos/dv_logo_1.png" alt="" /></div><table border="5"><tr><th>✓</th><th>Name</th> <th>Element</th><th>Breeding</th><th>Egg</th><th>Baby</th><th>Adult</th></tr><tr><td><input name="Own" type="checkbox" value="0" /></td><td>Air</td><td>Air</td><td>Fire/Water</td><td><img src="images/egg/Air_Dragon_Egg.png" alt="" width="104" height="127" /></td><td><img src="images/baby/Air_Dragon_Baby.png" alt="" width="104" height="127" /></td><td><img src="images/adult/Air_Dragon_Adult.png" alt="" width="104" height="127" /></td></tr><tr><td><input name="Own" type="checkbox" value="0" /></td><td>Blazing</td><td>Air/Fire</td><td>Air/Fire</td><td><img src="images/egg/Blazing_Dragon_Egg.png" alt="" width="104" height="127" /></td><td><img src="images/baby/Blazing_Dragon_Baby.png" alt="" width="104" height="127" /></td><td><img src="images/adult/Blazing_Dragon_Adult.png" alt="" width="104" height="127" /></td ></tr><tr><td><input name="Own" type="checkbox" value="0" /></td><td>Bloom~Expired</td><td>Plant/Cold/Lightning</td><td>Combine Plant/Cold/Lightning Elements</td><td><img src="images/egg/Bloom_Dragon_Egg_LA.png" alt="" width="104" height="127" /></td><td><img src="images/baby/Bloom_Dragon_Baby.png" alt="" width="104" height="127" /></td><td><img src="images/adult/Bloom_Dragon_Adult.png" alt="" width="104" height="127" /></td></tr><tr><td><input name="Own" type="checkbox" value="0" /></td><td>Blue Fire</td><td>Fire/Cold</td><td>Fire/Cold hybrid<br />Recommended: Fire/Snow or Fire/Lichen</td><td><img src="images/egg/Blue_Fire_Dragon_Egg.png" alt="" width="104" height="127" /></td><td><img src="images/baby/Bluefire_Dragon_Baby.png" alt="" width="104" height="127" /></td><td><img src="images/adult/BlueFire_Dragon_Adult.png" alt="" width="104" height="127" /></td></tr></table></div><br/></div></body></html>

Link to post
Share on other sites

You'll need mysql or something like it to make your table accessible to all users. Do you know mysql? If not have you done the tutorials? http://www.w3schools.com/sql/default.asp

Edited by niche
Link to post
Share on other sites

Yes I know MySQL a little bit, and I can't get everything to work except the images, I can't figure out how to populate my database so that an image can be called, I have figured out how to put the text data and even the check box into the database and can use php to then populate my page with that data but I don't know how to do it with images, I usually create my database using php myadmin

Link to post
Share on other sites

One way to do it would be to store the image names(like Bluefire_Dragon_Baby.png for example) in a database table instead of the image it self. Then for the page where you need the images, query the database table that has the image names and place them in the src attribute of the img tag along with making sure it points to the directory that has the images; for example /images. Another way would be to store the actual image files in the database.

Link to post
Share on other sites
  • 3 weeks later...
One way to do it would be to store the image names(like Bluefire_Dragon_Baby.png for example) in a database table instead of the image it self. Then for the page where you need the images, query the database table that has the image names and place them in the src attribute of the img tag along with making sure it points to the directory that has the images; for example /images. Another way would be to store the actual image files in the database.
could you give me an example of what the Query code would look like for the Bluefire_Dragon_Baby.png. that is where i run into problems, I don't know how to query the images.
Link to post
Share on other sites

Something like: SELECT image_names FROM image_table WHERE images_names = 'Bluefire_Dragon_Baby.png' That should select that particular image. To query/select all the images, you can do something like: SELECT image_names FROM image_table The table is called: image_table and within this table there is a column called image_names that contains all the image names. This is just an example.

Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...