javascript - while(1) JSON injection -


i read post why google prepend while(1); json responses?

can kind of php script ?

i try

$time=time(); $hash=md5(mt_rand(1,200000));  $arr = array('time' => $time, 'hash' => $hash); while(1);json_encode($arr); 

in ajax answer have error fatal error: maximum execution time of 30 seconds exceeded in c:\xampp\htdocs\foo\1.php on line 6

thank girish works :

1.php

<?php $time=time(); $hash=md5(mt_rand(1,200000));  $arr = array('time' => $time, 'hash' => $hash); echo "while(1);".json_encode($arr); 

ajax -side

responsetext=req.responsetext.substring(9);             var obj=json.parse(responsetext);              statuselem.innerhtml = obj.hash 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -