Bachu 45 Newbie Poster

Replace your display Function with this code. You missed to put <tr> tag in your table

function display($getallen){
 $table = '<table  border="1px" cellpadding="1px">';
 $bingokaart = array();

 for ($row = 1; $row < 7; ++$row){
     $table .= '<tr>';
     //iets met rijnummer doen en deze printen?
        foreach ($getallen as $number){
        $table .= '<td>'  .$row .  $number .'</td>';
    }
    $table .= '</tr>';
 }

  $table .='</table>'; 
echo $table;  
 }
Bachu 45 Newbie Poster

Try this
Click Here

Bachu 45 Newbie Poster

Check this link
Click Here

You will get some idea ...

Bachu 45 Newbie Poster

@fireburner29, You can also redirect it to the same page.

check this session value $_SESSION['sess_userrole'], before you print the details. Means that if its value is admin, print the admin details. Else print
the normal user details.

Bachu 45 Newbie Poster

Check this link Click Here.

Bachu 45 Newbie Poster

Check this

Click Here

Bachu 45 Newbie Poster

Check this
Click Here

Bachu 45 Newbie Poster

Try This Click Here

Bachu 45 Newbie Poster

@burt.munn

We can print the result with in a php tag, like

<?php
if(isset($_POST['sbt'])) {
    echo "<h2>Bill Report</h2>";
    if(is_numeric($_POST['txtCustomersNo']) && is_numeric($_POST['txtAmount'])) {
    if($_POST['txtCustomersNo']>=6) $gratuity = $_POST['txtAmount']*0.18;
    else $gratuity = $_POST['txtAmount']*0.15;

    $tax = $_POST['txtAmount']*0.0875;

    echo "<table cellpadding='2' border='1'>
    <tr><td>No: of Custermers</td><td>".$_POST['txtCustomersNo']."</td></tr>
    <tr><td>Amount:</td><td>".$_POST['txtAmount']."</td></tr>
    <tr><td>Gratuity:</td><td>".$gratuity."</td></tr>
    <tr><td>Tax:</td><td>".$tax."</td></tr>
    <tr><td><strong>Total:</strong></td><td>".($_POST['txtAmount']+$gratuity+$tax)."</td></tr>
    </table>";
    }
    else    echo "<h2>Wrong Customer Number/Amount </h2>";

}
?>

&&

Line 10 -> Checking form is submit or not

Line 12-> Checking customer number and bill amount are numeric

Bachu 45 Newbie Poster

Try this

<form name="calcBill" id="calcBill" action="" method="post">
<label for="txtCustomersNo">Customers Number</label>
<input type="text" name="txtCustomersNo" id="txtCustomersNo" value="<?php  echo isset($_POST['txtCustomersNo']) ? $_POST['txtCustomersNo'] : "1"; ?>" />
<label for="txtAmount">Amount</label>
<input type="text" name="txtAmount" id="txtAmount"  value="<?php  echo isset($_POST['txtAmount']) ? $_POST['txtAmount'] : "0"; ?>" />
<input type="submit" name="sbt" value="Calculate" />
</form>

<?php
if(isset($_POST['sbt'])) {
echo "<h2>Bill Report</h2>";
if(is_numeric($_POST['txtCustomersNo']) && is_numeric($_POST['txtAmount'])) {
if($_POST['txtCustomersNo']>=6) $gratuity = $_POST['txtAmount']*0.18;
else $gratuity = $_POST['txtAmount']*0.15;

$tax = $_POST['txtAmount']*0.0875;
?>
<table cellpadding="2" border="1">
<tr>
<td>No: of Custermers</td>
<td><?php echo $_POST['txtCustomersNo']; ?></td>
</tr>
<tr>
<td>Amount:</td>
<td><?php echo $_POST['txtAmount']; ?></td>
</tr>
<tr>
<td>Gratuity:</td>
<td><?php echo $gratuity; ?></td>
</tr>
<tr>
<td>Tax:</td>
<td><?php echo $tax; ?></td>
</tr>
<tr>
<td><strong>Total:</strong></td>
<td><?php echo $_POST['txtAmount']+$gratuity+$tax; ?></td>
</tr>
</table>
<?php
}
else {
?>  
    <h2>Wrong Number Of Customers Or Amount </h2>
<?php
}

}
?>
Bachu 45 Newbie Poster

