Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to do what the title says, make it so that if i click an image it saves its url to a sql database... I know how to do all the sql insert stuff but how do i make it save the url???

I have no code because i don't know where to start.
Posted

1 solution

You can always start here:

http://www.htmlcodetutorial.com/forms/_INPUT_onClick.html[^]

or here:

http://www.w3schools.com/jsref/event_onclick.asp[^]

Then you need to write a method that gets the URL into a variable.
One way is to use JavaScript.
JavaScript
<script>
    var myURL;
    function copyText()
    {
       myURL = document.getElementById("field1").value;
    }
</script>


Then save that variable into your database.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900