Nicholas Posted February 17, 2010 Posted February 17, 2010 hi, i remembered from while ago that a player on my game wanted some attack logs made for them so they know who attacked them. well i made it and now i feel like sharing it lol. its a quite simple mod but still here... i called this file "ayw.php" (attacks you won) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. i called this file "ayl.php" (attacks you lost) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. in explore just add these links anywhere you want... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. hope you like it :P Quote
Joshua Posted February 17, 2010 Posted February 17, 2010 Nothing tinkered with just slapped into one file You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. links Attacks Won Attacks Lost Untested. Quote
Equinox Posted February 17, 2010 Posted February 17, 2010 I updated this a bit - just made the code cleaner and made it into one file, altered the query a bit too... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Joshua Posted February 17, 2010 Posted February 17, 2010 You just did what I just did lol..................... I dont htmlentities the name as most use the typical <font color> and the htmlentities will strip that. Also prefer $db as it has it's own error handler :P Quote
Equinox Posted February 17, 2010 Posted February 17, 2010 GLOBAL is very insecure, so I don't use it. No need to use the class when you can just add : or die(mysql_error()); on the end of the 2 queries. Add the username inside of the <font> tags and it won't matter, that's if it's in the header. And <font> has been deprecated :D Quote
Joshua Posted February 17, 2010 Posted February 17, 2010 I know <font> is depricated but 80% of the users on the forums still use it, gotta cater to them ^_^ And for 2 queries adding the mysql bit is fine, but if i'm making a script that is 800+ lines i'm not going to do that for each one when i can just use $db :P Quote
Equinox Posted February 17, 2010 Posted February 17, 2010 So on that script, add a function at the top that works for mysql_query() just like the class. And it still doesn't change the fact that GLOBAL is insecure - also, Unless their username was '<font color = red>Equinox</font>' it shouldn't matter. You could just go to header and have: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Joshua Posted February 17, 2010 Posted February 17, 2010 You "could" but now all the users that want to use it would have to do that also, so would need the header tutorial ^ hehe ^_- Quote
CJ - Twitch Posted February 17, 2010 Posted February 17, 2010 Well here is my version of the code. Thought I might aswell post it like everyone else xD pal.php (player attack logs) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. :D Quote
CJ - Twitch Posted February 17, 2010 Posted February 17, 2010 Why does that happen to me? Try this. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
AlabamaHit Posted February 17, 2010 Posted February 17, 2010 GLOBAL is very insecure, so I don't use it.Care to enlighten us on how the Global is insecure? Quote
reek13 Posted February 17, 2010 Posted February 17, 2010 Good job +1 , i still haven't coded anything for the community , its just that life is busy . Quote
Equinox Posted February 17, 2010 Posted February 17, 2010 GLOBAL is very insecure, so I don't use it.Care to enlighten us on how the Global is insecure? GLOBAL is very insecure, so I don't use it.Care to enlighten us on how the Global is insecure? My bad - I was thinking of the superglobal You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. :pinch: Quote
Nicholas Posted February 18, 2010 Author Posted February 18, 2010 still in 2 files but i updated it little... this is "ayl.php"; You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. this is "ayw.php"; You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. unless you already had the joined together one... replace the information with this... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.