Greenguy's Board


Go Back   Greenguy's Board > Newbie Questions
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2010-03-04, 12:24 PM   #5
mark6188
I'm going to the backseat of my car with the woman I love, and I won't be back for TEN MINUTES
 
mark6188's Avatar
 
Join Date: Sep 2009
Posts: 88
Send a message via ICQ to mark6188
No, you don't need to add a form, basically the form is already in the code.

Code:
//The web form for input ability
else
 {
 echo "<form action=\"?op=reg\" method=\"POST\">\n";
 echo "Username: <input name=\"username\" MAXLENGTH=\"16\"><br />\n";
 echo "Password: <input type=\"password\" name=\"password\" MAXLENGTH=\"16\"><br 

/>\n";
 echo "Email Address: <input name=\"email\" MAXLENGTH=\"25\"><br />\n";
 echo "<input type=\"submit\">\n";
 echo "</form>\n";
 }
I think all you need to do is change this part of the code and replace the xxxx with the input names in the form above.

Code:
// Fields are clear, add user to database
 //  Setup query
 $q = "INSERT INTO `dbUsers` (`username`,`password`,`email`) "
  .
   "VALUES ('".$_POST["username"]."', "
  ."PASSWORD('".$_POST["password"]."'), "
  .
    "'".$_POST["email"]."')";
The code in the tutorial has it this way, so not sure why you changed the variables to xxxxx in your 1st post.

Honestly, I'm still not sure what your question is. When I click on your link, I see a "Error Connecting to Database" message. Is this what you need help with?

If so, you don't want to touch any of the code with the form in it. You need to modify the dbConfig.php file and put your username and password for the mysql database you setup.

Code:
<?
// Replace the variable values below
// with your specific database information.
$host = "localhost";
$user = "UserName";
$pass = "Password";
$db   = "dbName";
Change it to something like
Code:
<?
// Replace the variable values below
// with your specific database information.
$host = "localhost";
$user = "hostname_dvad3";
$pass = "abc123";
$db   = "hostname_dbName";
__________________
My Blog: Working The Business

Last edited by mark6188; 2010-03-04 at 12:27 PM..
mark6188 is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:30 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc