Home > Article > Backend Development > How to use php program to implement web page skin change
How to use php program to implement web page skin change: 1. Prepare a few skin pictures you like; 2. Create an images directory and place the skin pictures in the images directory; 3. Create the skin.php file, code Such as [
The operating environment of this article: windows10 system, php 7, thinkpad t480 computer.
The steps and codes for using PHP to achieve web page skin changing effect are as follows:
1. Prepare a few skin pictures you like and name them 01.jpg, 02.jpg, 03 respectively. .jpg.
2. Create the directory images and place all skin picture files in this directory.
3. Create the skin.php file with the following code:
<?php if(isset($_GET["source"])){ $source=$_GET["source"]; }else{ $source="image/01.jpg"; } ?> <body background="<?php echo $source?>"> <form> <select name="source"> <option value="image/01.jpg"<?php echo $source=="image/01.jpg"?"selected":"";?>> 皮肤一</option> <option value="image/02.jpg"<?php echo $source=="image/02.jpg"?"selected":"";?>> 皮肤二</option> <option value="image/03.jpg"<?php echo $source=="image/03.jpg"?"selected":"";?>> 皮肤三</option> </select> <input type="submit" value="修改皮肤"> </form>
Recommended learning: php training
The above is the detailed content of How to use php program to implement web page skin change. For more information, please follow other related articles on the PHP Chinese website!