Code not working

Here my code:

<?php
	$ipaddress = file_get_contents('https://ip.seeip.org/jsonip');
$decoded_json = json_decode($ipaddress, false);
	
$url = "https://maker.ifttt.com/trigger/new_search_result/with/key/REMOVED_";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$headers = array(
   "Content-Type: application/json",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$data = '{"value1":"' . htmlspecialchars($_GET["q"]) . '","value2":"' .  echo $decoded_json->ip . '"}';

curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);

?>

Here’s my URL: yousearch.gq, I can’t search
Here my screenshot:

alright, two things

  1. this is infinityfree not a php debugging site
  2. putting the code into a php debugger, it returns:
    “Syntax Error, unexpected T_ECHO at line 17”
    ask that at stackoverflow, dont ask at infinityfree
1 Like

Got it fixed, just a simple fix.

In the future, you need to explain your issue, and fill out the template. I know we have told you this before.

Thanks

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.