сделал так...
<?php
define('_IN_JOHNCMS', 1);
require_once ("../incfiles/core.php");
require_once ("../incfiles/head.php");
$a = htmlspecialchars(getenv("HTTP_REFERER"));
$_SESSION['buf'] = ''.$a.'';
header('Location: ' . $a . '');как лучше организовать вставку ссылки из буферa в окно ввода?