0

I have trouble with spaces, wher is php tag, i have spaces.
foto:
http://img99.imageshack.us/img99/4163/spacervd.png

If i delete: require("connect_db.php");
and
<form method = "post">
...

Everything ok. How i can remowe this space?
And why "New user" in ner rows?

<?php
session_start();
require("connect_db.php");
?>
<html>
<head>
<style type="text/css">
body { 
margin:0; 
margin-top: 0; 
margin-bottom: 0;
text-align: center;
}
div.body2{
width: 666px;
background-color: #e43546;
}
</style>
</head>
<body>
<div class = "body2">
<?php echo 'Text, text<br>'; ?>
<?php 
  echo '
    <form method = "post">
Name: <input type = text name = name>   
  Pass: <input type = password name = password>
  <input type = submit id = login value = login>
  </form>
<a href = "reg.php">New user</a>
';
 ?>
<?php echo 'Text, text<br>'; ?>
</div>
</body>
</html>

Thanks for help

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by almostbob
0
<?php session_start();
require("connect_db.php"); ?>
<html>
<head>
<style type="text/css">
body { margin:0; text-align: center; } /*top & bottom are redundant*/
.body2{ width: 666px; background-color: #e43546; }
form { margin:0; } 
</style>
</head>
<body>
<div class="body2">
<?php echo 'Text, text<br>';
echo '<form method="post">
Name: <input type="text" name="name">  Pass: <input type="password" name="password">  <input type="submit" id="login" value="login"></form>
<a href="reg.php">New user</a><br>';
echo 'Text, text<br>'; ?>
</div>
</body>
</html>

is there white space in connect_db

0

connect_db file:

<?php
$db_link = mysql_connect ('localhost', 'root', '');
if($db_link == false){ echo '<br>'; echo 'Error!<br>'; exit;}

$db = mysql_select_db('users');
if($db == false){ echo '<br>'; echo 'Error!'; exit;}
?>

margin:0; - don't help

0

code for connect_db

<?php
$db_link = mysql_connect ('localhost','root','');
if(!$db_link) { die('<br>'.$mysql_error().'<br>')};
$db = mysql_select_db('users');
if(!$db) { die('<br>'.$mysql_error().'<br>')};
?>

to give a hint should things go wrong
for the code sample previously given I get the images in the attachments, the window border is at the top of the image, margin:0;

can not find a visible whitespace, thinking takes time, back soon

Attachments IE.jpg 6.42 KB mozilla.jpg 7.23 KB
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.