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?

WBOY
Release: 2016-08-18 09:16:13
Original
1430 people have browsed it

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template