<?php
    include "admin/inc/configure.php";
    include "admin/inc/connect.php";
	include "admin/inc/select.php";
	
	$query="SELECT MAX(id) as id FROM convetion_check";
	$result=mysql_query($query, $link);
	$row=mysql_fetch_object($result);
	$id=$row->id;
	$id=$id+1;
	$url = $_SERVER['HTTP_REFERER'];
	$findmemsn="results.aspx?";
	$findmemsn1="spresults.aspx";
	$findme="search?";
	if(strpos($url, $findmemsn) ){
		$pieces = explode("results.aspx?", $url);
		$search_engine=$pieces[0];
		$keyword=explode("&q=", $pieces[1]);
		$key_word=$keyword[1];
		if(!$key_word){
		 $keyword=explode("q=", $keyword[0]);
		 $key_word=$keyword[1];
		}
		$key_word=explode("&FORM=", $key_word);
		$key_word=$key_word[0];

		$key_word=explode("&first=", $key_word);
		$key_word=$key_word[0];
		$key_word=explode("&srch_type=", $key_word);
		$key_word=$key_word[0];

		$key_word=str_replace("+", " ", $key_word);
	}

	else if (strpos($url, $findme)){
		$pieces = explode("search?", $url);
		$search_engine=$pieces[0];
		$keyword=explode("&q=", $pieces[1]);
		$key_word=$keyword[1];
		if(!$key_word){
		 $keyword=explode("q=", $keyword[0]);
		 $key_word=$keyword[1];
		}
		$key_word=explode("&btnG=", $key_word);
		$key_word=$key_word[0];

		$key_word=explode("&hl=", $key_word);
		$key_word=$key_word[0];

		$key_word=str_replace("+", " ", $key_word);

	}else{
		$pieces = explode("sponsoredlinks?q=", $url);
		$search_engine=$pieces[0];
		//echo $search_engine;
		$keyword=explode("&hl", $pieces[1]);
		$key_word=$keyword[0];
		$key_word=str_replace("+", " ", $key_word);
	}
	if($search_engine!="http://www.google.com/" &&( $search_engine!="http://search.msn.com/" && $search_engine!="http://search.msn.co.za/")){
		//echo "ss";
		$search_engine = "";
		$key_word = "";
	}

	//Removing the string after &

	if($key_word){
	$key_word=explode("&", $key_word);
	$key_word=$key_word[0];

	}

	$convertion="Not Converted";
	$entdate=date("Y-m-d");
	$query1="insert into convetion_check(search_engine, keyword, full_url, convertion, ldate) values ('$search_engine', '$key_word', '$url', '$convertion', '$entdate')";
	if($url){
		mysql_query($query1, $link);
	}


?>

<html>
<head>
<title><?echo $title;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="admin/images/ufo-sectrets.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="<?echo $siteurl;?>/nmod.js" ></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

  ctry=document.bisform.country.value;
  state=document.bisform.state.value;
  fn=document.bisform.first_name.value;
  ln=document.bisform.last_name.value;
  add=document.bisform.address.value;
  cit=document.bisform.city.value;
  zi=document.bisform.zip.value;
  pn=document.bisform.phone.value;
  ea=document.bisform.email.value;

function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}
   fn=trim(fn);
   ln=trim(ln);
   add=trim(add);
   cit=trim(cit);
   zi=trim(zi);
   pn=trim(pn);
   ea=trim(ea);

   if(fn.length==0){errors+='- first_name is required.\n';}
   if(ln.length==0){errors+='- last_name is required.\n';}
   if(add.length==0){errors+='- address is required.\n';}
   if(cit.length==0){errors+='- city is required.\n';}
   if(zi.length==0){errors+='- zip is required.\n';}
   if(pn.length==0){errors+='- phone is required.\n';}
   if(ea.length==0){errors+='- email is required.\n';}

     if(fn.length==0) {document.bisform.first_name.focus();}
else if(ln.length==0) {document.bisform.last_name.focus();}
else if(add.length==0) {document.bisform.address.focus();}
else if(cit.length==0) {document.bisform.city.focus();}
else if(zi.length==0)  {document.bisform.zip.focus();}
else if(pn.length==0)  {document.bisform.phone.focus();}
else if(ea.length==0)  {document.bisform.email.focus();}
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
var returnval=emailfilter.test(ea);


  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
		p2=val.indexOf('@',p+1);
        if (p<1 || p==(val.length-1) || p2>0 || (returnval==false)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } /*else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; */}
  }
  ctry=document.bisform.country.value;
  state=document.bisform.state.value;

  if(ctry=='United States' && (state=='' || state=='Outside of US')){
	errors+='- Please Select the State.\n';
  }
  cap_inv=document.bisform.capital_inv.value;
  if(cap_inv==''){
  	errors+='- Please Select the Capital Invest.\n';
  }


  if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<head>
