Results 1 to 2 of 2

Thread: Stuck with some simple code... Please find my mistakes

  1. #1
    Join Date
    Aug 2007
    Posts
    1

    Stuck with some simple code... Please find my mistakes

    In adding some content to my first page, I have ran into a few problems with syntax errors and could use some help seeing as this is my first site and I have no previous website design or programming experience.

    I have created a website for my dad and have set it up with 5-6 tabs linking to different content, all based off the same content/template. I wrote the code required in making a scalable box and you will see it in the code as a function. Here's my problem:

    For the index page I was able to get everything to work correctly, but I'm having trouble inserting the content in pages/links that have a if statement in order to call the correct information. I had it working correctly untill I tried to add content and the box function as well...here is my code for the working index page:

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    <?php
    include_once 'common.php';

    write_top('Home');
    echo "<p class='page_header'> The National Space Club - Huntsville</p>";
    write_box_top();
    ?>

    <p class="generic" style="text-align:justify">The National Space Club - Huntsville was founded in 1985 to further the aims locally of the National Space Club.</p>
    <p class="generic" style="text-align:justify">The National Space Club is the foremost entity devoted to fostering<img src="images/spacecamp.jpg" style="margin:10px;" align="right" width="200"/> excellence in space activity through interaction between industry and government, and through a continuing program of educational support.</p>
    <p class="generic" style="text-align:justify">Through its programs, activities, and awards, the National Space Club - Huntsville works to promote space leadership as well as education. The active involvement of senior members of government, industry and academia serves to stimulate a range of activities focused on these objectives. The Club is a nonprofit corporation comprised of representatives from industry, government, educational institutions, and private individuals.</p>

    <p class="subheader"> Objectives</p>
    <p class="generic">
    <ul>
    <li>Promote United States space leadership through conferences, workshops, and other literary and educational means.</li>
    <li>Stimulate the advancement of civilian and military applications of rocketry, astronautics, and related technologies for the benefit of all mankind.</li>
    <li>Bring together persons from government industry, education, the media, and other fields to exchange information on rocketry and astronautics.</li>
    </ul>
    </p>

    <p class="subheader"> Activites</p>
    <p class="generic">
    <ul>
    <li>Luncheons and receptions with recognized leaders speaking on timely subjects and issues.</li>
    <li>The Annual Dr. Wernher von Braun Memorial Dinner honoring individuals through the Dr. Wernher von Braun Space Flight Trophy, Astronautics Engineer Award, Media Award, Community Service Award and the Dr. Wernher von Braun Scholarships.</li>
    <li>Conference of national and international significance to the Space Program.</li>
    <li>Scholarships to stimulate youth interest in astronautics and related sciences.</li>
    <li>Special functions and workshops, and Annual NSC membership meeting.</li>
    </ul>
    </p>

    <?php
    write_box_bot();
    write_bot();
    ?>

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Now here is my code in which i'm having the problems, getting it to read correctly as well as having the if statements establishing multiple pages:

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    <?php
    include_once 'common.php';

    write_top('About Us');

    $aboutus = $_GET['e'];
    if ($aboutus == 'HISTORY' || !isset($aboutus)) {
    write_box_top();
    ?>

    <p class="subheader"> Objectives</p>

    <p class="subheader"> Activites</p>

    <?php
    write_box_bot();
    write_bot();
    ?>


    <?php
    }

    if ($aboutus == 'PURPOSE' || !isset($aboutus)) {
    write_box_top();
    ?>
    <p class="generic">This is the purpose page</p>
    <?
    }
    <?php
    write_box_bot();
    write_bot();
    ?>
    }

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Any guidance would be appriciated, I am moving along very well considering i'm only about 5-6 hours into this site and it already looks very good...thanks for any quick fixes regarding sloppy code. thanks

    Jeff

  2. #2
    Join Date
    Aug 2007
    Posts
    53
    Hi Jeff
    Withouth having the inc.common.php file I can't check everything thoroughly but if you have having errors it's almost always a missing { or } or a missing ) or (
    For example in the code sample above the 2nd file has two { and 3 } so you need to remove the bottom }

    Let me know if that helps.

    Chris.
    Frozen Interactive - Web Design

    t: +44 (0) 870 803 1780
    http://www.frozeninteractive.com

Similar Threads

  1. Find closest dealer using zip code
    By Nelson in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 24 Jan 2006, 03:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •