<?php
$path = dirname( __FILE__ );
echo $path;
if( preg_match("/dev-indiamart/i",$path ))
{
$dbh = oci_connect('iilmesh','11l4meshdb','mesh');  //MESH(DEV) 
}
else
{
$dbh = oci_connect('indiamart','ref0cl39','ddup'); //DDUP(live) 	
}
if(!$dbh)
{
Sendmail('abc',1,'vishwas.pradhan@indiamart.com','vishwas.pradhan@indiamart.com','vishwas.pradhan@indiamart.com','not able to connect to database[prim/db.php]','','vishwas');	
}
$glid=$_REQUEST['glid'];
$mobile=$_REQUEST['mobile'];
$email=$_REQUEST['email'];
$sql_insert="insert into react_data_tmp(fk_glusr_usr_id,email,mobile,country_iso)values($glid,
'$email','$mobile','103')";
$sth_insert=oci_parse($dbh,$sql_insert);
oci_execute($sth_insert);

function Sendmail($file_name,$lineno,$to,$from,$cc,$subject,$message,$sender_name)
        {
    
    $headers=
        "From:$from \n".
        "Reply-To:$to\n".
        "Cc:$cc\n".
        "MIME-Version: 1.0 \n".
        "Content-type: text/html; charset=UTF-8";
    mail($to,$subject,$message,$headers);
        }
