When activating PHP service for the website, the account is created on a dedicated server. The execution of all PHP-scripts is done there. Access to the following account, data upload, change and removal is accomplished via FTP with login and password (they were indicated when activating the PHP service), which you can see in the Control panel of the website.
When creating an account, the “scripts” directory is created automatically. All PHP-scripts that are called at the website pages, should be placed there. All the scripts should have the ".php" extension.
Only such files are available under the direct address links. All the other files (their content) can be received only by means of PHP-scripts.
All the accounts are created with the following limitations:
It is possible to use PHP-scripts on the website pages in the current domain via proxy mechanism:
http://SITE_ADDRESS/php/SCRIPT_NAME.php?param0=valueA¶m1=valueB...¶mN=valueM
<?$PHPCODE$("http://SITE_ADDRESS/php/SCRIPT_NAME.php?param0=valueA¶m1=valueB...¶mN=valueM")?>
You may use POST-requests via forms, iframe, other scripts of this domain etc, for example:
<script type="text/javascript">
function updatepostdata(result) { $('#postdiv').html(result); }
</script>
<div id="postdiv"></div>
<iframe frameborder="0" src="http://SITE_ADDRESS/php/SCRIPT_NAME.php?param0=valueA¶m1=valueB...¶mN=valueM"></iframe>
<?
$___notjson=1;
if ($_POST)
{
$ret="POST OK:<br>";
foreach ($_POST as $i => $val) $ret.="$i=$val<br>";
echo "<script type=\"text/javascript\">
window.parent.updatepostdata(\"$ret\");
</script>";
}
echo "<form
action=\"http://SITE_ADDRESS/php/SCRIPT_NAME.php?param0=valueA¶m1=valueB...¶mN=valueM\"
method=\"POST\">
<input type=\"hidden\" name=\"field0\" value=\"test_".rand()."\">
<input type=\"submit\" value=\"Go\">
</form>";
?>
<script type="text/javascript">
function updatepostdata(result) { $('#postdiv').html(result); }
</script>
<div id="postdiv"></div>
<iframe frameborder="0">
<form
action=\"http://SITE_ADDRESS/php/SCRIPT_NAME.php?param0=valueA¶m1=valueB...¶mN=valueM\"
method=\"POST\">
<input type=\"hidden\" name=\"field0\" value=\"test_".rand()."\">
<input type=\"submit\" value=\"Go\">
</form>
</iframe>
<?
$___notjson=1;
if ($_POST)
{
$ret="POST OK:<br>";
foreach ($_POST as $i => $val) $ret.="$i=$val<br>";
echo "<script type=\"text/javascript\">
window.parent.updatepostdata(\"$ret\");
</script>";
}
else echo "No data<br>";
?>
In this realization, the following language functions are forbidden to use:
This function is responsible for getting secure and valid website's user data, from the pages of whom the current script was called, when viewing those pages. The DATATYPE parameter defines which data should be returned. At the moment only one data type is available: SITEUSERID ($uid=ucoz_getinfo("SITEUSERID")). It indicates that the website's user identifier should be returned.