comparison user/confirmation.php @ 6:077b0a0a3e6d

remaining originals according to dependency walk
author Robert Boland <robert@markup.co.uk>
date Thu, 16 Feb 2017 22:29:02 +0000
parents
children 385ddd7c4b55 a67bf725e87b
comparison
equal deleted inserted replaced
5:55445b456ad0 6:077b0a0a3e6d
1 <?PHP
2 include "../../private/db.php";
3
4
5 // Passkey that got from link
6 $passkey=$_GET['passkey'];
7 $tbl_name1="temp_user";
8 $loc = 1;
9
10 // Retrieve data from table where row that match this passkey
11 $sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'";
12 //echo $sql1;
13 $result1=mysqli_query($link,$sql1);
14
15 // If successfully queried
16 if($result1){
17
18 // Count how many row has this passkey
19 $count=mysqli_num_rows($result1);
20 //echo $count;
21 // if found this passkey in our database, retrieve data from table
22 if($count==1){
23
24 $rows=mysqli_fetch_array($result1, MYSQLI_ASSOC);
25 $email=$rows['Email'];
26 $password=$rows['Password'];
27 $fname=$rows['FirstName'];
28 $sname=$rows['Surname'];
29 $loc=$rows['LocID'];
30 $displayName=$rows['DisplayName'];
31 $age=$rows['AgeGroup'];
32
33 $tbl_name2="user";
34
35 // Insert data that retrieves from "temp_members_db" into table "registered_members"
36 //$add = 'insert into user values (null,\'' . $email . '\',\'' . $password . '\');';
37 $add="CALL addNewUser('$email', '$password', '$fname', '$sname', $loc, '$displayName', $age)";
38
39 //echo $add;
40 $result2 = mysqli_query($link, $add);
41 }
42 // if not found passkey, display message
43 else {
44 echo "Invalid Confirmation code";
45 }
46 mysqli_use_result($link);
47 // if successfully moved data from table"temp_members_db" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "temp_members_db"
48 if($result2){
49 //Would prefer to create the cookie here, but GWT doesn't seem able to read it
50 /*session_start();
51 $_SESSION['email']=$email;
52 //session_id();
53 $DURATION = 1209600000;//(1000 * 60 * 60 * 24 * 14);
54 //Cookies.setCookie("bookWhacksid", sessionID, expires, null, "/", false);
55 setcookie("bookWhacksid", session_id(), time()+$DURATION);*/
56 //echo "Thank you, your account has been activated\nwww.bookwhack.co.uk";
57
58 // Delete information of this user from table "temp_members_db" that has this passkey
59 mysqli_close($link);
60 $sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'";
61 //echo $sql3;
62 include "../../private/db.php"; //need to reinclude otherwise an error is thrown
63 $result3=mysqli_query($link,$sql3);
64 mysqli_close($link);
65
66 $message = "<HTML><STYLE>.chrome-seo_meta-nofollow,.chrome-seo_meta-nofollow *{outline:2px dashed #ffb400!important;outline-offset:1px;}.chrome-seo_nofollow,.chrome-seo_nofollow *{outline:2px dotted #e90000!important;outline-offset:1px;}</STYLE><HEAD><META http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">
67 <TITLE>
68 Welcome to YourNextRead and YourNextFilm
69 </TITLE>
70 </HEAD><BODY><TABLE width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#232323\" align=\"center\">
71 <TBODY><TR><TD>
72 <TABLE width=\"600\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\" align=\"center\">
73
74 <TBODY>
75 <TR>
76 <tr>
77 <td bgcolor=\"#232323\" width=\"15\"></td>
78 <td bgcolor=\"#232323\">
79 <center><font face=\"verdana, sans-serif, arial\" color=\"#ffffff\" style=\"font-size:10px;\" size=\"1\">
80 Having trouble viewing this email? See it <a rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextread.com/welcome.html\" style=\"color:#ffffff;\">online<font face=\"verdana, sans-serif, arial\" color=\"#ffffff\" style=\"font-size:10px;\" size=\"1\"></font></a>. To help stop our emails being seen as spam, please add <strong><span style=\"border-bottom-style: dashed; border-bottom-width: 1px; border-bottom-color: rgb(0, 102, 204); cursor: pointer; \">newsletter@YourNextRead.com</span></strong> to your address book.
81 <br><br>
82 </font></center>
83 </td>
84 <td bgcolor=\"#232323\" width=\"15\"></td>
85 </tr>
86 <TR>
87 <TD colspan=\"3\" bgcolor=\"#232323\"><IMG src=\"http://www.yournextread.com/images/top_email.jpg\" style=\"display:block;\" width=\"600\" height=\"63\" alt=\"\"></TD>
88 </TR>
89
90 <TR>
91 <TD bgcolor=\"#ffffff\" colspan=\"2\">
92 <TABLE width=\"600\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\">
93 <TBODY>
94 <TR>
95 <td bgcolor=\"#594f43\"> <font face=\"verdana, sans-serif, arial\" color=\"#ffffff\" style=\"font-size:12px;\">" . date("F d, Y") . "
96 </font> </td>
97 </TR>
98 <TR>
99 <TD bgcolor=\"#f2b234\">
100 <FONT style=\"font-size:12px;\"> </FONT>
101 <FONT face=\"verdana, sans-serif, arial\" color=\"#232323\" style=\"font-size:20px; font-weight:bold;\">
102 Welcome to YourNextRead and YourNextFilm
103 </FONT>
104 <BR>
105 <FONT face=\"verdana, sans-serif, arial\" color=\"#232323\" style=\"font-size:12px; font-weight:bold;\">
106 Thanks for registering and a warm welcome
107 </FONT>
108 </TD>
109 </TR>
110 </TBODY>
111 </TABLE>
112 </TD>
113 </TR>
114 <TR>
115 <TR>
116 <TD bgcolor=\"#ffffff\" colspan=\"3\">
117 <TABLE width=\"570\" cellpadding=\"10\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\">
118 <TBODY>
119 <TR>
120 <TD>
121 <FONT face=\"verdana, sans-serif, arial\" color=\"#0000000\" style=\"font-size:12px;\">
122 Please read on to find out how you can discover and share with YourNextRead and YourNextFilm...
123 </FONT>
124 <BR>
125 <UL style=\"list-style:none;padding:4px;margin:3px;\">
126 <LI style=\"font-family:verdana, sans-serif, arial;padding:0px;margin:0px;font-weight:100;color:#594f43;font-size:14px;line-height:15px;\">1. <A rel=\"nofollow\" href=\"#first\" style=\"font-weight:bold;color:#594f43;\"><SPAN class=\"yshortcuts\" id=\"lw_1276845861_0\">What are YourNextRead and YourNextFilm?</SPAN></A></LI>
127 <LI style=\"font-family:verdana, sans-serif, arial;padding:0px;margin:0px;font-weight:100;color:#594f43;font-size:14px;line-height:15px;\">2. <A rel=\"nofollow\" href=\"#second\" style=\"font-weight:bold;color:#594f43;\"><SPAN class=\"yshortcuts\" id=\"lw_1276845861_2\">Support us!</SPAN></A></LI>
128 <LI style=\"font-family:verdana, sans-serif, arial;padding:0px;margin:0px;font-weight:100;color:#594f43;font-size:14px;line-height:15px;\">3. <A rel=\"nofollow\" href=\"#fourth\" style=\"font-weight:bold;color:#594f43;\"><SPAN class=\"yshortcuts\" id=\"lw_1276845861_3\">New features</SPAN></A></LI>
129 <LI style=\"font-family:verdana, sans-serif, arial;padding:0px;margin:0px;font-weight:100;color:#594f43;font-size:14px;line-height:15px;\">4. <A rel=\"nofollow\" href=\"#fifth\" style=\"font-weight:bold;color:#594f43;\"><SPAN class=\"yshortcuts\" id=\"lw_1276845861_3\">Six degrees of recommendations...</SPAN></A></LI>
130 </UL>
131
132 <BR>
133 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#f2b234;font-size:20px;line-height:22px;font-weight:bold;letter-spacing:-1px;padding:0px;margin:0px;\">
134 <A rel=\"nofollow\" name=\"first\" style=\"color:#594f43;\">
135 1. What are YourNextRead and YourNextFilm?
136 </A></P>
137 <DIV style=\"border-bottom:solid;border-bottom-width:3px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:5px;margin-bottom:5px;\"></DIV>
138 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">
139 YourNextRead.com and YourNextFilm.com help you discover your next book and film. Discovering becomes fun and enjoyable with us. We combine reviews, opinions and bring together the online crowd to make discovery simple.
140 </P>
141 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">
142 YourNextRead and Film are uniquely powered by our users. We combine simple one page navigation with multiple reviews and user recommendations. YourNextRead and Film go beyond simply collecting reviews to actually summarising group opinion. We make recommending simple.
143 </P>
144 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">
145 To find out more please go to the <A rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextread.com/further-info.html\" style=\"font-weight:bold;color:#594f43;\">YNRead - Further info</A> or <A rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextfilm.com/further-info.html\" style=\"font-weight:bold;color:#594f43;\">YNFilm - Further info</A> pages.
146 </P>
147 <DIV style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></DIV>
148
149 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#f2b234;font-size:20px;line-height:22px;font-weight:bold;letter-spacing:-1px;padding:0px;margin:0px;\">
150 <A rel=\"nofollow\" name=\"second\" style=\"color:#594f43;\">
151 2. Support us!
152 </A></P>
153 <DIV style=\"border-bottom:solid;border-bottom-width:3px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:5px;margin-bottom:5px;\"></DIV>
154 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">
155 Each time you buy anything (book, car, zebra...) from Amazon you can <A rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextread.com/us/#!SupportUs\" style=\"font-weight:bold;color:#594f43;\">Support Us</A>.
156 All you need to do is drag the Amazon buy now button to your bookmark buy from the <A rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextread.com/us/#!SupportUs\" style=\"font-weight:bold;color:#594f43;\">Support Us</A> page.
157 </P>
158 <DIV style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></DIV>
159
160 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#f2b234;font-size:20px;line-height:22px;font-weight:bold;letter-spacing:-1px;padding:0px;margin:0px;\">
161 <A rel=\"nofollow\" name=\"fourth\" style=\"color:#594f43;\">
162 3. New features
163 </A></P>
164 <DIV style=\"border-bottom:solid;border-bottom-width:3px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:5px;margin-bottom:5px;\"></DIV>
165 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">
166 We want to make YourNextRead and Film websites where you discover and share your next book and film. To make discovery and sharing as easy as possible we are continuely adding new features to YourNextRead and YourNextFilm.
167 </P>
168 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">
169 We want to hear from you how we can make YourNextRead and Film better. If you have any suggestions then please email us <A rel=\"nofollow\" target=\"_blank\" href=\"mailto:feedback@yournextread.com\" style=\"font-weight:bold;color:#594f43;\">YNRead - feedback</A> or <A rel=\"nofollow\" target=\"_blank\" href=\"mailto:feedback@yournextread.com\" style=\"font-weight:bold;color:#594f43;\">YNFilm - feedback</A>
170 </P>
171 <DIV style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></DIV>
172
173
174 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#f2b234;font-size:20px;line-height:22px;font-weight:bold;letter-spacing:-1px;padding:0px;margin:0px;\">
175 <A rel=\"nofollow\" name=\"fifth\" style=\"color:#594f43;\">
176 4. Six degrees of recommendations...
177 </A></P>
178 <DIV style=\"border-bottom:solid;border-bottom-width:3px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:5px;margin-bottom:5px;\"></DIV>
179 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">
180 During some down time (yes we sometimes take a break) the YourNextRead and Film team use the map of books and films to discover new and bizarre relationships.
181 We discovered that our map (intentionally of course) can be used in the same way as 6 degrees of separation (the theory that everyone is at most six steps away from any other person on Earth).
182 This rarely leads to dead ends but if you find one and know the book or film, then add a new recommendation for others to keep discovering.
183 So start playing and recommending....
184 </P>
185 <DIV style=\"border-bottom:solid;border-bottom-width:2px;border-bottom-color:#f2b234;height:1px;width:570px;margin-top:8px;margin-bottom:10px;\"></DIV>
186
187
188 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">We will keep you up to date with new features and events<BR></P>
189 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">Thanks for signing up,</P>
190 <P style=\"font-family:verdana, sans-serif, arial;font-weight:100;color:#433f40;font-size:13px;line-height:14px;\">The YourNextRead and Film Communities</P>
191 <DIV style=\"border-bottom:solid;border-bottom-width:1px;border-bottom-color:#cccccc;height:1px;width:480px;margin-top:20px;margin-bottom:15px;\"></DIV>
192 </TD>
193 </TR>
194 </TBODY>
195 </TABLE>
196 </TD>
197 </TR>
198
199 <TR>
200 <TD colspan=\"3\" bgcolor=\"#232323\"><BR>
201 <FONT face=\"arial, verdana, sans-serif\" color=\"#ffffff\" size=\"1\" style=\"font-size:10px;\">
202 Terms and Conditions
203 <BR>
204 This is a genuine email from <SPAN style=\"border-bottom-style: dashed; border-bottom-width: 1px; border-bottom-color: rgb(0, 102, 204); cursor: pointer; \">YourNextRead/YourNextFilm</SPAN>. However, if you receive an email which you are concerned does not legitimately originate from us, you can report it via <A rel=\"nofollow\" target=\"_blank\" href=\"mailto:feedback@yournextread.com\" style=\"color:#ffffff;\"><SPAN class=\"yshortcuts\">emailing us</SPAN></A> before deleting it.
205 <BR>
206 You have received this email because you have opted in to receive news, updates and offers from YourNextRead and YourNextFilm
207 <BR>
208 You can <A rel=\"nofollow\" target=\"_blank\" href=\"http://www.yournextread.com/user/unsubscribe.php?email=$email\" style=\"color:#ffffff;\"><SPAN>unsubscribe here</SPAN></A>, however as the majority of our communications are via email, you'll be missing out.
209 <BR>
210 </FONT>
211 </TD>
212 </TR>
213
214 </TBODY></TABLE>
215
216
217 </TD></TR></TBODY></TABLE>
218 </BODY></HTML>";
219
220 if (substr($email,0,1) != "@")
221 {
222 $header="from: YourNextRead <newsletter@YourNextRead.com>\nContent-Type: text/html; charset=iso-8859-1";
223 $to=$email;
224 $subject="Welcome to YourNextRead";
225 $sentmail = mail($to,$subject,$message,$header);
226 }
227
228
229 $redirectURL = "redirect.html";
230 header("Location:$redirectURL");
231 }
232
233 }
234 ?>