Вопрос

I am currently trying to create a mail list that stores emails into an existing mysql database after a first name, last name and email has been entered and a submit button has been clicked. Once this happens i would like a message to displayed that confirms to user they have been entered into the database



I have know experience in coding apart from html and css however im under the impression i will need 3 php files.

connect.php(this will allow the input.php to connect to the database for storing information)

input.php(this will allow users to input data into name and email fields and submit it to database)

sent.php(this will display confirmation message once email is entered into database




For the connect.php do i need anything more then the following code

$error = "Connection errror"

$connect = mysql_connect("localhost", "root", "") or die($error); mysql_select_db("") or die($error);

?>

I have created a database using cpanel, lets say mail1 is the cpanel user and prefix

that makes mail1_list is the database

with a database user of mail1_liuser

and the database user's password would can be mailto

Can somebody explain to me what credentials go where in the above code.

Это было полезно?

Решение

As a base you can use guest book tutorials for your project. Obviously you don't need fields like comment, or anchor for website so skip that.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top