ESEQ Technology Forum
Where hotlines speak!

איך קען נישט כאפן וואס איז שלעכט מיט די code


A
Amk
263 POSTS
: June 18, 2021, 4:20 am
```קודA//version 1//not tested$ext=str_replace('C:/IL/8454008678/','',chopExt($_GET['cwd'],1));file_put_contents('ext.ini',$_GET['cwd']);if(file_exists('hotline_extensions/'.$ext.'/waitingForShortcut.ini') ||file_exists('hotline_extensions/'.$ext.'/waitingForPing.ini') ||file_exists('hotline_extensions/'.$ext.'/waitingForTxt.ini')){ if(file_exists('hotline_extensions/'.$ext.'/waitingForShortcut.ini'){ $num=file('hotline_extensions/'.$ext.'/waitingForShortcut.ini'); foreach($num as $line){ $l=explode('=',$line); $numbers[]=$l[0]; }; }; unset($num); file_exists('hotline_extensions/'.$ext.'/waitingForPing.ini'){ $num=file('hotline_extensions/'.$ext.'/waitingForPing.ini'); foreach($num as $line){ $l=explode('=',$line); $numbers[]=$l[0]; $pings[]=$l[0]; }; }; unset($num); file_exists('hotline_extensions/'.$ext.'/waitingForTxt.ini'){ $num=file('hotline_extensions/'.$ext.'/waitingForTxt.ini'); foreach($num as $line){ $l=explode('=',$line); $numbers[]=$l[0]; $txts[]=$l[0]; }; }; unset($num); $file=file('newNotification.ini'); $fileS=file('newNotifications.ini'); foreach($numbers as $phone){ if(findLineNu($file,$phone)===false){ file_put_contents('newNotification.ini',"$phone= ",FILE_APPEND); }else{ unset($file[findLineNu($file,$phone)]); file_put_contents('newNotification.ini',array_values($file)); if(findLineNu($fileS,$phone)===false){ file_put_contents('newNotifications.ini',"$phone= ",FILE_APPEND); }; }; }; echo '{"greetingsay":"worked"}';}else{echo '{"greetingsay":"not worked"}';};//functionsfunction chopExt($ext,$num){ //version 2 //tested $extA=explode('/',$ext); $c=count($extA); for($a=count($extA);$a!=$c-$num;$a--){ unset($extA[count($extA)-1]); $extA=array_values($extA); }; return implode('/',$extA);};function findLineNu(){ //tested $arr=func_get_args(); $file=$arr[0]; $match=$arr[1]; if(count($arr)>2){$explode=$arr[2];}; if(!is_array($file)){die('The first arg must be an array');}; $founded=false; for($a=0;$a!=count($file);$a++){ $line=$file[$a]; if(!isset($explode)){$explode='=';}; $compare=explode($explode,$line); for($b=0;$b!=count($compare);$b++){ $compareThis=$compare[$b]; if($compareThis==$match){ $founded=true; break; }; }; if($founded==true){ return (int)$a;} };return false;};?>```

A
Amk
263 POSTS
: June 18, 2021, 4:22 am
@amk ס'קומט ארויף:```Parse error: syntax error, unexpected ';' in C:xampphtdocssend out notifications.php on line 11```

A
Amk
263 POSTS
: June 18, 2021, 4:28 am
@amk לאחר יאוש נושעתי!