Jump to content

Help with my code


xJordan

Recommended Posts

My code is,

<?php
function getreg($id) {return file_get_contents('http://arcbots.com/userinfo.php?id='.$id);}
function getID($reg) {return file_get_contents('http://arcbots.com/userinfo.php?reg='.$reg);}
function lastseen($user) {return file_get_contents('http://arcbots.com/userinfo.php?lastseen='.$user);}
function getdisplayname($user) {return file_get_contents('http://arcbots.com/userinfo.php?displayname='.$user);}
function gethomepage($user) {return file_get_contents('http://arcbots.com/userinfo.php?homepage='.$user);}
function getavatar($user) {return file_get_contents('http://arcbots.com/userinfo.php?avatar='.$user);}
function getuserinfo($user) {return file_get_contents('http://arcbots.com/userinfo.php?info='.$user);}
?>
<center>This will search a users ID and return the Registered name</center>
<html>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="css/custom.css" />
<center><form method="post" />
    <input type="text" name="search">
    <input type="submit" value="get regname" name="submit">
</form></center>
<?php
    function display()
    {
        echo getReg($_POST['search']);
    }
    if(isset($_POST["search"]))
    {
       display();
    } 
    ?>
</html>

I have two quick questions: 1 - How would I output the returned information it gives me in a popup window.

side note: I'd like to keep the original output on the page just incase their browser blocks the popup.

 

2 - How would I create a usable dropdown menu that can select what function they want to use

 

Link to comment
Share on other sites

Sample of function selection menu

<?php
function aaa() {echo "You selected function 'aaa'<hr>";}
function bbb() {echo "You selected function 'bbb'<hr>";}
function ccc() {echo "You selected function 'ccc'<hr>";}

if (isset($_GET['choice'])) {
    $func = $_GET['choice'];
    // call chosen function
    $func();
}
?>


<form>
Choose a function 
<select name="choice">
<option value="aaa">a</option>
<option value="bbb">b</option>
<option value="ccc">c</option>
</select>
<br><br>
<input type="submit" value="Submit" name="btnSub">
</form>
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.