Moderators: mem paulo89 adminik  |  |
| script per login un aiuto | | Author | Text |
rocco.mo Junior Member

Posts: 80

Gender:  Online: No |
Date: 27/09/2007 19:26 script per login un aiuto | #post2016 | salve a tutti ciao mem ascolta vorrei fartivedere uno script per il login mi puoi aiutare devo faregli output e secondo te com e sto script? | code |
<?
include 'funzioni.inc.php' ;
check( $_SERVER['REMOTE_ADDR']);
intestazione();
?>
<b>Pagina di Log In</b><br>
<?
error_reporting ( E_WARNING | ~ E_NOTICE ) ;
$ris = checkIP($REMOTE_ADDR);
if ($ris) {
print "Ciao $ris, eri già loggato. Vai alla home page.<br><br>";
} else {
if ($id=controllo($_POST['user'],$_POST['passw'])) {
$conn = connetti();
$dataEntr = @time()+60*10; // 60 sec * 10 minuti
$query = mysql_query("INSERT INTO `utenti_online` (`id_utente`,`ip`,`tempo`) VALUES ('$id','$REMOTE_ADDR','$dataEntr')",$conn) or print mysql_error();
disconnetti($conn);
echo "Utente connesso. Vai alla home page.<br><br>";
} else {
print "Attenzione il nick o la password inseriti non sono esatti!<br><br>";
}
}
finepagina();
?>
|
|
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 27/09/2007 19:40 script per login un aiuto | #post2017 | |
|
 |
| |
rocco.mo Junior Member

Posts: 80

Gender:  Online: No |
Date: 27/09/2007 19:42 script per login un aiuto | #post2018 | e io la ho preso questo script da quella guida che mi ai datoil link |
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 27/09/2007 20:18 script per login un aiuto | #post2019 | Ma solo quel pezzo non basta, usa tutto lo script  Cmq funziona, almeno quello della guida |
|
 |
| |
rocco.mo Junior Member

Posts: 80

Gender:  Online: No |
Date: 27/09/2007 21:44 script per login un aiuto | #post2020 | ma il problema e che devo creargli l output che lo devo far funzionare con flash capisci |
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 27/09/2007 22:41 script per login un aiuto | #post2021 | flash? non so aiutarti allora, mi spiace |
|
 |
| |
rocco.mo Junior Member

Posts: 80

Gender:  Online: No |
Date: 28/09/2007 01:14 Re: script per login un aiuto | #post2022 | mem secondo te cos c e di sbagliato in questo script perl invio delle email ti spiego io voglio che tutte l email vengano salvate nel db ma non capisco cosa non quadra ci dai un occhiata?perfavore sono due i files uno mailform.php e l altro config.php te li posto
| code |
<?
include 'config.php';
$adminaddress = "info@actionscriptnews.com";
$siteaddress ="http://www.actionscriptnews.com";
$sitename = "actionscriptnews.com";
//No need to change anything below ...
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");
// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email'] ;
$name = $HTTP_POST_VARS['name'] ;
$cognome = $HTTP_POST_VARS['cognome'] ;
$comments = $HTTP_POST_VARS['comments'] ;
$telefono = $HTTP_POST_VARS['telefono'] ;
$oggetto = $HTTP_POST_VARS['oggetto'] ;
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action == "send")
{
//Innanzitutto controlliamo la var.le name:
$controllo = check_email($email);
if ($controllo != "OK")
{
echo $controllo;
//Qui potresti anche far visualizzare una cosa del genere:
echo "<BR><A HREF="http://www.marikweb.com/homeita/">Ritorna alla registrazione</A>";
}
else
{
//Ora inseriamo i dati nel DB.
//Ovviamente devi creare una tabella in cui inserire i dati ke passi con il post.
$link_db = mysql_connect($CONFIG['host'],$CONFIG['user'],$CONFIG['pass']);
mysql_select_db($CONFIG['dbname']);
$sql_insert = "INSERT INTO contact (name,cognome,email,telefono,oggetto,comments) VALUES('$name','$cognome','$email','$telefono','$oggetto','$comments')";
if (mysql_query($sql_insert))
{
echo "OK RIGA INSERITA <br />";
}
else
{
die(mysql_error());
}
mysql_close($link_db);
//
mail ("$adminaddress","informazioni",
"Il visitatore ha lasciato le seguenti informazioni
Name: $name
Email: $email
Telefono: $telefono
Messaggio:
------------------------------
$comments
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$email" ) ;
//This sends a confirmation to your visitor
mail ("$email","Re:",
"Salve $name,
abbiamo ricevuto il suo messaggio e presto sarà contattato.
Saluti dallo Staff di $sitename
By
$siteaddress","FROM:$adminaddress ") ;
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thank you. You will receive a confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
}
}
?>
|
| code |
<?php
$CONFIG['host'] = "localhost";
$CONFIG['user'] = "rocco";
$CONFIG['pass'] = "maurizio";
$CONFIG['dbname'] = "user35512_7777";
$CONFIG['expire'] = 60;
$CONFIG['regexpire'] = 24; //in ore
$CONFIG['expire'] = 60;
$CONFIG['regexpire'] = 24; //in ore
$CONFIG['check_table'] = array(
"name" => "check_global",
"email" => "check_global"
);
function check_email($value)
{
global $CONFIG;
$value = trim($value);
if (($value == ""))
{
echo"Il campo non può essere lasciato vuoto";
}
else{
$query = @mysql_query("SELECT id FROM contact WHERE email='$value'")or die("Errore nella query");
if (@mysql_num_rows($query) != 0) return "Email già utilizzata";
else return"OK";
}
}
//--------------
define('AUTH_LOGGED', 99);
define('AUTH_NOT_LOGGED', 100);
define('AUTH_USE_COOKIE', 101);
define('AUTH_USE_LINK', 103);
define('AUTH_INVALID_PARAMS', 104);
define('AUTH_LOGEDD_IN', 105);
define('AUTH_FAILED', 106);
define('REG_ERRORS', 107);
define('REG_SUCCESS', 108);
define('REG_FAILED', 109);
$conn = @mysql_connect($CONFIG['host'], $CONFIG['user'], $CONFIG['pass']) or die('Impossibile stabilire una connessione');
@mysql_select_db($CONFIG['dbname']) or die("Errore nel DB");
?>
|
###########################################
Tabella
| quote |
CREATE TABLE `contact` (
`id` int(40) NOT NULL default '0',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`name` varchar(50) NOT NULL default '',
`cognome` varchar(50) NOT NULL default '',
`email` varchar(100) NOT NULL default '',
`telefono` varchar(50) NOT NULL default '',
`oggetto` varchar(100) NOT NULL default '',
`comments` text NOT NULL,
`ip` varchar(15) NOT NULL default '',
PRIMARY KEY (`id`)
|
|
|
 |
| |
rocco.mo Junior Member

Posts: 80

Gender:  Online: No |
Date: 28/09/2007 01:15 script per login un aiuto | #post2023 | sembra ok manon va non capisco il perche |
|
 |
| |
mem MemHT's Dad Admin / Developer

Posts: 3886

Gender:  Online: No
Languages: English, Italian, Macedonian, Serbian |
Date: 28/09/2007 11:08 script per login un aiuto | #post2024 | appena posso li guardo |
|
 |
| |
rocco.mo Junior Member

Posts: 80

Gender:  Online: No |
Date: 28/09/2007 11:28 script per login un aiuto | #post2025 | ok grazie mem |
|
 |
| |
 |