SennNathan Posted October 28, 2013 Share Posted October 28, 2013 Im not sure why this isnt working i if i go to website.co/wolfram.php?keyword=something it should work but it dont not sure what im missing here <?php error_reporting(E_ALL); ini_set('display_errors',E_ALL); $wolfram = isset($_GET['keyword']) && is_string($_GET['keyword']) ? trim($_GET['keyword']) : ''; $request = 'http://api.wolframalpha.com/v2/query?appid=YKAERX-QJJAE7kj2G6&input=.'$wolfram'.&format=html'; echo $wolfram; echo "text"; $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, $request); $response = curl_exec($curl); curl_close($curl); $blank = ''; $divwolf ='</div>'; $remove = ']]>'; $remove2 = '</div></div>'; $displaywolf = str_replace($remove, $blank, $response); echo $displaywolf; ?> Quote Link to comment Share on other sites More sharing options...
Solution objnoob Posted October 28, 2013 Solution Share Posted October 28, 2013 Your error is here: $request = 'http://api.wolframalpha.com/v2/query?appid=YKAERX-QJJAE7kj2G6&input=.'$wolfram'.&format=html'; The correction: $request = 'http://api.wolframalpha.com/v2/query?appid=YKAERX-QJJAE7kj2G6&input=' . $wolfram . '&format=html'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.