Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

boolean read error

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

boolean read error

Postby lanana » Mon Jul 01, 2013 4:46 pm

Hi this is my code...

<?php

$username = "user";
$wordlist = "password.txt";
foreach( file( $wordlist ) as $password )
{

$json_url = "http://www.mypage.com/security?j_username=$username&j_password=$password";
$json = file_get_contents($json_url);
$data = json_decode($json, TRUE);
var_dump($data);
echo $password, '<br>';
flush();
ob_flush();
sleep(1);
}

if($data["success"]== "1")
{
echo "Password is: <h4>$password</h4>";
}
else {
echo "false";
}

?>


the explanation is when i go to the page i receive and read json file with the "success" as boolean({"success":true}), if i get the true, print me the password im searching for, the problem is in my text file, when ordered at the beginning for example

password
test1
test2

the boolean always return in false, but if i ordered at the least

test1
test2
password

the boolean becomes true, what I want is that the script can find the password in any location,

thaks for help !
lanana
New php-forum User
New php-forum User
 
Posts: 3
Joined: Tue Jun 25, 2013 1:07 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.