The14thGOD Posted March 4, 2007 Share Posted March 4, 2007 Hey, Basically what I am doing is making a blog of mine on my website AJAXable (and I copyright that word!). So I have it when I'm logged in all the script is enabled and I can edit the blog. Now when I click on the text it generates all the info in a textarea. However! I see my html tags. Now I'm pretty sure once I click on the submit button, it is going to store all those tags into the database. I do not want that Is there a way with PHP or maybe Javascript to go through and delete these tags? Thanks in advance, The14thGOD Quote Link to comment Share on other sites More sharing options...
Orio Posted March 4, 2007 Share Posted March 4, 2007 What do you basically want to do is delete all of the HTML tags in a given string, right? <?php $str = preg_replace("/<.*?>/", "", $str); ?> Orio. Quote Link to comment Share on other sites More sharing options...
papaface Posted March 4, 2007 Share Posted March 4, 2007 or you could just use strip_tags() Quote Link to comment Share on other sites More sharing options...
The14thGOD Posted March 4, 2007 Author Share Posted March 4, 2007 I will try this as soon as I can figure out something . I'm new to javascript so this is kinda confusing for me. I had an error, I misnamed the field in one area. When it was misnamed it went to the php script and ran it, when I put it back to what it was supposed to, the page did not refresh, and I don't think the query ran because in my db nothing changed. But thank you for the info, The14thGOD ***EDIT*** Happen to know if there is a way through javascript to run a php script? i think that would be eaiser than the way I am doing. Thanks again for any help. Quote Link to comment Share on other sites More sharing options...
The14thGOD Posted March 4, 2007 Author Share Posted March 4, 2007 Bump, new time of day, new ppl are on, they may know a solution. (I don't remember if bumps are allowed here, sorry in advance) Quote Link to comment Share on other sites More sharing options...
fert Posted March 4, 2007 Share Posted March 4, 2007 Happen to know if there is a way through javascript to run a php script? Yes, it's called Ajax Quote Link to comment Share on other sites More sharing options...
The14thGOD Posted March 4, 2007 Author Share Posted March 4, 2007 Thanks for reminding me of what I already knew. I was more looking for a function, code, or a link to a tutorial or something like that. I've been googling and havn't found a method that would work with the way I'm doing it. I don't want the page to refresh, but the methods I keep finding would require the page to refresh. Quote Link to comment 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.