FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Enabled PHP Methods





ccarter24
I am new to the site, and hope to have a website as soon as server 2 accepts new requests. I was just wondering, what PHP functions have been enabled for use on websites? I was going to place text files in my directory, and was going to use fread and fwrite. Are those useable? Are there any restrictions as to what functions can be used? JUst wondering since there's no way for me to find out except by asking just yet.
Stubru Freak
Most functions are allowed, there aren't a lot of rules here.

Just nothing that's extremely riksy.
SamiTheBerber
ccarter24 wrote:
I am new to the site, and hope to have a website as soon as server 2 accepts new requests. I was just wondering, what PHP functions have been enabled for use on websites? I was going to place text files in my directory, and was going to use fread and fwrite. Are those useable? Are there any restrictions as to what functions can be used? JUst wondering since there's no way for me to find out except by asking just yet.


In Frihost is used PHP version 4.4.1, so I guess that fread and fwrite can be used (since PHP version 3). In PHP.net functions you can look if function that you want use is available.
SystemWisdom
I wrote this script a while back for that exact reason: What functions and modules are available with this specific host?

Just place the following file in your web directory and run it in a web browser.. It will list all installed modules, it lists all functions found within each module, and finally it links directly to PHP.net's online documentation for each function.

Enjoy!

Code:

<html>
<head>
<style><!--
body
{   color:#426394;
}
table
{   border: 1px solid #426394;
}
td.sepB
{   border: solid #426394;
    border-width: 0px 0px 1px 0px;
}
td.lrPad5, a, a:hover
{   padding: 0px 5px 0px 5px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 8pt;
    color: #426394;
}
a:hover
{   background-color: #E3E3E3;
}
//--></style>
</head>
<body>

<?php

$table1_cols = 5;
$table2_cols = 4;

$aModules = array();
$aModuleFuncs = array();

$counter = 1;
echo "<br><br><font size=+1><b><u>Listed Modules</u></b>:</font><br><br>\n";
echo "<table border=0 cellpadding=0 cellspacing=0 width=100%>";

$aModules = get_loaded_extensions();
foreach( $aModules as $szModuleName )
{
    if( $counter == 1 )         // First Column
    {
        echo "\n <tr>\n  <td class=lrPad5><a href=\"#$szModuleName\" style=\"font-weight:bold;\">$szModuleName</a></td>";
    }else if( $counter == $table1_cols )   // Last Column
    {
        echo "\n  <td class=lrPad5><a href=\"#$szModuleName\" style=\"font-weight:bold;\">$szModuleName</a></td>\n </tr>\n <tr>";
        $counter = 0;
    }else
    {
        echo "\n  <td class=lrPad5><a href=\"#$szModuleName\" style=\"font-weight:bold;\">$szModuleName</a></td>";
    }
    $counter++;
}
echo "\n</table>\n\n";

echo "<br><br><font size=+1><b><u>Module Functions</u></b>:</font>\n<br><br>\n";
$aModules = get_loaded_extensions();
foreach( $aModules as $szModuleName )
{
    echo "\n<table border=0 cellpadding=0 cellspacing=0 width=100%>";
    echo "\n <tr>\n  <td class=\"lrPad5 sepB\" colspan=\"$table2_cols\"><a name=\"$szModuleName\">Functions in <b>$szModuleName</b> Module..</a></td>\n </tr>";

    $counter = 1;
    $aModuleFuncs = get_extension_funcs( $szModuleName );
    foreach( $aModuleFuncs as $szFunctionName )
    {
        if( $counter == 1 )         // First Column
        {
            echo "\n <tr>\n  <td class=lrPad5><a href=\"http://php.net/$szFunctionName\" target=\"_new\">$szFunctionName</a></td>";
        }else if( $counter == $table2_cols )   // Last Column
        {
            echo "\n  <td class=lrPad5><a href=\"http://php.net/$szFunctionName\" target=\"_new\">$szFunctionName</a></td>\n </tr>\n <tr>";
            $counter = 0;
        }else
        {
            echo "\n  <td class=lrPad5><a href=\"http://php.net/$szFunctionName\" target=\"_new\">$szFunctionName</a></td>";
        }
        $counter++;
    }
    echo "\n</table>\n<br><br>\n\n";
}

?>

</body></html>
kv
Nice utility. Thanks.
ccarter24
SystemWisdom - you're awesome. I'll give that a shot, when I can.
Related topics
How To : Secure Your PHP Website
Dynamic PHP Images
Tutorial: PHP Installed Modules Dynamic Reference Tool
PHP OOP Tutorial
PHP version 5.0
Php sms
Running a "Hello World" php script
PHP installtion Help!
(server 2) php function exif_read_data() not supported ?
Perl CGI 500 Internal Server Error
Are XML and XSLT extentions enabled in PHP?
php extensions config
Need help with file permissions for WordPress & plugins
HTTP Fileupload and CHMOD
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.