Jump to content

php ajax problem


solon

Recommended Posts

Hey guys i have a file called file1.php which has a form with loads of data retrieved from a table in a DB! I have another file called file2.php which shows the data retrieved from another table in the DB, data that are imported based on the selection of the user in file1.php. What i need to do is use AJAX to import those data into the DB from file1.php and again use ajax to show the extracted data in file2.php without having to reload the page because of the big load of data!

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/131609-php-ajax-problem/
Share on other sites

ok. file1.php is a form filled with buttons that curry values from the database! onclick in file1.php it loads another file responsible to insert that selection into tha DB.

 

my file_all.php looks like this! Notice the included files!

<?php ob_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>K-ebet : The online betting site...</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href='default.css' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="wrapper">
<?php include("file.php");?>
<?php include("file_x.php");?>
<?php include("file_z.php");?>
<hr/>

<div id="page">
<table>
<tr>
<td valign="top">
<div id="sidebar">
	<?php include("file_y.php");?>
</div>
</td>
<td valign="top">
<div id="content">
	<h1> Available Games!</h1>
	<?php include("file1.php");?>
</div>
</td><td valign="top" align="left">
<div id="sidebarr" align="left">
	<?php include("file2.php");?>
</div>
</td>
</tr></table>
</div>
<hr />
<?php include("file_c.php");?>
</div>

</body>
</html>
<?php ob_flush(); ?>

 

Thats what i mean all the file are included in the same .php file.

 

What i want to do is while clicking a button in file1.php without having to reload the hole page , to send that data into mysql using ajax and at the same time show it in file2.php.

Link to comment
https://forums.phpfreaks.com/topic/131609-php-ajax-problem/#findComment-683571
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.