[thelist] PHP Include function error

HP Thniah heanpeng at gmail.com
Wed Feb 11 05:28:11 CST 2009

hi there

I have an issue with running this PHP script on PHP Triad ver 2.2. The part
highlighted in *RED* doesn't execute - please help!


include "include/session.php";
// username and password to log onto db server
// name of database
////// DONOT EDIT BELOW  /////////
function connecttodb($servername,$dbname,$dbuser,$dbpassword)
global $link;
$link=mysql_connect ("$servername","$dbuser","$dbpassword");
if(!$link){die("Could not connect to MySQL");}
mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error());
<!doctype html public "-//w3c//dtd html 3.2//en">
<title>(Type a title for your page here)</title>
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080"
if($rec=mysql_fetch_array(mysql_query("SELECT * FROM cus_info WHERE
login='$userid' AND password = '$password'")))
{  *include("include/newsession.php");
         echo "<p class=data> <center>Successfully,Logged in<br><br><a
href='logout.php'> Log OUT </a><br><br><a href=welcome.php>Click here if
your browser *
*is not redirecting automatically or you don't want to

print "<script>";
print " self.location='welcome.php';";
// Comment this line if you don't want to redirect
print "</script>";*
else {
echo "<font face='Verdana' size='2' color=red>Wrong Login. Use your correct
Userid and Password and Try <br><center><input type='button' value='Retry'


More information about the thelist mailing list