Styles2304 Posted August 12, 2007 Share Posted August 12, 2007 I was trying to update my database with this block of info for my church that requires some javascript however the quotes are throwing me off. Can you tell me how to fix that? Here's the link: <a href="javascript:void(0)" onclick="changePage('randompage.html');" class="announcements">here</a> Quote Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/ Share on other sites More sharing options...
gurroa Posted August 12, 2007 Share Posted August 12, 2007 You wish to store this block of data into the database? If so $data = '<a href="..." onclick=" ('som..')">Here</a>'; mysql_query(sprintf("update table set field = '%s' where id = 1", htmlspecialchars($data, ENT_QUOTES) )); Quote Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/#findComment-321483 Share on other sites More sharing options...
Styles2304 Posted August 12, 2007 Author Share Posted August 12, 2007 Is there a way to do it outside of a custom PHP form? I'm trying to enter it directly into the database using phpMyAdmin Quote Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/#findComment-321564 Share on other sites More sharing options...
fenway Posted August 20, 2007 Share Posted August 20, 2007 Is there a way to do it outside of a custom PHP form? I'm trying to enter it directly into the database using phpMyAdmin No idea if phpmyadmin does automatic quote escaping. Quote Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/#findComment-329189 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.