Try this Click Here

Bachu 45 Newbie Poster

Since $_POST['Item1'] and $_POST['Item2'] are array, you have to convert it to string before saving to your table.

Replace
$TextBox_item1 = ($_POST['Item1']);
with this to
$TextBox_item1 = implode(',', $_POST['Item1']);

And

$TextBox_item2 = ($_POST['Item2']);
with this to
$TextBox_item2 = implode(',', $_POST['Item2']);

Bachu 45 Newbie Poster

Try this

$array_one = array('Champlain Valley TTC(1/31/2015)','Old Shelburne Town School5420 Shelburne RdSherburne, VT  05482','Friday - 6:30 - 10:00PM','Jack Devine802-877-3341','<-----NEXT_CLUB ----->','Green Mountain Table Tennis Club(GMTTC)(6/30/2014)','Knights of Columbus - Boys & Girls Club Gymnasium21 Merchants RowRutland, VT  05701','Wednesday - 6:00 - 10:00PM and 2 Fridays(6:00 - 10:00PM) & 2 Saturdays(7:00AM - 9:00PM) per year for  tournaments(last Fri/Sat in March & Fri/Sat in Nov or Dec)','Ronald Lewis802-247-5913','<-----NEXT_CLUB ----->','Upper Valley Table Tennis Club(9/30/2014)','Marion Cross Elementary School Gym22 Church StNorwich, VT  05051','Wednesday - 7:00 - 9:15PM(During School Year)','Douglas Haynes603-643-2178','<-----NEXT_CLUB ----->');

echo '<h2>First Array</h2>';
var_dump($array_one);
$array_two = array();
$arrayIndex=0;
$loopCount=0;
$second_index="";
foreach ($array_one as $myValue) {
    $loopCount = ($loopCount<5) ? $loopCount : 0;
    switch ($loopCount) {
        case '0':
            $second_index="cName";
        break;
        case '1':
            $second_index="local";
        break;
        case '2':
            $second_index="days_times";
        break;
        case '3':
            $second_index="contact";
        break;
        case '4':
            $second_index="marker";
        break;
    }

    $array_two[$arrayIndex][$second_index]=$myValue;
    $arrayIndex = ($loopCount>=4) ? $arrayIndex+1 : $arrayIndex;
    $loopCount++;
}

echo '<h2>Second Array</h2>';

var_dump($array_two);
Bachu 45 Newbie Poster

Did you dry just print the value directly like
<img id="imgs" src="../images/verificarimg/img.jpeg" width=700> ?

Then, If you don't get the image, please check the path of image/name of image/type of image(jpeg,jpg,png etc)

Bachu 45 Newbie Poster

Try this

<?php
include 'connectMySql.php';

session_start();
if(isset($_POST['login']))
{
    $username = mysql_real_escape_string($_POST['username']);
    $password = mysql_real_escape_string($_POST['password']);
    if($username && $password)
    {
        $query = "SELECT * FROM users  WHERE username = '$username' AND password = '$password'";
        $result=mysql_query($query);
        $count=mysql_num_rows($result);

        if($count>0)
        {
            $_SESSION['username'] = $username;
            $_SESSION['password'] = $password;
            header("location:members.php");
        }
        else
        {
            header("location:index.php?notify=Incorrect Username or Password.");
        }
    }
    else
    {
        header("location:index.php?notify=All fields are required.");
    }
}

?>
Bachu 45 Newbie Poster

Can you show me your code ?

For reference Click Here

Bachu 45 Newbie Poster

Try this

function setMyValue ($myValue) {
$newValue = (int)$myValue;
$myArray = array_reverse(str_split($newValue));
$myValue ="";
foreach ($myArray as $key=>$myDigits) {
    $myValue.=($key>0 && $key%2==0) ? ":" : "";
    $myValue.= $myDigits;
}
return strrev($myValue);
}

