ziedinjsh Posted January 29, 2011 Report Share Posted January 29, 2011 es uz to kodu esmu atskatījies un nevaru vienalga saprast kapēc man neievada informāciju datubāzes tabulās!! <?php error_reporting(E_ALL); include "fcs/dbase.php"; include "lang/lv.php"; if(isset($_POST['register'])){ $user_name = addslashes($_POST['user_name']); $user_email = addslashes($_POST['user_email']); $user_pass = md5($_POST['user_pass']); $user_date = date('dd.mm.yyyy'); if ($_POST['user_pass'] != $_POST['user_pass2']) { echo "Paroles nesakriit"; } $add = "INSERT INTO users (user_name, user_email, user_pass, user_date) VALUES ('$user_name', '$user_email', '$user_pass', '$user_date')"; $result = mysql_query($add); if($result){ echo "All done!"; }else { echo "ERROR"; } } echo "<form method='post' action='".$_SERVER['PHP_SELF']."'>"; echo "".$lang['reg01']."<input type='text' name='user_name' class=''>"; echo "".$lang['reg02']."<input type='text' name='user_email' class=''>"; echo "".$lang['reg03']."<input type='password' name='user_pass' class=''>"; echo "".$lang['reg04']."<input type='password' name='user_pass2' class=''>"; echo "<input type='submit' name='register' value='".$lang['reg05']."'>"; echo "</form>"; ?> Quote Link to comment Share on other sites More sharing options...
rebuilder Posted January 29, 2011 Report Share Posted January 29, 2011 pamēģini action='' ja nelīdz, skaties kādu erroru izvada mysql Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted January 29, 2011 Author Report Share Posted January 29, 2011 kā to mysql errorus paskatīties? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted January 29, 2011 Report Share Posted January 29, 2011 mysql_query( ... ) or exit( mysql_error() ); Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted January 29, 2011 Author Report Share Posted January 29, 2011 hmm.. man neko nerāda.. :@ nesaprotu kas par vainu.. sviests kkāds!!! Quote Link to comment Share on other sites More sharing options...
gta1151 Posted January 29, 2011 Report Share Posted January 29, 2011 Pamēģini bez action. Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted January 29, 2011 Author Report Share Posted January 29, 2011 tad viņš nk refrešojas un neko neuzrāda! Quote Link to comment Share on other sites More sharing options...
ezis Posted January 29, 2011 Report Share Posted January 29, 2011 (edited) $result = mysql_query($add) or exit(mysql_error()); action='".$_SERVER['REQUEST_URI']."' Un tad paskaties, ko Tev izmet.. btw, baigi neforšs un "neloģisks" skripts :\ Edited January 29, 2011 by ezis Quote Link to comment Share on other sites More sharing options...
Kemito Posted January 29, 2011 Report Share Posted January 29, 2011 Ieteiktu novākt to debīlismu ar echo, lai var saprast HTML kodu pa priekšu. <?php error_reporting(E_ALL); include "fcs/dbase.php"; include "lang/lv.php"; if(isset($_POST['register'])){ $user_name = mysql_real_escape_string(trim($_POST['user_name'])); $user_email = mysql_real_escape_string($_POST['user_email']); $user_pass = md5($_POST['user_pass']); $user_date = date('dd.mm.yyyy'); if ($_POST['user_pass'] != $_POST['user_pass2']) { echo "Paroles nesakriit"; } $add = "INSERT INTO users (user_name, user_email, user_pass, user_date) VALUES ('$user_name', '$user_email', '$user_pass', '$user_date')"; $result = mysql_query($add) or die(mysql_error()); if($result){ echo "All done!"; }else { echo "ERROR"; } } ?> <form method="post" action=""> <input type="text" name="user_name" /> <input type="text" name="user_emai" /> <input type="password" name="user_pass" /> <input type="password" name="user_pass2" /> <input type="submit" name="register" value="<?php echo $lang['reg05']; ?>" /> </form> Kodu neesmu testējis, rakstīju šeit pat, paprovē šādi! Quote Link to comment Share on other sites More sharing options...
mounkuls Posted January 29, 2011 Report Share Posted January 29, 2011 (edited) $user_date = date('dd.mm.yyyy'); Kas tas tāds pa draņķi? Izlasi par funkciju date() vismaz! Un vēl, kurš pipuks html tomēr ir starā par nenoslēgtiem tagiem? Edited January 29, 2011 by mounkuls Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.