Jump to content

Simple question looking for a quick simple solution - if statement not executing


jdock1

Recommended Posts

This is pissing me off. Im trying to make it so when a button is clicked it displays phpinfo.

 

I dont understand what Im doing wrong here. It should be working. First, heres my code.

 

<?php
$phpinf= phpinfo();
if (@$_GET['submit'] == "phpinfo")
{
echo "$phpinf";
}
?>

 

At first I didn't create a variable for it, and had simply

echo "phpinfo()"

 

That worked, however instead of displaying the actual php info function it just echoed the text phpinfo(), lol.

 

So I figured this would solve that problem. But no, of course, php has to screw me again!

 

Im sure there is a simple solution to this please help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.