Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Did you actually read what I just posted?
-
It does already show the IP address, but there is no way it can display the mac address. The only reason why the server knows the IP address of the user is because the user tells the server. The user needs to do that so the server knows where to send the requested data.
-
You'd do it like this: <?php $result = mysql_query("SELECT * FROM users WHERE username='{$username}' LIMIT 1"); if(mysql_num_rows($result) == 1) { echo "Username is taken"; } else { echo "Username is available"; } ?>
-
Did you restart apache?
-
You can convert &'s to &'s using htmlentities(). How exactly does the ampersands break your script?
-
Yeah, my doctor says I need to gain weight too...
-
. [attachment deleted by admin]
-
Teach Yourself Programming in Ten Years
-
xdebug has xdebug_get_function_stack(). That might be able to do it. http://xdebug.org/docs/stack_trace
-
I haven't read any PHP book, so I can't really recommend one. You could always try the manual: http://php.net/oop5 There are also some tutorials on the main site.
-
AFAIK you can't. If you want to enforce visibility, then you'll have to declare it using e.g. public $whatever;.
-
It isn't particularly complicated. Feel free to ask if there is anything you don't understand in the code I posted though
-
You could do something like this: <?php class Mailer { function send($to, $from, $subject, $body) { $headers = "From: {$from}\r\n"; $headers .= 'X-Mailer: PHP/'.phpversion(); return mail($to, $subject, $body, $headers); } } class FaultReport extends Mailer { function __construct($error_id, $error_msg, $file, $line) { $time = date('r'); $body = <<<EOF Error [{$error_id]}: {$error_msg} in {$file} on line {$line} Time: {$time} EOF; $this->send("[email protected]", "[email protected]", "Error [{$error_id}]", $body); } } class AbuseReport extends Mailer { function __construct($reason, $reporter_uid, $offender_uid) { $body = <<<EOF User UID {$reporter_uid} reported user UID {$offender_uid} with the following reason: {$reason} EOF; $this->send("[email protected]", "[email protected]", "Abuse report", $body); } } new FaultReport(38, "Test Error", __FILE__, __LINE__); new AbuseReport("Just testing...", 5, 108); ?> Just call the class you want for the type of mail that should be sent.
-
I don't seem to be able to PM people!
Daniel0 replied to Xager's topic in PHPFreaks.com Website Feedback
You require a minimum of 10 posts (or maybe it's 50, I can't remember). It's protection against spammers. It has helped quite a lot (so I hear at least). -
Parameter 3 needs to be a file handle. Something which is created by functions like fopen().
-
Check your spam folder. Also, are you sending to a hotmail? There are often problems with mail() and hotmail.
-
Depends. If you need to decrypt it, then you'll need mcrypt. MD5 or SHA1 for one-way encryption. base64_encode and base64_decode for "not secure" encryption (it's not really encryption though).
-
Duplicate content? To who/what? A search engine? That shouldn't be a problem.
-
I'd say that "funny errors" should be restricted to very rare errors. Sort of like an easter egg. Funny errors for common error such as 404 would be stupid IMO. Edit: Voted "Professional".
-
Isn't that what I just did? o_O I think you missed line 3.
-
<?php $timestamp = 140820071211; $unix_timestamp = mktime(substr($timestamp,8,2), substr($timestamp,10,2), 0, substr($timestamp,2,2), substr($timestamp,0,2), substr($timestamp,4,4)); echo date('r', $unix_timestamp); ?> date() only takes UNIX timestamps.
-
... and be less accessible. And why would that be? Most web users has flash, if they do not have it, they will have to get it at some point. AFAIK screen readers don't know Flash...
-
... and be less accessible.
-
I really hate when web sites start playing audio without telling me and without giving me the option to turn it off. Also, when your "into" starts once more it'll start playing the sound file again, but the other one doesn't stop...
-
Your logo is way to large. On 800x600 it's the only thing you see and you almost see nothing else in 1024x768.