Search Box that returns URL with User Data

Hello there,

I have the following PHP Code:

<?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

 }


?>

This code is used to pick out an image and display it on the screen. An example of a URL that might be used is https://i.luckvintage.net/?img=jnl53XVVfi.jpg. How would I create a PHP Input box that takes the data that the user enters into it and puts it into the URL when a button is pressed? Here’s an example of what I mean: The user enters the text ‘jnl53XVVfi’ and clicks the button. This will open up the URL https://i.luckvintage.net/?img=jnl53XVVfi.jpg which will display the image.

I’ve tried searching the Internet, but I am unable to find anything that would do this specific task. I also have very little PHP knowledge so I don’t know any of the technical terms.

Many Thanks.

it’s just string concatenation.

I have no idea what that means. I don’t know that much about PHP, I only started today.

It’s not a PHP term, it’s a general programming term. It basically just means appending a value to another value. Google is your friend, especially if you want to learn programming ^^

Sponsor our Newsletter | Privacy Policy | Terms of Service