vibhaJ 126 Master Poster
<script language="javascript">
function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
	}
function getSubCat(strURL)
{  

     var req = getXMLHTTP(); // fuction to get xmlhttp object
     if (req)
     {
      req.onreadystatechange = function()
      {
		 
		  if (req.readyState == 4)
		  { //data is retrieved from server
		 	   if (req.status == 200)
			   	{ // which reprents ok status 
					 document.getElementById('subCatDiv').innerHTML=req.responseText;
				}
		       else
		       { 
				 alert("There was a problem while using XMLHTTP:\n");
		       }
    	   }            
      }        
    req.open("GET", strURL, true); //open url using get method
    req.send(null);
	}
}
</script>
<select name="maincat" style="width:200px" onchange="getSubCat('getsubcat.php?catid='+this.value);return false">
<option value="1">Main Cat 1</option>   
<option value="2">Main Cat 2</option>   
<option value="3">Main Cat 3</option>                           
</select>

<div id="subCatDiv">
<!-- <select name="subcat" style="width:200px">
<option value="1">Sub Cat 1</option>   
<option value="2">Sub Cat 2</option>   
<option value="3">Sub Cat 3</option>                           
</select> -->
</div>

when you select maincat drop down js function getSubCat will be called.
getsubcat.php is php page which will return subcat dropdown using passed catid.
e.g. when you run getsubcat.php?catid=1 in browser then in view source
<select name="subcat" style="width:200px">
<option value="1">Sub Cat 1 of main cat 1</option>
<option value="2">Sub Cat 2 of main cat 1</option>
<option value="3">Sub Cat 3 of main cat 1</option>
</select>

using document.getElementById('subCatDiv'), div's inner content is changed each time different value is selected.

vibhaJ 126 Master Poster

Try this code.instead of nine conditions.
Just for your review.
Here you have 3 fields and u r using 3*3=9 if-else, if you will have four fields then?It is not good practice for coding

if(!empty($_POST['Alumnos']))
{
	$sql = " (SELECT email FROM alumnos ORDER BY nombre) ";
}
if(!empty($_POST['Maestros']))
{
	if($sql!='') $sql.= ' UNION ';
	$sql.= " (SELECT email FROM maestros WHERE Admin='0') ";
}
if(!empty($_POST['Admins']))
{
	if($sql!='') $sql.= ' UNION ';
	$sql.= " (SELECT email FROM maestros WHERE Admin='1') ";
}
$sql.= ' ORDER BY email ';
$result = mysql_query($sql,$db);
while ($row = mysql_fetch_row($result)) 
{
	$correos .= "$row[0],";
}

If you will have less line of coding then it will reduce effort for debugging and finding any issue.
Hope this helps.

vibhaJ 126 Master Poster

you mean if there are three option tag then u want to store all in db? not the selected one?
Give example here what you want...

vibhaJ 126 Master Poster
<?php
define("MAJOR", 'pounds');
define("MINOR", 'p');

class toWords  {
           var $pounds;
           var $pence;
           var $major;
           var $minor;
           var $words = '';
           var $number;
           var $magind;
           var $units = array('','one','two','three','four','five','six','seven','eight','nine');
           var $teens = array('ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen');
           var $tens = array('','ten','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety');
           var $mag = array('','thousand','million','billion','trillion');

    function toWords($amount, $major=MAJOR, $minor=MINOR) {
             $this->major = $major;
             $this->minor = $minor;
             $this->number = number_format($amount,2);
             list($this->pounds,$this->pence) = explode('.',$this->number);
             $this->words = " $this->major $this->pence$this->minor";
             if ($this->pounds==0)
                 $this->words = "Zero $this->words";
             else {
                 $groups = explode(',',$this->pounds);
                 $groups = array_reverse($groups);
                 for ($this->magind=0; $this->magind<count($groups); $this->magind++) {
                      if (($this->magind==1)&&(strpos($this->words,'hundred') === false)&&($groups[0]!='000'))
                           $this->words = ' and ' . $this->words;
                      $this->words = $this->_build($groups[$this->magind]).$this->words;
                 }
             }
    }
    function _build($n) {
             $res = '';
             $na = str_pad("$n",3,"0",STR_PAD_LEFT);
             if ($na == '000') return '';
             if ($na{0} != 0)
                 $res = ' '.$this->units[$na{0}] . ' hundred';
             if (($na{1}=='0')&&($na{2}=='0'))
                  return $res . ' ' . $this->mag[$this->magind];
             $res .= $res==''? '' : ' and';
             $t = (int)$na{1}; $u = (int)$na{2};
             switch ($t) {
                     case 0: $res .= ' ' . $this->units[$u]; break;
                     case 1: $res .= ' ' . $this->teens[$u]; break;
                     default:$res .= ' ' . $this->tens[$t] . ' ' . $this->units[$u] ; break;
             }
             $res .= ' ' . $this->mag[$this->magind];
             return $res;
    }
}


    $amount = 12345.67;

    $obj = new toWords($amount);
    echo $obj->words;      // gives Twelve thousand three hundred forty five pounds 67p
    echo $obj->number;     // gives 12,345.67

    $obj = new toWords( $amount , 'dollars', 'c');
    echo  $obj->words;      // gives Twelve thousand three hundred forty five dollars 67c
    echo  $obj->number;     // gives 12,345.67
