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

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

-VladK- 27-06-06 16:42

קיים בJS משהו שמגביל לGET בPHP?
 
כלומר אם אני נכנס לפה:
http://www.hosts.co.il/forums/newthr...newthread&f=14
אז הPHP עושה שימוש בGET כדי לקחת את ה14 וזה...
אבל יש בJS משהו שעושה את הפעולה? סתם בשביל להציג...בתוך האתר לכתוב את ה14 וכו'....

eLad 27-06-06 16:47

קוד:

function getVar(name)
        {
        get_string = document.location.search;       
        return_value = '';
       
        do { //This loop is made to catch all instances of any get variable.
            name_index = get_string.indexOf(name + '=');
           
            if(name_index != -1)
              {
              get_string = get_string.substr(name_index + name.length + 1, get_string.length - name_index);
             
              end_of_value = get_string.indexOf('&');
              if(end_of_value != -1)               
                value = get_string.substr(0, end_of_value);               
              else               
                value = get_string;               
               
              if(return_value == '' || value == '')
                return_value += value;
              else
                return_value += ', ' + value;
              }
            } while(name_index != -1)
           
        //Restores all the blank spaces.
        space = return_value.indexOf('+');
        while(space != -1)
              {
              return_value = return_value.substr(0, space) + ' ' +
              return_value.substr(space + 1, return_value.length);
                                                       
              space = return_value.indexOf('+');
              }
         
        return(return_value);       
        }

http://scripts.franciscocharrua.com/...-variables.php

-VladK- 27-06-06 17:53

זה טיפה...ממש טיפה מפחיד...למה כל כך הרבה? מה אין איזה פונקציה מיוחד לזה?


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

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