Request an important programming experts

Discussion in 'PHP' started by d3mk, Oct 12, 2010.

  1. #1
    Has a file php
    I want to modify it
    This is an increase in the value - stat - When you load appearance file

    Is it possible to make it more than the value stat
    When the process of opening another site (popup)
    And I want the work piece in the same file and not another file

    
    
    
    <?php
    
    
    include("config.php");
    $get_pop = @mysql_query("SELECT `id`, `pop`, `url` FROM `popup` where pop > 0 and act='on' ORDER BY RAND() LIMIT 1");
    while($pop = @mysql_fetch_array($get_pop))
    {
    
    $id = $pop['id'];
    $url = $pop['url'];
      
    
    }
    
    
    $get_pop = mysql_query("UPDATE `popup` SET `stat` = stat + 1 WHERE `id` = $id");
    
    
    ?>
    
    
    
    
    
    var openx<? echo $id;?> = false;
    
            function opena<? echo $id;?>(url)
    
            {
    
                   if ( openx<? echo $id;?> == true )
    
                    {
    
                            return true;
    
                    }
    
                    win = window.open(url, 'open<? echo $id;?>', 'toolbar,status,resizable,scrollbars,menubar,location,height=750,width=1000');
    
                    if ( win )
    
                    {
    
                            win.blur();
    
                            openx<? echo $id;?> = true;
    
                    }
    
                    return win;
    
            }
    
            function setCookie(name, value, time)
    
            {
    
                var expires = new Date();
    
                expires.setTime( expires.getTime() + time );
    
                document.cookie = name + '=' + value + '; expires=' + expires.toGMTString();
    
            }
    
            function getCookie(name) {
    
                var cookies = document.cookie.toString().split('; ');
    
                var cookie, c_name, c_value;
    
                for (var n=0; n<cookies.length; n++) {
    
                    cookie  = cookies[n].split('=');
    
                    c_name  = cookie[0];
    
                    c_value = cookie[1];
    
                    if ( c_name == name ) {
    
                        return c_value;
    
                    }
    
                }
    
                return null;
    
            }
    
            function openz<? echo $id;?>()
    
            {
    
                    if ( document.attachEvent )
    
                    {
    
                            document.attachEvent( 'onclick', checkx<? echo $id;?> );
    
                    }
    
                    else if ( document.addEventListener )
    
                    {
    
                            document.addEventListener( 'click', checkx<? echo $id;?>, false );
    
                    }
    
            }
    
            function checkx<? echo $id;?>(e)
    
            {
    
                if ( !getCookie('copenx<? echo $id;?>') ) {
    
                    var e = e || window.event;
    
                    var win = opena<? echo $id;?>('<? echo $url;?>');
    
                    setCookie('copenx<? echo $id;?>', 1, 0*60*1000);
    
    
    
                }
    
            }
    
    openz<? echo $id;?>();
    
    
    PHP:

    I want to implement it

    $get_pop = mysql_query("UPDATE `popup` SET `stat` = stat + 1 WHERE `id` = $id");
    PHP:
    If you open the other site
    The inside of JavaScript code


    openz<? echo $id;?>();


    Waiting for your suggestions
     
    d3mk, Oct 12, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    koko5, Oct 12, 2010 IP
  3. d3mk

    d3mk Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I can not find in the website solves the problem
    Or you did not understand my intention

    When you click on the page shows another site

    And when the other site shows It performs the following

    $get_pop = mysql_query("UPDATE `popup` SET `stat` = stat + 1 WHERE `id` = $id");
     
    d3mk, Oct 12, 2010 IP
  4. d3mk

    d3mk Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    up up :( plz help me
     
    d3mk, Oct 13, 2010 IP
  5. paid1234

    paid1234 Greenhorn

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    have you received your help yet?
     
    paid1234, Oct 13, 2010 IP