Link to home
Start Free TrialLog in
Avatar of shopjd
shopjd

asked on

php call to undefined html_begin

php    call to undefined html_begin

do I have to enable
in the php.ini file
ASKER CERTIFIED SOLUTION
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shopjd
shopjd

ASKER

error:
call to undefined function html_begin()
at dump_members.php line 5

what should I declare in sampdb_pdo.php
for html_begin  and html_end  to make the code work
dump_members.php
 
<?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>
<?php
html_end ();
?>
 
 
sampdb_pdo.php
 
<?php
 #sampdb_pdo.php-commmon functions for sample pdo-based scripts function that uses username and password to connect to mysql server to use the sampdb database.  It also enables exceptions for errors that occur for subsequent pdo calls return value is the database handle produced by the new pdo()
 function sampdb_connect ()
 {
  $dbh = new PDO("mysql:host=localhost;dbname=april", "root","");
  $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  return($dbh);
 }
?>

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial