Jump to content

Help getting argument from url


SennNathan

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.