Skip to content
Advertisement

Tag: html

multiple buttons on a form

I have a clear button that I want to tie into some php coding. how do I detect if the clear button is pressed. When the user press clear, i’m going to have it update a sql table to clear out entries. …

Escaping data – stripslashes, strip_tags

Why do a lot of people use both these functions on a string? I see a lot of stripslashes(strip_tags($field)); (or the other way around) Isn’t strip_tags enough to filter any xss stuff and such things? Answer Escaping data has nothing to do with strip_tags or stripslashes. These functions filter certain characters out of a string while “escaping” encodes certain characters

How to echo in PHP, HTML tags

I went through this before posting: How can I echo HTML in PHP? And I still couldn’t make it work. I’m trying to echo this: But I still can’t find a way to make the tags “” and ” disappear. What do I have to do? Answer Just put it in single quotes.

Scraping a messy html website with PHP

I am in the following situation. I am trying to convert a messy scraped html code to a nice and neat xml structure. A partial HTML code of the scraped website: Now I want to create the following xml structure with php: Have been trying the simple html dom method, but have no idea how to get the next sibling

Print string with a php variable in it

For you guys, I imagine this will be easy. I want the variable to be $width and for it to have px on the end. If i put a space, it doesnt work. If i put them together, it treats it as one big variable name. Could I ask someone the correct snytax to achieve this? Thanks Answer If you

Advertisement