nothing happens, doesn’t go into database or anything. How could I fix this?
Here is my coding that you can look at if you got a suggestion.
I’m trying to link it to a page called index.php
<?php echo '| Username: | |
| Password: | |
| Confirm Password | |
nothing happens, doesn’t go into database or anything. How could I fix this?
Here is my coding that you can look at if you got a suggestion.
I’m trying to link it to a page called index.php
<?php echo '| Username: | |
| Password: | |
| Confirm Password | |
here is my php code
<?php include 'connect.php'; echo 'Firstly, try using [php] tags. It makes things easier.
Second, INSERT queries need to end in semi-colons so your query should be:
[php]
$sql = “INSERT INTO a1146222_Users (username, user_password)
VALUES(’”. mysql_real_escape_string($username).’",
‘". $cryptpass ."’,
NOW(),
0,
0);";
[/php]
The only problem here is, you have selected only 2 fields, but are trying to insert 5 Values.
So actually your code should be
[php]
$sql = “INSERT INTO a1146222_Users (username, user_password)
VALUES(’”. mysql_real_escape_string($username).’"’, “. $cryptpass .”’);";
[/php]
that doesn’t work…
it’s pretty much the same as what I had before.
I don’t understand what you mean by inserting 5 values.
Also, I programmed errors into the code, but none of the errors work
if you want to test go here
If you look at
[php]
$sql = “INSERT INTO a1146222_Users (username, user_password)
VALUES(’”. mysql_real_escape_string($username).’",
‘". $cryptpass ."’,
NOW(),
0,
0);";
[/php] You will see that you have done INSERT table (field1, field2)
VALUES (value1, value2, value3, value4, value5)
Theres an uneven amount of values.
I noticed a slight error in the second one. try
[php]
$sql = “INSERT INTO a1146222_Users (username, user_password)
VALUES(’”. mysql_real_escape_string($username)."’, “. $cryptpass .”’);";
[/php]
It still doesn’t insert into my database…
Also, none of my errors come up, I made it where let’s say your username isn’t 5 characters and you register, there is supposed to be an error, but nothing come up.
Try this code:
<?php include 'connect.php'; echo '[php]
if($_SERVER[‘REQEUST_METHOD’] != ‘POST’)
{
include ‘registerform.php’;
}
[/php]
Why would you do this?
It should be like
[php]
if (!isset($_POST[‘Submit’])) {
include(“registerform.php”);
}
[/php]
The way you had it checks something on the server, which is configured in the php.ini file.
@Rayth, I get a :
Parse error: syntax error, unexpected T_ELSE in /home/a1146222/public_html/register2.php on line 19
I see nothing missing either?
Can you post all of register2.php but include them in [php] tags.
[php]
<?php include 'connect.php'; echo '[php]
[php]
<?php include 'connect.php'; echo '[/php]
[php]
<?php include 'connect.php'; echo '[/php]
Removed the error you mentioned.
When I click register with all the correct info, it gives me errors just plain out.
Like I have a username greater than 5
Password greater than 5
but I still get the errors randomly.
[php]
if(strlen($username) > 30 || strlen($useranme) < 5)
[/php]
Spelling mistake? check the rest as well to make sure.
Nope, still get the errors
do you want to test it to see what I mean?
Can anyone else help?