| |

VerySource

 Forgot password?
 Register
Search
View: 1037|Reply: 2

Database security issues

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Unknown

Post time: 2020-2-24 15:30:01
| Show all posts |Read mode
The function is as follows:

$ INPUT: is the array that I defined to save the page submission data

function EscapeDBStr ($ INPUT)
{
$ tmp = array ();
foreach ($ INPUT as $ na => $ val) {
$ tmp [$ na] = addslashes ($ INPUT [$ na]);
}
Ranch
return $ tmp;
}

$ INPUT = escapeDBStr ($ INPUT);

The execution error is as follows:
Notice: Array to string conversion in E:\PHPServer\apache\htdocs\04 UpLoader (2)\include\common_function.php on line 26

Does anyone know what this means?
I want to convert the data submitted by the page to protect the database. How to solve it?
Reply

Use magic Report

0

Threads

27

Posts

18.00

Credits

Newbie

Rank: 1

Credits
18.00

 China

Post time: 2020-6-23 08:00:02
| Show all posts
Notice don't care, it should be that your $input is not an array?
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-25 07:45:01
| Show all posts
It should be because the type of $INPUT[$na] is an array, the reason is
There may be such a situation
  <input type="checkbox" name="size[]" value="small"/>
  <input type="checkbox" name="size[]" value="medium"/>
  <input type="checkbox" name="size[]" value="large"/>
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list