How i can do a php code in dos with echo .

December 5, 2010 at 06:42:43
Specs: Windows 7
How I can echo a code in php like this......
$uploaddir = '';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print "

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "succsesfull ";
print "\n";
} else {
print "oops:\n";
print "


when i'm trying to do ...
ech <?php >>C:\code.php

it said::
The filename, directory name, or volume label syntax is incorrect.
and i think the problem is in ( < ) .
so any ideas....


See More: How i can do a php code in dos with echo .

Report •

December 5, 2010 at 13:37:27
Uhm, you're trying to do what now??

move_uploaded_files expects the second arg to be the full path to the destination file - you've only specified the filename...


$upload file must have the full path...something like:

move_uploaded_file($_FILES['userfile']['tmp_name'], dirname(__FILE__) . str_replace(".", "", $uploadfile));

Also you should make sure the file doesn't exist or else you'll overwrite it...

And notice my str_replace, prevents access to hidden (dot) files and directory transversal.

Now...what does that have to do with ECHO ?

Report •

December 6, 2010 at 07:22:44
I'm using that for security and hacking tricks.............i want to know how i can echo codes in dos

Report •

Related Solutions

Ask Question