ashu.khetan Posted April 17, 2007 Share Posted April 17, 2007 i am using a link http://10.111.11.28/project/practice/test.php?v[0]=table%2B-1&v[1]=1&v[2]=12%0A%0A%0A%0A123456&v[3]=1&v[4]=0 my code is $b=$_GET['v'][0]; $c=$_GET['v'][2]; $d=$_GET['v'][3]; //$string=$_GET[a]; $a="delete from `$b` where `field1\"'''`='".$c."' and `qw`='".$d."'"; $link=@mysql_connect($_SESSION[host],$_SESSION[user],$_SESSION[pass]) or die(""); @mysql_select_db($_SESSION[db],$link); $string1="delete from `table+-1` where `field1\"'''`='12 123456' and `qw`='1'"; surprisingly when comparing the value of $string1 and $a,i found that both values are not equal.plz help me out.i am really confused. how can we make $a same as $string1.any help will be very much appreciated Link to comment https://forums.phpfreaks.com/topic/47351-solved-a-surprising-problemplz-help-me-out/ Share on other sites More sharing options...
HaLo2FrEeEk Posted April 17, 2007 Share Posted April 17, 2007 Uhm...$string1 = $a You are not setting $string1 before calling it up, so there is no reason that it would be equal to $a, but the code above will do it for you. Link to comment https://forums.phpfreaks.com/topic/47351-solved-a-surprising-problemplz-help-me-out/#findComment-231008 Share on other sites More sharing options...
ashu.khetan Posted April 17, 2007 Author Share Posted April 17, 2007 everyone knows that $string1=$a will set $string1 equal to $a..i didnt ask that..whatis asked is that why $string1 and $a are not equal? Link to comment https://forums.phpfreaks.com/topic/47351-solved-a-surprising-problemplz-help-me-out/#findComment-231017 Share on other sites More sharing options...
trq Posted April 17, 2007 Share Posted April 17, 2007 Can we see the value of $string1 and $a. Also, an explanation of why you would expect them to be equal would be nice. Link to comment https://forums.phpfreaks.com/topic/47351-solved-a-surprising-problemplz-help-me-out/#findComment-231030 Share on other sites More sharing options...
ashu.khetan Posted April 17, 2007 Author Share Posted April 17, 2007 the solution has been found.i found out the solution by printing the hex code of both the strings.it was found that when we press enter in case of $string1, the newline character is \r\n whereas in case case of $a we are only inputting \n,thanks everyone 4ur help:) Link to comment https://forums.phpfreaks.com/topic/47351-solved-a-surprising-problemplz-help-me-out/#findComment-231149 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.