简体   繁体   中英

Php Echo not working on header?

i have installed mysql phpadmin, and my connection is also running, i have tested this already with an If else statement. the problem is, i cant see the echo on my program.

$connection = mysql_connect('localhost', "root","") or die ("couldnt connect to server");
mysql_select_db("shelldb",$connection) or die ("couldnt connect to database");

echo "<body style='font-family: verdana, sans-serif;'>
    <div style='width: 80%; padding:10px; border: 1px solid #e3e3e3; background-color: #fff; color:#000;>
        <h1>Login</h1>
    </div>
</body>";

I don't think you have echo problem, May be the problem in any other place. But you need not to echo the whole branch of HTML. Just check out the syntax.

<?php 
$connection = mysql_connect('localhost', "root","") or die ("couldnt connect to server");
mysql_select_db("shelldb",$connection) or die ("couldnt connect to database");
?>
<body style='font-family: verdana, sans-serif;'>
    <div style='width: 80%; padding:10px; border: 1px solid #e3e3e3; background-color: #fff; color:#000;>
        <h1>Login</h1>
    </div>
</body>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM