REGISTER GLOBALS

superdos

New member
REGISTER GLOBALS

שלום, רציתי לדעת איך אני משנה את הקוד הבא, כך שיעבוד בשרת שה- REGISTER GLOBLAS שלו כבוי. <?php if(isset($id)) { @mysql_connect("localhost","user","password"); @mysql_select_db("table"); $result_data = @mysql_query("select bin_data from crg where id=$id"); $result_type = @mysql_query("select filetype from crg where id=$id"); $data = @mysql_result($result_data,0,"bin_data"); $type = @mysql_result($result_type,0,"filetype"); header("Content-type: $type"); echo $data; } ?>
 

superdos

New member
זהו בדיוק !

אני רוצה לדעת איך אני משנה את הסקריפט כך שיהיה עם משתנים כמו $_GET ו- $_POST
 

superdos

New member
קודם כל - תודה רבה רבה על התגובה

דבר שני - אני אמקד את השאלה שלי - איך אני גורם לקוד שלי להשתמש במשתנה שנשלח דרך ה URL כגון: www.site.com/get.php?id=6 ? מה אני צריל לרשום בשורת ISSET ? במה משתמשים ב- $_GET או $_POST ? להלן הקוד: <?php if ( isset ($id)) { $result_data = mysql_query("select bin_data from table where id=$id"); $result_type = mysql_query("select filetype from table where id=$id"); $data = mysql_result($result_data,0,"bin_data"); $type = mysql_result($result_type,0,"filetype"); header("Content-type: $type"); echo "$data" } ?>
 

nezek2003

New member
תראה...

בשביל להשתמש במשתנה שמגיע מה URL תשתמש ב $_GET POST לא מגיע ב URL
 

superdos

New member
צריך להשתמש ב $_GET בכל המשתנים ?

תוכל להדגים לי זאת על הקוד ששלחתי? ושוב תודה רבה על הזמן והתשובה המהירה
 

nezek2003

New member
אני נותן לך איזה דוגמא משלי

in the url:somthing.php?ID=2&type=word in the code: $id=$_GET['ID']; $tp=$_GET['type']; .... here you can use these variables .....​
 
למעלה