Search the Community
Showing results for tags 'first'.
-
So here is the Class: <?php /* * Game Name - Copyright 2013-2014; * This page will be * and open the template in the editor. */ /** * Author of Training * * @author Lingo Muwahaha */ class trainSloppyCheeseMen{ // Set Class public $type; // Unit Type public $amt; // Amount per Unit public $turns; // How much time will it take public $id; // Get user id public function doTrainSloppyCheeseMen(){ /* @var $type type */ if($type=="miners"){ $player = R::load('user', $id); echo $this->id; $new_price = bcmul($amt, 6000); // Create overall price by multiplication } } } ?> And here is the main page that calls the class: <?php require_once("config.php"); include("classes/trainSloppyCheeseMen.class.php"); // Get new Class $trainSloppyCheeseMen = new trainSloppyCheeseMen(); // Get train class $sloppyCheeseLock = new sloppyCheeseLock(); // Get sql inject scrubber. $trainSloppyCheeseMen->type = "miners"; // Type is Miner $sloppyID = 22; die($sloppyID); /* @var $sloppyProtect type */ $sloppyCheeseLock->vulnerable = $_POST['miner_amt']; $sloppyProtect = $sloppyCheeseLock->sloppyUniverseProtect(); $trainSloppyCheeseMen->amt = $sloppyProtect;// Amount to Train $trainSloppyCheeseMen->turns = 1; // How many turns to train these buggers $trainSloppyCheeseMen->plasma = $player->plasma; $trainSloppyCheeseMen->id = $sloppyID; $trainSloppyCheeseMen->doTrainSloppyCheeseMen(); ?> Ok when I try to die the $sloppyID nothing is outputed? This makes no Sense. Am I doing something wrong? I know this is my first time working with classes. If you need the config.php file let me know. Thanks, Lingo
-
Hello. I've just finished building my first website, and I'd appreciate some critique. Specifically, I'd like to get some feedback on the code (you can find it on the site, under the Source tab). I do realize it's pretty messy, and of poor quality (and not supported by Explorer), and pretty broken too, but I'd like to hear your opinions nonetheless. Here it is: http://www.nocommontheme.co.nf/ I also have a couple question, if you don't mind: On average, how long would it take a professional web developer/programmer to build a website similar to mine? It took me around 3 weeks; is that too long? Generally, how should I structure my website? As in, what should go in the index, and how do I distribute/divide/link the files? In what areas do I need to improve the most? Organization? Based solely on the code I've wrote, would you call me a beginner, or an intermediate? Sorry if these questions sound a little childish, and thanks in advance for any feedback.