echo setMyValue(91819.0);
Bachu 45 Newbie Poster

Check the below link
Click Here

Bachu 45 Newbie Poster

Try this

<?php
$result = mysql_query("SELECT   DATE_FORMAT(`joindate`,'%m/%Y') AS MonthYear   FROM  member GROUP BY YEAR(joindate), MONTH(joindate);");

while($row = mysql_fetch_array($result))
  {
     echo '<h2>'.$row['MonthYear'].' </h2>';
     $resultTwo = mysql_query("SELECT   *  FROM  member WHERE DATE_FORMAT(`joindate`,'%m/%Y') = '{$row['MonthYear']}';");
     while($rowTwo = mysql_fetch_array($resultTwo)) {
        echo '<p>Member: '.$rowTwo['name'].' </p>';
        echo '<p>Email: '.$rowTwo['email'].' </p>';
        echo '<p>Joindate: '.$rowTwo['joindate'].' </p><hr />';
     }
  }
?>
Bachu 45 Newbie Poster

I tested your above code in my local pc. It works fine.Make sure that "$data['content']" having contents or check your database table structure.

Bachu 45 Newbie Poster

Check this link
Click Here

Bachu 45 Newbie Poster

Hai;

Try this

<?php
include("config.php");

function runQry ($qry){
$rows = array();
$result = mysql_query($qry); 
if($result) {
                    while($row = mysql_fetch_object($result)) {
                        $rows[] = $row;
                    }
                } else {
                    $rows = null;
        }
        return $rows;
}   

function getAllMenus ($level=0) {
        $menuList=array();
        $sql="SELECT * FROM `tbl_structure` WHERE `PARENTID` = '$level'";
        $mainMenus=runQry($sql);
        foreach($mainMenus as $mm) {
            array_push($menuList, $mm);
            $subMenu=getAllMenus($mm->ID);  
            if(sizeof($subMenu)>0) {
                array_push($menuList, $subMenu);
            }
        }
        return $menuList;
}   


function generateTree($menuList) {
        $length=sizeof($menuList);

        $tree="<ul>";
        foreach($menuList as $i=>$ml) {
            if(is_array($ml)) {
                $tree=substr($tree, 0, -5);
                $tree.=generateTree($ml);
                $tree.="</li>";
            }
            else {
                $tree.="<li><a href='prodid=".$ml->ID."'>".strtoupper($ml->NAME)."</a></li>";
            }
        }
        $tree.="</ul>";
        return $tree;
    }

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="testcss.css" rel="stylesheet" type="text/css" />
</head>

<body>

<?php 
echo generateTree(getAllMenus()); 
?>

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

This link will help, Please check

Click Here

Bachu 45 Newbie Poster

Try this

$username = (isset($_POST['Username'])) ? $_POST['Username'] : "";
Bachu 45 Newbie Poster
<?php

function hello() {
    print "<h1>HELLO!</h1>";
    print "<p>Welcome to my web site</p>";
}


hello();
?>
Bachu 45 Newbie Poster

Try this

<?php

    $dates = array("1/28/13","1/29/13","1/30/13","1/31/13");
    foreach($dates as $myDate) {
        $dueDate = date('n/j/y', strtotime("+1 months", strtotime($myDate)));
        $myDateMonth = date ('n',strtotime($myDate));
        $dueDateMonth = date('n', strtotime($dueDate));
        $myDateYear = date ('Y',strtotime($myDate));
        $dueDateYear = date ('Y',strtotime($dueDate));


            if(($dueDateMonth - $myDateMonth)>1) {
                if($myDateYear==$dueDateYear) $nextMonth = $myDateMonth+1;
                else if($myDateYear<$dueDateYear) $nextMonth = 1;
                $dueDateOrg = date("n/t/y", strtotime($nextMonth."/1/".$dueDateYear));
            }
            else {
                $dueDateOrg = $dueDate;
            }



        echo $myDate." due date is ".$dueDateOrg."<br />";
    }

