Bachu 45 Newbie Poster
Bachu 45 Newbie Poster

Try this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test-String-Exg</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>

<title>Exam entry</title>
</head>

<body>
<script type="text/javascript">
$(function(){
    var str = "INC300051546,INC300051553,INC300051561,INC300051579";//Test your string here
    var seperators = ['.',';'];// add your expected seperators here
    var firstFlag = true;
    var secondFlag = true;
    var thirdFlag = true;
    var seperatorLength = seperators.length;

    //chacking other separator in the given string
    for(var i=0;i<seperatorLength;i++) {
        if(str.indexOf(seperators[i])>0) {
            firstFlag=false;
        }
    }

    if(firstFlag==true){
        var splitStr = str.split(',');
        for(var j=0;j<splitStr.length;j++){
            //check first 3 charectors equals to INC
            if(splitStr[j].substr(0, 3)!='INC')     secondFlag = false;
            // check other char number length is 9
            else if(splitStr[j].replace('INC','').length!=9) thirdFlag = false;
        }
        if(secondFlag == false) alert('INC is not in proper order');
        if(thirdFlag == false) alert('Error in 9 digits');
    }

    else alert('String contains other seperators');

});
</script>
</body>
Bachu 45 Newbie Poster

Try this Exg :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Table Exg</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>

<body>
<table id="myTable" width="200px" cellpadding="0px" cellspacing="0px">
  <tr>
    <td>One</td>
    <td>Two</td>
    <td>Three</td>
  </tr>
  <tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
  </tr>
</table>
<script type="text/javascript">
$(function(){
    $('#myTable').mouseover(function() {
        $(this).css('text-align','center');
        $(this).css('border','1px solid');
        $(this).css("background-color","#FF0000");
    });

    $('#myTable').mouseout(function() {
        $(this).css('text-align','left');
        $(this).css('border','0px');
        $(this).css("background-color","#FFFFFF");
    });
});
</script>

</body>
</html>
Bachu 45 Newbie Poster

Change this

 $dob= $_POST['dob'];  

to

if(isset($_POST['dob']))  $dob = $_POST['dob'];
 $dob = 'xx/xx/xxxx';
Bachu 45 Newbie Poster

Try this

<?php 

class myClass
{

    public $str;
    private $pinCode = 111;

    function printPrivateVariable()
    {
        echo $this->pinCode;
    }

}


//object
$ob = new myClass();

$ob -> str = "This is a string.";

//code before the exception
echo $ob -> str.'<br />';

    if($ob -> printPrivateVariable())
    {
        throw new Exception("this is private variable");
    }

try
{
    echo $ob -> printPrivateVariable().'<br />';
}

catch(Exception $e)
{
    echo 'Message : ' .$e -> getMessage().'<br />';
}


//code after the exception
$name = "abc <br />";
echo $name;

?>
Bachu 45 Newbie Poster

You can use different methodes for generating transactionreference Id and OrderId.

I prefer, create those id's related to your order table insert id

Bachu 45 Newbie Poster
Bachu 45 Newbie Poster

1; set $searchResult= array();

2; Check each tables and push all results to the array $searchResult, like below

$sql="SELECT   *  FROM    df_restaurent WHERE  (df_restaurent.Address  LIKE '%$query1%' )  GROUP BY RestaurentId ;";

                   $result=$this->db->query($sql);
                   $data=$this->db->fetchAll($result);
                   foreach($data as $dd)
                     {      
                 array_push($searchResult, array( "Page" => "RestaurentDetails", "RestaurentId"=>"$dd->RestaurentId" ));

                     }

3; At the end of cheking of all tables , return $searchResult

Bachu 45 Newbie Poster

You need a uploading-folder with file permission 777 ... we use jquery uploadify for file upload
http://www.uploadify.com/documentation/

Bachu 45 Newbie Poster

1; Set index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>

<body>

<?php
session_start();
echo $timezone = $_SESSION['timezone'];

?>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function() {
        if("<?php echo $timezone; ?>".length==0){
            var visitortime = new Date();
            var visitortimezone = "GMT " + -visitortime.getTimezoneOffset()/60;
            $.ajax({
                type: "GET",
                url: "http://www.yoursite.php/time.php",
                data: 'timezone='+ visitortimezone,
                success: function(){

                    location.reload();
                }
            });
        }
    });
</script>

2; Set time.php

<?php
    session_start();
    $_SESSION['timezone'] = $_GET['timezone'];
?>
diafol commented: Don't copy somebody else's code and supply it as your own. A link is sufficient -3