<title><?echo $title;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<?php include "header.php"; ?>
<tr>
<td>
<table width="80%" border="0" align="center" cellpadding="4" cellspacing="0">
<tD  colspan="2" VALIGN=TOP BGCOLOR=#FFFFFF ><div style="text-align:CENTER; "><FONT SIZE="3" COLOR="#000000" FACE="Arial,Helvetica,sans-serif">&nbsp;<FONT  COLOR="#0000FF" SIZE= 5 >
<i>
			 <?php 
				   if ($url=="") {
				  ?>
					  <script language="JavaScript" type="text/JavaScript" >
							document.write(keyword);
					 </script>
				  <?php 
					} else {
				  ?>
					  <script language="JavaScript" type="text/JavaScript" >
						 //str='You asked me:"'+keyword+'"Now I want to ask you -';
  						 document.write('You asked me: "');
						 document.write(keyword);
					 </script>
				     <script language="JavaScript" type="text/JavaScript" >
  						 document.write(' Now I want to ask you -');
					 </script> 	
				  <?php 
					} 
				  ?>
						</i>
						<br>
					<br> 
<B>&quot;Learn long lost homeopathic healing remedies that your doctor hopes you never find out&quot;</B></FONT></FONT></div>
<div style="text-align:CENTER; "><FONT SIZE="3" COLOR="#000000" FACE="Arial,Helvetica,sans-serif"><I><B>
This FREE Email Mini-Course Will Teach You:</B></I></FONT></div>
<div style="margin-left:48px; "><FONT SIZE="2" COLOR="#000000" FACE="Arial,Helvetica,sans-serif"><IMG SRC="images/checkmark.jpg" border=0 width="24" height="28" ALIGN="BOTTOM" HSPACE="0" VSPACE="0">
Holistic treatments of homeopathy and how it can make an immediate </FONT></div>
<div style="margin-left:72px; "><FONT SIZE="2" COLOR="#000000" FACE="Arial,Helvetica,sans-serif">
difference to your health</FONT></div>
<div style="margin-left:48px; "><FONT SIZE="2" COLOR="#000000" FACE="Arial,Helvetica,sans-serif"><IMG SRC="images/checkmark.jpg" border=0 width="24" height="28" ALIGN="BOTTOM" HSPACE="0" VSPACE="0">
How the benefits from alternative medicine can be rapid, complete and permanent</FONT></div>
<div style="margin-left:48px; "><FONT SIZE="2" COLOR="#000000" FACE="Arial,Helvetica,sans-serif"><IMG SRC="images/checkmark.jpg" border=0 width="24" height="28" ALIGN="BOTTOM" HSPACE="0" VSPACE="0">
The 7 most commons myths of homeopathy, seperate the facts from fiction</FONT></div>
<div style="margin-left:48px; "><FONT SIZE="2" COLOR="#000000" FACE="Arial,Helvetica,sans-serif"><IMG SRC="images/checkmark.jpg" border=0 width="24" height="28" ALIGN="BOTTOM" HSPACE="0" VSPACE="0">
How to choose the correct homeopathic remedies and learn what NOT to take.</FONT></div>
<div style="margin-left:48px; "><FONT SIZE="2" COLOR="#000000" FACE="Arial,Helvetica,sans-serif"><IMG SRC="images/checkmark.jpg" border=0 width="24" height="28" ALIGN="BOTTOM" HSPACE="0" VSPACE="0">
How this type of alternative medicine is different from other conventional medicine,</FONT></div>
<div style="margin-left:72px; "><FONT SIZE="2" COLOR="#000000" FACE="Arial,Helvetica,sans-serif">
which could mean <B><U>a longer and healthier life for you</U></B>...</FONT></div>
<bR>
<div style="margin-left:48px; "><FONT SIZE="4" COLOR="#FF0000" FACE="Arial,Helvetica,sans-serif"><B>
Isn't it time for you to take control of your own health</B></FONT></div>
<bR>
</td>
</table>
</td>
</tr>

