x

Your Pages - Setup PHP Site

Sample PHP Page, Inline-Frame League Schedule, VBScript

Return - Your Pages Setup

In this sample, you only need the programming in blue, optional lines are in green.

For a quick-start, you can copy and paste this entire code to a file in your website named "SampleIframeLeagueSchedule.php", then view this page in your browser: http://(YourSite)/SampleIframeLeagueSchedule.php

Working sample: http://php.divebarsussex.com/SampleIframeLeagueSchedule.php?rES=3&rSP=1&rLN=236&rDM=1
(displaying the sample code below)

If you would rather skip the sample page, just copy and paste the blue, and optionally green lines into your .php page.

<?php
    // Sample League Schedule file, using inline-frame, for PHP
    // ---------------------------------  Retrieve settings from the Query String
    $xES = $_GET['rES'];     // EstablishmentNumber
    $xSP = $_GET['rSP'];     // SportNumber
    $xLN = $_GET['rLN'];     // LeagueNumber
    $xDM = $_GET['rDM'];     // DisplayMode
    // ---------------------------------  The next 2 settings for options on this page
    $xMO = 1;                // Set MouseOverTeam and MouseOverRow Hi-Light effect
                             //    (1=enable,0=disable)
    $xFD = 1;                // Set TopOfPage FullDisplay elements (1=enable,0=disable)
                             //   (the PrinterFriendly link and Standings link)
    $URLStr = htmlspecialchars('http://www.easyleagues.biz/Content/Schedule.asp?' . 'rES=' . $xES
        . '&rSP=' . $xSP . '&rLN=' . $xLN . '&rDM=' . $xDM . '&rMO=' . $xMO . '&rFD=' . $xFD); ?>
<?php
    $calcFrameStr = htmlspecialchars('http://www.easyleagues.biz/Content/CalcParentFrame.asp?'
        . 'rES=' . $xES . '&rSP=' . $xSP . '&rLN=' . $xLN . '&rPG=2&rTH=22&rCH=23&rFF=5'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
  <title>iframe Sample - League Schedule</title>
  <style type="text/css"><!--
  .easyLeaguesFrame {width: 90%; height: 200px; margin: 5px 5%;
                    border: 1px solid #c0c0c0; overflow: hidden;} --></style>
  <link href="<?php echo $calcFrameStr; ?>" rel="stylesheet" type="text/css" />
</head>
<body>
  <div style="width: 800px; height: 100px; border: 1px solid #000000;">
    Your page header/banner here.
  </div>
  <div style="width: 800px; border: 1px solid #000000;">
    <p>Your personalized page-body content here, before the League Schedule content.</p>
    <!-- The first part of your page programming before here -->
    <!-- Begin needed programming -->
    <iframe src="<?php echo $URLStr; ?>" frameborder="0" class="easyLeaguesFrame">
      Your browser does not support iframes.<br />
      View <a href="<?php echo $URLStr; ?>" target="_blank">Simple Page</a>
      in a new window.
    </iframe>
    <!-- End needed programming -->
    <!-- The remainder of your page programming after here -->
  </div>
  <div style="width: 800px; height: 100px; border: 1px solid #000000;">
    Your page footer here.
  </div>
</body>
</html>

The above sample demonstrates a method for assigning the values needed further down in the page. For those site designers desiring a simplified version of the required code, here is a more condensed method.

<!-- Condensed version, PHP iframe sample, League Schedule -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
  <title>iframe Sample - League Schedule</title>
  <style type="text/css"><!--
  .easyLeaguesFrame {width: 90%; height: 200px; margin: 5px 5%;
                    border: 1px solid #c0c0c0; overflow: hidden;} --></style>
  <link href="<?php echo htmlspecialchars('http://www.easyleagues.biz/Content/CalcParentFrame.asp?'
        . 'rES=' . $_GET['rES'] . '&rSP=' . $_GET['rSP'] . '&rLN=' . $_GET['rLN'] . '&rPG=2&rTH=22&rCH=23&rFF=5'); ?>" rel="stylesheet" type="text/css" />
</head>
<body>
  <div style="width: 800px; height: 100px; border: 1px solid #000000;">
    Your page header/banner here.
  </div>
  <div style="width: 800px; border: 1px solid #000000;">
    <p>Your personalized page-body content here, before the League Schedule content.</p>
    <!-- The first part of your page programming before here -->
    <!-- Begin needed programming -->
    <iframe src="<?php echo htmlspecialchars('http://www.easyleagues.biz/Content/Schedule.asp?' . 'rES=' . $_GET['rES']
        . '&rSP=' . $_GET['rSP'] . '&rLN=' . $_GET['rLN'] . '&rDM=' . $_GET['rDM'] . '&rMO=1&rFD=1'); ?>" frameborder="0" class="easyLeaguesFrame">
      Your browser does not support iframes.<br />
      View <a href="<?php echo htmlspecialchars('http://www.easyleagues.biz/Content/Schedule.asp?' . 'rES=' . $_GET['rES']
        . '&rSP=' . $_GET['rSP'] . '&rLN=' . $_GET['rLN'] . '&rDM=' . $_GET['rDM'] . '&rMO=1&rFD=1'); ?>" target="_blank">Simple Page</a>
      in a new window.
    </iframe>
    <!-- End needed programming -->
    <!-- The remainder of your page programming after here -->
  </div>
  <div style="width: 800px; height: 100px; border: 1px solid #000000;">
    Your page footer here.
  </div>
</body>
</html>

Required Query String Parameters.

The EasyLeagues.biz content for both the web page version and printable version of the Schedule page originates from the same file: "http://www.easyleagues.biz/Content/Schedule.asp". The parameter "rMO=1" will enable the MouseOver high-lighting in the web page version (setting "rMO=0" will disable the MouseOver high-lighting for the printable version). The parameter "rFD=1" will enable FullDisplay of the top-of-page links to a printer-friendly version and also the standings page (setting "rFD=0" will prevent the top-of-page information from appearing on the printer-friendly version of the Schedule).

Remember to seperate each parameter with an "&" (ampersand).

Optional programming, calculate <iframe> height.

Looking at the example above, you will see the URL for the style-sheet was constructed and assigned to a variable named CalcFrameStr. In the "Query String Parameter" part of the URL, the "EstablishmentNumber", "SportNumber", and "LeagueNo" were passed in according what League was selected. The four additional parameters for specifying how the <iframe> height should be calculated are the same as on the LeagueSelect page:

  • rPG=2, which page to calculate for (1=LeagueSelect, 2=LeagueSchedule, 3=LeagueStandings).
  • rTH=22, how tall the TitleHeight rows are. (all heights are in pixels).
  • rCH=23, the CellHeight rows in the rest of the table.
  • rFF=5, a FudgeFactor value to be added.
Sample Page Styles and Links

The styles and links in the sample pages will not work properly until you have copied the sample CSS files to your site and configured "Settings" in EasyLeagues.biz, but the content will display without problem.