Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**These are currently working code***/
- Choose Colour: <input class="color" name="color1" id="color1" placeholder="click to choose colour">
- <input type="submit" onclick="changebodycolour('color1')" value="Apply" />
- /**My function to insert the value to database table**/
- function changebodycolour(c1)
- {
- var selectedcolur = document.getElementById(c1).value;
- //alert(selectedcolur);
- $("#color1").empty();
- $("#loginScreen").empty();
- $.ajax({
- url: ""+pat+"changecolour.php?ipp="+encodeURIComponent(selectedcolur),
- type: 'POST',
- beforeSend: function()
- {
- $('body').css({ opacity: 0.5 });
- $("#loading_img").show();
- },
- success: function(data)
- {
- $("#loading_img").hide();
- $("#loginScreen").fadeIn('slow').append(data).delay(1300).fadeOut('slow');
- $('body').css({ opacity: 2 });
- }
- });//end ajax call
- }
- /**And this is php code**/
- $sql = "Insert into gr_colours values('','".$_GET['ipp']."','body')";
- $db->insert($sql);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement