• Bannato Super User

    controllo box con javascript

    Salve

    Sto cercando di applicare un controllo ai bannerini che vedete in fondo alla pagina (coregistrazioni) vorrei che diventino obbligatorie per poter procedere alla iscrizione al sito

    acash.net/index.php?view=join&

    Potete aiutarmi a trovare una soluzione valida che inponga di spuntare il SI in tutte i bannerini

    mi hanno fornito questo codice ma mi da problemi a tutti la pagina

    [php]

    if (msg != '') {
    alert(msg);
    return false;
    }
    if (msg == '') {
    $(".leadium_coreg input[type=radio][value=1]").each( function(){
    if( $(this).attr("checked") == "false" || $(this).attr("checked") == "" ){
    if( msg == "")
    alert("Per continuare è obbligatorio registrarsi alle nostre offerte cliccando su Si.");
    msg = 'ko';

                }
            });
        }
        if (msg != '') {
            return false;
        }else{
            return submitLeadiumCoregs("Errore");                
        }
    });
    

    });

    [/php]

    Vi ringrazio per aiuto

    Saluti


  • Super User

    Ciao guadagnaeuro,
    includi anche la libreria jQuery? Il tuo script la utilizza.


  • Bannato Super User

    Ciao ayrton2001

    Si ho una libreria che si chiama jquery-1.4.1.min.js e posso caricarla nella pagina

    Pero non so integrare la funzione nella pagina, non riesco a capire come creare questo controllo

    Ti allego il codice completo della pagina

    Spero in un tuo aiuto, ti ringrazio davvero

    Debbo attivare questo controllo in questa pagina solo per le coregistrazioni e deve funzionare sia se un utente non sceglie nulla e sia se un utente sceglie NO, devi mostrare un popup spiegando di accettare le newsletter dei banner proposti.

    codice completo della mia pagina
    [php]

    <?
    //S//
    function edit_upline($x, $ref) {
    global $form_username, $Db1;
    if($x <= 5) {
    if($form_username != $ref) {
    $sql=$Db1->query("SELECT * FROM user WHERE username='$ref'");
    $thisuser=$Db1->fetch_array($sql);
    $sql=$Db1->query("UPDATE user SET referrals".($x)."=referrals".($x)."+1".iif($x==1,", week_refs=week_refs+1").", referrals=referrals+1 WHERE username='$ref'");
    if((isset($thisuser[refered])) && ($thisuser[refered] != $ref)) {
    edit_upline(($x+1), $thisuser[refered]);
    }
    }
    }
    }
    //E//

    if($action == "join") {
    if($settings["deny_multiple_ips"] == 1) {
    $sql=$Db1->query("SELECT userid FROM user WHERE last_ip='$vip'");
    if($Db1->num_rows() > 0) $ipInUse = true;
    }
    if($reff == $form_username) {
    $reff="";
    }
    $a=strpos($form_url,"ht tp://");
    $sql=$Db1->query("SELECT * FROM email_block WHERE account='$form_email'");
    if($Db1->num_rows() != 0) {
    $error_msg="Questa Email Non E' Accettata";
    }
    else if(($settings["deny_multiple_ips"] == 1) && ($ipInUse == true)) {
    $error_msg="Il Tuo Indirizzo Ip E' Gia' Usato Accedi Con L'Account Gia' Registrato";
    }
    else if(is_email_blocked($form_email) > 0) {
    $error_msg="Error!";
    $sql=$Db1->query("INSERT INTO logs SET username='".$form_username."', log='Non Puoi Iscriverti Con Questa Email ($form_email)', dsub='".time()."'");
    }
    else if(empty($form_username)) {
    $error_msg="Inserisci Il Tuo Un Username";
    }
    else if((strlen($form_username) < 6)) {
    $error_msg="Il Tuo Username Deve Essere Di Almeno 6 Caratteri";
    }
    else if(empty($form_password)) {
    $error_msg="Inserisci Il Tuo Un Username";
    }
    else if((strlen($form_password) < 6)) {
    $error_msg="La Tua Password Deve Essere Di Almeno 6 Caratteri";
    }
    else if(empty($form_name)) {
    $error_msg="Inserisci Il Tuo Nome";
    }
    else if (Verify_Email_Address($form_email) == false) {
    $error_msg="Inserisci Una Email Valida";
    }
    else if($form_agree != "on") {
    $error_msg="Accetta Il Regolamento Per Iscriverti.";
    }
    else {
    if($reff == "") {
    srand((double)microtime()*1000000);
    $num = mt_rand(1,100);
    if($num > $settings['orphan_allow']) {
    $sql=$Db1->query("SELECT username FROM user WHERE type='1' ORDER BY rand() LIMIT 1");
    $newref=$Db1->fetch_array($sql);
    $reff=$newref[username];
    }
    }

        $sql=$Db1->query("SELECT userid FROM user WHERE username='$form_username' OR email='$form_email'");
        if($Db1->num_rows() == 0) {
            $sql=$Db1->query("INSERT INTO user SET
        name='".addslashes($form_name)."',
        username='".addslashes($form_username)."',
        password='".md5($form_password)."',
        email='".addslashes($form_email)."',
        refered='".addslashes($reff)."',
        last_ip='$vip',
        join_ip='$vip',
        balance='1.00',
        `country`='".addslashes($form_country)."',
        verified='".iif($settings[verify_emails] == 1,"0","1")."',
        joined='".time()."',
        last_act='".time()."',
        xcredits='0'
        ");
    
            $sql=$Db1->query("SELECT * FROM user WHERE username='$form_username'");
            $user=$Db1->fetch_array($sql);
    
            if($reff != "") {
                if($settings[tickets_ref] > 0) {
                    $Db1->query("UPDATE user SET tickets=tickets+$settings[tickets_ref] WHERE username='$reff'");
                }
                edit_upline(1, $reff);
            }
            
    
            $sql=$Db1->query("SELECT * FROM tracker WHERE ip='$vip' ORDER BY dsub DESC LIMIT 1");
            if($Db1->num_rows() > 0) {
                $trackid=$Db1->fetch_array($sql);
                $sql=$Db1->query("UPDATE tracker SET register=register+1 WHERE id='$trackid[id]'");
            }
    
            $today_date=date("d/m/y");
            $sql=$Db1->query("SELECT id FROM stats WHERE date='$today_date'");
            if($Db1->num_rows() == 0) {
                $sql-$Db1->query("INSERT INTO stats SET date='$today_date'");
            }
            $sql=$Db1->query("UPDATE stats SET new_members=new_members+1 WHERE date='$today_date'");
            
            if($settings[verify_emails] == 1) {
                send_act_email($form_username);
                $Db1->sql_close();
                header("Location: index.php?view=verify&uname=$form_username");
            }
            else {
                $Db1->sql_close();
                header("Location: index.php?view=welcome&uname=$form_username");
            }
        }
        else {
            $error_msg="Hai Gia' Aperto un Account Con Questi Dati, Non creare Altri Account";
        }
    }
    

    }

    /*
    if((!isset($reff)) && (!isset($ref))) {
    $sql = $Db1->query("SELECT * FROM temp_refs WHERE ip='$vip' ORDER BY dsub DESC LIMIT 1");
    $refinfo=$Db1->fetch_array($sql);
    $reff=$refinfo[referrer];
    }
    else if(isset($ref) && (!isset($reff))) {
    */
    $reff=$ref;
    //}

    $includes[content]="
    <b><font color="darkblue">$error_msg</font></b>
    <br>
    <div align="center">

    <!-- COREG LEADIUM -->
    <script type="text/javascript" src="h ttp://it.leadium.com/coreg_em.php?ref=5fc1a7e90f544439522657feb0b18faf&sid=533&eid=109"></script>
    <!-- COREG LEADIUM -->

    <form name="acash" action="index.php?view=join&action=join&".$url_variables."" method="post" onSubmit="submitonce(this)">

    <table cellspacing="0" cellpadding="0" border=0 width="100%" class="tableBD1">
    <tr>
    <td>
    <table cellspacing="1" cellpadding="1" border=0 width="100%" height="$height">

                <tr class=\"tableHL2\">
                <td>&nbsp;Titolo <font color=\"darkblue\"><sup>*</sup></font></td>
                <td>
                <select name=\"sex\" style=\"width:275px\">
                <option value=\"3\" selected>Signorina</option>
                <option value=\"2\" selected>Signora</option>
                <option value=\"1\" selected>Signore</option>
                </select>
                </td>
                </tr>
    
            
                <tr class=\"tableHL2\">
                    <td width=\"100%\">&nbsp;Nome <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"form_name\" value=\"\" size=\"50\"></td>
                </tr>
    
    
        
                <tr class=\"tableHL2\">
                    <td width=\"100%\">&nbsp;Cognome <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"surname\" value=\"\" size=\"50\"></td>
                </tr>
    
    
    
                <tr class=\"tableHL2\">
                <td>&nbsp;Data Di Nascita <font color=\"darkblue\"><sup>*</sup></font></td>
                <td>
                <select id=\"date_of_birth\" name=\"day\" size=\"1\">
        <option value=\"01\">01</option>
        <option value=\"02\">02</option>
        <option value=\"03\">03</option>
        <option value=\"04\">04</option>
        <option value=\"05\">05</option>
        <option value=\"06\">06</option>
        <option value=\"07\">07</option>
        <option value=\"08\">08</option>
        <option value=\"09\">09</option>
        <option value=\"10\">10</option>
        <option value=\"11\">11</option>
        <option value=\"12\">12</option>
        <option value=\"13\">13</option>
        <option value=\"14\">14</option>
        <option value=\"15\" selected=\"selected\">15</option>
        <option value=\"16\">16</option>
        <option value=\"17\">17</option>
        <option value=\"18\">18</option>
        <option value=\"19\">19</option>
        <option value=\"20\">20</option>
        <option value=\"21\">21</option>
        <option value=\"22\">22</option>
        <option value=\"23\">23</option>
        <option value=\"24\">24</option>
        <option value=\"25\">25</option>
        <option value=\"26\">26</option>
        <option value=\"27\">27</option>
        <option value=\"28\">28</option>
        <option value=\"29\">29</option>
        <option value=\"30\">30</option>
        <option value=\"31\">31</option>
        </select>
        <select id=\"date_of_birth\" name=\"month\" size=\"1\">
        <option value=\"01\">01</option>
        <option value=\"02\">02</option>
        <option value=\"03\">03</option>
        <option value=\"04\">04</option>
        <option value=\"05\" selected=\"selected\">05</option>
        <option value=\"06\">06</option>
        <option value=\"07\">07</option>
        <option value=\"08\">08</option>
        <option value=\"09\">09</option>
        <option value=\"10\">10</option>
        <option value=\"11\">11</option>
        <option value=\"12\">12</option>
        </select>
        <select id=\"date_of_birth\" name=\"year\" size=\"1\">
        <option value=\"1901\">1901</option>
        <option value=\"1902\">1902</option>
        <option value=\"1903\">1903</option>
        <option value=\"1904\">1904</option>
        <option value=\"1905\">1905</option>
        <option value=\"1906\">1906</option>
        <option value=\"1907\">1907</option>
        <option value=\"1908\">1908</option>
        <option value=\"1909\">1909</option>
        <option value=\"1910\">1910</option>
        <option value=\"1911\">1911</option>
        <option value=\"1912\">1912</option>
        <option value=\"1913\">1913</option>
        <option value=\"1914\">1914</option>
        <option value=\"1915\">1915</option>
        <option value=\"1916\">1916</option>
        <option value=\"1917\">1917</option>
        <option value=\"1918\">1918</option>
        <option value=\"1919\">1919</option>
        <option value=\"1920\">1920</option>
        <option value=\"1921\">1921</option>
        <option value=\"1922\">1922</option>
        <option value=\"1923\">1923</option>
        <option value=\"1924\">1924</option>
        <option value=\"1925\">1925</option>
        <option value=\"1926\">1926</option>
        <option value=\"1927\">1927</option>
        <option value=\"1928\">1928</option>
        <option value=\"1929\">1929</option>
        <option value=\"1930\">1930</option>
        <option value=\"1931\">1931</option>
        <option value=\"1932\">1932</option>
        <option value=\"1933\">1933</option>
        <option value=\"1934\">1934</option>
        <option value=\"1935\">1935</option>
        <option value=\"1936\">1936</option>
        <option value=\"1937\">1937</option>
        <option value=\"1938\">1938</option>
        <option value=\"1939\">1939</option>
        <option value=\"1940\">1940</option>
        <option value=\"1941\">1941</option>
        <option value=\"1942\">1942</option>
        <option value=\"1943\">1943</option>
        <option value=\"1944\">1944</option>
        <option value=\"1945\">1945</option>
        <option value=\"1946\">1946</option>
        <option value=\"1947\">1947</option>
        <option value=\"1948\">1948</option>
        <option value=\"1949\">1949</option>
        <option value=\"1950\">1950</option>
        <option value=\"1951\">1951</option>
        <option value=\"1952\">1952</option>
        <option value=\"1953\">1953</option>
        <option value=\"1954\">1954</option>
        <option value=\"1955\">1955</option>
        <option value=\"1956\">1956</option>
        <option value=\"1957\">1957</option>
        <option value=\"1958\">1958</option>
        <option value=\"1959\">1959</option>
        <option value=\"1960\">1960</option>
        <option value=\"1961\">1961</option>
        <option value=\"1962\">1962</option>
        <option value=\"1963\">1963</option>
        <option value=\"1964\">1964</option>
        <option value=\"1965\">1965</option>
        <option value=\"1966\">1966</option>
        <option value=\"1967\">1967</option>
        <option value=\"1968\">1968</option>
        <option value=\"1969\">1969</option>
        <option value=\"1970\">1970</option>
        <option value=\"1971\">1971</option>
        <option value=\"1972\">1972</option>
        <option value=\"1973\">1973</option>
        <option value=\"1974\">1974</option>
        <option value=\"1975\">1975</option>
        <option value=\"1976\">1976</option>
        <option value=\"1977\">1977</option>
        <option value=\"1978\">1978</option>
        <option value=\"1979\">1979</option>
        <option value=\"1980\">1980</option>
        <option value=\"1981\">1981</option>
        <option value=\"1982\">1982</option>
        <option value=\"1983\">1983</option>
        <option value=\"1984\">1984</option>
        <option value=\"1985\">1985</option>
        <option value=\"1986\" selected=\"selected\">1986</option>
        <option value=\"1987\">1987</option>
        <option value=\"1988\">1988</option>
        <option value=\"1989\">1989</option>
        <option value=\"1990\">1990</option>
        <option value=\"1991\">1991</option>
        <option value=\"1992\">1992</option>
        <option value=\"1993\">1993</option>
        <option value=\"1994\">1994</option>
        <option value=\"1995\">1995</option>
        <option value=\"1996\">1996</option>
        <option value=\"1997\">1997</option>
        <option value=\"1998\">1998</option>
        <option value=\"1999\">1999</option>
        <option value=\"2000\">2000</option>
        </select>
    

    </tr>

                <tr class=\"tableHL2\">
                    <td width=\"100%\">&nbsp;Username <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"form_username\" value=\"$form_username\" size=\"50\"></td>
                </tr>
                
                <tr class=\"tableHL2\">
                    <td>&nbsp;Password <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"password\" name=\"form_password\" value=\"$form_password\" size=\"50\"></td>
                </tr>
                
                
    
                <tr class=\"tableHL2\">
                    <td>&nbsp;Email <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"form_email\" value=\"$form_email\" size=\"50\"></td>
                </tr>
                
        
                <tr class=\"tableHL2\">
                    <td width=\"100%\">&nbsp;Indirizzo <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"address\" value=\"\" size=\"50\"></td>
                </tr>
    
    
                <tr class=\"tableHL2\">
                    <td width=\"100%\">&nbsp;Citta' <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"city\" value=\"\" size=\"50\"></td>
                </tr>
    
    
    
                <tr class=\"tableHL2\">
                    <td width=\"100%\">&nbsp;Codice Postale CAP <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"cap\" value=\"\" size=\"50\"></td>
                </tr>
    
    
    
                <tr class=\"tableHL2\">
                <td>&nbsp;Nazione <font color=\"darkblue\"><sup>*</sup></font></td>
                <td>
                <select name=\"form_country\" style=\"width:275px\">
                <option value=\"Italy\" selected>Italia</option>
                </select>
                </td>
                </tr>
    
    
                <tr class=\"tableHL2\">
                    <td width=\"100%\">&nbsp;Telefono <font color=\"darkblue\"><sup>*</sup></font></td>
                    <td><input type=\"text\" name=\"phone\" value=\"\" size=\"50\"></td>
                </tr>
    
    
    
                <tr class=\"tableHL2\">
                    <td>&nbsp;Presentatore</td>
                    <td>".iif($reff=="","<input type=\"text\" name=\"reff\" value=\"$reff\" size=\"50\" readonly>","
                    <input type=\"hidden\" name=\"reff\" value=\"$reff\">
                    $reff
                    ")."</td>
                </tr>
                <tr class=\"tableHL2\">
                    <td colspan=2 align=\"center\">
                        <input type=\"checkbox\" name=\"form_agree\" class=\"checkbox\"> Accetto Il <a href=\"index.php?view=terms\" target=\"_blank\">Regolamento</a><br>
                    
                <br>
                <!-- COREG LEADIUM -->
                <script type=\"text/javascript\"> displayLeadiumCoregs();</script>
                <!-- COREG LEADIUM -->    
                <br>
                    <br><b><center><small>* Campi Obbligatori</small></center></b><br>
                    </td>
                </tr>
    
                
    
                
                <tr class=\"tableHL1\">
                    <td colspan=2 align=\"center\"><input type=\"submit\" value=\"Iscriviti\" size=\"30\" onclick=\"submitLeadiumCoregs();\"></td>
                </tr>
                
            </table>
        </td>
    </tr>
    

    </table><br>
    ".iif($settings[verify_emails]==1,"<small>**Devi Inserire Una Email Reale Dove Ti Sara' Inviata La Conferma Dell'iscrizione Al Nostro sito.</small>
    <br><br>

    <div align="left">
    <b>Importante</b><br>
    Se Usi Un Blocco Per Lo Spam, Inserisci Nella Lista Degli Indirizzi Email Affidabili La Nostra Email $settings[admin_email] Altrimenti Non Potrai Ricevere Le Nostre Email E Non Potrai Attivare Il Tuo Account. Controlla Nella Tua Casella Di Posta Anche Nella Cartella Spam.
    </div>

    ")."
    </form>
    </div>
    ";
    ?>

    [/php]


  • Super User

    Il file PHP che hai postato suppongo venga incluso da un altro file: infatti non vi è traccia dei tags head, title, body, etc...