הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   והזוכה הוא... (https://hosts.co.il/forums/showthread.php?t=25433)

Tomer 01-07-06 21:17

והזוכה הוא...
 
הזוכה באתגר Hosts - פורום תכנות הוא Kuchi

הקוד:
PHP קוד:

 <Center> 
Type Somting End Check Your Access ! (To Get Access Type : Hosts.co.il) 
<br><br> 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
<br><br> 
<form method='post'> 
<input name='access' dir='ltr' size='22' tabindex='1' style='font-family: Tahoma; font-size: 10px; color: #000000; font-weight: bold; border-style: solid; border-width: 1px'> 
<input type='submit' value='Get' name='Send' style='color: #000000; font-family: Tahoma; font-size: 10px; font-weight: bold; border-style: solid; border-width: 1px'> 
</form> 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
<br><br> 

<? 
// By Kuchi.be :D For Hosts.co.il (Atgar Forum) 
// error_reporting(0); למקרה שתיהיה שגיאה בגלל ששרת נפל  
// אפשר לעשות 
// @file_get_contents('File'); אבל ... כל אחד ואיך נוח לו 
if(empty($_POST['access'])) 

echo 
"<b>Pleas Type Somting !</b>"

else 
        { 
            
error_reporting(0); 
            
$access file_get_contents('http://atgar.web.lsrv.co.il/index.php'); 
            if(
$access == $_POST['access']) 
            { 
            echo 
"<Font Color='Blue'><b>Yes</b></Font>"
            } 
            else 
                    { 
                    echo 
"<Font Color='Red'><b>No</b></Font>"
                    } 
        } 
?>

והקובץ על השרת המרוחק:
PHP קוד:

Hosts.co.il 

אתה מוזמן ליצור איתי קשר אני אביא לך איזה פרס

lalamen 01-07-06 21:19

דומה מאוד למה שאני עשיתי

PHP קוד:

<?php

// מיקום הדף בו נמצאת הסיסמא
// דוגמא
// http://www.site.co.il/serial.php
$file "";

// פונקציה שמראה את תוכן הדף
function pagecontent()
{
  echo 
"
  <div align=\"center\">
  אתגר תיכנות פורום הוסטס
  </div>
  "
;
}

// עיצוב הדף
echo "
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<title>Hosts.co.il</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1255\" />
<style type=\"text/css\">
body
{
  font-family: Arial;
  font-size: 11px;
}
input 
{
  border-right: #eeeeee 1px solid; 
  padding-right: 0px; 
  border-top: #eeeeee 1px solid; 
  padding-left: 0px; font-size: 9pt; 
  padding-bottom: 0px; 
  border-left: #eeeeee 1px solid; 
  padding-top: 0px; 
  border-bottom: #eeeeee 1px solid; 
  font-family: Arial;
  background: #f5f5f5;
  font-size: 11px;
}
td
{
  font-family: Arial;
  font-size: 11px;
  color: #0a2d4d;
}
</style>
</head>
<body>
<div align=\"center\">
<form action=\"index2.php\" method=\"post\">
  <table>
    <tr>
      <td><input type=\"hidden\" name=\"posted\" value=\"\" /></td>
    </tr>
    <tr>
      <td align=\"center\">:סיסמת גישה לקובץ</td>
    </tr>
    <tr>
      <td align=\"center\"><input type=\"text\" name=\"serial\" value=\"\" /></td>
    </tr>
    <tr>
      <td align=\"center\"><input type=\"submit\" value=\"בדוק\" /></td>
    </tr>
  </table>
</form>
</div>
</body>
</html>
"
;

// בדיקה אם נשלח הטופס ואם הסיסמא שנקלטה שווה לסיסמא שבקובץ
if(isset($_POST['posted']))
{
    
$file file_get_contents($file);
    if(
$_POST['serial'] == $file)
    {
      echo 
"<div align=\"center\"><font style=\"color: green; font-size: 11px; font-family: arial;\">הגישה אושרה</font></div>";
      
pagecontent();
    }
    else
    {
      echo 
"<div align=\"center\"><font style=\"color: red; font-size: 11px; font-family: arial;\">הגישה נדחתה</font></div>";
    }
}

?>


TheShark 01-07-06 21:19

מזל טוב =]

HighA 01-07-06 21:45

יש לי שאלה :)

אפשרי לעשות קריאה מקובץ בשרת מרוחק, אבל כשהתוכן שלו לא נראה בגישה ישירה?
נגיד קובץ שהתוכן שלו בתוך תגי הערות בPHP, אפשר לקרא את ההערות בשרת אחר?(הרשאות אולי?)

Oppis 01-07-06 22:01

ציטוט:

נכתב במקור על ידי SsH S Scripts
יש לי שאלה :)

אפשרי לעשות קריאה מקובץ בשרת מרוחק, אבל כשהתוכן שלו לא נראה בגישה ישירה?
נגיד קובץ שהתוכן שלו בתוך תגי הערות בPHP, אפשר לקרא את ההערות בשרת אחר?(הרשאות אולי?)

תעבוד אם קריאה בינארית..

Oppis 01-07-06 22:04

הנה הפתרון שלי :) עבודה אם FTP

PHP קוד:

<?php

//FTP Connection

$connect ftp_connect("ftp.style-host.net");
$result ftp_login($connect,"host@meni45.style-host.net","123456");

if(!
$result) {
echo 
"לא יכול להתחבר לשרת FTP";
exit;
}

$result ftp_get($connect,"ps.inc","password.pass",FTP_ASCII);

if(!
$result) {
echo 
"לא יכול לייבא את הקובץ";
}

ftp_close($connect);

//Read File in Local server

$password file_get_contents("ps.inc");
if (
$password == $_GET['ps']) {
 echo 
"גישה אושרה";
} else {
 echo 
"גישה נדחתה";
}

?>


HighA 01-07-06 22:35

הדרך שלך טובה אבל ממש לא יעילה בנושא של רשיונות למערכות :\
כי אז אנשים מתחברים לFTP ואפשר להרוס הכל

Kuchi 02-07-06 17:44

Pro :D
thanks man !

Light-Era.Net || Ronen 03-07-06 10:08

וואע איזה באסה..
הוא לא היה אמור להגמר ב27 ?
מזה רציתי להשתתף והיה לי ת'פתרון בראש..

איחוליי לקוצ'י הזוכה !


כל הזמנים הם GMT +2. הזמן כעת הוא 06:11.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