DarkWater
Members-
Posts
6,173 -
Joined
-
Last visited
Never
Everything posted by DarkWater
-
What OS are you running? It's very strange that this isn't working for you, because I just tried pgrep from PHP and it worked just fine. Maybe it's some php.ini setting that I don't know about, but idk. Do you have access to your php.ini?
-
@CV: That's why he included the document path... I'd suggest checking out realpath() to fix up those ../'s and stuff.
-
Wow, that was very...brusque. =P Nice way to put it though.
-
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
DarkWater replied to windjohn's topic in PHP Coding Help
{ } are curly braces. ( ) are parentheses. [ ] are brackets. Just letting you know. -
Can you use < and >= in a SQL WHERE statement?
DarkWater replied to kpetsche20's topic in MySQL Help
Absolutely. My suggestion for dates, though, would be to have it set as a DATETIME column and use the MySQL NOW() function. -
Lol. Btw, I saw your long post...I was going to pull a nice tl;dr, but I actually decided to read it. xD
-
Are the shell scripts really in the same folder as your PHP script? You have ./ in front of the path, which would mean that it HAS to be in the same folder or deeper. If it's in like, ~/bin, then use a full path or hope that you have nothing else with the same name in your PATH.
-
Don't capitalize your HTML tags! XHTML Strict would spit out an error for every single HTML tag on that page. Make them lowercase. Also, I'm not too sure I like the text on the right in the banner. If you insist on keeping it, however, it should be ειρηνική (note the accent). =P I speak Greek, obviously. Btw, it looks like a nice piece of land. How far away from Athens is Lesvos?
-
Check out MySQL's COUNT() function and GROUP BY clause. You should be able to piece it together.
-
Kindly dont spoil my site but try to find flaws and report to me
DarkWater replied to om's topic in Beta Test Your Stuff!
1) The design is really, really...abysmal. I thought it was a joke at first. 2) I could not decipher the point of the website at all. It was too cluttered and just unappealing. 3) Good luck making money. You might need it. -
Authors don't get a sexy badge. =( And we can't set our main group to Authors either. The radio button is disabled. Was that intentional?
-
[SOLVED] Get arguments in include function.
DarkWater replied to BillyBoB's topic in PHP Coding Help
Moral of the story: You CANNOT send true GET variables to a locally included file because you aren't actually using an HTTP GET request for it, therefore Apache won't parse a request and send any variables to PHP. Just set the variables before you include the file. -
I hope you realize that view-source: is just a browser thing to make lives easier, correct?
-
Whenever I log into the main site, it just gives me a white screen on any page I visit. Once I remove the cookie/restart my browser, the site works.
-
What Really Is The Point In A Callback Function?
DarkWater replied to glenelkins's topic in PHP Coding Help
That point made no sense. You just called the function multiple times with different values; you didn't pass it all in at once. Let's say you were writing for an MVC router and you needed to send extra parameters off to the proper method. You'd need call_user_func_array(). -
Web pages don't magically have viruses...you actually have to download something. That something could be an ActiveX control (looking at you, IE), so it SEEMS like you're not DLing anything, but you are.
-
Good luck. =D
-
Then don't use OOP? I honestly don't think that there's a real memory hit in storing an int referenced by a class or just a random int in the main scope of the script...
-
What Really Is The Point In A Callback Function?
DarkWater replied to glenelkins's topic in PHP Coding Help
Now, how do you plan on calling that function with multiple parameters that you might not know ahead of time? I guess you could compile a string together and eval() it, but it's slow. Very slow. And error-prone. call_user_func_array() does the job just fine though. Also, some functions like sort() and it's relatives and even preg_replace_callback() need callbacks for good reasons. -
1) Don't ever store a list of values separated with a delimiter in a single column, or I'll go to your house and create a hostage situation. (Being creative today. ) 2) I had something like this set up on a little user system I made one day out of boredom. You have to do a join with the users table: SELECT u.* FROM friends AS f INNER JOIN users AS u ON f.friend_id = u.user_id WHERE f.user_id = '{$_SESSION['user_id']}' AND f.accepted = 1 That query fetches any given user's friends. It was copied and pasted from my PHP file, so I know it works.
-
I guess a spot of tea-bagging is out of the question then... Lmfao.
-
That was written 7 years ago; the code looks pretty deprecated. Anyway, what kind of validation do you mean? Actually checking if it's online, or making sure it's just a valid URL.
-
[SOLVED] enter url then click to open in new window
DarkWater replied to emma225's topic in PHP Coding Help
You should just do this in Javascript. <form name="redirect" onsubmit="window.location = document.getElementById('redirect_link').value; return false;" action="" method=""> <input id="redirect_link" type="text" /> <input type="submit" value="Go!" /> </form> -
A User object has nothing to do with a database; queries should not be delegated to the User object. You'd probably want a data mapper that creates new User objects. Anyway, I'd suggest reading up on design patterns.