Jump to content

i am trying to add this ID aceptoterm but something i am missing


Recommended Posts

<?


//echo "($contentAction)";
$contentName="default";
//require 'includes/fonctions.php';
//print_r($_SESSION);

if(($_POST ||$contentAction=="e") && $_SESSION["postreg"]!=1){

$sid=session_id();
include("tmp/$sid.php");
$_SESSION["basic"]["etape"]=1;
$flog=fopen("logs/register.log.php","a");
fwrite($flog,"<?/*".date("dmY H:i:s")."------------".session_id()."----AVANT CODE-------$contentAction----------\n");
fwrite($flog,"ERREUR POST sans SESSION\n");
fwrite($flog,implode(",",$_POST)."\n");
fwrite($flog,print_r($_SESSION,true)."\n");
fwrite($flog,print_r($_ENV,true)."\n");
fwrite($flog,"---------------------------------*/\n");
fclose($flog);
}
if(isset($contentAction) && $contentAction=="n") {
unset($_SESSION["basic"]);
unset($_SESSION["class"]);
}
if(isset($contentAction) && $contentAction=="e") {
$_SESSION["basic"]["etape"]=0;
//$REQUEST_URI=ereg_replace("/modifier","",$REQUEST_URI);
}


$etape=isset($_SESSION["basic"]["etape"])?$_SESSION["basic"]["etape"]+1:1;
$etape=$etape>2?1:$etape;
//$etape=$etape==2&&$contentAction!="f"?1:$etape;

$_SESSION["basic"]["etape"]=$etape;

$admin_data="Submit,etape";

$nbad=0;
$thisPage="p,registration.htm$idSess";
$thisPageNext="p,f,registration.htm$idSess";
$thisPageModify="p,e,registration.htm$idSess";

$reki["lstname"]="[A-Za-z\' -]{2,}";
$reki["fstname"]="[0-9A-Za-z\.\' -]{0,}";
$reki["captcha"]=".";
$reki["email"]="^[[:alnum:]]([-_.]?[[:alnum:]])+_?@[[:alnum:]]([-.]?[[:alnum:]])+\.[a-z]{2,4}$";


$form["email"]="E-mail";
$form["fstname"]="Nombre";
$form["lstname"]="Apellido";


$style[0]="active";
$style[-1]="inactive";
$style[1]="inactive";
$style[-2]="inactive";
$style[2]="inactive";

include("includes/form_lib.php");
?>
<!--<h1 class="<?=$style[$etape-1]?>">Etape 1 </h1>» <h1 class="<?=$style[$etape-2]?>"> Etape 2 </h1>» <h1 class="<?=$style[$etape-3]?>"> Etape 3 </h1>
<br/>-->
<div id="breadcrumb"><a href="home.htm">Inicio</a> > <a href="p,my-inkiti.htm">Mi Cuenta</a> > <span id="bcsel">Registracion</span> </div>
<?php


switch($etape)
{
case 1 :
$_SESSION["postreg"]="1";
echo "<div class=\"sectionTitle\">Registracion</div>";
if (SITE_ACCESS == 1)
echo " La Registracion no es necesaria, pero si te registras tendras la opcion de:<ul><li>publicar y administrar tus anuncios sin tener que confirmar cada accion por correo</li></ul>";


//session_write(session_id());

  $o = new form_generator();
  $o->name = "add_basic";
  $o->method = "post";
  $o->action = "$thisPage";
  // Form Fields
  $o->input = array(
  array(
  'before'=>'<!--<div id="postAd">-->Para iniciar la registracion por favor llene los siguientes casilleros<br/>'.$rfs.' = necesario <br/><div class="'.$_SESSION["basic"]['errorClass'].' statusBox">'.$_SESSION["basic"]['error'].'</div>',
  'type'=>'hidden',
  'label'=>'',
  'name'=>'etape',
  'value'=>$etape,
  'id'=>'etape',
  'class'=>'noshow'
  ),
  array(
  'type'=>'text',
  'label'=>'Email'.$rfs,
  'name'=>'email',
  'value'=>$_SESSION["basic"]['email']?$_SESSION["basic"]['email']:$_SESSION["userid"],
  'id'=>'email',
  'class'=> $_SESSION["class"]["email"]
  ),
  array(
  'type'=>'text',
  'label'=>'Nombre',
  'name'=>'fstname',
  'value'=>$_SESSION["basic"]['fstname'],
  'id'=>'fstname',
  'class'=> $_SESSION["class"]["fstname"]
  ),
   array(
  'type'=>'text',
  'label'=>'Apellido'.$rfs,
  'name'=>'lstname',
  'value'=>$_SESSION["basic"]['lstname'],
  'id'=>'lstname',
  'class'=> $_SESSION["class"]["lstname"]
  ),
   array(
  'type'=>'text',
  'label'=>'Codigo '.$rfs,
  'name'=>'captcha',
  'value'=>'',
  'id'=>'captcha',
  'class'=> $_SESSION["class"]["captcha"],
  'after'=>'<span id="instrucciones">  por favor escriba el codigo abajo (<u>caso sensitivo</u>)</span><div id="capimg"><img src="cryptimage.php'.$idSess.'"/> <a href="p,n,registration.htm">Cambiar imagen</a></div>'
  ),
   array(
  'type'=>'radio',
  'label'=>'Acepto'.$rfs,
  'name'=>'aceptoterm',
  'value'=>$_SESSION["basic"]['aceptoterm'],
  'id'=>'aceptoterm',
  'class'=> $_SESSION["class"]["aceptoterm"],
  'after'=>'<span id="instrucciones">  Acepto los <a href="p,2,help.htm">Terminos condiciones y politica de A1C</a></span>'
  ),
  array(
  'type'=>'submit',
  'label'=>'',
  'name'=>'Submit',
  'value'=>'Enviar Registracion',
  'id'=>'Submit',
  'after'=>'<!--</div>-->',
  ));

  $o->make();

//session_write(session_id());

$flog=fopen("logs/register.log.php","a");
fwrite($flog,"<?/*-".date("dmY H:i:s")."--------".session_id()."----APRES CODE-----$contentAction---------------\n");

if($_POST && $_SESSION["basic"]["etape"]==1)
fwrite($flog,"ERREUR POST sans SESSION\n");
fwrite($flog,implode(",",$_POST)."\n");
fwrite($flog,print_r($_SESSION,true)."\n");
fwrite($flog,print_r($_ENV,true)."\n");
fwrite($flog,"---------------------------------*/\n");
fclose($flog);

break;
case 2 :
unset($_SESSION["basic"]['errorClass']);
unset($_SESSION["basic"]['error']);
unset($_SESSION["basic"]['captcha']);

$flog=fopen("logs/register.log.php","a");
fwrite($flog,"<?/*".date("dmY H:i:s")."------------".session_id()."----Etape 2--------$contentAction---------\n");
if(!$_SESSION["code"])
fwrite($flog,"ERREUR PAS DE CODE SESSION\n");
fwrite($flog,implode(",",$_POST)."\n");
fwrite($flog,print_r($_SESSION,true)."\n");
fwrite($flog,print_r($_ENV,true)."\n");
fwrite($flog,"---------------------------------*/\n");
fclose($flog);

$email=$_POST["email"];
$fstname=$_POST["fstname"];
$lstname=$_POST["lstname"];
$captcha=$_POST["captcha"];
$aceptoterm=$_POST["aceptoterm"];
$code=$_SESSION['code'];
unset($_SESSION["class"]);

    while(list($var,$val)=each($_POST))
    {
        if(!ereg($var,$admin_data))
        {
        if(ereg($reki[$var],$val)) {$class="good";}
        else {$class="bad";$nbad++;}
        $_SESSION["class"]["$var"]=$class;
        $_SESSION["basic"]["$var"]=$val;
        }
    }

    if($code==$captcha ) {$class="good";}
    else {$class="bad";$nbad++;}
    $_SESSION["class"]["captcha"]=$class;

    if(!verifUser($email)) {$class="good";}
    else {
    $class="bad";$nbad++;
    $_SESSION["basic"]['errorClass']="error";
    $_SESSION["basic"]['error'].="Email ya esta en uso<br/>";
    }
    $_SESSION["class"]["email"]=$class;

if($nbad){
$_SESSION["basic"]['errorClass']="error";
$_SESSION["basic"]['error'].="Por favor corriga los casilleros en rojo<br/>";

//unset($_SESSION["code"]);
session_write(session_id());
session_write_close();
//echo $thisPageModify;
header("Location:$thisPageModify");

}
else{
    $validation=makePass(6);
    $date=date("d-m-Y H:i:s");
    $q="replace into $tab_users (email,password,fstname,lstname,aceptoterm,active,date) values('$email','".md5($validation)."','{$_SESSION['basic']['fstname']}','{$_SESSION['basic']['lstname']}','Y','$date')";
    //echo $q;
    $flog=fopen("logs/registration.log.$ddl.php","a");
    fwrite($flog,"$date $q \r\n");

    DBquery($q,0,"U");

    $qv="Select * from $tab_users where email='$email'";
    $resv=DBquery($qv,0);

    if(count($resv)==0)    {$tr="/* $email Unknown user */";}
    else{
        $act=$resv[0]["active"];
        if($act!="Y"){$tr="/* $email not registered */";}
        else {$tr="/* $email OK */";};
    }

    fwrite($flog,"$tr \r\n");
    fclose($flog);
    echo '<div class="sectionTitle">Registracion</div><br>';
    echo "Gracias por registrarte!<br/>recibiras muy pronto un correo con tu contraseña.";

$q="select * from ann_config where param='REGISTRATION_EMAIL'";$res=DBquery($q,0);
$REGISTRATION_EMAIL = $res[0]['value'];
$REGISTRATION_EMAIL = str_replace("{SITE_NAME}", SITE_NAME, $REGISTRATION_EMAIL);
$REGISTRATION_EMAIL = str_replace("{USER_EMAIL}", $email, $REGISTRATION_EMAIL);
$REGISTRATION_EMAIL = str_replace("../", SITE_URL."/", $REGISTRATION_EMAIL);
$REGISTRATION_EMAIL = str_replace("{USER_NEWPASSWORD}", $validation, $REGISTRATION_EMAIL);
$bodyHTML = $REGISTRATION_EMAIL;

    require_once('hermail.inc.php');
    $cMail = new cPHPezMail();
    $cMail->SetFrom($from, SITE_NAME.'<'.SITE_CONTACT.'>');
    if(REGISTRATION_EMAIL_S)
        $cMail->AddBcc(SITE_CONTACT);
    $cMail->AddTo($_SESSION['basic']['email']);
    $cMail->SetSubject(SITE_NAME." registration");
    $cMail->SetBodyText("$bodyTxt");
    $cMail->SetBodyHTML("$bodyHTML");
    $cMail->SetCharset('utf8');
    $cMail->SetEncodingBit(;

    $sEMLData = $cMail->ExportEML();

    $cMail->Send();
    session_write(session_id());
}
break;
default:
echo "$etape";
}
?>
Edited by requinix
please use [code] tags when posting code

People will not read code unless the code itself is readable. Use

 tags around your code. I added them for you this time but you need to do it next time yourself.

 

What you're missing is how to post a question. What are you talking about? What ID? What "aceptoterm"? Use multiple sentences to explain what you're trying to do, why, what you've tried so far, what the code is doing, and what you want the code to be doing.

Edited by requinix

Ops didnt know sorry, and thank you

Well what i am trying to do, is the user will register, but they must do this action, to click on The radio Acept terms.
So what i did was, to add this code

 

   array(
  'type'=>'radio',
  'label'=>'Acepto'.$rfs,
  'name'=>'aceptoterm',
  'value'=>$_SESSION["basic"]['aceptoterm'],
  'id'=>'aceptoterm',
  'class'=> $_SESSION["class"]["aceptoterm"],
  'after'=>'<span id="instrucciones">  Acepto los <a href="p,2,help.htm">Terminos condiciones y politica de A1C</a></span>'
  ),

and of course

i added this line

[code] $aceptoterm=$_POST["aceptoterm"]; [code]

But I know i am missing something in these codes, because cant register.
Before i added this option, registration was working good,



 

Edited by cpljv2
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.