Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trenutna stranica
Author Message
danielvast Offline
Forumaš
***

Posts: 435
Joined: Dec 2009
Reputation: 22
Post: #11
RE: trenutna stranica
Quote:$_GET['pages']['id'] ili?
Ne ovo bi ti bilo dvodimenzionalno polje He he

Mozda ovako:
PHP Code:
<?php
$tutorijal 
$_GET['tutorijal'];
$id $_GET['id'];

if(!
$id)
{
    if (
$tutorijal == "tut1")
        require (
"tutorijali/tut1.php");
    else if (
$tutorijal == "tut2")
        require (
"tutorijali/tut2.txt");
    else if (isset(
$_GET["tutorijal"]))
        echo 
"<h2>Oups...</h2>";
}
else
{
    if (
$id == "1")
        require (
"tutorijali/id/1.php");
    else if (
$id == "s2")
        require (
"tutorijali/id/2.php");
    else if (isset(
$_GET["id"]))
        echo 
"<h2>Oups...</h2>";
}


?>

"When all else fails, read the manual."
(This post was last modified: 15-04-2011 10:02 PM by danielvast.)
15-04-2011 09:57 PM
Find all posts by this user Quote this message in a reply
sixr Offline
Novi korisnik
*

Posts: 17
Joined: Apr 2011
Reputation: -1
Post: #12
RE: trenutna stranica
E bravo, to je to što mi treba. Veoma sam zahvalan s obzirom na koliko sam foruma bio lik mi je jedan napisao ovako

<?php
if(isset($_GET['index']))
echo "Opis"
?>
xD

ugl, radi kako sam i htio, očitava posebno i hvala još jednom i srry što sam peglao He he
15-04-2011 10:07 PM
Find all posts by this user Quote this message in a reply
danielvast Offline
Forumaš
***

Posts: 435
Joined: Dec 2009
Reputation: 22
Post: #13
RE: trenutna stranica
Nish Namigivanje

"When all else fails, read the manual."
15-04-2011 10:45 PM
Find all posts by this user Quote this message in a reply
sixr Offline
Novi korisnik
*

Posts: 17
Joined: Apr 2011
Reputation: -1
Post: #14
RE: trenutna stranica
Dok sam još online da ne otvaram novu temu, pa ću ovdje.
ako neko ima neki dobar token kod da stavim, pa ako imate neki kod za random key (?s=abb7a8903jm209hljg9)

ja sam to nešto ovako

PHP Code:
class KeyGen {
    
@var 
string
    
const CHAR_ALPHA         "abcdefghijklmopqrstuvwxyz";    
@var 
string
    
const CHAR_ALPHA_CAP    "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@var 
string
    
const CHAR_NUMERIC         "0123456789";
@var 
string
    
const CHAR_SPECIAL         "~@#$%^*()_+-={}|][";
@var 
string
    
const FORMAT_CHAR        "X";
@
param int $length
@param string $characters
    
public static function random($length=4$characters=""){
        if(
$characters == ""$characters .= self::CHAR_ALPHA self::CHAR_ALPHA_CAP self::CHAR_NUMERIC;
        
        
$random "";
        
$characters_length strlen($characters);
        for(
$i=$i $length $i++){
            
$random .= $characters[mt_rand(0$characters_length-1)];
        }
        return 
$random;
    }

public static function 
serial($seperator="-"$part_length=4$parts=5$characters=""$exclude=array()){
        
$serial "";
        do{
            for(
$i=$i $parts $i++){
                if(
$i 0$serial .= $seperator;
                
$serial .= self::random($part_length$characters);
            }
        }while( 
in_array($serial$exclude) );
        
        return 
$serial;
    }

public static function 
customSerial($format="XXXX-XXXX-XXXX"$characters=""$exclude=array()){
        
        
$serial = array();
        
$format_length strlen($format);
        do{
            for(
$i=$i $format_length $i++){
                if(
$format[$i] == self::FORMAT_CHAR){
                    
$serial[] = self::random(1$characters);
                }else{
                    
$serial[] .= $format[$i];
                }
                if(
in_array(implode("",$serial), $exclude)) $i--;
            }
        }while( 
in_array($serial$exclude) );
        return 
implode("",$serial);
    }
    


ako ima neko bolji neka stavi, i ovo mi treba xD
16-04-2011 01:47 AM
Find all posts by this user Quote this message in a reply
danielvast Offline
Forumaš
***

Posts: 435
Joined: Dec 2009
Reputation: 22
Post: #15
RE: trenutna stranica
Ako ti radi tada bi trebao koristiti, meni se ovo cini OK. He he samo da izbacis ove separatore

"When all else fails, read the manual."
(This post was last modified: 16-04-2011 10:05 AM by danielvast.)
16-04-2011 10:02 AM
Find all posts by this user Quote this message in a reply
sixr Offline
Novi korisnik
*

Posts: 17
Joined: Apr 2011
Reputation: -1
Post: #16
RE: trenutna stranica
Pošto sam definisao stringovima različite oblike key generacije, mogu dobiti tipa 999-0000 itd kao i hash kod od 8 do 128 simbola u mogućosti generacije do 5,998,000 "unique key". Mada ću probati dodati još neke stvari tu pa možda izbrišem separatore.
16-04-2011 04:15 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)