Jump to content

Need help with this code,. (xml parser)


BRADERY

Recommended Posts

<?PHP
echo "BRADERY is awesome!\n\nBegin loading script...\n";
/////////////////////////////////////////////
// THE ATTACK / ATTACK_HITLIST HEADER HERE //
/////////////////////////////////////////////
$iAttackHeader = "GET /proxy/relay.proxy?opensocial_url=http%3A//mob-dynamic-lb5.mobsters05.com/mob/attack_hitlist?user_id=496046235&target_id=441317595&session_id=dd896935d829c07733c6599c7adb3f4a4f080109&auth_key=eda415e123e5040838f1079ba1ae8e9a64d1763e&nocache=1265534050174
";
/////////////////////////////////////////////
// DELAY BETWEEN ATTACKS, RECOMMENDED 0 /////
/////////////////////////////////////////////
$iAttackDelay = 0;
/////////////////////////////////////////////
// NUMBER OF TIMES TO ATTACK ////////////////
/////////////////////////////////////////////
$iAttackTimes = 10;
/////////////////////////////////////////////
///////// DO NOT EDIT BELOW THIS LINE ///////
/////////////////////////////////////////////
$iAttackHeader = explode("&opensocial_authtype", str_replace("GET /proxy/relay.proxy?opensocial_url=", "", urldecode($iAttackHeader)));
$iAttackDelay *= 1000000;
echo "Script loaded, begin hitlisting and attacking...\n\n";
$iPrint[1] = file_get_contents($iAttackHeader[1]);
for($i=1; $i<$iAttackTimes+1; $i++)
{
  $iPrint[$i] = file_get_contents($iAttackHeader[0]);
  usleep($iAttackDelay);
}
for($i=1; $i<$iAttackTimes+1; $i++)
{
  if(stristr($iPrint[$i], "<message>"))
  {
    xml_parse_into_struct($iP=xml_parser_create(), $iPrint[$i], $iS, $iX);xml_parser_free($iP);
    $iMessage = strip_tags($iS[$iX['MESSAGE'][0]]['value']);
  }
  else $iMessage = "You should probably check your headers... $iPrint[$i]";
  echo "$i : ".$iMessage."\n";
}
echo "You can close this script at any time...";
sleep(100000);
?>

 

 

how would I get the message that is returned $iAttackHeader to show in php every time it is returned instead of waiting for $iAttackTimes to go to 10 and then it returns the message... Idk if im making any sense.. but I start the script.. it reloads the iAttackHeader 10 times then it gives the message returned each time.. how do I get it to show as soon as it is returned instead of waiting for it to end?

Link to comment
https://forums.phpfreaks.com/topic/200758-need-help-with-this-code-xml-parser/
Share on other sites

Im gonna have to say your gonna have to try and be a little more detailed about what you want to have do when and or where.. cause reading your post, it sounds like you want to keep reopening the header thats your gathing info from everytime it cycles.. rather than wait for it to cycle and get to the EOF

when I open the script it says

 

"Begin hitlisting and attacking" and about 4 seconds later it returns the message 10 times because I have the header set to only reload 10 times.. I dont want the message to appear after the header resets 10 times I want it to return the message as soon as the header reloads instead of waiting 10 times and then it shows all 10 messages at once

Ok well if i understand you right then, try adding a conditional variable at the top of the script..

 

$loaded = 1;

 

 

then where you have

echo "Script loaded, begin hitlisting and attacking...\n\n";

just add an if-else..

if($loaded == "1"){echo "Script loaded, begin hitlisting and attacking...\n\n";$loaded++;}

 

what that does is on its first cycle finds that the variable is 1, indicating its first run through the loop.. because its found as 1, it prints out on page the loading, begin comment.. then add + 1 to the number to change it from 1 to 2.. so the next cycle through the loop wont find the variable equal to 1 anymore and will just continue through the loop without reprinting it.

 

just make sure you put $loaded = 1; somewhere in the area outside the loops like in this area

