Author

Topic: I need help debugging php (Read 554 times)

member
Activity: 90
Merit: 10
<<<<>>>>>><<<
January 03, 2017, 11:12:26 AM
#9
im not the one who is using???
I'm talking about your example. It's bad practice and should be deprecated.
Building queries like that is the reason why injections exist and are so common.
addslashes shouldn't exist in PHP, nor should it's replacement mysqli_real_escape_string because it promotes bad code.
of-course is not safe...its been years i do not see it getting used. i didn't said it is or using it. just gave a suggestion to the OP so he wont get error...
sr. member
Activity: 293
Merit: 250
https://tinyurl.com/cheapVPS200
January 03, 2017, 05:32:24 AM
#8
I don't know php really, just came here to learn something form you guys!!!
hero member
Activity: 576
Merit: 514
January 02, 2017, 08:02:32 PM
#7
im not the one who is using???
I'm talking about your example. It's bad practice and should be deprecated.
Building queries like that is the reason why injections exist and are so common.
addslashes shouldn't exist in PHP, nor should it's replacement mysqli_real_escape_string because it promotes bad code.
member
Activity: 90
Merit: 10
<<<<>>>>>><<<
January 02, 2017, 05:53:00 PM
#6
im not the one who is using???
hero member
Activity: 576
Merit: 514
January 02, 2017, 04:49:37 PM
#5
Brisky had fixed it for u, but i would like to suggest also : addslashes use it only on POST & GET variables, do not use it with full query
for example
$mypost = addslashes($_GET['id']);
$sql = "SELCET * FROM `tables` WHERE `id`='.$mypost';";
It's 2017. Stop building queries like that, use prepared statements and forget all those crutches to avoid injections.
member
Activity: 90
Merit: 10
<<<<>>>>>><<<
January 02, 2017, 12:21:44 PM
#4
Brisky had fixed it for u, but i would like to suggest also : addslashes use it only on POST & GET variables, do not use it with full query
for example
$mypost = addslashes($_GET['id']);
$sql = "SELCET * FROM `tables` WHERE `id`='.$mypost';";
hero member
Activity: 576
Merit: 514
January 02, 2017, 09:13:27 AM
#3
Code:
echo "";

$tempstr = addslashes($where_sql);
echo "";

echo "";
newbie
Activity: 1
Merit: 0
January 02, 2017, 07:30:11 AM
#2
put

ini_set('display_errors', 1);

at the top and run it again - do you any errors?

is $where_sql initialized?

newbie
Activity: 2
Merit: 0
January 01, 2017, 10:34:54 PM
#1
In these few php lines, the first and the last lines are executed without any problem, but the middle two lines are ignored as if they are not even there.  Any suggestions?

Code:
echo "";

$tempstr = addslashes($where_sql);
echo "";

echo "";

Jump to: