Home >Backend Development >PHP Tutorial >Why is the database empty after I insert html tags into the database?

Why is the database empty after I insert html tags into the database?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-18 09:16:131439browse

I have a regex here. If the submitted data matches this regex, it will be inserted into the database using pdo.
This is the regex $reg='/^.{60,600}$/'; But for example, I insert a few randomly written html tags
After submitting it, it shows that the insertion was successful. There is an additional piece of data in the database, but this data is empty and contains nothing. Why?

<code><html><head><html><head><html><head><html><head><html><head><html><head><html><head><html><head><html><head></code>

If I insert some characters or something, for example, the following can be displayed. Why can't I insert html tags? I don't filter html tags. There is only one regular expression. Is it automatically filtered by pdo?

<code>/;'\,.":!@#$%^&*</code>

Reply content:

I have a regex here. If the submitted data matches this regex, it will be inserted into the database using pdo.
This is the regex $reg='/^.{60,600}$/'; But for example, I insert a few randomly written html tags
After submitting it, it shows that the insertion was successful. There is an additional piece of data in the database, but this data is empty and contains nothing. Why?

<code><html><head><html><head><html><head><html><head><html><head><html><head><html><head><html><head><html><head></code>

If I insert some characters or something, for example, the following can be displayed. Why can't I insert html tags? I don't filter html tags. There is only one regular expression. Is it automatically filtered by pdo?

<code>/;'\,.":!@#$%^&*</code>

The first regular expression is any number of 60 to 600 characters. Your HTML only has 37 characters, so it cannot be matched.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn