Salve!
Nel mio sito manca la data di registrazione degli utenti.
Ho deciso di aggiungerla creando un nuovo campo nella tabella user
ALTER TABLE user ADD reg DATETIME AFTER email;
e ho aggiunto al form di registrazione il seguente input,
ma avrò sbagliato qualcosa in quanto non mi registra la data nel database.
Mi aiutate per favore?
Grazie
Dario
<input type="hidden" name="reg" value="<? echo date("Y-m-d H:i:s") ?>">
Codice PHP:
<center><? require('error_inc.php'); require('config_inc.php'); $ref=intval($ref); if($REQUEST_METHOD=="POST"){ if(isset($add)){ ?> <HTML><HEAD><TITLE></TITLE></HEAD><FRAMESET Rows='30,*' BORDER='0'><FRAME MARGINHEIGHT='0' MARGINWIDTH='0' SRC='addframe.php?name=<?print $name;?>&email=<?print $email;?>&share=<?print $share;?>&site=<?print $site;?>®=<?print $reg;?>&language=<?print $language;?>&ref=<?print $ref;?>&sel[1]=<?print $sel[1];?>&sel[2]=<?print $sel[2];?>&sel[3]=<?print $sel[3];?>&sel1[1]=<?print $sel1[1];?>&sel1[2]=<?print $sel1[2];?>&sel1[3]=<?print $sel1[3];?>&pass=<?print $pass;?>&url=<?print $url;?>' SCROLLING='No' NORESIZE NAME='top' BORDER='0'><FRAME MARGINHEIGHT='0' MARGINWIDTH='0' SRC='<?print $url;?>' SCROLLING='AUTO' NORESIZE NAME='main' BORDER='0'></FRAMESET><noframes></noframes></HTML> <? exit; } } $query1 = "select * from ".$t_cat." order by id"; $result1 = MYSQL_QUERY($query1); require('header_inc.php'); require ('blocchi_sx.php'); ?> <SCRIPT language=javascript1.2 type=text/javascript> function isEmail(str) { var supported = 0; if (window.RegExp) { var tempStr = "a"; var tempReg = new RegExp(tempStr); if (tempReg.test(tempStr)) supported = 1; } if (!supported) return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); return (!r1.test(str) && r2.test(str)); } function EvaluateField() { var userName = document.NewUser.name.value; var userEmail = document.NewUser.email.value; var userEmail2 = document.NewUser.email1.value; var SiteName = document.NewUser.site.value; var SiteURL = document.NewUser.url.value; var SiteLanguage = document.NewUser.language.selectedIndex; if(SiteLanguage==0 ){ alert('bisogna settare la lingua principale del sito.'); document.NewUser.language.focus(); return false; } if(userName == "") { alert("Il campo \"Tuo nome\" deve essere compilato."); document.NewUser.name.focus(); return false; } if(userEmail == "") { alert("Il campo \"Tua e-mail\" deve essere compilato."); document.NewUser.email.focus(); return false; } else { if(isEmail(userEmail) == false) { alert(userEmail + " non può essere usato come e-mail."); document.NewUser.email.focus(); return false; } } if(userEmail != userEmail2) { alert("I campi \"Tua e-mail\" e \"Conferma tua e-mail\" devono essere identici."); document.NewUser.email.focus(); return false; } if(SiteName == "") { alert("Il campo \"Nome tuo Sito\" deve essere compilato."); document.NewUser.site.focus(); return false; } if(SiteURL == "") { alert("Il campo \"URL tuo Sito\" deve essere compilato."); document.NewUser.url.focus(); return false; } if(SiteURL == "http://") { alert("Il campo \"URL tuo Sito\" deve essere compilato."); document.NewUser.url.focus(); return false; } alert('Puoi adesso aprire il sito per verificare che l'URL sia corretto. Segui le informazioni sulla parte superiore della schermata successiva.') return true; } </SCRIPT> <div align="center"> <table cellspacing="0" cellpadding="0" width="100%"><tr><td width="8"></td><td>
Compila i campi, leggi e accetta i termini e le condizioni per accedere al nostro circuito.
<FORM name=NewUser action="" method=post> <div><table width="400" border="0" cellspacing="0" cellpadding="0" align="left"> <tr> <td width="400" align="left">Tuo Nome:</td> <td align="left" width="200"> <input type="text" name="name" size="30"> </td> </tr> <tr> <td width="400" align="left">Tua E-mail:</td> <td align="left" width="200"> <input type="text" name="email" size="30"> </td> </tr> <tr> <td width="400" align="left">Conferma tua E-mail:</td> <td align="left" width="200"> <input type="text" name="email1" size="30"> <input type="hidden" name="share" value="0"> </td> </tr> <tr> <td width="400" align="left">Nome tuo Sito:</td> <td align="left" width="200"> <input type="text" name="site" size="30"> </td> </tr> <tr> <td width="400" align="left">URL tuo Sito:</td> <td align="left" width="200"> <input type="text" name="url" value="http://" size="30"> <input type="hidden" name="reg" value="<? echo date("Y-m-d H:i:s") ?>"> </td> </tr> <tr><td><center>
<INPUT onclick="return EvaluateField();" type=submit name="add" value="Accetto Termini e Condizioni"></tr></td> <? while($row = mysql_fetch_array($result)){ ?> <? } @mysql_free_result($result); ?> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
</p> </center></form>
</td></tr></table><? include ('block/promozioni_altervista.php'); ?><? include ('block/circuito_banner.php'); ?> </td><td width="0"></td> <? include ('blocchi_dx.php'); ?><? include ('footer_inc.php'); ?></div>