?>

Try this code.. will help u

vibhaJ 126 Master Poster

<chart caption='COST OF TURNOVER' subCaption='' showPercentValues='1' pieSliceDepth='30' showBorder='0'> is behaving as html tags...

So it is coming in output but you wont be able to see it.It can be seen in view source.

You want to disply it as a text??
Try this:

<?php
$str = "<chart caption='COST OF TURNOVER' subCaption='' showPercentValues='1' pieSliceDepth='30' showBorder='0'>";
$strXML1 = htmlspecialchars($str, ENT_QUOTES);
echo $strXML1; 
?>
vibhaJ 126 Master Poster

Need selected in if else for each option tag.

<td>
<label>Billing Month
<span class="small">Like September-2010</span>
</label></td>
<td>
<? 
	$year = date("Y") ;
	if(isset($_REQUEST['submit']))// if submit btn is pressed
	{
		$b = $_REQUEST['b'];
	}

?>
<select name="b" class="billmonth"/ >
  <option value=<? echo "January-".$year; ?> <?=($b == "January-".$year)?'selected="selected"':'';?> ><? echo "January-".$year; ?></option>
  <option value=<? echo "February-".$year; ?> <?=($b == "February-".$year)?'selected="selected"':'';?>><? echo "February-".$year; ?></option>
  <option value=<? echo "March-".$year; ?> <?=($b == "March-".$year)?'selected="selected"':'';?>><? echo "March-".$year; ?></option>
  <option value=<? echo "April-".$year; ?> <?=($b == "April-".$year)?'selected="selected"':'';?>><? echo "April-".$year; ?></option>
  <option value=<? echo "May-".$year; ?> <?=($b == "May-".$year)?'selected="selected"':'';?>><? echo "May-".$year; ?></option>
  <option value=<? echo "June-".$year; ?> <?=(!isset($_REQUEST['b']))?'selected="selected"':'';?>><? echo "June-".$year; ?></option>
  <option value=<? echo "July-".$year; ?> <?=($b == "July-".$year)?'selected="selected"':'';?> ><? echo "July-".$year; ?></option>
  <option value=<? echo "August-".$year; ?> <?=($b == "August-".$year)?'selected="selected"':'';?> ><? echo "August-".$year; ?></option>
  <option value=<? echo "September-".$year; ?> <?=($b == "September-".$year)?'selected="selected"':'';?> ><? echo "September-".$year; ?></option>
  <option value=<? echo "October-".$year; ?> <?=($b == "October-".$year)?'selected="selected"':'';?> ><? echo "October-".$year; ?></option>
  <option value=<? echo "Novemebr-".$year; ?> <?=($b == "Novemebr-".$year)?'selected="selected"':'';?> ><? echo "Novemebr-".$year; ?></option>
  <option value=<? echo "December-".$year; ?> <?=($b == "December-".$year)?'selected="selected"':'';?> ><? echo "December-".$year; ?></option>
</select>
 </td></tr>

This code will help u.

vibhaJ 126 Master Poster

After importing csv, run this query in sql tab of phpmyadmin.

alter table tbltest add id int(11) primary key auto_increment not null first;

Here tbltest is table name and id is auto incremented field.

vibhaJ 126 Master Poster

oopppsss :)
was in hurry..back my words

vibhaJ 126 Master Poster

Not sure but you can execute these two query separately.
First insert query then execute it and then select query and again execute.
Its a trial & error.

vibhaJ 126 Master Poster

Hi andydeans,

Just fix width of the container which is having this note table.
(i.e. parent tag of <table width="50%">)
not in percentage but in pixel.

vibhaJ 126 Master Poster

In second code line number 11 foreach loop is wrong:

$selstatus = $_POST['selstatus'];
foreach($selstatus as $key => $value)
{
    echo $key . ': ' . $value . '<br>';
}
vibhaJ 126 Master Poster

Hi,
try this code.

$bedrooms=$_POST['bedrooms'];
$bathrooms=$_POST['bathrooms'];  
	  
$whereStr = ' 1=1 ';
	  
if(trim($bedrooms)!='') $whereStr.= " AND  bedrooms like '$bedrooms'" ;
if(trim($bathrooms)!='') $whereStr.= " AND  bathrooms like '$bathrooms'" ;
	  
$query=   "SELECT * FROM inventory WHERE ".$whereStr." ORDER BY model_name ASC";
vibhaJ 126 Master Poster

This is one js function , which will help u .

function continue()
{
	 var hasSelected = false;
	 var FormObj = document.formName; // formName => name of form tag
	 
	 var chklen = FormObj.elements.length;
	 for( var n = 0; n < chklen; n++ )
	 {
		currobj = FormObj.elements[n];
		if(currobj.type == "checkbox" && currobj.checked)
			hasSelected = true;
	}
	if( hasSelected )
	{
		alert("One checkbox is checked.");
		return true;
	}
	else
	{  
	   alert( "Please check at least one Record." );
	   return false;
	}
}
vibhaJ 126 Master Poster

not sure but if you want just paging for one big content.
then go with this link:
http://blog.mastykarz.nl/paging-large-content-sharepoint-jquery/

vibhaJ 126 Master Poster

Even you can use nl2br function during displaying it.

e.g. <td><?php echo nl2br($address);?></td>