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


XML and Javascript





Simulator
Ok, I have made a PHP script on getting XML into PHP variables, but Frihost does not support the way I did it, I then came across get.child.id or something in JS, but have no idea on how to use it, does anyone here know how I can get XML into PHP variables or arrays through javascript?
Ranfaroth
You could have a look at E4X. (Read this page and this presentation)
SystemWisdom
Frihost supports Expat XML Parser, but it is tedious to work with to say the least...

Reference: http://php.net/manual/en/ref.xml.php

I currently use it on my site, and it works fine...

Anyway, try this script I made on your web account, and you will see a list of all the modules that frihost supports, plus a listing of all the functions in each module, plus a direct link to PHP.net's online documentation for every single function. Comes in very handy!

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>


Hope that helps!
Simulator
SystemWisdom wrote:
Frihost supports Expat XML Parser, but it is tedious to work with to say the least...

Reference: http://php.net/manual/en/ref.xml.php

I currently use it on my site, and it works fine...

Anyway, try this script I made on your web account, and you will see a list of all the modules that frihost supports, plus a listing of all the functions in each module, plus a direct link to PHP.net's online documentation for every single function. Comes in very handy!

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>


Hope that helps!


Thanks man, I did find my own way of doing it though.... sorry, this can be locked now
Related topics
what do you think about frontpage
best tool?
to make web site
Po co forum?
Free Lancing
[DESIGNER]dreamweaver, frontpage ou mambo??
Need Idea to create a website
smart phone applications
Professional JavaScript For Web Developers
The best site for learning JavaScript
Javascript news feed?
Converting XML into HTML
javascript php html styling and good practice.
Do I need JavaScript?
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.