Hola, se puede hacer con Ajax y con pseudoAjax.
Con Ajax, preguntá en el foro correspondiente.
Con Javascript, una de las maneras sería esta (hay otras):
pag.php:
Código PHP:
<!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=iso-8859-1" />
<title>pag</title>
<script>
function cargar(){
document.getElementById('pepe').src='pag1.php';
}
</script>
</head>
<body>
<a href="javascript:cargar()">activar</a>
<div id="desde_php"></div>
<iframe id="pepe" frameborder="0" width="0" height="0" style="display:none"></iframe>
</body>
</html>
pag1.php:
Código PHP:
<?php
define('MENSAJE','hola, que tal');
echo '<script>window.parent.document.getElementById("desde_php").innerHTML="'.MENSAJE.'";</script>';
?>