fout in script?

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Geoffrey Mastenbroek

Geoffrey Mastenbroek

09/01/2005 23:31:00
Quote Anchor link
Ik ben bezig met een member script, maar nou als ik in het formulier de gevens invul krijg ik in de database bij website en bij email voor de ingevulde waardes een stuk of 6 spaties waar ligt dit aan???
dit is het script:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
//maschel.nl member system beta 1.0
echo "<h3>maschel.nl member system beta 1.0</h3><br><br<br>\n";
//maschel.nl member system beta 1.0
require("mysql.php");

$activcode = rand(1000000, 9999999);

$sql1 = mysql_query("SELECT username, password FROM member WHERE email='$HTTP_POST_VARS[email]'");
$email_check = mysql_num_rows($sql1);

 if($email_check == 0) {

     $sql2 = mysql_query("SELECT username, password FROM member WHERE username='$HTTP_POST_VARS[username]'");
     $user_check = mysql_num_rows($sql2);

       if($user_check == 0) {

          if (isset($_POST["username"]) && isset($_POST["email"]) && isset($_POST["con_email"]) && isset($_POST["password"])
          &&
isset($_POST["con_password"]) && ($_POST["password"] == $_POST["con_password"] && $_POST["email"] == $_POST["con_email"]))
          {

              $sql3 = "INSERT INTO member (id, username, email, password, name, country, msn, website, activcode, activ) VALUES ('', '$HTTP_POST_VARS[username]', '
          $HTTP_POST_VARS[email]', '$HTTP_POST_VARS[password]', '$HTTP_POST_VARS[name]', '$HTTP_POST_VARS[country]', '$HTTP_POST_VARS[msn]', '
          $HTTP_POST_VARS[website]', '$activcode', '0')"
;
              $res = mysql_query($sql3);

                  if ($res) {
                echo "<font color=\"green\">Your account is sucsesfully added.</font><br>";
        echo "an e-mail has been send to: $_POST[email] with a link in it to activate your account";
        $from = "[email protected]";
        $message = "Activation member account maschel.nl\n";
                $message .= "Copy this link into your browser to activate your account:\n";
                $message .= "http://www.maschel.nl/beta-members/activate.php?activcode=$activcode\n";
        $message .= "Thnx for making an account on maschel.nl\n";
        mail($_POST["email"], "Activate your account on maschel.nl", $message);
                }
else{
                        echo "an error has encorred please try again.";
                        echo('<br>'.mysql_error()); }
}
else {
    echo "<font color=\"red\">You didn't fill in everything! and/or user/user and/or pass/pass aren't the same</font><br>\n";
    echo "<a href=\"register_form.php\">Click here to go back</a><br><br>\n"; }

}
else {
    echo "<font color=\"red\">Username already exists!</font>"; }
}
else{
    echo "<font color=\"red\">Email already exists</font>"; }

//don't delete copyright>>>>>
echo "<br><br><br><br><p align=\"center\"><font size=\"1px\">copyright 2005 <a href=\"http://www.maschel.nl\">www.maschel.nl</a></font></p>";
//don't delete copyright>>>>>
?>
 
PHP hulp

PHP hulp

06/11/2024 03:51:02
 
Geoffrey Mastenbroek

Geoffrey Mastenbroek

10/01/2005 00:56:00
Quote Anchor link
Heb zelf de oplossing al gevonden.
had om het script overzichterlijker te maken dit gedaan:
$HTTP_POST_VARS[username]', '
$HTTP_POST_VARS', '

in plaats van:

$HTTP_POST_VARS[username]',
'$HTTP_POST_VARS[email]', '
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.