Using Check Boxes to Update MySql

I would like to set up a image of a map that has checkboxes to update

Page 1 of 1

2 Replies - 904 Views - Last Post: 04 April 2008 - 04:07 PM Rate Topic: -----

#1 CyberPetWorld  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 01-April 08

Using Check Boxes to Update MySql

Post icon  Posted 01 April 2008 - 08:30 PM

Hello everyone,

I am new here and see there are alot of experienced coders which is good. I am not asking for anyone to do my 'homework' but was wondering if I can ask you what is needed to do the following...

I want to create a small 600x300 image map that members of my virtual pet site can go to and 'move in' to that place. The way I want to do this is to have lines of check boxes spread out over the map that can be ticked by admin to open the spot, or unchecked to close the spot so that when members visit the map they will see a small text link saying open (which is the ticked check boxes)

The admin page will only be able to see the check boxes to update the screen.

Once a member clicks onto a open spot, they are then loaded to another page where they fill in some details which will insert into a MySql database and then that spot will appear with that users name.

My question is can the check boxes be done only by using PHP or is it HTML or another coding way! Im a beginner so this is a big job for me but I am going to give it a go! :o)

I would apreciate any advice on which direction to look at or what type of coding is required.


Thank you

CPW

Is This A Good Question/Topic? 0
  • +

Replies To: Using Check Boxes to Update MySql

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4187
  • View blog
  • Posts: 11,845
  • Joined: 18-April 07

Re: Using Check Boxes to Update MySql

Posted 01 April 2008 - 10:30 PM

Well essentially what you would need is HTML, perhaps some javascript for users, and PHP. Your areas of the image map will have unique number ids or the names of the users who have already claimed a spot. This info is initially read from the database when the page is first loaded.

If the spot has not been claimed, the image map area will trigger a submit which will send the user to a PHP page to fill out a form. When they hit submit, the PHP will evaluate the user and check that the spot they want hasnt been taken already. If it hasn't been taken, it creates the insert sql statement.

Upon completion of the process, you reload the beginning image map screen and their name will be in place where they reserved.

:)
Was This Post Helpful? 0
  • +
  • -

#3 CyberPetWorld  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 01-April 08

Re: Using Check Boxes to Update MySql

Posted 04 April 2008 - 04:07 PM

Hey again


This is related to the other INSERT problem you are helping me out with Martyr so obviously I am focusing on just getting that to work before speeding ahead with this. But I want to understand how the actual user-end page code would be set out and how the process page would accept and process each individual Free spot.


So say for example I have a 600x300 image map with say 25 different 'MOVE HERE' links. The user clicks on one link to move in and then the link changes from MOVE HERE to $username 's House. Then if the user decides to leave again it changes back to MOVE HERE again.

Am I looking at setting individual $spot1 $spot2 $spot3 $spot4 etc then having the process page insert the different number spot into the table that I have set up as you have seen in the other post? Then would I need an individual $check for each $spot number as well as an indivdual echo statment or can these be done as a group?
This seems like a big task so I just want to make sure Im on the right track lol

Tanks

Justin
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1