Forum version: SMF 2.0 RC4
SimplePortal 2.3.3
I'm trying to use SimplePortal Pages to display a page which will show a location count of all my members. I.E. Texas = 348, New York = 297 and so on.
I wrote the working PHP page and can display the results outside of my forum but when I try to insert it into a SimplePortal Page I get an error. So, I tried a simple test to see if I could access my database (open and close as connection) and that failed. Here is the code:
<?php
// set database server access variables for MySQL:
$host = "localhost";
$user = "username";
$pass = "password";
$db = "smf_db";
// Set Variables
$LCount = 0;
// open connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
?>
<p><b>Test</b></p>
<?
// free result set memory
mysql_free_result($result1);
// close connection
mysql_close($connection);
?>
When I try to preview the page I get:
Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error.So, I guess the basic question is, can I access my SMF database from within a SimplePortal Page using PHP?