BinaryBird Posted January 21, 2009 Share Posted January 21, 2009 Hello, i am trying to format the output of a include file. I am displaying the output in a table. I want the table to be centered. Here is the code: <div style="text-align: center;"> <table style="text-align: center;"> <tr> <td> No of visitors: </td> <td> <?php include( "./counter/counter.php" ); ?> </td> </tr> </table> </div> I need to center the table. How do i do that? The style element is not working. What am i doing wrong? I am new to html and php. Please help me. Thanks. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted January 21, 2009 Share Posted January 21, 2009 center the table in the page or center the contents of the table ? Also this is a HTML problem not PHP, please you the correct section Quote Link to comment Share on other sites More sharing options...
benjamin_1 Posted January 21, 2009 Share Posted January 21, 2009 Hello, i am trying to redirect username and password that is not in mysql database. i created two pages one to redirect and the other one to login username and password.which is only redirecting all including the username and password in mysql database. can any body help me out with my code. Here is the code for redirect <?php $user = $_POST["user"]; $password = $_POST["password"]; $user = stripslashes($user); $password = stripslashes($password); $connect_mysql = mysql_connect ('localhost','root') or die(mysql_error()); if ($connect_mysql) { //echo "connect esterblished"; } else { //die ("connect esterblish<br>"); } $db = "table"; $mysql_db = mysql_select_db ("table") or die(mysql_error()); if ($mysql_db) { //echo "<br><br> connect to the database"; } else { //die ("unable to connect to the database"); } $result = mysql_query ("select * from pet WHERE user='$user' && password='$password'"); while($rows = mysql_fetch_array($result)) if(mysql_num_rows($result)>0) { header('Location:./login.php');//page to go to if user name is correct } else { $error = 'Your login details are incorrect'; } echo "$errorUnknown user or password incorrect.<br><br>"; echo "<a href=select2.html>Go to the login page</a> <a href=test.html>and Register</a>"; ?> And this is my login code <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $user = $_POST["user"]; $password = $_POST["password"]; $connect_mysql = mysql_connect ('localhost','root') or die(mysql_error()); if ($connect_mysql) { //echo "connect esterblished"; } else { //die ("connect esterblish<br>"); } $db = "table"; $mysql_db = mysql_select_db ("table") or die(mysql_error()); if ($mysql_db) { //echo "<br><br> connect to the database"; } else { //die ("unable to connect to the database"); } $result = mysql_query ("select * from pet WHERE user='$user' && password='$password'"); while($rows = mysql_fetch_array($result)) if(!mysql_num_rows($result)>0) { print "<br>welcome $user <BR>$password "; } else { print "Your login details are incorrect"; } ?> </body> </html> i need help Quote Link to comment Share on other sites More sharing options...
MadTechie Posted January 21, 2009 Share Posted January 21, 2009 benjamin_1 please create a New Thread in the PHP Help Section. Also please use the Code tag (# button) also redirect to where ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.