Click to See Complete Forum and Search --> : Welcome!


jstarkey
09-29-2003, 07:33 PM
Welcome to the new Code Critique forum. We've created this forum in the spirit of Open Source. One of the biggest advantages of OS is the fact that everyone can see the code. Having millions of eyes on the source means that just about any bug or exploit is going to be found in record time. It also helps the community grow, by sharing the "better ways" of doing things.

Please feel free to post your code here for others to offer suggestions and/or comments. Please also share the wealth by checking out someone else's work as well.

Enjoy!!

n00854180t
09-29-2003, 07:35 PM
Cool forum idea ;)

Merve
09-29-2003, 07:37 PM
I think that this forum is a great idea. It'll help me find the bugs in PEBoDMyAdmin in record time! And now...BuzzLY is a mod! Congrats BuzzLY!

I just found it a little weird when I signed into PHPBuilder, went to the EL, went back to the main page, and found a new forum, but it's all good because I'm sure that this forum is going to rock and we'll be running on ten pages in record time!

planetsim
09-29-2003, 07:38 PM
This sounds like a great idea for all..

so to start things off


<?php
phpinfo();
?>


Can someone tell me how to improve that :D

n00854180t
09-29-2003, 07:40 PM
LOL


<?php
phpinfo();
?>


Indent.

Merve
09-29-2003, 07:42 PM
Actually, you wouldn't indent for that one. Usually...it's a matter of preference. It's so simple that there is absolutely no point in indenting.

n00854180t
09-29-2003, 07:42 PM
I know. I was j/k.

planetsim
09-29-2003, 07:42 PM
yay im a master at phpinfo(); Ok i guess there are more serious ones like Merve wants..

jstarkey
09-29-2003, 07:46 PM
Originally posted by planetsim


<?php
phpinfo();
?>



You forgot to comment it. Remember, a year from now you may look at this and say "what was I thinking".

n00854180t
09-29-2003, 07:48 PM
LOL good one.

planetsim
09-29-2003, 07:51 PM
your so right hows this


<?php
//this page will say im so smart
//it will produce a whole gui look of the php.ini file
//my mates will think im some sort of genius when i show them
// that a little line of code can produce so much
phpinfo();

//remember its php as in the language
//info as information about it
// () for no particular reason other than it looks good
// ; to close it off
?>


I might not have said enough.

jstarkey
09-29-2003, 07:57 PM
While that will suffice, it's generally a good idea to follow a standard convention. Might wanna check out something like PHPDoc:

http://pear.php.net/manual/en/package.php.php

:D

LordShryku
09-29-2003, 09:25 PM
Bah! There's those "standards" again...

drawmack
09-29-2003, 09:32 PM
actually you should turn php_info off on your server it gives a hacker too much information including your htaccess usernames and passwords.

drawmack
09-29-2003, 09:35 PM
On a different note this is a great forum idea. I am working up my cv site and for it I am doing some downloadable php - mostly games and guestbooks and stuff. With this forum I can let the community test them out for me so I'm not embarassed by a stupid mistake that stops my code from executing on other people's servers.

thanks phpbuilder.

Moonglobe
09-29-2003, 10:43 PM
Yes indeed, great idea! lol thats about all i have to say right now.....

piersk
09-30-2003, 08:14 AM
Originally posted by drawmack
actually you should turn php_info off on your server it gives a hacker too much information including your htaccess usernames and passwords.

