Greenguy's Board


Go Back   Greenguy's Board > Newbie Questions
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2010-03-04, 12:24 PM   #1
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
Old 2010-03-04, 12:35 PM   #2
DIVAD3
I'm going to the backseat of my car with the woman I love, and I won't be back for TEN MINUTES
 
DIVAD3's Avatar
 
Join Date: Aug 2009
Location: Up-Sate NY !
Posts: 79
Send a message via ICQ to DIVAD3
Quote:
Originally Posted by mark6188 View Post
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.
Thats a big yes! As to what I am troulbe with as well as uncertain to just where I insert my info in certain places.

And I was just putting the xxx's as to fill it in with something.
DIVAD3 is offline   Reply With Quote
Old 2010-03-04, 12:50 PM   #3
DIVAD3
I'm going to the backseat of my car with the woman I love, and I won't be back for TEN MINUTES
 
DIVAD3's Avatar
 
Join Date: Aug 2009
Location: Up-Sate NY !
Posts: 79
Send a message via ICQ to DIVAD3
Quote:
Originally Posted by mark6188 View Post
<?
// Replace the variable values below
// with your specific database information.
$host = "localhost";
$user = "hostname_dvad3";
$pass = "abc123";
$db = "hostname_dbName";
Here I see where I should have it as = local host and not my entire server host name. so thats one area corrected now.
DIVAD3 is offline   Reply With Quote
Reply


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 02:29 PM.


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