?>
Bachu 45 Newbie Poster

Try this

<?php
mysql_connect("localhost", "root", "") or die("Connection failed! " . mysql_error());
mysql_select_db("your_database") or  die("Error in database selection" . mysql_error());

 function  qryTry ($parentId) {
    $find_query = "SELECT Id  FROM  Table_1 WHERE parent = '$parentId' ";
    $strSQL = mysql_query($find_query);
    while($row = mysql_fetch_array($strSQL)) {
        echo $row['id'] . "<br />";
    }
    $strSQL2 = mysql_query($find_query);
    while($row = mysql_fetch_array($strSQL2)) {
        qryTry ($row['id']);
    }
 }
 $parentValue = 4;
 qryTry ($parentValue);

mysql_close();
?>
Bachu 45 Newbie Poster
Bachu 45 Newbie Poster
Bachu 45 Newbie Poster

Hai;

Use the following codes for rename the file name, if any file with same name exist on upload path.

$tempFile = $_FILES['txtFile']['tmp_name'];
    $targetPath = 'uploadfolder/';
    $newFileName =$_FILES['txtFile']['name'];
    $targetFile =  str_replace('//','/', $targetPath) . $newFileName;

    $cpy=0;
    do {

        if($cpy>0)
        $fileName="copy_".$cpy.str_replace(' ','_', ((isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name']))? $_FILES['file']['name'] : $_FILES['Filedata']['name']));
        else $fileName=str_replace(' ','_', ((isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name']))? $_FILES['file']['name'] : $_FILES['Filedata']['name']));
        $targetFile =  str_replace('//','/',$targetPath) .$fileName;        

        $cpy++;
    }while(is_file($targetFile));

    move_uploaded_file($tempFile,$targetFile);
Bachu 45 Newbie Poster

Hai;

You use a hidden field for store this total value in your form.Like

<input type="hidden" name="hdnTotal" id="hdnTotal" value="" />

And also add the below code in your calculateSum().

 $("#hdnTotal").val(sum5.toFixed(2));

In your action page you will get the total value as

  $_POST['hdnTotal'] //if you use post methode
  $_GET['hdnTotal'] // if you user get methode
Bachu 45 Newbie Poster

Hai;

check this link Click Here

Bachu 45 Newbie Poster

Hai;

Try this..

<input type="text" name="txtfield" id="txtfield" value="" />
<input type="button" onclick="getValue()"  value="Get Value"/>

<script type="text/javascript">
function getValue() {
    alert(document.getElementById("txtfield").value);
}
</script>
Bachu 45 Newbie Poster

Change This

$sql="SELECT idNumber, mType FROM tableItem";

To

$sql="SELECT idNumber, mType FROM tableItem  GROUP BY mType";
Bachu 45 Newbie Poster

You have a </htm> tag at the end which is at least not standard

Sorry ..Thats was my typing mistake..

Did you try like this ?

var optionalValues=[];
$j('#dibujoshechos option').each(function(){
    optionalValues.push( $j(this).attr('value'));
});
    var lospuntos="";
    var lospuntos = optionalValues[0]; 
    console.log("the value is " + lospuntos);

And check it in your console.

Bachu 45 Newbie Poster

When I try it in my PC it works fine.. One question . Why do you use $j ?
Check the following code. It's my code

<!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 src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
</head>

<body>
<select id="My">
<option value="Test">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
</body>
<script type="text/javascript">
$(function() {
var optionalValues=[];
$('#My option').each(function(){
    optionalValues.push( $(this).attr('value'));
});
    var FirstValue = optionalValues[0];
    alert(FirstValue);
});
</script>
</htm>
Bachu 45 Newbie Poster

It is possible, In jquery

exg:

<script type="text/javascript">
$(function(){
<?php
    if($id==1)
    {
?>
        window.location="page1.php";
<?php
    }
    else
    {
?>
        window.location="page2.php";
<?php    
    }
    ?>
});
</script>
Bachu 45 Newbie Poster

Try this

var optionalValues=[];
$('#combobox option').each(function(){
    optionalValues.push( $(this).attr('value'));
});
var FirstOption = optionalValues[0];
alert(FirstOption);
Bachu 45 Newbie Poster

There are lot of issues

In container_24 you have given max-width: 980px;
but Mid_Content is a div inside of this div, For Mid_Content div you have given width: 1100px;

Why?

Give Mid_Content div width value with less than or equal to width of container_24 div

Bachu 45 Newbie Poster
Bachu 45 Newbie Poster

Use Float insted of align. Like

<div id="Mid_Content">

<div id="Left_Content">
<h2>heading </h2>
<p>
test</p>
</div>
<div id="Mid_point_Content">asdasd</div>
<div id="Right_Content">Form</div>
</div>


<style>
#Mid_Content {
    Width: 1000px;
    float: left;
}

#Left_Content {
width: 33%;
float:left;
}
#Mid_point_Content {
    Width: 33%;
    float: left;
}
#Right_Content {
    Width: 33%;
    float:left;
}

</style>
Bachu 45 Newbie Poster
Bachu 45 Newbie Poster

Change your td css to

td {
    background-color: #EEEEEE;
    border-bottom: 1px solid #FFFFFF;
    border-left: 1px solid #FFFFFF;
    padding: 0 10px 0 0;
}
Bachu 45 Newbie Poster

Change this $_POST['check_option']; to $_POST['refID'];

You are posting refId with field name 'refID' 
Bachu 45 Newbie Poster
Bachu 45 Newbie Poster

If you have repeated Id, and you don't want to change the Id name
You can use the following code ...

var myPTags = document.getElementsByTagName("p");
for(var i = 0; i < myPTags.length; i++){
    if(myPTags[i].id == "f2")  {
        myPTags[i].innerHTML = q2;
    }
}

document.getElementById("f1").innerHTML = q1;
//document.getElementById("f2").innerHTML = q2;
document.getElementById("f3").innerHTML = q3;
setTimeout("moretext()",9000);

Insted of

document.getElementById("f1").innerHTML = q1;
document.getElementById("f2").innerHTML = q2;
document.getElementById("f3").innerHTML = q3;
setTimeout("moretext()",9000);
Bachu 45 Newbie Poster

Hi, @diafole .Good one.

Only One suggestion

I think, checking with Id is better than checking with name ...

Name Can be repeate ... Is it ?

Bachu 45 Newbie Poster

Tyr this :

$result1 = mysql_query("SELECT id, name  FROM  allparks");

   while ($row1 = mysql_fetch_array($result1)) {
       echo '<h3>'.$row1['name'].'</h3><ul>';
       $result2 = mysql_query("SELECT feat_name
                                FROM allparks
                                LEFT JOIN prkcombine ON allparks.id = prkcombine.pk_id
                                LEFT JOIN prkfeature ON prkcombine.pkfeat_id = prkfeature.pkfeat_id
                                WHERE allparks.id =".$row1['id']);

         while ($row2 = mysql_fetch_array($result2)) { 
            echo '<li>'.$row2['feat_name'].'</li>';
         }

         echo '</ul>';
   }
Bachu 45 Newbie Poster

Hi;

In your script, startTime & endTime are not defined ...

And asign these values in your form, like

<input type="hidden" name="event_sub_stime1" value="2013-01-09" />
<input type="hidden" name="event_sub_etime1" value="2013-01-14" />
Bachu 45 Newbie Poster

Check this Exg

Your index file:

<!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>Form -  validate - Exg</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<form  method="post" name="myForm">

    <select id="sltOption" name="sltOption">
    </select>
</form>

<script type="text/javascript">
$(function (){
    $.ajax({
    type:"post",
    url:"phpfile.php",
    success:function(response){
        $('#sltOption').html(response);
    }
    });

})
</script>
</body>
</html>

&
your php file:

<?php
echo "<option> add to list1 </option>";
echo "<option> add to list2 </option>";
?>