Or, you could do what I did (http://rover.diablog.co.uk/info.php) (although I can't take all the credit. I got the idea off John (http://www.phpbuilder.com/board/member.php?s=&action=getinfo&userid=1))

jstarkey
09-30-2003, 01:44 PM
Originally posted by piersk
Or, you could do what I did (http://rover.diablog.co.uk/info.php) (although I can't take all the credit. I got the idea off John (http://www.phpbuilder.com/board/member.php?s=&action=getinfo&userid=1))

Copycat!! :mad:

:D

piersk
09-30-2003, 01:47 PM
Hey! I credited you, both here and there (http://rover.diablog.co.uk/info.php).

jayant
09-30-2003, 04:15 PM
but what if some error occurs and we need to debug:-



<?php
// note about the license in which the following is being
// dibtributed, other legal mumbo jumbo

// turn on all errors for better debugging
error_reporting(E_ALL);
// some comment
$debug_on = 1;
// some comment
if($debug_on==1) echo "about to enter function phpinfo";
// some comment
phpinfo();
// some comment
if($debug_on==1) echo "just exit from function phpinfo";

// end thanksgiving if any
?>

n00854180t
09-30-2003, 04:25 PM
If you did that kind of thing for every line of code, a 10kb file would turn into a 100kb file very quickly.

BuzzLY
09-30-2003, 04:44 PM
Originally posted by Merve
I think that this forum is a great idea. It'll help me find the bugs in PEBoDMyAdmin in record time! And now...BuzzLY is a mod! Congrats BuzzLY!

Thanks! I have been itching to use the ban button for ages now, and johnny's given me the go-ahead! Woo hoo! If any of you post crappy code, you're banned! :mad: :D

LordShryku
09-30-2003, 04:55 PM
if($mod == "BuzzLy") {
run(&$hide);
}

jstarkey
09-30-2003, 04:57 PM
Originally posted by BuzzLY
If any of you post crappy code, you're banned! :mad: :D

I knew you'd make a fine mod!! :D

planetsim
09-30-2003, 07:04 PM
Originally posted by BuzzLY
Woo hoo! If any of you post crappy code, you're banned! :mad: :D

I guess thatd make me first. :p

Merve
09-30-2003, 08:56 PM
Looks like I'm going to be banned pretty damn fast....

Jeb.
10-01-2003, 06:22 AM
Originally posted by LordShryku
if($mod == "BuzzLy") {
run(&$hide);
}

Tsk tsk, didn't you know that calltime pass-by-reference has been deprecated? :D

BTW, brilliant idea with this forum jstarkey. I know I'm going to make some use out of it!

Piersk/John - I'd sure like to know how you did that. Mind sharing the secret? Or is it so obvious I should be kicking myself? ;)

piersk
10-01-2003, 06:36 AM
Trade secret I'm afraid.

<incredibly geeky joke>If I told you, I'd have to kill you!</ekoj ykeeg ylbidercni>

Nah, all you do is run the phpinfo()-type script and then edit the html that is outputted.

Easy :D

<red neck>Now, where's ma gun, Bettsy</red neck>

jstarkey
10-01-2003, 09:47 AM
Yes, I wouldn't advise doing it the purist way :D

piersk
10-01-2003, 09:50 AM
It is possible to do it the long way round, but what would be the point (unless you're that board (geddit?)).

John, what happened to the PHPBuilder one?

Jeb.
10-01-2003, 11:40 AM
Originally posted by piersk
Nah, all you do is run the phpinfo()-type script and then edit the html that is outputted.

Well, excuse me whilst I kick myself ;) Cheers for sharing :D

piersk
10-01-2003, 11:54 AM
No probs. Now I'll just get my gun...

laserlight
10-01-2003, 12:09 PM
hmm... what protocol would you use to send the bullets over the Internet?

Moonglobe
10-01-2003, 12:11 PM
whatever it is i somehow think it'll go straight through Jeb's firewall.......

piersk
10-01-2003, 01:28 PM
Muhahahahahahahaha

Who said anything about going over the internet. My "gun" is the kind that has disarmament treaties against it...

Muahahahahahahahahahahahahaha

Merve
10-01-2003, 09:23 PM
This thread is starting to sound like the EL. Is there no such thing as OT in CC too?

Moonglobe
10-01-2003, 09:27 PM
o i think their should be. we dont want you to start bumping here too!


yes i know that's weak coming from me...... but i have stopped and will not bump a topic in bad taste again. if i do jstarkey must decrememnet my post count by 100. agreed?:D


PS: i'm not kidding.....:)

Merve
10-01-2003, 09:34 PM
Does your post count really matter that much?

Moonglobe
10-01-2003, 09:38 PM
no..... but it was the only thing that i thought of that they could punish me with.....other suggestions are welcome.

Merve
10-01-2003, 09:43 PM
using the LART, caging the PEBoD forever, temporary ban....

LordShryku
10-02-2003, 12:45 AM
I'm thinking ban of the beaver would be good punishment... :D

Moonglobe
10-02-2003, 01:11 AM
ok you guys are starting to scare me ;)

seriously i'd hate to be banned........ i love this community and i won't go away (unfortunately maybe but still:D).

LordShryku
10-02-2003, 01:13 AM
Oh, you can stay. But the beaver hits the bricks :D

Moonglobe
10-02-2003, 01:16 AM
well.....jusec.

include "incl/PEBoD.php5";
$beaver = new PEBoD();
$beaver->put_in_cage();
$beaver->cage->lock(mktime(0,0,0,12,31,2010));

that good enough?

LordShryku
10-02-2003, 01:17 AM
LOL

piersk
10-02-2003, 05:54 AM
Surely locking it away is not really a punishment. I think that maybe you should be locked in there with it

muahahahahahahahahahaha

(I'm quite liking these evil laughs.... maybe I should change my title. hmmmm)

Jeb.
10-02-2003, 08:00 AM
Originally posted by piersk
No probs. Now I'll just get my gun...

Hmm, well, you gotta catch me first :p :D

Originally posted by Merve
This thread is starting to sound like the EL. Is there no such thing as OT in CC too?

Aww, c'mon. Every subforum has got to have at least one OT thread. ;)

Merve
10-02-2003, 08:08 PM
Well a topic like 'Welcome' isn't much of a topic. :D

piersk
10-03-2003, 11:00 AM
Originally posted by Jeb.
Hmm, well, you gotta catch me first :p :D

Well, I could use GeoIP...

Merve
10-04-2003, 12:49 PM
Isn't that the thing they use to track hackers?

Moonglobe
10-04-2003, 01:08 PM
well, yes, they could i suppose..... its just a database of which IPs belong to which countries basically.....

Merve
10-04-2003, 01:12 PM
Norton Firewall uses it.

Moonglobe
10-04-2003, 04:02 PM
yes well norton sucks.

Merve
10-04-2003, 04:05 PM
Originally posted by Moonglobe
yes well norton sucks.

really? Coool...didn't know that...is there anything better out there....or do all firewalls sucks? Or does it suck because I use it:D?

Moonglobe
10-04-2003, 04:09 PM
personally i dont use any anti-virus software and i get on just fine. Im a gamer, and they just cause too many problems. Plus im really cheap. IF i was goign to use anything, it'd be McAfee.