echo "BRADERY is awesome!\n\nBegin loading script...\n";
/////////////////////////////////////////////
// THE ATTACK / ATTACK_HITLIST HEADER HERE //
/////////////////////////////////////////////
$iAttackHeader = "GET /proxy/relay.proxy?opensocial_url=http%3A//mob-dynamic-lb5.mobsters05.com/mob/attack_hitlist?user_id=496046235&target_id=441317595&session_id=dd896935d829c07733c6599c7adb3f4a4f080109&auth_key=eda415e123e5040838f1079ba1ae8e9a64d1763e&nocache=1265534050174
";/////////////////////////////////////////////
// DELAY BETWEEN ATTACKS, RECOMMENDED 0 /////
/////////////////////////////////////////////

 

 

 

Sorry, I think I had you put the if(...){} in the wrong spot.. try wrapping that if(...){} around

 

$iMessage = strip_tags($iS[$iX['MESSAGE'][0]]['value']);

 

But still that concept applied would only make it print once when the right output is wrapped.. PHP isn't the language your looking for if you want it to display as it processes. Cause PHP only runs once on page loading and thats it, so its results wont display until its script is done processing along with the page being ready to display. What you want if you want it to phase out while on the fly is use javascript, your going to need to make a function via javascript then call it out through php.. I would say a combination of efforts. Make a .php file have it change its headers within the file to get the server to treat it as a diffrent file type in this case a javascript file (.js) all the while still being able to process the php within it as its a php file too

 

myscript.php:

<?php header('content-type: application/x-javascript'); ?>
function print_display(myMsg){
document.write(myMsg);
}
<?php
echo "BRADERY is awesome!\n\nBegin loading script...\n";
/////////////////////////////////////////////
// THE ATTACK / ATTACK_HITLIST HEADER HERE //
/////////////////////////////////////////////
$iAttackHeader = "GET /proxy/relay.proxy?opensocial_url=http%3A//mob-dynamic-lb5.mobsters05.com/mob/attack_hitlist?user_id=496046235&target_id=441317595&session_id=dd896935d829c07733c6599c7adb3f4a4f080109&auth_key=eda415e123e5040838f1079ba1ae8e9a64d1763e&nocache=1265534050174
";
/////////////////////////////////////////////
// DELAY BETWEEN ATTACKS, RECOMMENDED 0 /////
/////////////////////////////////////////////
$iAttackDelay = 0;
/////////////////////////////////////////////
// NUMBER OF TIMES TO ATTACK ////////////////
/////////////////////////////////////////////
$iAttackTimes = 10;
/////////////////////////////////////////////
///////// DO NOT EDIT BELOW THIS LINE ///////
/////////////////////////////////////////////
$iAttackHeader = explode("&opensocial_authtype", str_replace("GET /proxy/relay.proxy?opensocial_url=", "", urldecode($iAttackHeader)));
$iAttackDelay *= 1000000;
echo "Script loaded, begin hitlisting and attacking...\n\n";
$iPrint[1] = file_get_contents($iAttackHeader[1]);
for($i=1; $i<$iAttackTimes+1; $i++)
{
  $iPrint[$i] = file_get_contents($iAttackHeader[0]);
  usleep($iAttackDelay);
}
for($i=1; $i<$iAttackTimes+1; $i++)
{
  if(stristr($iPrint[$i], "<message>"))
  {
    xml_parse_into_struct($iP=xml_parser_create(), $iPrint[$i], $iS, $iX);xml_parser_free($iP);
    $iMessage = strip_tags($iS[$iX['MESSAGE'][0]]['value']);
    echo "print_display(".$iMessage.")";
  }
  else $iMessage = "You should probably check your headers... $iPrint[$i]";
  echo "$i : ".$iMessage."\n";
}
echo "You can close this script at any time...";
sleep(100000);
?>

 

now i want to say this is just concept, im not testing this stuff as I go.. i don't guarantee it working in anyway shape form or another but I think this is at least a stepping stone idea for you to work with. As javascript can manipulate a document after its been loaded and php can not (without the use of javascript), php manipulates the data for output prior to load

 

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.