adam291086 Posted June 21, 2008 Share Posted June 21, 2008 I have never tried this before, but i am trying to run a some php within a javascript function but i asuming i am doing something really wrong can somebody help me here is my javascript function function update_database(el) { var height; var width; var top; var left; var Div_name; var Border; var Position; var Background; var Cursor; height = el.style.height; width = el.style.width; top = el.style.top; left = el.style.left; Div_name = el.id; Border = el.style.border; Position = el.style.position; Background = el.style.background-color; Cursor = el.style.cursor; <?php $conn; mysql_query("UPDATE Admin_Page_Style SET Style_Left = 'left',Style_Top = 'top',Style_Height = 'height',Style_Width = 'width',Style_Position = 'Position',Style_bgcolor = 'Background',Style_Cusor = 'Cursor',Border = 'Border',div_name = 'div_name', WHERE div_name = 'div3'"); ?> } i need the function to get some of the page elements style details and upload them into the database Link to comment https://forums.phpfreaks.com/topic/111270-solved-php-and-javascript/ Share on other sites More sharing options...
DarkWater Posted June 21, 2008 Share Posted June 21, 2008 You can store it in a cookie or set it in a hidden form field or something. PHP and Javascript have very little in the field of communication. Or you could use Ajax. >_> Link to comment https://forums.phpfreaks.com/topic/111270-solved-php-and-javascript/#findComment-571154 Share on other sites More sharing options...
adam291086 Posted June 21, 2008 Author Share Posted June 21, 2008 i have no experience with Ajax. Where can i pick up a decent tutorial? Link to comment https://forums.phpfreaks.com/topic/111270-solved-php-and-javascript/#findComment-571156 Share on other sites More sharing options...
DarkWater Posted June 21, 2008 Share Posted June 21, 2008 Uhh...google or an Ajax book. I'd recommend the former because there are plenty of easily available tutorials. Look up "php ajax tutorial" or something. Link to comment https://forums.phpfreaks.com/topic/111270-solved-php-and-javascript/#findComment-571158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.