Php simple registration code for help

Source: Internet
Author: User
Php simple registration code for help & lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; XHTML & nbsp; 1.0 & nbsp; TransitionalEN & nbsp; www. w3.orgTRxhtml1DTDxhtml1-transitional. dtd & gt; & lt; simple php registration code for help









Registration page











// Author: avirtuous
$ Con = mysql_connect ("localhost", "root", "") or die ('Cloud not connect: '. mysql_error ());
Mysql_select_db ("demo", $ con );
$ Un = $ _ POST ['username'];
$ Pwd = $ _ POST ['password'];
$ Result = mysql_query ("insert into user (username, password) VALUES ($ un, $ pwd )");
If ($ result ){
Echo "registration successful ";
} Else {
Echo "registration failed ";
}
?>







015-03-11 00:00:04 19492 [Note] Server socket created on IP: '::'.
2015-03-11 00:00:05 19492 [Note] Event Scheduler: Loaded 0 events
2015-03-11 00:00:05 19492 [Note] wampmysqld: ready for connections.
Version: '5.6.12-log' socket: '' port: 3306 MySQL Community Server (GPL)






[Wed Mar 11 14:50:59.548409 2015] [:error] [pid 6216:tid 1696] [client ::1:13262] PHP Stack trace:, referer: http://localhost/zc.html
[Wed Mar 11 14:50:59.549479 2015] [:error] [pid 6216:tid 1696] [client ::1:13262] PHP 1. {main}() E:\\wamp\\www\\reg.php:0, referer: http://localhost/zc.html
[Wed Mar 11 14:50:59.549479 2015] [:error] [pid 6216:tid 1696] [client ::1:13262] PHP 2. mysql_connect() E:\\wamp\\www\\reg.php:3, referer: http://localhost/zc.html

------ Solution ----------------------
Does the landlord change the password of myadmin without changing the password of mysql. It seems that you have encountered this problem before.
------ Solution ----------------------
Since the password is empty
You write
Mysql_connect ("localhost", "root ","")
Mysql_connect ("localhost", "root ","")
Obviously there is a space.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.