zelf ook mail ontvangen bij inschrijving nieuw lid

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

H de Vries

H de Vries

20/02/2013 15:40:16
Quote Anchor link
Hallo, Ik heb een kant en klaar software pakket gekocht (datingsite), als iemand zich inschrijft dan ontvangen zij een mail. Nu wil ik ook dat ik een mail krijg als dat gebeurt. Het gaat via PHP scripts.

Nu heb ik wat php files bekeken, maar ik heb geen idee waar ik dat neer moet zetten. Ik heb wel het PHP script gevonden waar de verificatie mail staat, maar het is me net wat te ingewikkeld.

Is er iemand die mij daar bij kan helpen, dus een extra scriptje plaatsen zodat ik ook een mail ontvang

Alvast bedankt,
Linda Hagenaars
 
PHP hulp

PHP hulp

29/04/2024 14:52:48
 
Eddy E

Eddy E

20/02/2013 15:43:05
Quote Anchor link
Als je even het PHP-stukje plaatst waarin de verificatiemail wordt verstuurd zou je ons best helpen...
 
H de Vries

H de Vries

20/02/2013 15:46:12
Quote Anchor link
dat is waar :-)

hier 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
52
53
<?php
/* (C) ABK-Soft Ltd., 2004-2006
IMPORTANT: This is a commercial software product
and any kind of using it must agree to the ABK-Soft
Ltd. license agreement.
It can be found at http://abk-soft.com/license.doc
This notice may not be removed from the source code. */


include("./_include/core/main_start.php");

class CRegisterConfirmEmail extends CHtmlBlock
{
    function
action()
    {

        $hash = get_param("hash", "");
        if($hash)
        {

            $user_id = DB::result("SELECT user_id FROM user WHERE active_code = " . to_sql($hash, "Text") .";");
            if($user_id)
            {

                DB::execute("UPDATE user SET active_code = '' WHERE user_id=" . $user_id . "");
                
                set_session("user_id", $user_id);
                set_session("user_id_verify", $user_id);

                DB::execute("UPDATE user SET last_ip='" . $_SERVER['REMOTE_ADDR'] . "' WHERE user_id=" . $user_id . "");
                redirect("profile.php?cmd=confirmed");
            }

            else
            {
                redirect('index.php');
            }
        }

        else
        {
            redirect('index.php');
        }
    }
    function
parseBlock(&$html)
    {

        parent::parseBlock($html);
    }
}


$page = new CRegisterConfirmEmail("", $g['tmpl']['dir_tmpl_main'] . "index.html");
$header = new CHeader("header", $g['tmpl']['dir_tmpl_main'] . "_header.html");
$page->add($header);
$footer = new CFooter("footer", $g['tmpl']['dir_tmpl_main'] . "_footer.html");
$page->add($footer);

include("./_include/core/main_close.php");

?>
 
Eddy E

Eddy E

20/02/2013 16:45:21
Quote Anchor link
Wordt hier ergens een mail verstuurd?

Euh... nee
 
Daniel Vos

Daniel Vos

21/02/2013 16:17:45
Quote Anchor link
Als dit is wat je bedoelt zou het kunnen werken:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
<?php
$eigen_email
= "[email protected]";
$onderwerp = "nieuwe registratie";
$message = "Iemand heeft zich geregistreerd";

mail($eigen_email, $onderwerp, $message, "From: [email protected]");
?>


[email protected] = je email-adress waar je de mail van een nieuwe registratie wilt ontvangen.
[email protected] = het adress waar het vandaan komt, of dit kan ligt eraan of je een mailbox hebt bij je hosting pakket.
 
H de Vries

H de Vries

09/03/2013 17:43:19
Quote Anchor link
ik had het verkeerde script door gekregen. Dit is de juiste. Hoe plaats ik hier nu een BCC 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php

function user_has_role_admin_view()
{

    global $g_user;
    
    return $g_user['user_id'] && ($g_user['role'] == 'admin' || $g_user['role'] == 'demo_admin');
}

function
user_has_role_admin_edit()
{

    global $g_user;
    
    return $g_user['user_id'] && ($g_user['role'] == 'admin');
}

function
hash_generate($hash_length = 64)
{

    $chars = "1234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    $i = 0;
    $hash = "";
    while ($i < $hash_length)
    {

      $hash .= $chars{mt_rand(0, strlen($chars)-1)};
      $i++;
    }

    
    return $hash;
}

function
user_change_email($user_id, $email)
{

    global $g;
    
    do {
        $hash = hash_generate(40);
    }
while(DB::result("SELECT user_id FROM user WHERE active_code = " . to_sql($hash, "Text") .";") != "");

    DB::execute("UPDATE user SET active_code = " . to_sql($hash, "Text") . ", mail = " . to_sql($email, "Text") . " WHERE user_id=" . $user_id . "");
    
    $subject = DB::result("SELECT subject FROM email_auto WHERE note='confirm_email'");
    $text = DB::result("SELECT text FROM email_auto WHERE note='confirm_email'");
    $subject = str_replace("{title}", $g['main']['title'], $subject);
    $text = str_replace("{title}", $g['main']['title'], $text);
    
    $url = $link = "http://".$_SERVER['HTTP_HOST'] . str_replace("_include/lib/","",str_replace("\\", "", dirname($_SERVER['PHP_SELF'])));
    
    $text = str_replace("{confirm_link}", $url.'/confirm_email.php?hash='.$hash, $text);
    
    send_mail(
        $email,
        $g['main']['info_mail'],
        $subject,
        $text
    );
}

function
friend_delete($user_id, $friend_id)
{

    DB::execute("DELETE FROM friends WHERE user_id=" . to_sql($user_id, 'Number') . " AND fr_user_id = " . to_sql($friend_id, 'Number'));
    DB::execute("DELETE FROM friends WHERE user_id=" . to_sql($friend_id, 'Number') . " AND fr_user_id = " . to_sql($user_id, 'Number'));
}

function
friend_add($user_id, $friend_id)
{

    friend_delete($user_id, $friend_id);
    
    DB::execute("INSERT INTO friends SET user_id=" . to_sql($user_id, 'Number') . ", fr_user_id = " . to_sql($friend_id, 'Number') . ", DATA='".date('Y-m-d H:i:s')."'");
    DB::execute("INSERT INTO friends SET user_id=" . to_sql($friend_id, 'Number') . ", fr_user_id = " . to_sql($user_id, 'Number') . ", DATA='".date('Y-m-d H:i:s')."'");
}

function
user_blocked($user_id, $this_user_id = null)
{

    global $g_user;
    $this_user_id = $this_user_id ? $this_user_id : $g_user['user_id'];
    
    $check_mail = DB::result("select user_to from users_block where user_from=".to_sql($this_user_id)." and user_to=".to_sql($user_id));
    if($check_mail)
        return true;
        
    $check_block = DB::result("select user_to from user_block_list where user_from=".to_sql($this_user_id)." and user_to=".to_sql($user_id). " AND (im > 0 OR audio > 0 OR video > 0 OR game > 0)");
    if($check_block)
        return true;
        
    return false;
}

function
user_mail_blocked_by($user_id)
{

    global $g_user;
    
    $check_mail = DB::result("select user_to from users_block where user_from=".to_sql($user_id)." and user_to=".to_sql($g_user['user_id']));
    if($check_mail)
        return true;

    return false;
}

function
user_service_blocked_by($user_id, $service)
{

    global $g_user;
    
    $check_block = DB::result("select user_to from user_block_list where user_from=".to_sql($user_id)." and user_to=".to_sql($g_user['user_id']). " and " . $service . "  > 0");
    if($check_block)
        return true;
    
    return false;
}

function
user_select_by_id($user_id)
{

    DB::query("SELECT * FROM `user` WHERE `user_id` = " . to_sql($user_id) . " LIMIT 1;");
        
    if($row = DB::fetch_row())
    {

        return $row;
    }

        
    return null;
}
 
- Ariën  -
Beheerder

- Ariën -

09/03/2013 18:09:10
Quote Anchor link
Hoe ziet de send_mail() functie eruit?
 
Eddy E

Eddy E

09/03/2013 20:11:25
Quote Anchor link
Ik zou het persoonlijk anders doen:

Regel 50 en verder (wat dus send_mail() is):

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
<?php
// 1e regel is regel 50 van hierboven
    send_mail(
        $email,
        $g['main']['info_mail'],
        $subject,
        $text
    );

// voeg dit hieronder toe (dus er gewoon onder zetten)
    send_mail(
        "[email protected]",
        $g['main']['info_mail'],
        "KOPIE: ".$subject,
        "Er is zojuist verstuurd...".PHP_EOL."-------------------".PHP_EOL.$text
    );
?>


Lekker makkelijk.
send_mail() aanpassen kan natuurlijk ook.
 
H de Vries

H de Vries

10/03/2013 01:33:03
Quote Anchor link
Eddy E,

jij bent de held van de dag. Hartstikke bedank, dit werkt prima.
 



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.