Page 1 of 1

How to insert the information when we click on the image

Posted: Tue Oct 12, 2010 2:29 am
by pavithra
Please anyone help me. i have created 4 tables. in front end i have 4 image specifying the type . if i click that image it should save in database. that field is in all the four tables in the database by name register type. how shall i do it using javascript and php. please anyone guide my :(

Thanks in advance...............

Re: How to insert the information when we click on the image

Posted: Tue Oct 12, 2010 7:42 am
by iijb
Hi
Could you give more details about your problem.
I think you can done it by including in the url .
<a href="insert.php?imagetype=yourtype"><img src="image.jpg" /></a>

In insert.php get the value by $_GET['imagetype'] and save it your database

Regards
iijb

Re: How to insert the information when we click on the image

Posted: Wed Oct 13, 2010 1:30 am
by kalpesh.mahida
Hi,

If you want to store info of type of register account along with some other fields of your registration form you can make use of four submit button. You can apply the images to submit buttons using CSS and after successfull submit of the form you can check which submit button was pressed while submitting regristration data to server.

Bellow is Html part of the page.

<form name="frmSubmitTest" id="frmSubmitTest" action="buttons.php" method="POST">
<input type="text" name="firstname" id="firstname" />
<input type="submit" value="Submit1" name="Submit1" />
<input type="submit" value="Submit2" name="Submit2" />
<input type="submit" value="Submit3" name="Submit3" />
<input type="submit" value="Submit4" name="Submit4" />
</form>

buttons.php
print_r($_POST);

I think you are looking for something like described above. If this is not you are looking for please explain your problem with more details.
Hope this will help you,

Kalpesh Mahida