I have a problem with form processing.
I have installed on my computer Windows98, Apache 1.3.20, Php 4.06 and MySql 3.23.37.
Everything works very well.
This is how I’ve created the database 'web' with table 'users':
CREATE TABLE users (
id
int(4)
unsigned
zerofill
DEFAULT '0000'
NOT NULL
auto_increment,
name varchar(50),
nickname(50),
email varchar(50),
PRIMARY KEY (id)
);
I've created user 'webuser' with password 'public'
with access to this database.
I put in a webpage called index.php this lines:
<?php
include ("conectare.inc");
bazadate_conectare () or die ("Not connected");
if ( $name && $nickname && $email)
{
$sql = "INSERT users (name,nickname,email) VALUES ('$name','$nickname','$email')";
mysql_query($sql) or die ("Form hasn't been processed");
}
?>
<form method="post" action="<?php $php_self;?>" >
<p align="center"><font color="#408080" size="4">Name</font></p>
<p align="center"><input type="text"size="20"name="name"value="<?php echo $name;?>"></p>
<p align="center"><font color="#408080" size="4">nickname</font></p>
<p align="center"><input type="text"size="20"name="nickname"value="<?php echo $nickname ; ?>"></p>
<p align="center"><font color="#408080" size="4">Email</font></p>
<p align="center"><input type="text"size="20"name="email"value="<?php echo $email ; ?>"> </p>
<p align="center"> </p>
<p align="center"><input type="submit"name="submit"value="Send"></p>
</form>
The connection.inc file looks like this:
<?php
function bazadate_conectare ()
{
$link=mysql_connect("localhost","webuser","public");
$db=mysql_select_db("web");
}
?>
It doesn't and I don't know why?
Do you have any sugestions?