我有以下PHP代碼:<?phpif(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}?>此代碼用于挑選圖像并將其顯示在屏幕上??赡苁褂玫腢RL的示例是https://i.luckvintage.net/?img=jnl53XVVfi.jpg。我如何創建一個PHP輸入框,當用戶按下按鈕時,該輸入框會接受用戶輸入的數據并將其放入URL?這是我的意思的示例:用戶輸入文本“ jnl53XVVfi”并單擊按鈕。這將打開URL https://i.luckvintage.net/?img=jnl53XVVfi.jpg,該URL將顯示圖像。我嘗試搜索Internet,但是找不到任何可以完成此特定任務的內容。我也很少有PHP知識,所以我不知道任何技術術語。
1 回答

月關寶盒
TA貢獻1772條經驗 獲得超5個贊
我剛剛添加了這段代碼,它運行良好。
<form action="image.php" method="GET">
Search Image:<input type="text" name="img">
<input type="submit" value="Open Image">
</form>
- 1 回答
- 0 關注
- 124 瀏覽
添加回答
舉報
0/150
提交
取消