Jump to content

end of line


serial

Recommended Posts

hi all could someone answer my question please

 

i have made a program that makes random number but i have made another program to read this file and just get the length of the random numbers but it doesn't just get the number that i was because sometime the number might be 5 chars long and sometime it could be 12 chars long could someone help me out please

 

here is my code

<?php

 

$pass = file_get_contents("rnd.php");

$pass1 = substr($pass, 1272, 12);

 

 

echo $pass1;

?>

 

as you can see its only getting the 12 chars when the chars could be 5 chars long.

 

i hope i explained it ok for everyone

thanks

Link to comment
https://forums.phpfreaks.com/topic/41434-end-of-line/
Share on other sites

sorry no i didn't explain it properly hat i have is a page and i have to get a certain amount of letters out of that page it goes something like this:

the solution is : 17637828374

 

but the numbers keep changing length so it could be 12 chars one time and 6 chars the next time i was wondering if there is a function to just get the length because i start getting a < at the end of the line and then other times i don't

 

thank you for replying

Link to comment
https://forums.phpfreaks.com/topic/41434-end-of-line/#findComment-203523
Share on other sites

<?php

 

$pass = file_get_contents("http://www.chumley.biz/modules/programming7/programming7.php");

$pass1 = substr(trim($pass), 1272, 12);

 

$decode = md5($pass1);

 

$url = "http://www.chumley.biz/modules/programming7/programming7.php?solution=".$decode;

$sol = header("location:$url");

 

 

echo $sol;

?>

 

this is the code but the page where i have to get the numbers keeps changing the numbers to a different length so it isn't a fixed length

Link to comment
https://forums.phpfreaks.com/topic/41434-end-of-line/#findComment-203535
Share on other sites

Try this should get only the first 5 numbers all the time.

 

<?php

   $pass = file_get_contents("http://www.chumley.biz/modules/programming7/programming7.php");
   $pass1 = substr(trim($pass), 1272, 12);
   
   $x = md5($pass1);
   $decode = substr($x,5);

   $url = "http://www.chumley.biz/modules/programming7/programming7.php?solution=".$decode;
   $sol = header("location:$url");


   echo $sol;
?>

Link to comment
https://forums.phpfreaks.com/topic/41434-end-of-line/#findComment-203682
Share on other sites

You need that number? I tested this script and it gave me the right number:

 

<?php

$find = "The number you need is: ";
$url = "http://www.chumley.biz/modules/programming7/programming7.php";

$page = file_get_contents($url);
$solution = intval(substr(strstr($page, $find), strlen($find)));

?>

 

Orio.

Link to comment
https://forums.phpfreaks.com/topic/41434-end-of-line/#findComment-203688
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.