0

I did post something earlier put this time I am going to post all of it.I am getting error message and it will not show up when i try to pull it up on local host. Here's the code:

This one is includeindex.php

if ($_POST['submit'] != "") {
    if ($_POST['name'] != "") {
        session_start();
        $_SESSION['name'] = $_POST['name'];
        TopNavigation("PHP Includes Example - ECA236", "PHP Includes", $_SESSION['name']);
    } else {
        header("Location:includindex.php");
        exit;
    }
} else {
    TopNavigation("PHP Includes Example - ECA236", "PHP Includes");
    echo "<div class=\"formtable\">\n";
    echo "<br>";
    echo "<form action=\"" . $PHP_SELF . "\" method=\"post\">\n";
    echo "Please enter your name:<input type=\"text\" name=\"name\">\n";
    echo "<input type=\"submit\" class=\"btnSubmit\" value=\"Enter\" name=\"submit\">\n";
    echo "</form>\n";
    echo "<br>";
    echo "</div>\n";
    Footer();
}

?>

This one is header

<?php
function TopNavigation($pagetitle, $pageheading, $username = '') {
    echo "<html>\n";
    echo "  <head>\n";
    echo "  <title>" . $pagetitle . "</title>\n";
    echo "  <link href=\"../style.css\" type=\"text/css\" rel=\"stylesheet\">";
    echo "  </head>\n";
    echo "  <body>";
    echo "      <h1>" . $pageheading . "</h1>\n";
    echo "      <hr>\n";
    echo "      <p class=\"tiny\">" . date("F j,Y") . "</p>";
    if ($username != '') {
        echo "<div align=\"center\">\n";
        echo "<a href=\"includeindex.php\">Use a different name</a> | <a href=\"about.php\">About</a> | <a href=\"signout.php\">Signout</a>\n";
        echo "</div>\n";
        echo "<p>Welcome. " . $username . "!";
    }
}

function Footer() {
    echo "</body>\n";
    echo "</html>\n";
}

?>

This one is about.php

<?php
session_start();
include("include/header.php");
if (!isset($_SESSION['name'])) {;
    header("Location:includeindex.php");
    exit;
} else {
    TopNavigation("About Me -ECA236", "About Me", $_SESSION['name']);

    echo "<p>Here is a little about me. I am a mother of twin girls who are 9 </p>\"n;
    echo " < p>I been married for 5 years but been with my husband for 11 years </p > \"n;
    echo "<p > I am attending college for Computer Programming and Database Mangament </p > \"n;
    echo "<p > After I get done with this degree I am want to go back for Web Design </p > \"n;
    echo "<p > since half my classes are web design now . I enjoy camping,bon fires and  </p > \"n;
    echo "<p > playing video games, hanging out with friends and family .</p > \"n;
    Footer();
}
?>

This one is signout.php

<?php
session_start();
if (isset($_SESSION['name'])) {
    session_destroy();
    session_start();
}
header("Location:includeindex.php");
exit;
?>

I can not get it to show up and work at all. I have no clue why it is not doing it. Can someone please help me.

I keep getting errors no matter what I fixed and it doesnt show up when you look at it online..

here the errors i get: Notice: Undefined variable: PHP_SELF in C:\wamp\www\includeindex.php on line 19 Undefined index: submit in C:\wamp\www\includeindex.php on line 4 Warning: include(include/header.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\about.php on line 3 Warning: include() [function.include]: Failed opening 'include/header.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\about.php on line 3 Fatal error: Call to undefined function TopNavigation() in C:\wamp\www\about.php on line 9

Alexander Yancharuk
  • 13,817
  • 5
  • 55
  • 55
andy
  • 97
  • 2
  • 8
  • Appears to be intended as a follow-up to http://stackoverflow.com/questions/6507796/error-code-in-php? –  Jun 29 '11 at 03:08

2 Answers2

0

All of your echo statements in the TopNavigation() function are still incorrectly quoted. Instead of \"n;, they should end with \n";

// Wrong
echo "<p>Here is a little about me. I am a mother of twin girls who are 9 </p>\"n;

// Should be:
echo "<p>Here is a little about me. I am a mother of twin girls who are 9 </p>\n";
                                                                          ---^^^^
Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
0

in your php.ini change display_errors=Off to display_errors=On

Gasim
  • 7,615
  • 14
  • 64
  • 131