BradMeyer Posted December 3, 2012 Share Posted December 3, 2012 (edited) How can I take the result of this link (true or false) and be able to use it as an embedded image? https://minecraft.ne...p?user=username For example, if the result in the browser of the link above is false, can we use a script to display an image?... something like this: <img src="thescript.php?something=somestuffidontknow"> It should show one image for false, and another image for true. I am not a web developer or anything, so if this is possible and isn't too much work I would really appreciate if someone could write the script for me. If it's too much work, I am more than willing to donate for a coffee or beer. Why? I run a game server & website for the game Minecraft and would like an easy visual way of showing my staff if a Minecraft player has a legit account when applying to our website. Edited December 3, 2012 by BradMeyer Quote Link to comment https://forums.phpfreaks.com/topic/271518-how-to-use-php-script-to-turn-string-into-image/ Share on other sites More sharing options...
nodirtyrockstar Posted December 3, 2012 Share Posted December 3, 2012 I am not sure what is meant by "the result of this link." That said, it is not too hard to evaluate a boolean and render a variable image based on the results. Still, if you want help in here you are going to need to be more specific. Someone could write you a function, but they're going to need to see some code. Quote Link to comment https://forums.phpfreaks.com/topic/271518-how-to-use-php-script-to-turn-string-into-image/#findComment-1397083 Share on other sites More sharing options...
jcbones Posted December 3, 2012 Share Posted December 3, 2012 Make you two images, one as a check, and another as an x. Then retrieve the results of your minecraft check, as they have made it easy. if the contents return true, then display the check, and if it is false, display the x. <?php if(isset($_GET['username'])) { if(file_get_contents('https://minecraft.net/haspaid.jsp?user=' . $_GET['username']) == 'true') { echo '<img src="check.png">'; } else { echo '<img src="x.png">'; } } Quote Link to comment https://forums.phpfreaks.com/topic/271518-how-to-use-php-script-to-turn-string-into-image/#findComment-1397240 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.