Jump to content

WHITESPACE :@


0perator

Recommended Posts

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIE, "PHPSESSID=pmo5ssg2ffbf4r5fk7o698emi4;  PHPSESSID=kk9q6o9v1momaruilfteu9usv7; enigmafiedV4=a%3A4%3A%7Bi%3A0%3Bs%3A4%3A%221813%22%3Bi%3A1%3Bs%3A40%3A%22e67ebe875f7160d8a4680aab6f0038ca824396b1%22%3Bi%3A2%3Bi%3A1401991156%3Bi%3A3%3Bi%3A2%3B%7D");
curl_setopt($ch, CURLOPT_URL, "http://www.enigmagroup.org/missions/programming/7/index.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$da = explode(".", $result);
$be = explode(": ", $da[17]);
$one = $be[2];
$two = $da[18];
$three = $da[19];
$four = $da[20];
$five = $da[21];
$string = "".$one.".".$two.".".$three.".".$four.".".$five[0]."";
$space = explode(" ", $result);
$dept = $space[37];
$reet = explode(" ", $result);
$num = substr_count($result, $dept);
$val = 100;
$i = 0;
$reetval = 103;
while($val <= 300){
$check = $reet[$val];
if($check == $dept){ 
$cost[$i] = str_replace("$", "", $reet[$reetval]);
$val = $val +5;
$reetval = $reetval + 5;
$i = $i + 1;
//echo $check;
}
else{
$val = $val +5;
$reetval = $reetval + 5;
}
}
$sumt = array_sum($cost);
$sum=preg_replace('/\s+/','',$sumt);
$comp = substr($string, 0, ($output-1));
echo "company=".$comp."&department=".$dept."&total=".$sum;
//$sum = substr_replace($sumt,"",-1);
$new = curl_init();
curl_setopt($new, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($new, CURLOPT_COOKIE, "PHPSESSID=pmo5ssg2ffbf4r5fk7o698emi4;  PHPSESSID=kk9q6o9v1momaruilfteu9usv7; enigmafiedV4=a%3A4%3A%7Bi%3A0%3Bs%3A4%3A%221813%22%3Bi%3A1%3Bs%3A40%3A%22e67ebe875f7160d8a4680aab6f0038ca824396b1%22%3Bi%3A2%3Bi%3A1401991156%3Bi%3A3%3Bi%3A2%3B%7D");
curl_setopt($new, CURLOPT_URL, "http://www.enigmagroup.org/missions/programming/7/submit.php");
curl_setopt($new, CURLOPT_POST, 1);
curl_setopt($new, CURLOPT_POSTFIELDS, "company=".$comp."&department=".$dept."&total=".$sum);
$points = curl_exec($new);
echo $points;
?>

 

i get whitespace on $comp and $sum

Link to comment
https://forums.phpfreaks.com/topic/110911-whitespace/#findComment-568995
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.