mercredi 16 mai 2018

How to pass sld in the search term of enom API given below:

When I pass sld in the search term of Enom API given below I'm getting error as "Undefined Index".

'http://resellertest.enom.com/interface.asp?command=GETNAMESUGGESTIONS&uid=resellid&pw=resellpw&SearchTerm=hand&MaxResults=5&ResponseType=XML

Help me to pass the search term in the above API to get the data correctly. Because when I pass the search term as given above like"hand" I get the name suggestions correctly.

My controller code is given below:

 public function domaincheck(Request $request)
{

        $sld = $request['sld'];
        $tld = $request['tld'];

        $response1 = file_get_contents('http://resellertest.enom.com/interface.asp?command=GETNAMESUGGESTIONS&uid=resellid&pw=resellpw&SearchTerm=hand&MaxResults=5&ResponseType=XML');       
        $data1 = simplexml_load_string($response1);
        $configdata1   = json_encode($data1);
        $final_data1 = json_decode($configdata1,true);// Use true to get data in array rather than object



      return view('clientlayout.main.registerdomain',compact('final_data1'));

}

}

Find my view code below:

 @foreach($final_data1['DomainSuggestions']['Domain'] as $key)

   <br>

@endforeach

Find the route below:

Route::get('/registerdomain','EnomController@domaincheck');

Help me with the solution how to pass the sld in the search term to print the domain suggestions from the Enom API.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire