Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. It's called the "login game". You go into a computer lab and log in with as many computers as possible (that won't look suspicious or weird....)
  2. This will give you all the posted values and names. foreach($_POST as $key => $val) { echo "key => " . $key . " val => " . $val; }
  3. Edit: Nevermind... :-X
  4. Not with PHP. You would have to use AJAX to make a server call without a page refresh.
  5. Why can't you use the aggregate SUM function on amount?
  6. You need to setup a new user with privileges - new user
  7. Yes you can, have you tried it? Apparently not.
  8. Maq

    <?php vs <?

    I'm going to start using those tags in all of my examples just to bother you now
  9. W3 is for someone who knows absolutely nothing about PHP. You should just try and create your own website. Look at what other people have or tutorials and try to develop and integrate it into yours. You can also learn a lot by just participating on phpfreaks.
  10. Put this in the while loop: print ("$id"); print ("$reporteduser"); print ("$report"); print ("$reporter"); print ("$implevel"); print ("$status"); print ("");
  11. Aren't these the same exact thing? It depends how your teacher wanted you to do this. Maybe they were trying to teach you a certain concept with an easy assignment. What was the point of this exercise?
  12. Can we see the relevant code?
  13. It's not about coding style or preference. The way the language is built forces you to use a certain style/standard. It's good to be consistent anyway. PHP is a web language, and with many web languages they are very loosely typed and aren't very strict about, well almost everything. This is one of the reasons PHP is so easy to learn, and the reason that you can code any way you want. The reason for Java and C++ being so strict is because it eliminates mistakes, run-time errors, etc... Once PHP turns into a primarily OOP language, it will be stronger typed, coding standards and practices you should follow, and just overall consistent. Issues like, whether or not to declare variables, I guess are relative to the situation. For example, building a simple website, they don't matter at all. But when developing medical software for hospitals, it's very important to declare and instantiate variables, there are plenty of examples (not just in Java) where people have died or have been injured due to improper programming practices. But then again, these are two different horses. It's hard to compare languages, especially something like Java vs PHP. All I can say is learn multiple languages, they will all teach you something new and helpful.
  14. I don't know. Could we see some code?
  15. I thought you said you were using OOP... Your class should contain the methods. To get to those methods you should create an object of that class. Is that how you're doing it? Or am I misunderstanding the question?
  16. I think when he said java he was referring to J2EE.
  17. Although it would work, it would also kill the script if file_get_contents() doesn't return anything. Which is probably not what the OP wants.
  18. Seems pretty mindless to me. Problem is that it's commission so you have to work harder for more money, but you do get to make your own hours...
  19. If you want to get into PHP editors, go here!: Which PHP-Editor do you think is the best?
  20. Exactly, you can clearly see the color change of the text. What are you using BTW?
  21. @OP Maybe you should take a look at, classes. Seems like you are trying to do the equivalent of an accessor method in Java with get and set methods. What's the general goal here?
  22. For starters you have an extra '}'. Why are you having a class in another class? You should separate them and "extend" the first class to the second.
  23. Before examining your code, what exactly are the "line errors" saying?
  24. Yeah I made my own class. It's got all the basics with some error checking. You're welcome to use it. $host="***"; $user_name="***"; $password="***"; $db="***"; define("DB",$db); define("HOST",$host); define("USERNAME",$user_name); define("PASSWORD",$password); class db_works { var $Query_ID=0; var $connection=0; function connect() { if($this->connection==0) { $this->connection=mysql_connect(HOST,USERNAME,PASSWORD) or die("Database Error ".mysql_error()); $SelectResult = mysql_select_db(DB, $this->connection) or die("Could not Select Database".mysql_error()); } else { echo "Database Connection Could not be Established"; die(); } } function query($sql) { $this->Query_ID=mysql_query($sql,$this->connection); if(!$this->Query_ID) { $errorstr = mysql_error(); if (stripos($errorstr, "Duplicate") === false) { echo "Query Failed " . $errorstr . "\n"; } } else return $this->Query_ID; } function connection_close() { mysql_close($this->connection); } } ?>
×
×
  • 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.