New to php and currently stuck How do I get the user input from my html to pass to my api query? Instead of having the query hardcoded, I want the user input to be set as the query for the api
<?php
//keys
$CONSUMER_KEY = 'w';
$CONSUMER_SECRET = 'w';
$ACCESS_KEY = 'w';
$ACCESS_SECRET = 'w';
//include lib
require "twitteroauth/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
//connect to the api
$connection = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET, $ACCESS_KEY, $ACCESS_SECRET);
$content = $connection->get("account/verify_credentials");
// get tweets
// $tweets = $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=trump");
$tweets = $connection->get("search/tweets", ["q" => "trump"]);
?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Twitter Api Search</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<form action="" method="get">
<input name="keyword" type="text" placeholder="Search Tweets">
</form>
<?php foreach ($tweets->statuses as $key => $tweet) { ?>
<img src="<?=$tweet->user->profile_image_url;?>" /><?=$tweet->text; ?><br>
<?php } ?>
</body>
</html>