Advertisement
Guest User

Untitled

a guest
Sep 24th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.29 KB | None | 0 0
  1.  
  2.  
  3. <?php
  4. session_start();
  5.  
  6.  
  7. if(!isset($_SESSION['registerd']) || $_SESSION['registerd'] == false){
  8.  
  9. if(isset($_POST['submit'])){
  10.  
  11. if(isset($_POST['username']) && ($_POST['password']) && ($_POST['email']) && ($_POST['password2'])){
  12. $username = $_POST['username'];
  13. $password = $_POST['password'];
  14. $password2 = $_POST['password2'];
  15. $email = $_POST['email'];
  16. $zapamtime = 'tekradimo';
  17. $ID = '0';
  18.  
  19.  
  20.  
  21. while($ID == '1' && $ID < '1000'){
  22. $ID++;
  23. }
  24.  
  25. $connect = mysqli_connect("localhost","root","","coklica") or die(mysql_error());
  26. if($connect){
  27.  
  28. }else{
  29. echo 'jebi ga sta da ti kazem';
  30. }
  31. if($password === $password2){
  32. $query = "INSERT INTO `users`(`ID`, `username`, `password`, `email`) VALUES ('$ID', '$username', '$password', '$email')";
  33. header("Location: index.php");
  34. }
  35. }
  36.  
  37.  
  38. }
  39.  
  40. // napraviti ako zapamti me da te zapamti
  41. // napraviti da se provjerava unesena sifra sa ponovi unesenu sifru sa if oboje
  42.  
  43.  
  44.  
  45.  
  46. echo "
  47. <!DOCTYPE html>
  48. <html>
  49. <head>
  50. <title>World News</title>
  51.  
  52. <meta charset='utf-8'/>
  53. <meta http-equiv='X-UA-Compatible' content=='IE=edge'/>
  54. <meta name='google' value='notranslate'/>
  55. <link rel='stylesheet' type='text/css' href='style.css'>
  56. <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  57. <link rel='stylesheet' type='text/css' href='http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css' rel='stylesheet'>
  58.  
  59. </head>
  60. <body>
  61.  
  62.  
  63.  
  64. </div><nav class='main-menu'>
  65.  
  66.  
  67.  
  68. <div>
  69. <a class='logo' href='http://startific.com'>
  70. </a>
  71. </div>
  72. <div class='settings'></div>
  73. <div class='scrollbar' id='style-1'>
  74.  
  75. <ul>
  76.  
  77. <li>
  78. <a href='http://startific.com'>
  79. <i class='fa fa-home fa-lg'></i>
  80. <span class='nav-text'>Home</span>
  81. </a>
  82. </li>
  83.  
  84. <li>
  85. <a href='http://startific.com'>
  86. <i class='fa fa-user fa-lg'></i>
  87. <span class='nav-text'>Login</span>
  88. </a>
  89. </li>
  90.  
  91.  
  92. <li>
  93. <a href='http://startific.com'>
  94. <i class='fa fa-envelope-o fa-lg'></i>
  95. <span class='nav-text'>Contact</span>
  96. </a>
  97. </li>
  98.  
  99.  
  100.  
  101.  
  102. <li>
  103. <a href='http://startific.com'>
  104. <i class='fa fa-heart-o fa-lg'></i>
  105.  
  106. <span class='share'>
  107.  
  108.  
  109. <div class='addthis_default_style addthis_32x32_style'>
  110.  
  111. <div style='position:absolute;
  112. margin-left: 56px;top:3px;'>
  113.  
  114.  
  115.  
  116.  
  117. <a href='http://www.facebook.com/sharer/sharer.php?u=' target='_blank' class='share-popup'><img src='http://icons.iconarchive.com/icons/danleech/simple/512/facebook-icon.png' width='30px' height='30px'></a>
  118.  
  119. <a href='http://twitter.com/share' target='_blank' class='share-popup'><img src='https://cdn1.iconfinder.com/data/icons/metro-ui-dock-icon-set--icons-by-dakirby/512/Twitter_alt.png' width='30px' height='30px'></a>
  120.  
  121.  
  122.  
  123.  
  124. <a href='https://plusone.google.com/_/+1/confirm?hl=en&url=_URL_&title=_TITLE_
  125. ' target='_blank' class='share-popup'><img src='http://icons.iconarchive.com/icons/danleech/simple/512/google-plus-icon.png' width='30px' height='30px'></a>
  126.  
  127.  
  128.  
  129. </div>
  130. <script type='text/javascript'>var addthis_config = {'data_track_addressbar':true};</script>
  131. <script type='text/javascript' src='//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4ff17589278d8b3a'></script>
  132.  
  133.  
  134.  
  135.  
  136.  
  137. </span>
  138. <span class='twitter'></span>
  139. <span class='google'></span>
  140. <span class='fb-like'>
  141. <iframe src='//www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffacebook.com%2Fstartific&amp;width&amp;layout=button&amp;action=like&amp;show_faces=false&amp;share=false&amp;height=35' scrolling='no' frameborder='0' style='border:none; overflow:hidden; height:35px;' allowTransparency='true'></iframe>
  142.  
  143. </span>
  144. <span class='nav-text'>
  145. </span>
  146.  
  147. </a>
  148.  
  149. </li>
  150.  
  151.  
  152.  
  153.  
  154. </li>
  155. <li class='darkerlishadow'>
  156. <a href='http://startific.com'>
  157. <i class='fa fa-clock-o fa-lg'></i>
  158. <span class='nav-text'>News</span>
  159. </a>
  160. </li>
  161.  
  162. <li class='darkerli'>
  163. <a href='http://startific.com'>
  164. <i class='fa fa-desktop fa-lg'></i>
  165. <span class='nav-text'>Technology</span>
  166. </a>
  167. </li>
  168.  
  169. <li class='darkerli'>
  170. <a href='http://startific.com'>
  171. <i class='fa fa-plane fa-lg'></i>
  172. <span class='nav-text'>Travel</span>
  173. </a>
  174. </li>
  175.  
  176. <li class='darkerli'>
  177. <a href='http://startific.com'>
  178. <i class='fa fa-shopping-cart'></i>
  179. <span class='nav-text'>Shopping</span>
  180. </a>
  181. </li>
  182.  
  183. <li class='darkerli'>
  184. <a href='http://startific.com'>
  185. <i class='fa fa-microphone fa-lg'></i>
  186. <span class='nav-text'>Film & Music</span>
  187. </a>
  188. </li>
  189.  
  190. <li class='darkerli'>
  191. <a href='http://startific.com'>
  192. <i class='fa fa-flask fa-lg'></i>
  193. <span class='nav-text'>Web Tools</span>
  194. </a>
  195. </li>
  196.  
  197. <li class='darkerli'>
  198. <a href='http://startific.com'>
  199. <i class='fa fa-picture-o fa-lg'></i>
  200. <span class='nav-text'>Art & Design</span>
  201. </a>
  202. </li>
  203.  
  204. <li class='darkerli'>
  205. <a href='http://startific.com'>
  206. <i class='fa fa-align-left fa-lg'></i>
  207. <span class='nav-text'>Magazines
  208. </span>
  209. </a>
  210. </li>
  211.  
  212. <li class='darkerli'>
  213. <a href='http://startific.com'>
  214. <i class='fa fa-gamepad fa-lg'></i>
  215. <span class='nav-text'>Games</span>
  216. </a>
  217. </li>
  218.  
  219. <li class='darkerli'>
  220. <a href='http://startific.com'>
  221. <i class='fa fa-glass fa-lg'></i>
  222. <span class='nav-text'>Life & Style
  223. </span>
  224. </a>
  225. </li>
  226.  
  227. <li class='darkerlishadowdown'>
  228. <a href='http://startific.com'>
  229. <i class='fa fa-rocket fa-lg'></i>
  230. <span class='nav-text'>Fun</span>
  231. </a>
  232. </li>
  233.  
  234.  
  235. </ul>
  236.  
  237.  
  238. <li>
  239.  
  240. <a href='http://startific.com'>
  241. <i class='fa fa-question-circle fa-lg'></i>
  242. <span class='nav-text'>Help</span>
  243. </a>
  244. </li>
  245.  
  246.  
  247. <ul class='logout'>
  248. <li>
  249. <a href='http://startific.com'>
  250. <i class='fa fa-lightbulb-o fa-lg'></i>
  251. <span class='nav-text'>
  252. BLOG
  253. </span>
  254.  
  255. </a>
  256. </li>
  257. </ul>
  258. </nav>
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265. <center>
  266. <div class='page'>
  267. <h1 style='margin-top: -50px;'>World News</h1>
  268. <p>Need news? It's here.</p>
  269.  
  270. <form method='post'>
  271. <div class='login'>
  272. <h2>Registracija</h2>
  273. <input name='username' placeholder='Korisnicko ime' type='text'/>
  274. <input id='text' name='email' placeholder='Unesi e-mail' type='text'/>
  275. <input id='pw' name='password' placeholder='Sifra' type='password'/>
  276. <input id='pw' name='password2' placeholder='Ponovo unesi sifru' type='password'/>
  277. <div class='remember'>
  278. <input checked='1' id='remember' name='remember' type='checkbox'/>
  279. <label for='remember'></label>Zapamti me!
  280. </div>
  281. <input type='submit'name='submit' value='Registruj racun'/>
  282. <a class='forgot' href='#'>Zaboravio si sifru? Resetuj ovdje!</a>";
  283.  
  284.  
  285. if(isset($_POST['submit'])){
  286.  
  287. if(isset($_POST['username']) && ($_POST['password']) && ($_POST['email']) && ($_POST['password2'])){
  288. if($password === $password2){
  289.  
  290. ///////////////////////////////
  291. $result = mysqli_query($connect,$query);
  292. if($result){
  293. echo 'Korisnicki racun uspjesno kreiran!';
  294.  
  295. }else{
  296. echo 'Korisnicki racun nije kreiran provjerite unesene podatke!';
  297. }
  298.  
  299. ///////////////////////////////
  300. }else{
  301. echo 'Sifre se ne poklapaju!';
  302. }
  303. }
  304. else{
  305. echo 'Niste popunili sva trazena polja!';
  306. }
  307.  
  308. }
  309.  
  310.  
  311. echo "
  312. </div>
  313.  
  314. </form>
  315.  
  316.  
  317. </center>
  318. </body>
  319. </html>";
  320.  
  321. session_destroy();
  322. }
  323.  
  324. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement