php html_begin

error with html_begin

in apache how 'install' dump_members.php script in ushl directory
To encode values for display in the Web page, dump_members.php uses the
htmlspecialchars() function to take care of escaping characters that are special in
HTML, such as <,>, or &. (To encode values for inclusion with URLs, use
urlencode() instead.) These two PHP encoding functions are similar to the CGI.pm
escapeHTML() and escape() methods for Perl that are discussed in Section 8.4.2.3,
Escaping HTML and URL Text.
To try the dump_members.php script, install it in the ushl directory of your Web server
document tree and access it from your Web browser using this URL:
http://localhost/ushl/dump_members.php
To let people know about dump_members.php, place a link to it in the Historical
League home page script.The modified script (index4.php) looks like this:
<?php
# USHL home page - version 4
require_once "sampdb_pdo.php";
$title = "U.S. Historical League";
html_begin ($title, $title);
?>
<p>Welcome to the U.S. Historical League Web Site.</p>
<?php
try
{
$dbh = sampdb_connect ();
$sth = $dbh->query ("SELECT COUNT(*) FROM member");
$count = $sth->fetchColumn (0);
print ("<p>The League currently has $count members.</p>");
$dbh = NULL; # close connection
}
catch (PDOException $e) { } # empty handler (catch but ignore errors)
?>
<p>
You can view the directory of members <a href="dump_members.php">here</a>.
</p>
542 Chapter 9 Writing MySQL Programs Using PHP
<?php
html_end ();
?>

Open in new window

shopjdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NerdsOfTechTechnology ScientistCommented:
1. What error are you receiving?
2. Is the function html_begin() defined in your included file "sampdb_pdo.php"; If not that is what is probably causing the error
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.