FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


php and ajax





gerimter
Do you have examples of that? <php and ajax>
jmraker
Here's a simple one that uses jQuery to put the contents of an ajax call into the h2
The ajax call is $("h2").load("?ajax"); where it loads the page again with an ajax parameter.
where it can return text like HTML, XML, json, or plaintext. But the header('Content-type: text/xml') should be used to have the XML parsed by the browser.

Code:
<?php
if(isset($_REQ UEST['ajax']))
   die('<i>This</i> is from the ajax call');

?>
<html><head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script>
$(document).ready(function(){
   $("h2").load("?ajax");
})
</s cript>
</head>
<body>
<h1>This is from the html part of the page</h1>
<h2></h2>
</body></html>
gerimter
thanks
b4r4t
Well ... there are good examples directly on jquery reference manual.
.ajax method is realy easy to use with jquery.

You also will use PHP5 func - json_encode i think Smile
Related topics
[Community Project] Easy Simple Content Management System
Need a comment on the feel of my advertisements
Why Javascript inside php that opened with ajax doesn;t refr
Codeur php/sql/js? j'ai besoin d'un coup de pouce
AJaX or ASPX?
mod_security question
AJAX, PHP, XHTML some critism pls!
AJAX tutorials?
www.newgengamers.com
Los 50 mejores sitios diseñados en CSS
Qui peut m'aider à créer un site ?
PHP + Ajax
Javascript vs PHP (or python?) - unicode text file search
Need some help.
PHP, AJAX and setInterval. Can't make a stopwatch
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.