Current location: Hot Scripts Forums » General Web Coding » JavaScript » [SOLVED] Ajax + Php


[SOLVED] Ajax + Php

Reply
  #1 (permalink)  
Old 10-06-08, 07:41 AM
devphp12 devphp12 is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Ajax + Php

Hi
i have one phpscript which has ajax scipt to load opening data

wen m try to call same from list.php it cant give any ansewe.
even if it doesnt echo nything.

javascript Code:
  1. <code>
  2. <?php
  3. <script language='javascript'>
  4.  function get_list(parameter) {
  5.     //alert("hi");
  6.     parameter_1='parameter='+parameter;
  7.      makePOSTRequest('name_db.php',parameter_1);
  8.    }
  9.     function get_again(val)
  10.    {
  11.     //parame='parameter='+val;
  12.     alert(parame);
  13.     //makePOSTRequest('name_db.php',parame);
  14.  
  15.    }
  16.   </script>
  17.  
  18.  
  19.  
  20. ?>
=======================================
PHP Code:

name_db.php
<? $link mysql_connect("localhost","1111",'1111') or die("Connection fail"); 
   
mysql_select_db("db") or die("Can't Open database");
   
   
$parameter=$_POST['parameter'];
   
$end=$parameter+500;
?>
<?php 
echo date("H:i:s");

$quy="select * from member_name where id>=$parameter and id<=$end";
    
$an=mysql_query($quy) or die(mysql_error());
    
?>
    
    <table width="100%" border="0">
    <?php
    
while($aa=mysql_fetch_array($an))
    {    
        
?>
  <tr>
    <td><?php echo $aa['id'];?></td>
  </tr>
  <?php  //sleep(1);
  
}
  
?>
  
   <tr>
    <td</td>
  </tr>
  
</table>
<script language="javascript">
get_again(<?php echo $end;?>);
</script></code>

Last edited by Nico; 10-06-08 at 08:10 AM. Reason: Wrappers.
Reply With Quote
  #2 (permalink)  
Old 10-06-08, 08:08 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Thread moved to Javascript, since this is not a PHP problem.

And Javascript won't be parsed in responses from XMLHttpRequests.
Take a look at setInterval() instead.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax....changing values of php variables sushi4664 JavaScript 1 08-09-07 12:04 AM
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
Sample scirpt php & AJAX jsanders PHP 3 07-24-06 05:24 AM
how to use onclick in php coolcoder HTML/XHTML/XML 2 05-31-06 12:40 PM
PHP Downside--Solutions? Amulet PHP 10 07-15-05 08:26 AM


All times are GMT -5. The time now is 11:44 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.