/* cand nu functioneaza, decomentez si vad eroarea; ultima oara era firewall de la chroot spre portul 8053 $ch = curl_init(); $out = fopen('php://output', 'w'); curl_setopt($ch, CURLOPT_STDERR, $out); curl_setopt($ch, CURLOPT_URL, "http://B3-01.go.ro:8053/"); curl_setopt($ch, CURLOPT_PORT, 8053); curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTP); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ "cerere" => "secretizare_problema", "data" => "$string_cu_data" ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//return the transfer as a string $id = curl_exec($ch); fclose($out); $error = curl_error($ch); curl_close($ch); echo "
$string_cu_data
"; echo "$id
"; echo "$error
"; return (int) $id; */ function acceseaza_b3_01_8053($argumente_pentru_post) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://B3-01.go.ro:8053/"); curl_setopt($ch, CURLOPT_PORT, 8053); curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTP); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $argumente_pentru_post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $rezultat = curl_exec($ch); curl_close($ch); return $rezultat; } function afiseaza_problema($id_problema) { echo acceseaza_b3_01_8053([ 'cerere' => "afisare_problema", 'id_problema' => "$id_problema" ]); } function id_aleator() { return acceseaza_b3_01_8053([ 'cerere' => "id_problema_aleator" ]); } function get_id() { if (($_SERVER["REQUEST_METHOD"] == "GET") and (isset($_GET['id']))) { $id = $_GET['id']; if (! empty($id)) return (int) $id; } if (($_SERVER["REQUEST_METHOD"] == "POST") and (isset($_POST['id']))) { $id = $_POST['id']; if (! empty($id)) return (int) $id; } return id_aleator(); } $afiseaza_numai_problema = 0; if (($_SERVER["REQUEST_METHOD"] == "POST") and (isset($_POST['afiseaza_numai_problema']))) $afiseaza_numai_problema = (int) $_POST["afiseaza_numai_problema"]; if (! $afiseaza_numai_problema) include "partea1.php"; afiseaza_problema(get_id()); if (! $afiseaza_numai_problema) include "partea2.php"; ?>