开发者

PHP show image if post result equals

开发者 https://www.devze.com 2022-12-31 00:21 出处:网络
I have a form that posts to a page. I want to display an image if the value of the item posted equals \"paypal\".

I have a form that posts to a page. I want to display an image if the value of the item posted equals "paypal".

I need to write something that says;

if $_POST['method'] equals "paypal" then show paypal.gif

if $_POST['method'] equals "mastercard" then show mastercard.gif

开发者_JAVA技巧

I hope I made a bit of sense, new to php trying to learn the best I can


If the methods have the same values as the file names, you can use this:

<img src="<?=$_POST['method']?>.gif" />
0

精彩评论

暂无评论...
验证码 换一张
取 消