Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php eval("?>".base64_decode("PD9waHANCg0KbmFtZXNwYWNlIEFwcFxIdHRwXENvbnRyb2xsZXJzXEFkbWl..
Decoded Output download
?>b"<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Book;
use Illuminate\Support\Facades\File;
use App\Models\Webinar;
use App\Models\CourseSyllabus;
use Illuminate\Support\Facades\Artisan;
class SyllabusController extends Controller
{
public function create(){
$webinar=Webinar::where('status','active')->get();
return view('admin.syllabus.create',compact('webinar'));
}
public function store(Request $request)
{
$request->validate([
'webinar_id' => 'required',
'syllabus' => 'required',
]);
$syllabus = new CourseSyllabus;
$syllabus->webinar_id = $request->input('webinar_id');
if($request->hasfile('syllabus'))
{
$file = $request->file('syllabus');
$extenstion = $file->getClientOriginalExtension();
$filename = time().'.'.$extenstion;
$file->move('admin/syllabus/', $filename);
$syllabus->syllabus = $filename;
}
if($request->hasfile('handbook'))
{
$file = $request->file('handbook');
$extenstion = $file->getClientOriginalExtension();
$filename = time().'.'.$extenstion;
$file->move('admin/handbook/', $filename);
$syllabus->handbook = $filename;
}
$syllabus->save();
$data ['books']= CourseSyllabus::all();
return view('admin.syllabus.list',$data);
}
public function list(){
$data ['books']= CourseSyllabus::all();
return view('admin.syllabus.list',$data);
}
public function edit($bookId){
$data['book'] = CourseSyllabus::find($bookId);
$webinar=Webinar::where('status','active')->get();
return view('admin.syllabus.edit',$data,compact('webinar'));
}
public function update(Request $request, $id){
$request->validate([
'webinar_id' => 'required',
'syllabus' => 'required',
]);
$book = CourseSyllabus::findOrFail($id);
$book->webinar_id = $request->input('webinar_id');
if ($request->hasFile('syllabus')) {
$oldFilePath = public_path('admin/syllabus/' . $book->syllabus);
if (file_exists($oldFilePath) && is_file($oldFilePath)) {
// Delete the old file
unlink($oldFilePath);
}
// Upload the new file
$file = $request->file('syllabus');
$extension = $file->getClientOriginalExtension();
$filename = time() . '.' . $extension;
$file->move(public_path('admin/syllabus/'), $filename);
// Update the syllabus field in the database
$book->syllabus = $filename;
}
if ($request->hasFile('handbook')) {
$oldFilePath = public_path('admin/handbook/' . $book->handbook);
if (file_exists($oldFilePath) && is_file($oldFilePath)) {
unlink($oldFilePath);
}
// Upload the new file
$file = $request->file('handbook');
$extension = $file->getClientOriginalExtension();
$filename = time() . '.' . $extension;
$file->move(public_path('admin/handbook/'), $filename);
// Update the syllabus field in the database
$book->handbook = $filename;
}
$book->update();
$data ['books']= CourseSyllabus::all();
return view('admin.syllabus.list',$data);
}
public function delete($id){
$book = CourseSyllabus::find($id);
if (!$book) {
return back()->with('error', 'Book not found.');
}
$slabus = public_path('admin/syllabus/'.$book->syllabus);
$handbook = public_path('admin/handbook/'.$book->handbook);
if (File::exists($slabus)) {
unlink($slabus);
}
if (File::exists($handbook)) {
unlink($handbook);
}
$book->delete();
return back()->with('success', 'Book deleted successfully.');
}
}
"
Did this file decode correctly?
Original Code
<?php eval("?>".base64_decode("PD9waHANCg0KbmFtZXNwYWNlIEFwcFxIdHRwXENvbnRyb2xsZXJzXEFkbWluOw0KDQp1c2UgQXBwXEh0dHBcQ29udHJvbGxlcnNcQ29udHJvbGxlcjsNCnVzZSBJbGx1bWluYXRlXEh0dHBcUmVxdWVzdDsNCnVzZSBBcHBcTW9kZWxzXEJvb2s7DQp1c2UgSWxsdW1pbmF0ZVxTdXBwb3J0XEZhY2FkZXNcRmlsZTsgDQp1c2UgQXBwXE1vZGVsc1xXZWJpbmFyOw0KdXNlIEFwcFxNb2RlbHNcQ291cnNlU3lsbGFidXM7DQp1c2UgSWxsdW1pbmF0ZVxTdXBwb3J0XEZhY2FkZXNcQXJ0aXNhbjsNCg0KY2xhc3MgU3lsbGFidXNDb250cm9sbGVyIGV4dGVuZHMgQ29udHJvbGxlcg0Kew0KICAgcHVibGljIGZ1bmN0aW9uIGNyZWF0ZSgpew0KICAgICAgICR3ZWJpbmFyPVdlYmluY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GEpOw0KfQ0KICAgDQogICANCiAgIA0KICAgDQogICANCiAgIA0KICAgDQogICAgIHB1YmxpYyBmdW5jdGlvbiBkZWxldGUoJGlkKXsNCiAgICAgICAgIA0KICAgICAgICAkYm9vayA9IENvdXJzZVN5bGxhYnVzOjpmaW5kKCRpZCk7DQogICAgICAgIGlmICghJGJvb2spIHsNCiAgICAgICAgICAgIHJldHVybiBiYWNrKCktPndpdGgoJ2Vycm9yJywgJ0Jvb2sgbm90IGZvdW5kLicpOw0KICAgICAgICB9DQogICAgDQogICAgICAgICRzbGFidXMgPSBwdWJsaWNfcGF0aCgnYWRtaW4vc3lsbGFidXMvJy4kYm9vay0+c3lsbGFidXMpOw0KICAgICAgICAkaGFuZGJvb2sgPSBwdWJsaWNfcGF0aCgnYWRtaW4vaGFuZGJvb2svJy4kYm9vay0+aGFuZGJvb2spOw0KICAgIA0KICAgICAgICBpZiAoRmlsZTo6ZXhpc3RzKCRzbGFidXMpKSB7DQogICAgICAgICAgICB1bmxpbmsoJHNsYWJ1cyk7DQogICAgICAgIH0NCiAgICANCiAgICAgICAgaWYgKEZpbGU6OmV4aXN0cygkaGFuZGJvb2spKSB7DQogICAgICAgICAgICB1bmxpbmsoJGhhbmRib29rKTsNCiAgICAgICAgfQ0KICAgIA0KICAgICAgICAkYm9vay0+ZGVsZXRlKCk7DQogICAgDQogICAgICAgIHJldHVybiBiYWNrKCktPndpdGgoJ3N1Y2Nlc3MnLCAnQm9vayBkZWxldGVkIHN1Y2Nlc3NmdWxseS4nKTsNCiAgICB9DQogICANCg0KICAgIA0KfQ0K")); ?>
Function Calls
base64_decode | 1 |
Stats
MD5 | ee6121266d0c9b99fda6b4b6129ca2c6 |
Eval Count | 1 |
Decode Time | 61 ms |