Home >Backend Development >PHP Tutorial >PHP uses post to dynamically select avatars and js events to dynamically change avatars, postjs_PHP tutorial

PHP uses post to dynamically select avatars and js events to dynamically change avatars, postjs_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:44:04843browse

php uses post to dynamically select avatars and js events to dynamically change avatars, postjs

<html>
<head>
    <meta http-equit="Content-type" content="text/html" charset="utf-8">
    <title>动态选择头像logo</title>
    <script type="text/javascript">
        <span>function</span><span> check(obj){
            $(</span>"showImage").src = obj.<span>value;
        }
        </span><span>function</span><span> $(obj){
            </span><span>return</span> document.<span>getElementById(obj);
        }
    </span></script>
</head>
<body>
<?<span>php
    </span><span>echo</span> '<img src="'.<span>$_POST</span>['mylogo'].'">;
</span>?>
    <img id="showImage" src="1.png" style="padding:10px;">
    <br>
    <form action="" method="post">
        <select name="mylogo" id="id_logo" onchange="check(this)">
            <option value="1.png">1.png</option>
            <option value="2.png">2.png</option>
        </select>
        <input type="submit" name="submit" title=""/>
    </form>
</body>
</html>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1051324.htmlTechArticlephp uses post to dynamically select avatars and js events to dynamically change avatars, postjs htmlhead meta http-equit="Content-type " content="text/html" charset="utf-8" title dynamically selects avatar logo/title...
Statement:
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