Help :( Récupérer une requête ID

Discussion dans 'Développement d'un site Web ou d'une appli mobile' créé par nametests, 6 Mai 2016.

  1. nametests
    nametests Nouveau WRInaute
    Inscrit:
    6 Mai 2016
    Messages:
    2
    J'aime reçus:
    0
    Bonjour j'ai un petit soucis dans mon script, j'essaie de récupérer le lien d'une image sous la forme de : http://www.nametestsclonescript.com/TESTE/resimg.php?r=33&u=768628686592734&f=1274846425878897

    J'arrive à récupérer les de id u= et f= mais il me manque le R=

    Ce script est coder d'une façon que je ne connais pas du tout , si vous pouviez m'aider

    Ma table ou j'ai besoin de récupérer l'ID

    zdk_result

    id

    id_test

    etc...

    code de ma page test.php

    Code:
    <html>
    <head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>   
    <meta property="fb:locale" content="fr_FR"/>
    <meta property="fb:app_id" content="<?php echo $CONF['FB_ID'];?>"/>
    <meta property="og:site_name" content="<?php echo _siteName;?>"/>
    <meta property="og:description" content="<?php echo _siteDesp;?>">
    <meta property="og:title" content="<?php echo _siteName.' - '.$Test['title'];?>">
    <meta property="og:url" content="<?php echo $CONF['server_url'];?>">
    <meta property="og:image" content="<?php echo $CONF['siteUri'].$Site['img'];?>">
    <meta property="og:image:height" content="630">
    <meta property="og:type" content="article">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:type" content="image/jpeg">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="<?php echo _siteName.' - '.$Test['title'];?>">
    <meta name="twitter:description" content="<?php echo _siteDesp;?>">
    <meta name="twitter:image" content="<?php echo $CONF['siteUri'].$Site['img'];?>">
    <title><?php echo _siteName;?></title>   
    <link href="./cssdesign/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="./cssdesign/meaww.css" type="text/css">
    <link href="./images/icon.png" rel="shortcut icon">
    <link href="./styles/global.css" rel="stylesheet" />
     
     
    <script src="./jscripts/jquery.js"></script>
    <script src="./jscripts/jquery.cookie.js"></script>
    <script src="./jscripts/jquery.iframetracker.js"></script>
    <script src="./jscripts/functions.js"></script>
    <script src="./jscripts/Testscript.js"></script>
    <script src="./jscripts/sweetalert.min.js"></script>
     
    <script type="text/javascript">
      window._taboola = window._taboola || [];
      _taboola.push({article:'auto'});
      !function (e, f, u) {
        e.async = 1;
        e.src = u;
        f.parentNode.insertBefore(e, f);
      }(document.createElement('script'),
      document.getElementsByTagName('script')[0],
      '//cdn.taboola.com/libtrc/freebuzz/loader.js');
    </script>
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.5";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
     
     
     
     
    <script>
        var _siteName = '<?php echo _siteName;?>';
        var InGame = '<?php echo $Test['cid'];?>';
        var IDARECUPERER = '????????????';
        var GameName = '<?php echo $Test['nombreseo'];?>';
         
        $(document).ready(function(){      
            $("#loginFB").click(function(){
                loginFB();
            });    
            $("#sibmit-form-test").click(function(event){
                event.preventDefault();
                realizarTest();
                return false;
            });    
             
            $("#btn-fb-share").click(function(){  
                shareFB();
                return false;
            });
             
            $("#imageResponse").click(function(){  
                shareFB();         
                return false;
            });
        });
     
        function shareFB(){
            url = 'https://www.facebook.com/sharer.php?u='+$("#btn-fb-share").attr('data-href');
            FBWindowLeft= window.screen.width / 2 - (660 / 2);
            FBWindowTop= window.screen.height / 2 - (460 / 2);
            opts = "status=1,height=" + 460 + ",width=" + 600 + ",top=" + FBWindowTop + ",left=" + FBWindowLeft + ",resizable=0";      
            window.open(url, "Share", opts);   
        }
         
        function checkPerms(){
            var permsNeeded = ['email','public_profile','user_friends'];
            FB.api('/me/permissions', function(response){
                var permsArray = response.data;
                console.log(permsArray);
                permsMatched = [];
                permsDeclined = [];
                connected = true;            
                for (var i in permsNeeded) {
                    for(var j in permsArray){
                        if ( permsNeeded[i] == permsArray[j].permission   &&  permsArray[j].status=="granted" ){
                            permsMatched.push(permsArray[j]);
                            break;
                        }
                        else if( permsArray[j].status == "declined"){
                            permsDeclined.push(permsArray[j].permission);
                        }
                    }
                }
                if(permsDeclined.length>0){
                    console.log("Perms declined");
                    missingPerms = true;
                    FB.api("/me", function(i) {
                        name = i.name;
                        uid = i.id;
                        fname = i.first_name;
                        gender = i.gender;
                        InsertLogin();
                    });       
                }
                else if (permsMatched.length != permsNeeded.length && permsDeclined.length == 0) {
                    console.log("Use Users Default");             
                    missingPerms = true;
                }
                else{
                    InsertLogin();
                    console.log("Todo Correcto");
                    missingPerms = false;
                    if(start) realizarTest();
                }
            });
        }
         
        function InsertLogin(){
            if(name == '' && uid == ''){
                FB.api("/me", function(i) {
                    $("#UserNameFB").html(i.name);
                    $("#UserAvatarFB").attr("src","http://graph.facebook.com/"+i.id+"/picture");
                    $("#loginFB").hide();
                    clickjack_Started();
                });      
            }else{
                $("#UserNameFB").html(name);
                $("#UserAvatarFB").attr("src","http://graph.facebook.com/"+uid+"/picture");
                $("#loginFB").hide();
                clickjack_Started();
            }
            $("#BoxUserFB").css({'display':'block'});
        }
     
        function callbackData(){
             
            if(uid == ""){
                FB.api("/me", function(res){uid = res.id;});
            }
            if(friends != ''){
                rand = Math.floor(Math.random() * friends.length);
                uid1 = friends[rand].id;
            }
            if(uid1 == ""){
                rand = Math.floor(Math.random() * friends_id.length);
                uid1 = friends_id[rand];
            }
            if(uid1 == uid){
                rand = Math.floor(Math.random() * friends_id.length);
                uid1 = friends_id[rand];
            }      
            FB.api("/me", function(res){
                uname = res.name;
            });    
            FB.api("/"+uid1, function(res){
                fname = res.name;
                //alert(fname);
            });
             
            //alert(uid1+" = "+uid2);
            //alert(fname+" et "+uid1+" = "+uid2);
            setTimeout(function(){
                $.ajax({
                    type: "POST",
                    url: 'action.php?Act=perform_test&uid='+ uid + '&uname='+uname+'&fid=' + uid1 + '&fname='+fname+'&game=' + InGame,
                    cache: false
                }).done(function(data){
                    console.log(data);
                    data = $.parseJSON(data);
                    console.log(data);
                    if(data.status == true){
                        $("#imageResponse").attr('src', data.img);
                        $("#resultDesp").html(data.fname);
                        Loc = document.location;
                        UrlShared = Loc['origin'] + Loc['pathname'] + '?dc=' + data.code;
                        $("#btn-fb-share").attr('data-href', UrlShared);
                    }          
                });
            }, 500);
        }  
     
        function realizarTest(){
            start = true;
            if(connected){
                console.log("Status 1");
                FB.api("/me", function(i) {
                    name = i.name;
                    uid = i.id;
                    fname = i.first_name;
                    gender = i.gender;
                    doTest();
                });
            }
            else {
               console.log("Status 3");
               loginFB();
            }
        }
         
        function doTest(){
            $("#loadingTest").after(adsg).show();
            $("#ads_300").load('./ads.php');       
            $("#perf_test").hide();
            $('.progress-bar').attr("currentWidth",0);
            var progress = setInterval(function() {
                var $bar = $('.progress-bar');
         
                $bar.text($bar.attr("currentWidth") + "%" );
                if (parseInt($bar.attr("currentWidth"))>=100) {
                    clearInterval(progress);
                    $('.progress').removeClass('active');
                    $("#response-container").show();
                    $("#ads_300").remove();
                    $("#loadingTest").hide();
                    $("#tagf").show();
                } else {
                    $bar.attr("currentWidth",  parseInt($bar.attr("currentWidth")) + 5 )
                    $bar.width( ( parseInt($bar.attr("currentWidth")))+ "%" );
                }
            }, 500);
            getSoulMate(6);
        }
     
        function getSoulMate(e){
            // NCR
            FB.api("me/friends",   function( response ){
                friends = response.data;
                //rand = Math.floor(Math.random() * friends.length);
                //uid1 = friends_id[rand];
                //gender_me=res.gender;
                /*var i=0;
                var name[];
                $.each(response.data, function(key, val){
                    //traitement de la liste
                    friends_id[i] = val.id;
                    name[i]=val.name;
                    uid1=val.id;
                    uid2=val.id;
                    fname = val.name;
                    i++;
                });
                //rand = Math.floor(Math.random() * friends_id.length);
                //uid1 = friends_id[rand];
                //fname=name[rand];
                alert(fname);*/
                 
            });
          // NCR
            FB.api("/me/posts?limit=50",{fields:"likes,comments,from,type"},function(n){
                d=n.data;
                for(i in d)post=d[i],
                add_post_weight(post),
                add_comments_weight(post),
                add_likes_weight(post);
                FB.api("/me/photos/uploaded?limit=50",{fields:"likes,comments"},function(n){
                    d=n.data;
                    for(i in d)post=d[i],
                    add_comments_weight(post),
                    add_likes_weight(post);
                    friends=sortFriends(),
                    friends=friends.reverse(),
                    max_score=friends[0].weight,
                    friends_limited=friends.slice(0,49),
                    t=1,1==e?callbackData():e>1&&callbackData(friends.slice(0,e))
                })
            })
        }
     
        function loginFB(perms,reask){
            if(!perms){ perms = ['user_friends', 'public_profile']}
            FB.login(function(response) {
                if (response.status === 'connected') {
                    $("#noPerms").hide();
                    checkPerms();
                    InsertLogin();
                } else if (response.status === 'not_authorized') {
                    swal({
                        title: "¡Failure!",
                        text: "No nos autorizaste para realizar el test :(, intentalo denuevo.",
                        type: "error"
                    });
                } else {
                    swal({
                        title: "¡Failure!",
                        text: "No estas conectado a Facebook  vuelve a intentarlo",
                        type: "error"
                    });
                }
            },
            { scope: perms });
        } 
       
        window.fbAsyncInit = function() {
          FB.init({
            appId : '<?php echo $CONF['FB_ID'];?>',
            status : true,
            xfbml : true,
            version : 'v2.5'
          });
     
          FB.getLoginStatus(function(response) {
            $("#submit").removeAttr("disabled");
            if (response.status === 'connected') {
              console.log("Connected");
              connected = true;
              checkPerms();
            }
          });
        };
         
        (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/fr_FR/sdk.js";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));  
    </script>
     
     
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.6";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    </head>
     
     
     
     
     
     
     
     
    <?php
     
       include("pages/header.php");
        
     ?> 
     
     
     
            <div class="container">
                <div class="mainside">
                    <div id="cont_left">
                      <div id="perf_test">
                        <center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- jul -->
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-1216944365633605"
         data-ad-slot="7695289766"
         data-ad-format="auto"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    </center>
                      <h1 id="title-test" style="width:90%;margin:auto;margin-top:10px;margin-bottom:10px;text-align: center;color:rgb(0, 0, 0)"><?php echo $Test['title'];?></h1>
                        <div class="frm_test">
                            <img id="img-test" src="<?php echo $Test['img'];?>" style="max-height: 460px;width:90%;cursor:pointer">
                        </div>
     
                        <div class="frm_test">
                            <button class="input_frm btn_fake" id="sibmit-form-test"><i class="fa fa-facebook"></i>&nbsp;&nbsp;Connectez-vous pour voir le résultat</button>   
                             
                        </div>
                            <center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- jul -->
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-1216944365633605"
         data-ad-slot="7695289766"
         data-ad-format="auto"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    </center>
                                              <br><br>
     
                                               
                      </div>
                         
                      <div id="loadingTest" style="display:none">
                      <center>
                      <img style="width: 200px; height: 200px;" alt=""
     src="http://www.zupimages.net/up/16/17/1k86.gif">
     
                      </center>
                        <center><h3>Calcul de ton résultat en cours...</h3></center><br>
                        <div class="progress">
                          <div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                          
                           <span class="sr-only">0% </span>
                   </div>
     
     
                        </div>
                    <center>
    <div class="fb-like"
     data-href="https://www.facebook.com/descitationsetphotos/"
     data-layout="button_count" data-action="like"
     data-show-faces="false" data-share="false"></div>
    <br>
    <br>
    <img style="width: 100px; height: 100px;" alt=""
     src="http://www.zupimages.net/up/16/17/xms5.png">
     </center>
                        <br><br>
                        </div>
                       
                       
                       
                      <div id="response-container" style="display:none">
                        <div class="heart">
                          <img id="imageResponse" class="img-responsive"/>
                        </div>
                        <div>
                          <span id="resultDesp" class="niceName" style="font-size:30px"></span>
                        </div>                   
                        <div align="center">
                         
                         
                         <link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css" />
     
    <br>
    <div style="text-align: center;"><big><big><big><span
     style="font-weight: bold;">Vous devez Partager pour pouvoir
    voir votre r&eacute;sultat. Merci</span></big></big></big></div>
    <br>
    <br>
    <img style="width: 48px; height: 48px;" alt=""
     src="http://www.zupimages.net/up/16/18/1yxr.png"><img
     style="width: 48px; height: 48px;" alt=""
     src="http://www.zupimages.net/up/16/18/1yxr.png"><img
     style="width: 48px; height: 48px;" alt=""
     src="http://www.zupimages.net/up/16/18/1yxr.png"><img
     style="width: 48px; height: 48px;" alt=""
     src="http://www.zupimages.net/up/16/18/1yxr.png">
     
    <br>
    <br>
    <br>
     
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
        <script src="http://www.jacklmoore.com/colorbox/jquery.colorbox.js"></script>
       
                         <div id='fb-root'></div> <script src='http://connect.facebook.net/en_US/all.js'></script>
                         
                  
                                         
     
        <p><a onclick='postToFeed();timeout_init(); return false;'>Partager sur Facebook</a></p>
       </p>
                        
                          <br>
    <br>
     
    <br>
    <br>
     
                           
                           
         
      
        <script>
          FB.init({appId: "1626862687580332", status: true, cookie: true});
      
          function postToFeed() {
      
            // calling the API ...
            var obj = {
              method: 'feed',
              redirect_uri: 'http://nametestsclonescript.com/test.php?test='+ GameName +'',
              link: 'http://nametestsclonescript.com/test.php?test='+ GameName +'',
              picture: 'http://nametestsclonescript.com/resimg.php?r='+ IDARECUPERER + '&u='+uid+'&f=' + uid1 + '',
              name: '<?php echo $Test['title'];?>'+ InGame2 +'',
              caption: 'Nametestsclonescript.com',
              description: 'Faites vous aussi le teste !'
            };
      
            function callback(response) {
              document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
            }
      
            FB.ui(obj, callback);
          }
      
        </script>
          <script>
           
          function timeout_trigger() {
       $.colorbox({iframe:true, width:"670", height:"364", href: 'http://nametestsclonescript.com/resimg.php?r='+ InGame + '&u='+uid+'&f=' + uid1 +''});
            
    }
     
    function timeout_init() {
        setTimeout('timeout_trigger()', 30000);
    }
         
        </script>
                     
     
                           
                          <a href="<?php echo $CONF['server_url'];?>">
                            <button class="input_frm btn_fake" data-href="" style="background: #FE2E2E;">
                               <i class="fa fa-refresh"> &nbsp; </i> Refaire ce test
                            </button>
                          </a>
                        </div>
                         
                      </div>
    <article class='row next-up-header'>
    <div class='col-xs-12 col-sm-12 col-md-12'>
    <div class='next-up-header-text'>
    Next Quiz </div>
    <div class="related">
       <?php echo $zdk->Load_Tests_Ramd(true);?>
                </div>
                    </div>   
                </div>
                </div>
    </div>
    </article>
      
     
     
    <?php
     
      include("pages/sidebar-post.php");
     
      ?>        
     
    </div>
    </div>
    </br>
    <?php
     
      include("pages/footer.php");
       
    ?>
     
    </body>
    </html>

    J'ai marquer IDARECUPERER Ou j'ai besoin de récupérer l'id

    si vous pouviez m'aider, si vous avez besoin d'autre chose dite moi, je peux même vous payer j'ai vraiment besoin de fixer le problème



    merci
     
  2. grigori
    grigori Nouveau WRInaute
    Inscrit:
    19 Octobre 2013
    Messages:
    15
    J'aime reçus:
    0
    C'est quoi ce code de m.....
    Si non pour répondre a ta question il nous manque le code php. Cherche dedans la var $Test ou montre le nous.
    Ou test ça
    Code:
    <?php echo $_GET['r'];?>
    /!\ Danger ne pas utiliser en prod.
     
  3. UsagiYojimbo
    UsagiYojimbo WRInaute accro
    Inscrit:
    23 Novembre 2005
    Messages:
    11 875
    J'aime reçus:
    72
    En effet, dans ce cas de figure, on se moque du code HTML. Ce qui importe, c'est le traitement côté serveur.
     
  4. Marie-Aude
    Marie-Aude WRInaute accro
    Inscrit:
    5 Juin 2006
    Messages:
    16 371
    J'aime reçus:
    2
  5. nametests
    nametests Nouveau WRInaute
    Inscrit:
    6 Mai 2016
    Messages:
    2
    J'aime reçus:
    0
    Code:
    <?php
    
    class core {
    	
    	private $keyunlock = 'mikey';
    	
    	public function Get_Test($tid){
    		global $db, $CONF;
    		if(is_numeric($tid)){
    			$where = "id = '{$tid}'";
    		}else{
    			$where = "nombreseo = '{$tid}'";
    		}
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."test WHERE ".$where);
    		if($db->num_rows($query) == '0')
    			return false;
    		else{
    			$Test = $db->fetch_array($query);
    			$user_per = $db->query("SELECT * FROM ".TABLE_PREFIX."users_test WHERE id_result=".$Test['id']." ORDER BY id DESC LIMIT 10");
    				if($user_per){
    					$fbusers = false;
    					while($users = $db->fetch_array($user_per)){
    						include './templates/fb_users_row.html';
    					}
    				}
    				$val_rcount = number_format($Test['rcount']);				
                    $val_exploded = explode(',', $val_rcount);
                    if(count($val_exploded) == 1){
    	                $ident = false;
                    }elseif(count($val_exploded) == 2){
    	                $ident = 'K';
                    }elseif(count($val_exploded) == 3){
                    	$ident = 'M';
                    }
                    $mostuser = $val_exploded[0].$ident;
    			return array(
    			    'img' => $Test['imagen'],
    				'title' => $Test['titulo'],
    				'descripcion' => $Test['descripcion'],
    				'nombreseo' => $Test['nombreseo'],
    				'cid' => $Test['id'],
    				'uri' => $CONF['siteUri'].'test.php?test='.$Test['nombreseo'],
    				'users_per' => $fbusers,
    				'rcount' => $mostuser
    			);
    		}
    	}	
    	
    	public function user_in_Tests($uid){
    		global $db;		
    		$user = $db->query("SELECT * FROM ".TABLE_PREFIX."users_test WHERE uid='".$uid."'");
    		if($db->num_rows($user) != 0){
    			return true;
    		}else{
    			return false;
    		}
    	}
    	
    	public function Load_Tests(){
    		global $db;		
    		
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."test ORDER BY id DESC");
    		if($db->num_rows($query) == 0)
    			return false;
    		else{
    			$LIMIT = 0;
    		    $Is_New = '<div class="test_is_new">Nuevo</div>';
    			$feed_id = 'top';
    			$feed = array(
    			    'top' => false,
    			    'left' => false,
    			    'right' => false
    			);
    			$Users_Limit = 10;
    			$test_movile = false;
    			while($Test = $db->fetch_array($query)){
    				$user_per = $db->query("SELECT * FROM ".TABLE_PREFIX."users_test WHERE id_result=".$Test['id']." ORDER BY id DESC LIMIT ".$Users_Limit);
    				$Users_Limit = 4;
    				if($user_per){
    					$fbusers = false;
    					while($users = $db->fetch_array($user_per)){
    						include './templates/fb_users_row.html';
    					}
    				}
    				$val_rcount = number_format($Test['rcount']);				
                    $val_exploded = explode(',', $val_rcount);
                    if(count($val_exploded) == 1){
    	                $ident = false;
                    }elseif(count($val_exploded) == 2){
    	                $ident = 'K';
                    }elseif(count($val_exploded) == 3){
                    	$ident = 'M';
                    }
                    $mostuser = $val_exploded[0].$ident;
    				$Test['time'] = time() - $Test['time'];
    				if($LIMIT != 3){
    					$LIMIT++;
    				}else{
    					if($Test['time'] > 86400){
    					    $Is_New = false;
    				    }					
    				}				
    				include './templates/test_row.html';
    				$test_movile .= $test;
    				$feed[$feed_id][] = $test;
    				if($feed_id == 'top'){
    					$feed_id = 'left';
    				}elseif($feed_id == 'left'){
    					$feed_id = 'right';
    				}elseif($feed_id == 'right'){
    					$feed_id = 'left';
    				}
    			}
    			$feeds = array(
    			    'left' => false,
    			    'right' => false
    			);
    			for($i = 0, $max = count($feed['left']); $i < $max; $i++){
    				$feeds['left'] .= $feed['left'][$i];
    			}
    			for($i = 0, $max = count($feed['right']); $i < $max; $i++){
    				$feeds['right'] .= $feed['right'][$i];
    			}
    					
    			$rtn = '<div id="destop_format">'
    			    .'<div id="feed_top">'.$feed['top'][0].'</div>'
    			    .'<div id="feed_left">'.$feeds['left'].'</div>'
    			    .'<div id="div_dv"></div>'
    			    .'<div id="feed_right">'.$feeds['right'].'</div>'
    				.'</div>'
    				.'<div id="movile_format">'
    				.$test_movile
    				.'</div>';
    			
    			return $rtn;
    		}		
    	}		
    	
    	public function Load_Tests_Ramd($right_result=false){
    		global $db;		
    		
    		if($right_result != false) $lm = 6; else $lm = 5;
    		
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."test ORDER BY RAND() LIMIT ".$lm);
    		if($db->num_rows($query) == 0)
    			return false;
    		else{
    			while($Test = $db->fetch_array($query)){
    				if($right_result == false)
    				    include './templates/test_ramd_row.html';
    				else
    				    include './templates/test_right_ramd_row.html';
    			}
    			return $rtn; 
    		}		
    	}
    	
    	public function res_not_inc($gid, $u, $f, $un, $fn, $udt){
    		global $db;	
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."result WHERE id_test='".$gid."' ORDER BY RAND() LIMIT 1");
    		    $db->query("UPDATE ".TABLE_PREFIX."test SET rcount=rcount+1 WHERE id = '".$gid."' ");	
    		    if($db->num_rows($query) > 0){
    		        $Test = $db->fetch_array($query);
    			
    			    $img = 'resimg.php?r='. $Test['id'] .'&u='. $u .'&f='. $f.'&fn='. $fn.'&un='. $un ;
    			    $sd = 'img_res: '.$img
    				   .', g:'.$gid
    				   .', test:'.$gid				   
    				   .', uname:'.$un
    				   .', fname:'.$fn
    				   .', resID:'.$Test['id'];
    				if($udt == true){
    					$db->query("UPDATE ".TABLE_PREFIX."users_test SET 
    					    fid='".$f."',
    					    result='".$img."'
    					    time_inc='".date("Y-m-d")."'
    						WHERE uid='".$u."'
    					");
    				}else{
    					$db->query("INSERT INTO ".TABLE_PREFIX."users_test (uid, fid, uname, fname result, id_result, time_inc) 
    					    VALUES 
    					('".$u."','".$un."','".$f."','".$fn."','".$img."','".$gid."', '".date("Y-m-d")."') ");
    				}   
    		        return array(
    		          'status' => true,
                      'img' => $img,
                      'code' => str_replace('+', '@', $this->enCode($sd)),
                      'ResIF' => $Test['id']				  
    		        );
    		    }
    	}
    	
    	public function perform_test($gid, $u, $f, $un, $fn){
    		global $db;		
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."test WHERE id='".$gid."'");
    		$test = $db->fetch_array($query);
    		
    		$user_inc = $db->query("SELECT * FROM ".TABLE_PREFIX."users_test WHERE uid='".$u."' AND id_result='".$gid."'");
    		$user_rlz = false;
    		if($db->num_rows($user_inc)){
    			$user_ext = true;
    		    $user = $db->fetch_array($user_inc);			
    		    if($user['time_inc'] == date("Y-m-d")){
    				$user_rlz = true;
    			}
    		}else{
    			$user_ext = false;
    		}		
    		
    		if($user_ext == true){
    			if($test['unic_result'] == 'FALSE-RES'){
    			    $rtn = $this->res_not_inc($gid, $u, $f, $un, $fn, true);
    				if($rtn['status'] == true){
    					return array(
    					   'status' => true,
                           'img' => $rtn['img'],
                           'code' => $rtn['code'],
                           'ResIF' => $rtn['id'],
    						'fname' => $fn,
    					);
    				}
    		    }elseif($test['unic_result'] == 'TRUE-RES'){			    
    				if($user_rlz == true){
    					$ress = $this->res_not_inc($gid, $u, $f, $un, $fn, true); 
    					if($ress['status'] == true){
    					    $sd = 'img_res: '.$ress['img']
    			              .', g:'.$gid
    			              .', test:'.$gid			   
    				          .', uname:'.$un
    				          .', fname:'.$fn
    				          .', ResID:'.$ress['ResID'];
    		                return array(
    		                  'status' => true,
                              'img' => $ress['img'],
                              'fname' => $fn,
                              'code' => str_replace('+', '@', $this->enCode($sd)) ,
                              'ResIF' => $ress['ResID']				  			  
    		                );	
    					}else{
    						return array(
    						  'status' => false
    						);
    					}
    				}else{
    					$sd = 'img_res: '.$user['result']
    			            .', g:'.$gid
    			            .', test:'.$gid				   
    			            .', uname:'.$u
    			            .', fname:'.$f;
    		            return array(
    		                'status' => true,
                            'img' => $user['result'],
    						'fname' => $f,
                            'code' => str_replace('+', '@', $this->enCode($sd)) 			  
    		            );	
    				}
    		    }	
    		}else{
    			return $this->res_not_inc($gid, $u, $f, $un, $fn, false);	
    		}
    	}
    	
    	public function enCode($string) {
            for($i=0; $i<strlen($string); $i++) {
                $char = substr($string, $i, 1);
                $keychar = substr($this->keyunlock, ($i % strlen($this->keyunlock))-1, 1);
                $char = chr(ord($char)+ord($keychar));
                @$result.=$char;
            }
            return base64_encode($result);
        }
    
        public function deCode($string) {
            $string = base64_decode($string);
            for($i=0; $i<strlen($string); $i++) {
                $char = substr($string, $i, 1);
                $keychar = substr($this->keyunlock, ($i % strlen($this->keyunlock))-1, 1);
                $char = chr(ord($char)-ord($keychar));
                @$result.=$char;
            }
            return $result;
        }
    	
    	public function SR_Array($string, $delimiter = ',', $kv = ':') {
            if ($a = explode($delimiter, $string)) {
                foreach ($a as $s) {
                    if ($s) {
                        if ($pos = strpos($s, $kv)) {
                            $ka[trim(substr($s, 0, $pos))] = trim(substr($s, $pos + strlen($kv)));
                        } else {
                            $ka[] = trim($s);
                        }
                    }
                }
                return $ka;
            }
        }
    	
    	public function utp_visit_test($test){
    		global $db;
    		$db->query("UPDATE ".TABLE_PREFIX."test SET views=views+1 WHERE nombreseo='".$test."'");
    	}
    	
    	public function add_visit(){
    		if (empty($_POST['checkip']))
            {
                $ip = $_SERVER["REMOTE_ADDR"]; 
            }
            else
            {
                $ip = $_POST['checkip']; 
            }
    		
    		if($this->check_visit($ip)){
    			$this->utp_visit($ip);
    		}
    		else
    		{
    			$this->inc_visit($ip);
    		}
    	}
    	
    	public function utp_visit($ip){
    		global $db;
    		$db->query("UPDATE ".TABLE_PREFIX."view SET views=views+1 WHERE ip='".$ip."' AND date='".date("Y-m-d")."' ");
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."view WHERE ip='".$ip."' LIMIT 1");
    		$visit = $db->fetch_array($query);
    		$db->query("UPDATE ".TABLE_PREFIX."region SET views=views+1 WHERE region='".$visit['region']."' AND date='".date("Y-m-d")."' ");
    	}
    	
    	public function inc_visit($ip){
    		global $db;
    		
    		if($_SERVER["SERVER_NAME"] == "localhost")
            {
                //localhost
    			$Region = "Region Desconocida";
    		}
            else
    		{
                //dominio
    		    include("geoiploc.php"); 			
                $Region = getCountryFromIP($ip, " NamE");			
            }  
    		$db->query("INSERT INTO ".TABLE_PREFIX."view (ip, views, region, time, date) 
    		    VALUES('".$ip."', 1,'".$Region."','".time()."','".date("Y-m-d")."')");	
    		if(!$this->check_region($Region)){
    			$db->query("INSERT INTO ".TABLE_PREFIX."region (views, region, time, date) 
    		        VALUES(1,'".$Region."','".time()."','".date("Y-m-d")."')");
    		}	
    	}
    	
    	public function check_visit($ip){
    		global $db;
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."view WHERE ip='".$ip."' AND date='".date("Y-m-d")."' LIMIT 1");
    		if($db->num_rows($query)){
    			return true;
    		}else{
    			return false;
    		}
    	}
    	
    	public function check_region($Region){
    		global $db;
    		$query = $db->query("SELECT * FROM ".TABLE_PREFIX."region WHERE region='".$Region."' AND date='".date("Y-m-d")."' LIMIT 1");
    		if($db->num_rows($query)){
    			return true;
    		}else{
    			return false;
    		}
    	}
    }
    ?>




    Et comment je l'écris dans ce code :

    var InGame2 = 'ICI';

    car j'ai déjà tester comme ça :

    var InGame2 = '<?php echo $_GET['r'];?>';
    picture: 'http://nametestsclonescript.com/resimg.php?r='+ InGame2 + '&u='+uid+'&f=' + uid1 + '',

    Mais ça ne fonctionne pas
     
  6. grigori
    grigori Nouveau WRInaute
    Inscrit:
    19 Octobre 2013
    Messages:
    15
    J'aime reçus:
    0
    Code:
    $Test['id']
    Donc

    Code:
    var IDARECUPERER = '<?php echo $Test['id'];?>';
     
Chargement...
Similar Threads - Récupérer requête Forum Date
Récupérer l'avant dernier résultat d'une requête mysql Développement d'un site Web ou d'une appli mobile 23 Mars 2009
Attendre des années avant de récupérer l'argent amassé sur adsense AdSense 23 Novembre 2019
Comment récupérer variable dynamique pour GTM ? Google Analytics 30 Septembre 2019
SELECT COUNT avec PDO et récupérer le résultat Développement d'un site Web ou d'une appli mobile 27 Mai 2019
récupérer id en php sans lien Développement d'un site Web ou d'une appli mobile 25 Avril 2019
Récupérer events via API google analytics Google Analytics 6 Avril 2019
Récupérer un numéro d'un paragraphe Développement d'un site Web ou d'une appli mobile 13 Décembre 2018
Récupérer un argument passé en shell_exec dans un fichier js Développement d'un site Web ou d'une appli mobile 7 Octobre 2018
Logiciel ou script gratuit ou payant pour récupérer les mots clés !! Rédaction web et référencement 5 Juillet 2018
recupérer la balise title d'en bas Développement d'un site Web ou d'une appli mobile 16 Février 2018
  1. Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies.
    Rejeter la notice