Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
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....)
-
This will give you all the posted values and names. foreach($_POST as $key => $val) { echo "key => " . $key . " val => " . $val; }
-
Edit: Nevermind... :-X
-
Not with PHP. You would have to use AJAX to make a server call without a page refresh.
-
Why can't you use the aggregate SUM function on amount?
-
Need to access MySQL database from outside. How to?
Maq replied to lopes_andre's topic in MySQL Help
You need to setup a new user with privileges - new user -
[SOLVED] Can You Put an include in an if else statement?
Maq replied to limitphp's topic in PHP Coding Help
Yes you can, have you tried it? Apparently not. -
I'm going to start using those tags in all of my examples just to bother you now
-
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.
-
[SOLVED] how do i make mysql show all rows i select ?
Maq replied to jamesxg1's topic in PHP Coding Help
Put this in the while loop: print ("$id"); print ("$reporteduser"); print ("$report"); print ("$reporter"); print ("$implevel"); print ("$status"); print (""); -
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?
-
Can we see the relevant code?
-
[SOLVED] Is there a command to make echo happen at different times?
Maq replied to PGTibs's topic in PHP Coding Help
Try sleep(). -
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.
-
How's my script working when I forgot to write part of the code? lol
Maq replied to leefentress's topic in PHP Coding Help
I don't know. Could we see some code? -
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?
-
I think when he said java he was referring to J2EE.
-
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.
-
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...
-
If you want to get into PHP editors, go here!: Which PHP-Editor do you think is the best?
-
Exactly, you can clearly see the color change of the text. What are you using BTW?
-
@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?
-
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.
-
Before examining your code, what exactly are the "line errors" saying?
-
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); } } ?>