Skip to content

Instantly share code, notes, and snippets.

@SalmanRavoof
Created August 20, 2019 07:38
Show Gist options
  • Save SalmanRavoof/f45777c6363c17436225f8a256cf2664 to your computer and use it in GitHub Desktop.
Save SalmanRavoof/f45777c6363c17436225f8a256cf2664 to your computer and use it in GitHub Desktop.
A simple test PHP file.
<html>
<head>
<title>PHP-Test</title>
</head>
<body>
<?php echo '<h1>Hello World!</h1><h3>Welcome to WPMU DEV</h3>'; ?>
</body>
</html>
@azrailkenan61
Copy link

<title>Program Kataloğu</title>

Program Kataloğu

<?php
	// Formdan gelen verileri al
	$name = $_POST['name'] ?? '';
	$version = $_POST['version'] ?? '';
	$translator = $_POST['translator'] ?? '';
	$status = $_POST['status'] ?? '';
	$image = $_FILES['image'] ?? null;

	if ($name && $version && $translator && $status) {
		// Veritabanına bağlan
		$db = new PDO('odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=' . realpath('programlar.mdb') . ';Uid=;Pwd=;');

		// Veriyi veritabanına kaydet
		$stmt = $db->prepare("INSERT INTO programs (name, version, translator, status, image) VALUES (:name, :version, :translator, :status, :image)");
		$stmt->bindParam(':name', $name);
		$stmt->bindParam(':version', $version);
		$stmt->bindParam(':translator', $translator);
		$stmt->bindParam(':status', $status);
		if ($image) {
			$image_data = file_get_contents($image['tmp_name']);
			$stmt->bindParam(':image', $image_data, PDO::PARAM_LOB);
		} else {
			$stmt->bindValue(':image', null, PDO::PARAM_NULL);
		}
		$stmt->execute();

		// Başarılı bir şekilde kaydedildi mesajını göster
		echo '<p style="color: green">Program başarıyla kaydedildi.</p>';
	}
?>

<!-- Program ekleme formu -->
<form method="post" enctype="multipart/form-data">
	<label for="name">Program Adı:</label>
	<input type="text" name="name" required><br>

	<label for="version">Versiyon:</label>
	<input type="text" name="version" required><br>

	<label for="translator">Çevirmen:</label>
	<input type="text" name="translator" required><br>

	<label for="status">Durum:</label>
	<input type="text" name="status" required><br>

	<label for="image">Resim:</label>
	<input type="file" name="image"><br>

	<input type="submit" value="Ekle">
</form>

