Location: PHPKode > projects > PRAjax - PHP Reflected Ajax > examples/example_target.php.txt
// Set the header
header("Content-Type: text/html; charset=utf-8");

// Use bin or src?
$strSources = '../bin';

// Import PRAjax
require_once($strSources . '/PRAjax.php');

// Instantiate PRAjax
$objPRAjax = new PRAjax($strSources . '/');

// Register functions
$objPRAjax->RegisterFunction('HelloWorld');	// This is something external and does not have to be implemented in this script file. Beware when using objects: they must be known on the current page!

// Handle PRAjax client request
		<title>Hello World (Target: example_helloworld.php)</title>
		<?php $objPRAjax->GetJavaScript(); ?>
		<script language="JavaScript">
		// Callback functions
		function HelloWorld_cb(data) {
		// -->
		<style type="text/css">
		body, p, td {
			font-family: Arial, Helvetica, sans-serif;
			font-size: 11px;
		h1 {
			font-size: 22px;
			font-weight: bold;
		h2 {
			font-size: 18px;
			font-weight: bold;
		<div style="width: 100%; height: 65px; background-color: #EEEEEE; font-family: Arial, Helvetica, Sans-Serif; font-size: 9pt;">
			This example calls PHP functions of example_helloworld.php
			<a href="example_target.php.txt" target="_blank">View code...</a>
		<form name="frmForm">
			<h1>Hello World</h1>
			<input type="button" value="Simple Hello World" onClick="HelloWorld(HelloWorld_cb, 'setPRAjaxTarget:example_helloworld.php;');">
Return current item: PRAjax - PHP Reflected Ajax