<tr>
    <td background="img/bg.jpg" >
	<form name="bisform" action="http://www.aweber.com/scripts/addlead.pl" method="post" onSubmit="MM_validateForm('first name','','R','last name','','R','city','','R','zip','','R','phone','','R','email','','RisEmail','address1','','R');return document.MM_returnValue">
	<input type="hidden" name="meta_web_form_id" value="1229030639">
	<input type="hidden" name="meta_split_id" value="">
	<input type="hidden" name="unit" value="yoga-discipline">
	<input type="hidden" name="redirect" value="http://yoga-discipline.com/thankyou.php">
	<input type="hidden" name="meta_adtracking" value="yoga-new">
	<input type="hidden" name="meta_message" value="1">
	<input type="hidden" name="meta_required" value="from">
	<input type="hidden" name="meta_forward_vars" value="1">


        <table width="80%" border="0" align="center" cellpadding="4" cellspacing="0">
		
				  <tr>
				 <td colspan="2" >
             <div style="text-align:CENTER; "><FONT SIZE="4" COLOR="#CC0000" FACE="Arial,Helvetica,sans-serif">
			 <B>Get </B><B><U>Your </U></B><B>Free Email Mini-Course!</B></FONT></div>
			<div style="text-align:CENTER; "><FONT SIZE="3" COLOR="#CC0000" FACE="Arial,Helvetica,sans-serif">
			<B>&quot;Quick and Easy Homeopathic Wellness Tips&quot;</B></FONT></div>
			 <br></td>
          </tr>
		   
          <tr align="left">
            <td colspan="2" class="product-con">The homeopathy tips mini-course will be sent to you via email every few days for the next month. Submit your first name and email address in the form below to receive "Part 1" of this mini-course in your email box <b>RIGHT NOW</b>. (Check your email in a few minutes)<br></td>
          </tr>
          <tr align="center" >
            <td colspan="2" class="product-con">
</td>
          </tr>
          <?php
		     $f_name= $_GET['firstname'];
			 $l_name=$_GET['lastname'];
			 $address=$_GET['address'];
			 $city=$_GET['city'];
			 $phone=$_GET['phone'];
			 $email=$_GET['email'];
			 if($f_name=="unavailable"){
			 $f_name= "";
			 }
			 if($l_name=="unavailable"){
			 $l_name= "";
			 }
			 if($city=="unavailable"){
			 $city= "";
			 }
			 if($phone=="unavailable"){
			 $phone= "";
			 }
			 if($email=="unavailable"){
			 $email= "";
			 }



		  ?>
          <tr>
            <td width="45%" align="right" class="product-con1">First Name: </td>
            <td width="55%" class="product-con1"><input name="name" type="text" id="first name" value="<?php echo $f_name; ?>">
            </td>

          </tr>
		  
           
          
            <td align="right" class="product-con1">Email Address:<br>
              e.g., email@aol.com </td>
            <td class="product-con1"><input name="from" type="text" id="email" size="35" value="<?php echo $email; ?>">
              <input type="hidden" name="search_engine" value="<?php echo $search_engine; ?>">
              <input type="hidden" name="key_word" value="<?php echo $key_word; ?>">
              <input type="hidden" name="surl" value="<?php echo $url; ?>">
			  <input type="hidden" name="id" value="<?php echo $id; ?>">
			   <input type="hidden" name="country" id="country" value="United States">
          
    		  </td>
            </td>
          </tr>
         
	<!--	   <tr>
            <td align="right" class="product-con1">Comment / Question :</td>
            <td class="product-con1"><TEXTAREA name="comment" id="comment"cols=27 rows=2></TEXTAREA>
			 </td>
          </tr> -->
          <tr align="center" >
            <td colspan="2" class="product-con1"><input type="submit" name="Submit" value="Submit"></td>
          </tr>
          <tr>
            <td colspan="2" ><div ><FONT SIZE="3" COLOR="#0000FF" FACE="Arial,Helvetica,sans-serif">
			Always seek the advice of a trained health professional before seeking any new treatment regarding your medical diagnosis or condition.</FONT></div>

			<div ><FONT SIZE="3" COLOR="#0000FF" FACE="Arial,Helvetica,sans-serif">
			Any information received from this course is not intended to diagnose, treat, or cure. This site is for information purposes only.</FONT></div></td>
          </tr>
          <tr>
            <td colspan="2" class="product-con2"><!--The &#8220;Ultimate UFO Secretes&#8221; will be emailed to immediately--></td>
          </tr>
          
        </table>
	  </form>
	  </td>
  </tr>
	<?php include "footer.php"; ?>
</table>

</body>
</html>