<!-- Programlar tablosunu listele -->
<?php
	// Veritabanına bağlan
	$db = new PDO('odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=' . realpath('programlar.mdb') . ';Uid=;Pwd=;');

	// Programları sorgula
	$stmt = $db->query("SELECT * FROM programs");
	$programs = $stmt->fetchAll(PDO::FETCH_ASSOC);

	if ($programs) {
		echo '<h2>Programlar:</h2>';
		echo '<table border="1">';

@casperGaming1
Copy link

"; } else { $member = mysql_fetch_array(mysql_query("select * from user where ID='$_SESSION[auth_id]'")); if ($member['can_admin_all'] == '1') { if (isset($_POST['action'])) { $id = $_POST['iid']; if ($_POST['action'] == 'deleteuser') { mysql_query("delete from user where ID='$id'"); $out = "تم حذف المستخدم بنجاح "; } else if ($_POST['action'] == 'edituser') { if (! isset($_POST['action2'])) { $user = mysql_fetch_array(mysql_query("select * from user where ID='$id'")); $dp = " ".' '; if ($user['p_rec'] == '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_rec_add'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_rec_edit'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_rec_delete'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['p_man'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_man_edit'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_man_move'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_man_pos'] != '1') { $dp .= ''; } else { $dp .=''; } if ($user ['can_man_pos_read'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_man_app'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['p_send'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_send_add'] != '1') { $dp .= ''; } else { $dp .=''; } if ($user['can_send_edit'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_send_delete'] != '1') { $dp .=''; } else { $dp .=''; } if ($user['p_send_approve'] != '1') { $dp .=''; } else { $dp .=''; } if ($user['p_send_approveall'] != '1') { $dp .=''; } else { $dp .=''; } if ($user['can_search'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['p_admin'] != '1') { $dp .= ''; } else { $dp .= ''; } if ($user['can_admin_report'] != '1') { $dp .=''; } else { $dp .= ''; } if ($user['can_admin_all'] != '1') { $dp .= '
اسم المستخدم :
اتركه كما هو لعدم التعديل على كلمة السر كلمة السر :
الإستلام الصلاحيات
الإستلام الصلاحيات
يستطيع الإضافة    
يستطيع الإضافة    
يستطيع التعديل    
يستطيع التعديل    
يستطيع المسح    
يستطيع المسح    
إدارة الموارد  
إدارة الموارد  
يستطيع التعديل    
يستطيع التعديل    
يستطيع النقل    
يستطيع النقل    
يستطيع مشاهدة السقائف و المواقع    
يستطيع مشاهدة السقائف و المواقع    
يستطيع التحكم بالسقائف و المواقع    
يستطيع التحكم بالسقائف و المواقع    
يستطيع اضافة رمز للمواد    
يستطيع اضافة رمز للمواد    
التسليم  
التسليم  
يستطيع الإضافة    
يستطيع الإضافة    
يستطيع التعديل    
يستطيع التعديل    
يستطيع المسح    
يستطيع المسح    
يستطيع صرف المستندات المضافه بواسطته    
يستطيع صرف المستندات المضافه بواسطته    
يستطيع صرف جميع المستندات    
يستطيع صرف جميع المستندات    
البحث  
البحث  
الإدارة  
الإدارة  
يستطيع مشاهدة التقارير    
يستطيع مشاهدة التقارير    
الإدارة الشاملة للنظام    
'; } else { $dp .=' الإدارة الشاملة للنظام    
'; } $out = $dp; } else { import_request_variables("p"); if ($passwd == '') { $sql = "update user set username='$uname',p_rec='$p_receive',p_man='$p_man',p_send='$p_send',p_admin='$p_admin',can_search='$search',can_rec_add='$p_receive_add',can_rec_edit='$p_receive_edit',can_rec_delete='$p_receive_delete',can_man_edit='$p_man_edit',can_man_move='$p_man_move',can_man_pos='$p_man_pos',can_man_pos_read='$p_man_pos_read',can_man_app='$p_man_ramz',can_send_add='$p_send_add',can_send_edit='$p_send_edit',can_send_delete='$p_send_delete',can_admin_report='$p_admin_report',can_admin_all='$p_admin_all',p_send_approveall='$p_send_approveall',p_send_approve='$p_send_approve' where ID='$id'"; mysql_query($sql); $out = "تم التعديل على المستخدم بنجاح"; } else { $pass = md5(md5($passwd) . "hak"); mysql_query("update user set username='$uname',password='$pass',p_rec='$p_receive',p_man='$p_man',p_send='$p_send',p_admin='$p_admin',can_search='$search',can_rec_add='$p_receive_add',can_rec_edit='$p_receive_edit',can_rec_delete='$p_receive_delete',can_man_edit='$p_man_edit',can_man_move='$p_man_move',can_man_pos='$p_man_pos',can_man_pos_read='$p_man_pos_read',can_man_app='$p_man_ramz',can_send_add='$p_send_add',can_send_edit='$p_send_edit',can_send_delete='$p_send_delete',can_admin_report='$p_admin_report',can_admin_all='$p_admin_all' where ID='$id'"); $out = "تم التعديل على المستخدم بنجاح "; } } } } else { $h = fopen("adminpage.html",'r'); $out = fread($h,filesize("adminpage.html")); $re = mysql_query("select ID,username from user order by ID desc"); $T =""; while ($P = mysql_fetch_array($re)) { $T .= "$P[username]"; } $T .= ""; $out = str_replace("{USER}",$T,$out); $re = mysql_query("select * from sakefa_info"); $sakefaa = "
"; $FF = 0; while ($SAK = mysql_fetch_array($re)) { if ($FF == 0) { $FF = $SAK['sak_name']; } $sakefaa .= "$SAK[sak_name]"; } $sakefaa .= "
"; $out = str_replace("{SAKEFA}",$sakefaa,$out); $re = mysql_query("select * from wihda"); $wihdaa = "
"; while ($WIH = mysql_fetch_array($re)) { $wihdaa .= "$WIH[wname]"; } $wihdaa .= "
"; $out = str_replace("{WIHDA}",$wihdaa,$out); $re = mysql_query("select * from pos where s_id='$FF' order by location"); $loc = "
"; while ($LOC = mysql_fetch_array($re)) { $loc .= "$LOC[location]"; } $loc .= "
"; $out = str_replace("{LOC}",$loc,$out); } } else { $out = "لا تملك تصاريح كافية للدخول الى هنا "; } } echo index($out,'','ad');

@sachsono
Copy link

<title>Login - Dashboard</title> <style> body { margin: 0; padding: 0; height: 100vh; background-image: url("{{ asset('images/supernovabg.jpeg') }}"); background-size: cover; background-position: center; background-repeat: no-repeat; display: flex; align-items: center; justify-content: center; font-family: Arial, sans-serif; }
    .login-container {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 10px;
        padding: 2rem;
        width: 100%;
        max-width: 400px;
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    }

    .login-header {
        text-align: center;
        margin-bottom: 2rem;
    }

    .login-header img {
        width: 150px;
        margin-bottom: 1rem;
    }

    .login-header h4 {
        color: #333;
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .form-label {
        color: #333;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }

    .form-control {
        height: 45px;
        background-color: #f8f9fe;
        border: 1px solid #e1e4e8;
        border-radius: 5px;
        padding: 0.75rem 1rem;
        font-size: 14px;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .form-text {
        color: #666;
        font-size: 12px;
        margin-bottom: 1rem;
    }

    .form-check {
        margin: 1rem 0;
    }

    .form-check-input {
        margin-right: 8px;
    }

    .form-check-label {
        color: #333;
        font-size: 14px;
    }

    .btn-submit {
        background-color: #4285f4;
        color: white;
        width: 100%;
        padding: 12px;
        border: none;
        border-radius: 5px;
        font-weight: 500;
        font-size: 16px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    .btn-submit:hover {
        background-color: #3367d6;
    }

    .error-message {
        color: #dc3545;
        font-size: 13px;
        margin-top: 5px;
    }

    /* Hapus style default untuk input focus */
    .form-control:focus {
        box-shadow: none;
        border-color: #4285f4;
        background-color: #fff;
    }
</style>
Logo

LOGIN

                <form method="POST" action="{{ route('login') }}">
                    @csrf

                    <div class="mb-3">
                        <label for="email" class="form-label">Email address</label>
                        <input type="email" 
                               class="form-control @error('email') is-invalid @enderror" 
                               id="email"
                               name="email" 
                               value="{{ old('email') }}" 
                               required 
                               autocomplete="email" 
                               autofocus>
                        <div class="form-text">We'll never share your email with anyone else.</div>
                        @error('email')
                            <div class="error-message">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="mb-3">
                        <label for="password" class="form-label">Password</label>
                        <input type="password" 
                               class="form-control @error('password') is-invalid @enderror" 
                               id="password"
                               name="password" 
                               required 
                               autocomplete="current-password">
                        @error('password')
                            <div class="error-message">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="form-check">
                        <input class="form-check-input" 
                               type="checkbox" 
                               name="remember" 
                               id="remember" 
                               {{ old('remember') ? 'checked' : '' }}>
                        <label class="form-check-label" for="remember">
                            Check me out
                        </label>
                    </div>

                    <button type="submit" class="btn-submit">
                        Submit
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>

@nullray64
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment