PHP-返回包含用户数据的URL的搜索框
我有以下PHP代码:PHP-返回包含用户数据的URL的搜索框,php,html,Php,Html,我有以下PHP代码: <?php if(isset($_REQUEST['img'])){ ?> <title><?=$_REQUEST['img']?></title> <style> img{ max-width: 80%; max-height:100%; display: block; margin-left: auto; margin-right: auto; text-al
<?php
if(isset($_REQUEST['img'])){
?>
<title><?=$_REQUEST['img']?></title>
<style>
img{
max-width: 80%;
max-height:100%;
display: block;
margin-left: auto;
margin-right: auto;
text-align: center;
border: 3px solid blue;
}
}
</style>
<style>
body {
background-color: #0e0e0e;
}
</style>
<img src="<?=$_REQUEST['img']?>"class="img">
<a href="<?=$_REQUEST['img']?>" download>
<strong>
<p style="text-align: center;">
<span style="color: #ffffff;">Download Image: <?=$_REQUEST['img']?></span>
</p>
<strong
</a>
<?php
}
?>
此代码用于选择图像并将其显示在屏幕上。可能使用的URL示例如下。我如何创建一个PHP输入框,当按下按钮时,该输入框接收用户输入的数据并将其放入URL?这里有一个例子来说明我的意思:用户输入文本“jnl53XVVfi”并单击按钮。这将打开显示图像的URL
我尝试过在互联网上搜索,但我找不到任何可以完成这项特定任务的东西。我也没有什么PHP知识,所以我不知道任何技术术语
非常感谢。我刚刚添加了这段代码,它工作得非常好
<form action="image.php" method="GET">
Search Image:<input type="text" name="img">
<input type="submit" value="Open Image">
</form>
这看起来将是一个可怕的混乱局面。这是因为你从真实的页面代码中切掉了一些片段来总结页面的功能吗?是否有一个页面上的某个地方也有一个标记?@riggsfully是的,我刚刚切掉了一些片段来显示网站上需要的内容。这是我仅有的文件。