Home > Backend Development > PHP Problem > How to use php program to implement web page skin change

How to use php program to implement web page skin change

王林
Release: 2023-03-13 08:54:01
Original
2914 people have browsed it

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 [

How to use php program to implement web page skin change

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>
Copy after login

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!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template