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; ?> Link to comment https://forums.phpfreaks.com/topic/283357-help-getting-argument-from-url/ Share on other sites More sharing options...
objnoob Posted October 28, 2013 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'; Link to comment https://forums.phpfreaks.com/topic/283357-help-getting-argument-from-url/#findComment-1455803 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.