Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/141742-output-of-a-include-file/
Share on other sites

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.