ddanielsmith

I'm so cofused and I don't understand the box model at all.
For example, How do I know what number to use with margin and padding?
It's not like I have a grid and I just don't get the concept of margin and padding at all or which number to use for them.
I get the idea that each element is a box, but when it comes to different box types i'm also confused.
Please help me!
I appreciate any help whatsoever, but please don't provide a link to another site because I think I have read every article there is!

ddanielsmith

Here's my index.php page:

<?php
require 'connect.php';
?>

<html>
<body>

<form action="action.php" method="post">
Username: <input type="text" name="uname">

Password: <input type="password" name="pword">
<input type="submit" name="submit1" />
</form>

</body>
</html>

Here's my connect.php page:

<?php
$connect = mysql_connect("localhost", "root", "");
if (!$connect)
{
die ('Could not connect: ' . mysql_error ());
}

mysql_select_db("users", $connect);
?>

Here's my action.php page:

</php

require 'connect.php';

$username = $_POST ['uname'];
$password = $_POST ['pword'];

mysql_query("INSERT INTO userlogin ($username, $password)
VALUES ('$username', '$password')");

?>

Here's the problem:

Every time I try to register a username and password into the table in my database, It doesn't work.
Nothing happens. I'm trying to register a username and password into my table userlogin, but nothing happens!

Please help! I'll choose a best answer.

ddanielsmith

This is my index.php page:

<html>
<body>

<form action="action.php" method="post">
Username: <input type="text" name"username"><br />
Password: <input type="password" name="password">
<input type="submit" name="submit" />
</form>

</body>
</html>

This is my action.php page:

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("users", $con);

mysql_query("INSERT INTO userlogin (username, password)
VALUES ('username', 'password')");

mysql_close($con);
?>

Here's the problem:

Everytime the users clicks submit the action.php page insert username and password into my table instead of the username and password the user types in. It just put username under the colum username and password under the column password!

I don't understand what I did wrong!

ddanielsmith

@klemme,

Thanks for your help.
You're awesome. :-)

ddanielsmith

Here's the main index page:

<html>
<body>

<form action="action.php" method="post">
Name: <input type="text" name="fname">
Age: <input type="text" name="age">
<input type="submit" name="mybutton" />
</form>

</body>
</html>

Here's the action page:

<?php
$mycar='';
echo "$mycar";

?>

I left the variable $mycar empty because i'm trying to assign it's value as my forms name (fname).
How do I do this?
I'm so confused!