I am new to php and been taking a php programing class this summer semester and i was wondering if someone can help me figure what i need to do in order for things to work.
I am working on a final project and we had to build our on little database on the subject that we wanted. So I choose to do a movie database. And I had used some code already from my_guitar_shop from murach's php book. which is the Murach's php and mysql book. And for some reason when I go to index.php page, I can not get my information to show up in my table on my page.
I will show you the code for my index page
<?php
require_once('database.php');
if (isset($_POST['deleteThis'])) {
$deleteThis = $_POST['deleteThis'];
$sqlDel="DELETE FROM categories WHERE categoryID = $deleteThis";
$temp=$db->exec($sqlDel);
}
// Get all categories
$query = 'SELECT * FROM categories
ORDER BY categoryID';
$categories = $db->query($query);
?>
<!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">
<!-- the head section -->
<head>
<title>My Movie Store</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<!-- the body section -->
<body>
<center>
<div id="heading">My Movie Store</div>
</center>
<div id="page">
<div id="header">
<h1>Top Movies</h1>
</div>
<div id="main">
<h1>Movie List</h1>
<table class="content">
<tr>
<th>Title</th>
<th>Date</th>
<th> </th>
</tr>
<?php foreach($categories as $cat) {
?>
<tr>
<td><?php echo $cat['categoryName'];?>
</td>
<form method="post" action="category_list.php">
<input type="hidden" name="deleteThis"
value="<?php echo $cat['categoryID']; ?> " />
<td></td>
<td><input type="submit" value="Delete" />
</td>
</form>
<?php
}
?>
</table>
<br />
<h2>Add a Movie</h2>
<!-- add code for the form here -->
<p>
Add Movie
</p>
<br />
<p>
Movie List
</p>
</div>
<!-- end main -->
<div id="footer">
<p>
©
<?php echo date("2012"); ?>
My Movie Store, created by Kara Holey
</p>
</div>
</div>
<!-- end page -->
</body>
</html>
My database name is called moviedatabase that i had created in localhost/phpmyadmin and my 2 tables underneath the database are called categories and movies. and for some reason thsi is the error that i get on this page.
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\1306\finalp\index.php on line 82
If anyone can help me that would be great.
If you're using PDO, this probably means your query failed and the output of $db->query() is false.
To avoid this problem, I would suggest enabling exception handling:
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
You can add this to database.php. Doing this will produce a very obvious and hard-to-miss exception if a query fails with details as to why it failed.
$categories = $db->query($query) // this is your problem
I think your foreach() is not receiving a valid array. Try troubleshooting with a static array you create!!
example make
$categories = array("A","B");
foreach($categories as $value){
echo $value."<br/>";
}
Your variable $categories in foreach loop isn't a valid collection that's why php gives you this error. You need to see what $categories really is.
I doubt it might be a resource returned from your query or could be a null.
Related
I'm trying to display an image which have been stored in MySQL, but haven't been able to get a success just yet. Apparently echoing the table header (img) gives me back something like this
In addition I would like to be able to add the image in the website itself rather than using the phpmyadmin and inserting the image there.
As of now this is the code I have for the standing.php page
<?php
require_once('database.php');
// Get all categories
$query = 'SELECT * FROM categories
ORDER BY categoryID';
$statement = $db->prepare($query);
$statement->execute();
$teams = $statement->fetchAll();
$statement->closeCursor();
?>
<!DOCTYPE html>
<html>
<!-- the head section -->
<head>
<title>NBA</title>
<link rel="stylesheet" type="text/css" href="css/index.css">
<link rel="shortcut icon" type="image/png" href="images/favicon.ico"/>
</head>
<!-- the body section -->
<body>
<main id="standingListMain">
<h1 id="addCategoryh1">Team Standings</h1>
<table id="standingListTable">
<tr>
<th>Team</th>
<th> </th>
</tr>
<?php foreach ($teams as $team) : ?>
<tr>
<td><?php echo $team['categoryID']; ?></td>
<td>
<?php echo $team['categoryName']; ?>
<?php echo $team['img']; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<br>
</main>
<!-- <footer id="standingListFooter">
<p>© <?php echo date("Y"); ?> NBA</p>
</footer> -->
</body>
</html>
Basically, the user can add or remove a team from the team_list.php page and view it on the standings page
<?php
require_once('../Model/database.php');
// Get all categories
$query = 'SELECT * FROM categories
ORDER BY categoryID';
$statement = $db->prepare($query);
$statement->execute();
$teams = $statement->fetchAll();
$statement->closeCursor();
?>
<!DOCTYPE html>
<html>
<!-- the head section -->
<head>
<title>NBA</title>
<link rel="stylesheet" type="text/css" href="../css/index.css">
<link rel="shortcut icon" type="image/png" href="images/favicon.ico"/>
</head>
<!-- the body section -->
<body>
<main>
<h1 id="addCategoryh1">Teams</h1>
<table id="categoryListTable">
<tr>
<th>Name</th>
<th> </th>
</tr>
<?php foreach ($teams as $team) : ?>
<tr>
<td><?php echo $team['categoryName']; ?></td>
<td>
<form action="delete_team.php" method="post"
id="delete_product_form">
<input type="hidden" name="team_id"
value="<?php echo $team['categoryID']; ?>">
<input id="deleteCategoryList" type="submit" value="Delete">
</form>
</td>
</tr>
<?php endforeach; ?>
</table>
<br>
<h2 id="add_category_h2">Add Team</h2>
<form action="add_team.php" method="post"
id="add_category_form">
<label>Name:</label>
<input type="input" name="name">
<input id="add_category_button" type="submit" value="Add">
</form>
<br>
<p>View Team List</p>
</main>
<footer id="categoryListFooter">
<p>© <?php echo date("Y"); ?> NBA</p>
</footer>
</body>
</html>
Code above is the team_list.php page and below is the code to connect to the database called the add_team.php
<?php
// Get the team data
$name = filter_input(INPUT_POST, 'name');
// Validate inputs
if ($name == null) {
$error = "Invalid team data. Check all fields and try again.";
include('../Error/error.php');
} else {
require_once('../Model/database.php');
// Add the product to the database
$query = 'INSERT INTO categories (categoryName)
VALUES (:team_name)';
$statement = $db->prepare($query);
$statement->bindValue(':team_name', $name);
$statement->execute();
$statement->closeCursor();
// Display the team List page
include('team_list.php');
}
?>
The image above shows the page where u can add or remove a team.
For testing purposes
First you need to know if the Image really exist. Let's assume that in your database you have an image with category Id of 1. Thus create another file, eg "image.php".
(Please ensure that this code runs correctly. I have not tested it but it should work for you).
image.php
<?php
require_once('database.php');
// Get all categories
$query = "SELECT img FROM categories where categoryID=1";
$statement = $db->prepare($query);
$statement->execute();
$num = $statement->rowCount();
if( $num ){
$teams = $statement->fetchAll();
// Ensure to specify header with content type,
// you can do header("Content-type: image/jpg"); for jpg,
// header("Content-type: image/gif"); for gif, etc.
header("Content-type: image/png");
//display the image file
print $teams['img'];
exit;
}else{
//echo no image found with that Category Id.
}
?>
Then in your "standing.php", remove this code:
<?php echo $team['img']; ?>
and replace it with:
<!– "1" is the categoryID id of the image to be displayed –>
<img src="image.php?id=1" />
I did complete a website for online Entrance form for students as my demo project to learn. When I run from my local server it works fine but when I uploaded on webserver and tasted index.php and other files run fine except when user enter his/her symbol no to check if he/she already been registered or not..I have coded a logic
if (exists)>Show admit card
if(don't exist)>show alert box
It works fine in local server but in webserver when I enter value in search box and enter then it shows empty page with no any error.
I have one row in my database. So in case you wanna check here is the symbol no in column =15369-2017-02 . On Entering submit it should show admit card and you can enter any random value other then this .which should show alert box.
Here is my website
https://cmprc.edu.np/condensed/entrance_form_demo/studntreport/main/
This is the code of file which is not responding and showing blank
<html>
<head>
<title>
CDP || Admission Form
</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="../style.css" media="screen" rel="stylesheet" type="text/css" />
<body style="background-color: white;">
<?php
include('../connect.php');
$var_value = $_POST['search_value'];
echo $var_value;
$sql="SELECT * FROM entrance WHERE re_value='$var_value'";
$STH = $db->prepare($sql);
$STH->execute(array($var_value));
$User = $STH->fetch();
if (empty($User))
echo "<script>alert('Sorry, you Have not Registered yet');
window.location = 'index.php';</script>";
else
$result = $db->prepare("SELECT * FROM entrance
WHERE re_value = '$var_value' ORDER BY id ASC;");
$result->execute();
for($i=0; $row = $result->fetch(); ){
?>
<link href="../style.css" media="screen" rel="stylesheet" type="text/css" />
<center><h4><i class="icon-edit icon-large"></i> You've Already Registered</h4></center>
<hr>
<center>
<div class="panel panel-default">
<div class="container">
<div class="row">
<div class="col-md-4 seventy">
<img src="img/admit.png"/ >
</div>
<div class="col-md-8 thirty">
<img src="../image/profile/<?php echo $row['pic_value'];?>" class="roundimage2" alt=""/>
</div>
</div>
</div>
<hr>
<table style=" width: 500px;">
<tr>
<td >Roll no: </td>
<td> <?php echo $row['id']; ?></td>
</tr>
<tr>
<td >Name : </td>
<td > <?php echo $row['name_en_value']; ?></td>
<td > Subject: </td>
<td > <?php echo $row['ge_value']; ?> </td>
</tr>
</table>
<br><br>
<h5><i><strong>STUDENTS MUST BRING THIS ADMIT CARD ON THE DAY OF EXAMINATION</strong></i></h5>
<br>
</div>
</center>
<?php
}
?>
</body>
<?php include('footer.php');?>
</html>
Any help? I did almost finished it which I was working continously for 4-5 Days.
It seems that your php is not executed correctly. Maybe try to enable error reporting to get a hint of what's wrong.
Include the following at the beginning of your destination file (my.php)
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
I have an issue with PHP form which is coded as follows
<?php
include "conn.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>Redbrick</title>
<meta name="description" content="">
<link rel="shortcut icon" href="images/favicon.ico" />
<?php include "js-css.php"; ?>
<meta charset="UTF-8">
<script>
var deleteid = 0;
function deletefunc(del)
{
deleteid = del;
$( "#deletedialog" ).dialog( "open" );
}
function deletethis()
{
$.post("delete.php?tab=careers", {deleteid : deleteid},
function(data) {
$('#deldiv').show();
}
);
}
</script>
</head>
<body>
<section id="main-content">
<section id="content">
<div class="centered">
<div class="grid-1">
<div class="title-grid"><span>Enquiry</span><span style="float:right;text-decoration:none;">Enquiry Listings</span></div>
<div class="content-gird">
<div class="alert red hideit" style="display:none;" id="deldiv"><a class="close" onclick ="location.reload();">Close</a></div>
<?php
global $con;
$prod_qry = mysqli_query($con,"select * from signup order by id");
?>
<table class="display" id="example">
<thead>
<tr>
<th class="th_chexbox"><input type="checkbox" name="set" onclick="setChecked(this)" /></th>
<th class="th_title">Fullname</th>
<th class="th_status">Email</th>
<th class="th_action">phone </th>
<th class="th_action">city </th>
<th class="th_action">enquiry </th>
</tr>
</thead>
<tbody>
<?php while ($prod = mysqli_fetch_array($prod_qry)) { ?>
<tr class="item">
<td><input type="checkbox" name="id[]" value="1" /></td>
<td class="subject"><?= $prod['fullname']; ?></td>
<td><?= $prod['email']; ?></td>
<td><?= $prod['phone']; ?></td>
<td><?= $prod['city']; ?></td>
<td><?= $prod['needs']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="clear"> </div>
</div>
</div>
<!-- Table Ends -->
</div><!--end center-->
</section> <!--end content-->
<!-- Form -->
<div id="deletedialog" title="Upload Images" style="display:none">
<div id='preview'></div>
<h1>Delete</h1>
<div>
Do you really want To Delete this? This cannot be undone!
</div>
</div>
<!-- Form -->
<div class="empty"></div>
</section> <!--end main-content-->
</body>
</html>
Now, the issue is, this code has been coded by previous developer and my client wishes me to handle the project but I am a newbie with PHP forms being integrated in SQL and the mail being sent to the client with details of customers
Futhermore, the clients wishes to integrate this contact form along with some property managements software which uses api and the property management company has given the following information along with code to integrate
Getting Started
Web service deployment
Web service name is PostEnquiry
It is deployed on server 114.143.217.246:85 from where any application can consume the web service deployed on it.
Sample application
http:// 114.143.217.246:85/HighriseAPI/Enquiry_Service.asmx?op=Enquiry_Method
Picture Here
Implementing the web service
Add reference of web service reference in your application.
Below is the sample code to consume web service, assuming validation is being done before calling save method of web service. (Please see comments for better understanding)
Dim id As Integer
\* Create Instance of a web service *\
Dim objPostEnquiry As New PostEnquiryToERP.PostEnquiryToERP
\* Create Instance of an Enquiry object *\
Dim objEnquiry As New PostEnquiryToERP.Enquiry
\* Set properties of an Enquiry object *\
objEnquiry.EnquiryName = txtName.Text.Trim
objEnquiry.ContactNo = txtContact.Text.Trim
objEnquiry.EmailId = txtEmail.Text.Trim
objEnquiry.Address = txtAddress.Text.Trim
objEnquiry.City = txtCity.Text.Trim
objEnquiry.Zip = txtZip.Text.Trim
objEnquiry.State = txtState.Text.Trim
objEnquiry.Country = txtCountry.Text.Trim
objEnquiry.Remark = txtRemark.Text.Trim
objEnquiry.EnquiryType = txtEnqType.Text.Trim
objEnquiry.Project = txtProject.Text.Trim
\* Invoke Save method of web service and pass Enquiry object as an argument*\
id = objPostEnquiry.InsertEnquiry(objEnquiry)
\* If id>0 then assume that record saved successfully *\
If id > 0 Then
lblMessage.Text = "Record Saved Successfully"
End If
On completion of code “objPostEnquiry.InsertEnquiry(objEnquiry)” new enquiry will generate in ERP and return the enquiry number in ERP, else you will get the exception as string.
I have tried all possibilities and searched entire google but found no solutions, please help me with the same
EDIT: New Question (Previous answered, stupid mistake)
I corrected the below code to call $dbh into the menu function (nav.php). However, now I am getting a new error that Google isn't helping me with (all answers are program specific):
PDOStatement::execute(): SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected in /CCU/STH Liquidations/scripts/GetData.php on line 10
No database handle errors were thrown prior to trying to pull the menu in.
I am new to PDOs, so this might be a relatively simple question - but I couldn't find an answer close enough to my problem to help.
I am building my first true content management system. I am trying to bring in a menu based on whether it is to be shown (value is either 1 or 0, to be determined by admin).
However, in just trying to read them in, I'm getting undefined variable errors between files. The files are called in the correct order, and both are pulled in by index.php.
The variable that is undefined is the $dbh in the GetData.php file.
Do you see what I'm doing wrong? Because I can't see it.
index.php:
<?php
session_start();
$title = "STH Liquidations";
$description = "Product wholesale";
$keywords = "wholesale, product, pallets";
include "parts/_head.php";
include "parts/header.php";
include "parts/nav.php";
?>
<div id="content_index">
<?php include "parts/hot_deals.php"; ?>
<div id="image_holder">
<ul class="bxslider">
<li><img src="slider/pic1.jpg" title="Welcome to STH Liquidations!"/></li>
<li><img src="slider/pic2.jpg" title="Electronics"/></li>
<li><img src="slider/pic3.jpg" title="Furniture" /></li>
<li><img src="slider/pic4.jpg" title="Appliances" /></li>
<li><img src="slider/pic5.jpg" title="Tools" /></li>
<li><img src="slider/pic6.jpg" title="Sporting Goods"/></li>
</ul>
</div>
<p class="head1">Welcome to <strong>STH Liquidations, Inc.</strong></p>
<p>We at <strong>STH Liquidations, Inc.</strong> have been in the business of buying and selling overstock and liquidated NAME BRAND merchandise from <strong>major retailers</strong>, catalog companies, and big box stores for over 10 years now. Our goal has always been to consistently provide your business with <strong>dependable</strong> and <strong>trustworthy</strong> service along with the best possible pricing that will allow you to <strong>MAXIMIZE YOUR PROFITS</strong> and <strong>minimize your risk</strong> on every deal. Whether your business is wholesale, retail, auctions, online, flea markets, or if you are a “mom and pop store”, we are able to meet your specific needs.
</p>
<p>We carry truckloads of general merchandise, furniture, housewares, tools, toys, sporting goods, jewelry lots, apparel and much more. We ship direct from the reclaim centers, which eliminates “cherry picking” and keeps <strong>YOUR COST LOW</strong>. Our simple philosophy; <strong>money saved is money made</strong>. Your success is our success.</p>
<p>Please feel free to browse our website at your leisure and CALL us with ANY questions you may have to <strong>place your order</strong>.</p>
<p>Join our FREE mailing list HERE to receive <strong>up to date listings</strong> and our <strong>HOT deals</strong>.</p>
</div>
<div id="hotdeals">
<p class="head2">Hot Deals!</p>
<div class="deals">
<p class="deal_title">K-Hardgoods</p>
<p class="deal_desc">Truckloads, general merchandise, tools, toys housewares and more</p>
<p class="deal_price">as low as $139 per pallet</p>
<p class="deal_pdf">Call for Information!</p>
</div>
<div class="deals">
<p class="deal_title">SRS Tool Truckload</p>
<p class="deal_desc">CR*STSM*N TOOLS AND MUCH MORE <br />Saws, compressors, blowers, edgers. saber saws, table saws and much more</p>
<p class="deal_price">27 PALLETS--WHLS $66,649.32 <br />SELL PRICE $12,900</p>
<p class="deal_pdf">Download PDF</p>
</div>
<div class="deals">
<p class="deal_title">W*M Power wheels</p>
<p class="deal_desc">Ride on toy truckloads
<br />150-180 units per truckload
<br />Customer returns</p>
<p class="deal_price">Price only $5,900</p>
</div>
</div>
<div class="clear"></div>
<?php
include "parts/footer.php";
?>
_head.php:
<!DOCTYPE html>
<html>
<?php
require "config.php";
require_once "scripts/GetData.php";
?>
<head>
<!-- NAME THE PAGE -->
<title><?php $title ?></title>
<!-- GET THE FAIRY DUST AND DUST BUNNIES -->
<link rel="stylesheet" type="text/css" href="scripts/basic.css" />
<script type="text/javascript" src="contact-files/contact-form.js"></script>
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<!-- bxSlider -->
<script src="scripts/jquery.bxslider.min.js"></script>
<link href="scripts/jquery.bxslider.css" rel="stylesheet" />
<script src="scripts/muscles.js"></script>
<!-- TELL GOOGLE WHAT IT WANTS TO HEAR -->
<meta name="description" content="<?php $description ?>">
<meta name="keywords" content="<?php $keywords ?>">
<!-- FIX ENCODING ERROR -->
<meta charset="UTF-8">
</head>
<!-- =============== -->
<!-- HEADER -->
<!-- =============== -->
config.php:
<?php
$host = "localhost";
$user = "root";
$pass = "root";
$database_name = "sthliquidations";
// Create connection
try
{
// PDO Connection
$dbh = new PDO("mysql:host = $host; dbname = $database_name", $user, $pass);
}
catch (PDOException $e)
{
echo $e -> getMessage();
}
// Show me any exceptions
// TURN THIS OFF WHEN LIVE
$dbh -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
?>
GetData.php (and where the error is being thrown):
<?php
function menu ($dbh)
{
// Make a call to the database
$menu_handle = $dbh->prepare("
SELECT * FROM cats
WHERE menu = ?;
");
$menu_handle->execute(array(1));
// Testing
$row = $menu_handle->fetch();
echo "<pre>";
echo $row;
echo "</pre>";
}
?>
nav.php (what's making the call in the first place):
<!-- NAVBAR -->
<div id = "sidenav">
<div id = "leftnav">
<ul class = "menulink">
<li>Home</li>
<li>About Us</li>
<?php menu($dbh); ?>
<li>Freight Services</li>
<li>Contact Us</li>
<li>Glossary</li>
</ul>
</div>
</div>
It was a simple fix after all. Scope was correct, call was correct - simply forgot the parameter.
Once I added the $dbh call in the correct places, I started getting this error:
PDOStatement::execute(): SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected in /CCU/STH Liquidations/scripts/GetData.php on line 10
After some trial and error, I figured out that the PDO database connection script doesn't like spaces.
Connected perfectly after that fix and have gotten my menu working properly, even able to pull in only those menu links set to true.
Days work done LOL!
I am building an online system where the users are instructors of a certain college institution. One of the main function of the system is for the users to be able to view their schedules via internet.
I am currently building the page where the users view their schedule, and what I have done is create a select option in it that triggers a jquery function (that does an ajax request) when the value is changed. The requested page is then displayed on a div in the current page.
The problem is, when I try to change the value of a select option, the page occasionally displays a huge white blank on top of my whole page. I don't know what triggers the bug since it only happens occasionally, not every time. When i reload the page, the white space disappears.
I have been searching for answers everywhere and did not get one that fits my problem.
This is the page before the white space shows up
https://lh6.googleusercontent.com/-rb0XXjcpn6w/UPiwjIY92OI/AAAAAAAAABo/BmiDIbZWcxU/s640/before.jpg
This is the page when the white space shows up
https://lh3.googleusercontent.com/-RZxh2P3Bk0o/UPiwRv5oHHI/AAAAAAAAABc/VIB6LYvPBE4/s640/after.jpg
I hope you guys can help me out...
this is the code of the page..
<?php
require_once("../includes/initialize.php");
$adminEmps = employee::find_by_cond("(department = 'ACADEMIC-TEACHING' or department = 'ACADEMIC-NON TEACHING') and emp_status='active' order by lastname asc");
?>
<!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>Schedule</title>
</head>
<script type="text/javascript">
function selectEmp(){
$('#here').html("<img src=../Images/gif/loading14.gif' class='three columns centered'>");
$.post('viewSched.php','id='+$('#selector').val()+'&yr='+$('#yrselect').val(),
function (response){
$('#here').html(response);
});
}
</script>
<body>
<?php include("AdminDropdown.php"); ?>
<div class="row">
<div class="twelve columns">
<div class="row panel">
<h2><img src="../Images/Shedule.png" height="100px" width="100px" style="vertical-align:middle"/>
Schedule
</h2>
<dl class="tabs pill">
<dd class="active">Academic</dd>
<dd>Administrative</dd>
<dd class="hide-for-small">OSAS</dd>
</dl>
</div>
<ul class="tabs-content">
<li class="active" id="simple1Tab">
<div class="two columns">
Select Employee
</div>
<div class="three columns end">
<select id='selector' onchange="selectEmp()" >
<option>--Select--</option>
<?php
foreach ($adminEmps as $key => $value) {
echo "<option value={$value['emp_ID']}>{$value['lastName']}, {$value['firstName']} {$value['lastName']}</option>";
}
?>
</select>
</div>
<div class='two columns'>
</div>
<div class='two columns' style='text-align:right;'>
Select Year
</div>
<div class='three columns end'>
<select id='yrselect' onchange="selectEmp()">
<option>-- Select --</option>
<?php
for ($i=2008; $i <= date('Y'); $i++) {
$yr = $i + 1;
echo "<option>{$i}-{$yr}</option>";
}
?>
</select>
</div>
<br>
<br>
<div class="twelve columns ">
<div class="nine columns centered">
<div id='here'>
</div>
</div>
</div>
</li>
<li id="simple2Tab"></li>
<li id="simple3Tab">This is simple tab 3s content.</li>
</ul>
</div>
</div>
<?php include("adminfooter.php"); ?>
</body>
</html>
and this is the code of the requested page.
<?php
require_once('../includes/initialize.php');
$id = $_POST['id'];
$yr = $_POST['yr'];
$info = sched::find_scheds_by_id_yr($id,$yr);
$display = "<table>
<thead>
<tr>
<th>Day</th>
<th>Time Start</th>
<th>Time End</th>
<th>Room</th>
<th>Subject</th>
</tr>
</thead>
<tbody>
";
if($info){
foreach ($info as $key2 => $value2) {
$display .= "<tr>
<td>".$value2['day']."</td>
<td> ".$value2['time_start']."</td>
<td>{$value2['time_end']}</td>
<td>{$value2['room']}</td>
<td>{$value2['Subject_description']}</td>
</tr>";
}
}
$display.="</tbody>
</table>";
?>
<html>
<head><title></title></head>
<body>
<?php echo $display; ?>
</body>
</html>
By the way this only happens in google chrome.
Going by your source files, the only javascript visible changes the content of the #here div, to a loading image inside an img tag, or to the result of the AJAX call.
Since nothing but this div seems to be changing, you should take a look at the css and see if its correctly handling a div with dynamic content (i.e, a div whose contents will be changing in size).
Look for how it's being positioned/sized, and how you're handling the overflow property.