Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I've recently been working on a fairly complicated game. I've stored information with local storage, but that allows the player to edit it, and does not transfer from computer to computer. The two scripts run on a single server, and I use the following to ping the php server:
function initiateLoginSequence() { var isnewplayer=prompt("Hello! Are you new?(Y/N)"); if(isnewplayer.equalsIgnoreCase("N")) { var username = prompt("Enter username."); var password = prompt("Enter Password."); //parsing code goes here later. } else { var username = prompt("Enter a username. This will be used for future logins."); var password = prompt("Enter a password. This will be used for future logins.","*"); var req = new XMLHttpRequest(); req.open('POST', 'http://69.144.34.106/Scores.php', true); req.send("returning=false"+"&name="+username+"&pw="+password+"&level="+lvl+"&save=true"); req.send(); } }
I then process the results with this:
php $returning=_POST["returning"]; $save=_POST["save"] $password=_POST["pw"]; $username=_POST["name"]; $score=_POST["lvl"]; $connection=mysql_connect("localhost:3306","****","*****"); if($returning=="false" && $save=="true") { mysql_select_db("userdata",$connection); $sqlcmd = "CREATE TABLE ".$username."( Username varchar(".$username.") Password varchar(".$password.") Score varchar(".$score.") )"; mysql_query($sqlcmd); } else if($save==false) { $sqlcmd="SELECT * FROM userdata" $result = mysql_query($sqlcmd); while($row=mysql_fetch_array($result)) { if($row['Username']==$username && $row['Password']) { echo row['Score']; } } } else REPLY 0 views 0 likes 0 shares Facebook Twitter Linked In WhatsApp
Several points:
PHP error handling is famous for being both bad (e.g. the default action for most unusual conditions is to continue regardless and issue a warning, which possibly goes to the client browser, or might be ignored as well), AND complicated. Once you fully understand PHP error handling, you can write an error handler which carries out appropriate actions in all cases.
In my opinion:
Security:
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.