Jump to content

absorr

Members
  • Posts

    53
  • Joined

  • Last visited

Posts posted by absorr

  1. <!DOCTYPE html><html>    <head>	    <title>Nova Skin Lite</title>	    <script type="text/javascript">		    function steve() {			    document.getElementById('edit').innerHTML = '<iframe src=\"http://minecraft.novaskin.me/lite#http://www.minecraft.net/images/char.png\" width=\"100%\" height=\"800\">ERROR CODE: I ######ed up</iframe>';		    }		    function userSkin() {  var user = document.skin.user.value			    document.getElementById('edit').innerHTML = '<iframe src=\"http://minecraft.novaskin.me/lite#'user'\" width=\"100%\" height=\"800\">ERROR CODE: I ######ed up</iframe>';		    }	    </script>    </head>    <body>	    <div id="edit"><iframe src="http://minecraft.novaskin.me/lite#http://www.minecraft.net/images/char.png" width="100%" height="90%">ERROR CODE: I ######ed up</iframe></div>	    <form name="skin">		    Load User Skin: <input type="text" name="user" />		    <input type="button" value="Submit" onClick="javascript:userSkin();" />		    <input type="button" value="Steve (default)" onClick="javascript:steve();" />	    </form>    </body></html>

    When I click the button (either one) it does not work. In the chrome JS console it says "Uncaught ReferenceError: steve is not defined"

  2. I am making a Windows 8 app using Visual Basic. I'm using the VBScript forum because its pretty much the same thing but one is for web and I love W3Schools Forums. I need to write into an already existing .jar file. I know in Java this is done by unpacking adding and packing but the API methods for it is not in VB. How do I do it?Oh also would it be possible to do this using VBScript in a Windows 8 HTML/JS app?

  3. So I just have to align it all into one line for each writing? Wait hold on I spotted something, I forgot to end some functions with }. I'm going to try these one at a time and see If I can fix it. Lemme see if it works.
    Ok so it did not work. Chrome highlights all of the parts in the script part where it says "area". It says "Uncaught Syntax Error: Unexpected Token ILLEGAL". and also on the buttons for activating, it says the functions don't exist
  4. What exactly happens, what are the errors? I'll give you a hint: it doesn't think anything, it only does what you tell it to. One problem is that you're using multi-line strings, and Javascript doesn't support those. A string in Javascript ends at the end of the line.
    So I just have to align it all into one line for each writing? Wait hold on I spotted something, I forgot to end some functions with }. I'm going to try these one at a time and see If I can fix it. Lemme see if it works.
  5. I need help debugging this because I can't find the problem. When I click the buttons that are supposed to make the script write in the correct code, it doesn't. The Google Chrome debuger is coming up with weird stuff and I don't understand why it thinks this.

    <html><head><title>SimpServ - Simple Server Managment Dashboard</title><link rel="shortcut icon" href="simpservicon.png"><script language="javascript">function playman(){document.getElementById("area").innerHTML = "<b>Player Managment</b><br><form action=\"methods/playermain.php\" method=\"post\">Player Name: <input type=\"text\" name=\"name\" /><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name="pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\"><input type=\"submit\" value=\"Get Info\"/></form>";}function plugman(){document.getElementById("area").innerHTML = "<b>Plugin Managment</b><br><a onclick=\"on()\">Turn On Plugin</a><br><a onclick=\"off()\">Turn Off Plugin</a><br><a onclick=\"upload()\">Upload Plugin</a><br><p id=\"area\"></p>";function off(){document.getElementById("area").innerHTML = "<form action=\"methods/disablePlugin.php\" method=\"post\">Plugin: <input type=\"text\" name=\"name\" /><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\"><br><input type=\"submit\" /></form>";}function on(){document.getElementById("area").innerHTML = "<form action=\"methods/enablePlugin.php\" method=\"post\"><input type="hidden" value="absorr" name="user"><input type="hidden" value="homestar" name="pass"><input type="hidden" value="salty goodness" name="salt"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\">Plugin: <input type=\"text\" name=\"name\" /><br><input type=\"submit\" /></form>";}function upload(){document.getElementById("area").innerHTML = "<form action=\"methods/upload.php\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\"><input type=\"file\" name=\"file\" id=\"file\" /><input type=\"submit\" name=\"submit\" value=\"Submit\" /></form>";}function servman(){document.getElementById("area").innerHTML = "<b>Server Managment</b><br><a onclick=\"chatname()\">Chat With Name</a><br><a onclick=\"send()\">Broadcast Message</a><br><p id=\"area\"></p>";function servinfo(){document.getElementById("area").innerHTML = "<b>Server Managment</b><br><a onclick=\"read()\">Read File</a><br><a onClick=\"banIPlist()\">Banned IPs</a><br><a onClick=\"banlist()\">Banned Players</a><br><a onClick=\"loglist()\">Recent Connections</a><br><a onClick=\"chatlist()\">Recent Chats</a><br><a onClick=\"worldlist()\">List Worlds</a><br><p id=\"area\"></p>";function chatname(){document.getElementById("area").innerHTML = "<form action=\"methods/broadcastWithName.php\" method=\"post\"><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\">Name: <input type=\"text\" name=\"name\" /><br>Message:<br> <TEXTAREA NAME=\"msg\" ROWS=\"10\" WRAP=\"hard\"></TEXTAREA><br><input type=\"submit\" /></form>";}function send(){document.getElementById("area").innerHTML = "<form action=\"methods/broadcastWithName.php\" method=\"post\"><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\">Message:<br> <TEXTAREA NAME=\"msg\" ROWS=\"10\" WRAP=\"hard\"></TEXTAREA><br><input type=\"submit\" /></form>";function cust(){document.getElementById("area").innerHTML = "<p>You have no custom methods or other functions set. E-mail us at absorr@live.com and we will put it in for you. Custom JSONAPI methods can be created in the config file in your plugins folder. You may add things from other plugins too here.</p>";}</script></head><body bgcolor="#F0F0F0"><center><table height="10%" width="100%"><tr><td width="300"><img src="http://i499.photobucket.com/albums/rr358/Absorr/simpservbanneral.png" height="150"></font></td><td><b>TechCraft</b> git-Bukkit-1.1-R4-b1938jnks (MC: 1.1)  Players Online: 0/20</td></tr></table><table width="100%" height="90%"><tr><th align="center" bgcolor="#C8C8C8" width="30%" height="30">JSONAPI</th><th align="center" bgcolor="#C8C8C8" width="70%" height="30">Dynmap</th></tr><tr><td bgcolor="#B8B8B8" valign="top"><forum><input type="button" value="Player Managment" onClick="playman()" /><input type="button" value="Plugin Managment" onClick="plugman()" /><input type="button" value="Server Managment" onClick="servman()" /><input type="button" value="Server Information" onClick="servinfo()" /><input type="button" value="Custom Methods" onClick="cust()" /></form><p id="area"></p></td><td bgcolor="#B8B8B8"><iframe src="http://174.101.159.155:8123" width="100%" height="100%">EPIC FAILURE</iframe></td></tr></table><table width="100%" height="500"><tr><td width="50%" height="100%"><iframe src="methods/getLatestConsoleLogs.php" width="100%" height="100%">EPIC FAILURE</iframe></td><td><iframe src="advanced.html" width="100%" height="100%">EPIC FAILURE</iframe></td></tr><tr><td height="36"><iframe src="runit.html" width="100%" height="35">EPIC FAILURE</iframe></td><td>Made by Will Stephenson. Copyright Absorr Design (c) 2012. Thanks to JSONAPI and Dynmap and Bukkit</table></center></body></html>

    Note the copyright at the bottom. Don't steal (not saying that I don't trust you guys, I'm saying this is the internet).

  6. Perhaps you could use APIs from external sites like Google or Facebook? Lots of sites allow you to login through Facebook through their API. Or you could get a host that uses cPanel to set a password onto a directory. I do that with my Troop's site.

  7. Did you try with IE9? I'm pretty sure, but I might be wrong, that HTML 5 was not compatible in 8. It for sure is in IE9. Also from the looks at all of that code it does seem like it would be simpler to use an iframe seeing that all you would have to do is

    <iframe src="URL HERE">MESSAGE FOR IF IT DOES NOT WORK HERE</iframe>

    with other optional attributes like width and height

  8. Technically, you never really need to start a new line in code. That's only to improve readability. You can use \n or \r\n to put a new line. The only characters you really need to escape are the type of quotation marks used around the string that has the code in it. I don't really recommend generating PHP, though. Why do you need to do that? The only time I ever did that was to create a config file with variables in it upon installation. Though I've used different methods for that too.
    Thank you! The reason is for that server manager that I've been posting for help on recently. I keep having to manually put in my clients' information in and I want to make it generate the files based on the information they put into the form field. That just gave me the last thing i needed to make that work!
  9. I know that you can use file_put_contents to write a file and that you can use \ to cancel things, but though If I were to generate a PHP file through this (unless there is a more efficient way) what would I need to cancel and also how would I make it start a new line?

    • Like 1
  10. Read the <input /> element's page from top to bottom (OK, OK... the attributes part I mean) without skipping anything, and you'll see it. Alternatively, you could use the <button /> element with an <img /> in it, but keep in mind this doesn't work in IE versions prior to IE8.
    That did not work. I click on the image button (using chrome. also tried on IE9) and it does nothing. I used the button tag because looking at the input it was an image not an image button.Here's the code
    <?phprequire('JSONAPI.php'); // get this file at: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php$api = new JSONAPI(CENSORED, CENSORED, CENSORED, CENSORED, CENSORED);echo "<form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"2\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"4\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"6\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"8\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"10\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"12\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"14\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"16\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"18\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum><form action=\"setPlayerHealth.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"hidden\" name=\"heart\" value=\"20\" /><button type=\"button\"><img src=\"http://www.minecraftwiki.net/images/thumb/a/a7/Heart.svg/9px-Heart.svg.png\"></button></forum>";echo "<br><br><form action=\"ban.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"submit\" value=\"Ban\"/></form>";echo "<form action=\"unban.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"submit\" value=\"Unban\"/></form>";echo "<form action=\"banIP.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"submit\" value=\"Ban IP\"/></form>";echo "<form action=\"unbanIP.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"submit\" value=\"UnbanIP\"/></form>";echo "<form action=\"opPlayer.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"submit\" value=\"Make Op\"/></form>";echo "<form action=\"unopPlayer.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" /><input type=\"submit\" value=\"Unop\"/></form>";echo "<form action=\"kickPlayer.php\" method=\"post\"><input type=\"hidden\" name=\"name\" value=\"{$_POST['name']}\" />Reason: <input type=\"text\" name=\"msg\" /><input type=\"submit\" value=\"Kick\"/></form>";var_dump($api->call("getPlayer", array($_POST["name"])));?>

  11. So that I don't have to start a new topic, I'll just tell you my related problem. I have 10 hearts next to each other to show the player's health level. I want to make it so that if you were to click on the last heart, it will, using PHP, carry on the player name with the health level 20 to the PHP file. Very similar to my above problem only I want it when you click a picture instead of pressing a button to submit the forum. Now that I think about it, this probably fits under the HTML category better. Oh well, it does include PHP. So how do I make this happen?

  12. Sorry... we're touchy about terminology, because when dealing with complex problems, it's often the use of wrong/misleading terminology that leads us into providing useless/irrelevant solutions => proper terminology = quick, useful, relevant and proper solutions. See, that's another term that may lead many people into giving you more "advanced" kind of responses than what you're really asking for. The term is "HTML forms". "Forums" are whole large applications, such as the one we're writing in right now. The only reason I'm able to detect that's not what you mean is that we are in a forum... if you were asking this in a mailing list, I might have fallen for the trap and ask you something like "If you've made forums, you should know this already...". You can use PHP to generate <input type="hidden" /> fields that contain the previous information in their name and value attributes, or you could use the GET method while setting the form's action to the current URL (thus embedding the previous data into the URL), or you could start a session after the first call. Each approach has its benefits and drawbacks: 1. hidden inputs are not preserved in case the browser is closed (i.e. closing the browser = start the whole form over again), but if the user decided to take a break in the middle of the form, he could leave the browser open and continue when ready. Also, each next page loads slower since the old data is downloaded in addition to the new form.2. GET method with action setting is not preserved (as in hidden inputs), but if the user is wise enough to copy the current page's URL before closing their browser, and paste it back later, they can resume from where they left. Data in the URL is generally limited though, so it should be used for stuff other than large text boxes, such as the one for this post. Page will generally load just as fast on all pages.3. A session is saved at each page, so users can resume even if they don't copy&paste the URL, storage size per user is not an issue, and requests don't grow as you advance pages. If they stop filling in the form though, they must return within a time limit that you can adjust, but must have one non the less. The longer time you specify, the higher the risk that your web server will run out of space (because it is where the session data of each user is stored, until you're actually ready to submit it to your database or whatever). A mixture of these would be ideal, but as far as simplicity goes - hidden inputs all the way.
    YES! A hidden input! THANK YOU! That was exactly what I was looking for! THANK YOU THANK YOU THANK YOU! Now to see if works.... EDIT It does!
  13. You missed the point. You have to store the result of the function call into a variable like we already showed you earlier:
    $array = $api->call("getPlayer", array($_POST["name"]))

    Sorry, I had it changed to the var dump because of how it didn't work and I forgot to change back when testing your answer. it gave me the table but it didn't show the results. Here's the table: Property Valueresult successsource getLatestConsoleLogssuccess Array and here is getLatestConsoleLogs.php
    <?phprequire('JSONAPI.php'); // get this file at: https://github.com/alecgorge/jsonapi/raw/master/sdk/php/JSONAPI.php$api = new JSONAPI([color=#000000][size=2]CENSORED[/size][/color][color=#666600][size=2],[/size][/color][color=#000000][size=2] CENSORED[/size][/color][color=#666600][size=2],[/size][/color][color=#000000][size=2] CENSORED[/size][/color][color=#666600][size=2],[/size][/color][color=#000000][size=2] CENSORED[/size][/color][color=#666600][size=2],[/size][/color][color=#000000][size=2] CENSORED[/size][/color]);$array = $api->call("getLatestConsoleLogs");echo '<table>';echo '<tbody>';foreach($array as $property=>$value) {  echo '<tr>';  echo "<td>$property</td><td>$value</td>";  echo '</tr>';}echo '</tbody>';echo '<thead><tr><th>Property</th><th>Value</th></tr></thead>';echo '</table>';?>

    and birbal's didn't give me anything

  14. PHP can't act upon clicks. But forms can be submitted (see the forms part of the HTML tutorial), and PHP can process the data from (see the forms part of the PHP tutorial).
    I know that already, how else do you think it got the information in the first place? I have made tons pf HTML forums that link to PHP but I want to know how I can make it so that after that 1st one, previous inputs are recycled in the next part. The way I was it the easiest way would seem to be a forum in the PHP file that will activate a part in the same PHP file so that it never loses the information. How do I do this?
  15. PHP can't do that. That's what Javascript is for.
    Well I want it so that when you insert a player's name and after it gives you information about that player that you can do things like ban, kick, give an item, etc, but the function requires a name input and I don't want to have to put the name in all over again. I need some way that the received name is carried throughout.
  16. I know that in JavaScript you use onClick="functionName" but how do you do it in a php file? I have HTML echoed in a php and I want it so that when the button is pressed in the HTML that is echoed it will start some kind of function. How do I do that?

    • Like 1
×
×
  • Create New...