<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[errore: Undefined index]]></title><description><![CDATA[<p dir="auto">ciao ragazzi perche  nei file che ho creato dopo che compilo dei campi in un form per registrarmi mi da questo errore</p>
<p dir="auto"><strong>Notice</strong>: Undefined index: action in <strong>c:\programmi\easyphp1-8\www\registrazione_1\include\reg.lib.php</strong> on line <strong>51</strong></p>
<p dir="auto">&lt;?php<br />
function reg_register($data){<br />
//registro l'utente<br />
global $_CONFIG;</p>
<p dir="auto">$id = reg_get_unique_id();<br />
mysql_query("<br />
INSERT INTO ".$_CONFIG['table_utenti']."<br />
(name, surname, indirizzo, occupazione, username, password, temp, regdate, uid)<br />
VALUES<br />
('".$data['name']."','".$data['surname']."','".$data['indirizzo']."',<br />
'".$data['occupazione']."','".$data['username']."',MD5('".$data['password']."'),<br />
'1', '".time()."','".$id."')");</p>
<p dir="auto">//Decommentate la riga seguente per testare lo script in locale<br />
echo "&lt;a href="<a href="http://localhost/Articoli/autenticazione/2/scripts/confirm.php?id=%22.$id.%22%5C%22%3EConferma%3C/a%3E%22" rel="nofollow ugc">http://localhost/Articoli/autenticazione/2/scripts/confirm.php?id=".$id."\"&gt;Conferma&lt;/a&gt;"</a>;<br />
if(mysql_insert_id()){<br />
return reg_send_confirmation_mail($data['mail'], "test@localhost", $id);<br />
}else return REG_FAILED;<br />
}<br />
function reg_send_confirmation_mail($to, $from, $id){<br />
//invio la mail di conferma<br />
$msg = "Per confermare l'avvenuta registrazione, clicckate il link seguente:<br />
<a href="http://localhost/Articoli/autenticazione/1/scripts/confirm.php?id=%22.$id.%22" rel="nofollow ugc">http://localhost/Articoli/autenticazione/1/scripts/confirm.php?id=".$id."</a><br />
";<br />
return (mail($to, "Conferma la registrazione", $msg, "From: ".$from)) ? REG_SUCCESS : REG_FAILED;<br />
}<br />
function reg_clean_expired(){<br />
global $_CONFIG;</p>
<p dir="auto">$query = mysql_query("<br />
DELETE FROM ".$_CONFIG['table_utenti']."<br />
WHERE (regdate + ".($_CONFIG['regexpire'] * 60 * 60).") &lt;= ".time()." and temp='1'");<br />
}<br />
function reg_get_unique_id(){<br />
//restituisce un ID univoco per gestire la registrazione<br />
list($usec, $sec) = explode(' ', microtime());<br />
mt_srand((float) $sec + ((float) $usec * 100000));<br />
return md5(uniqid(mt_rand(), true));<br />
}<br />
function reg_check_data(&amp;$data){<br />
global $_CONFIG;</p>
<p dir="auto">$errors = array();</p>
<p dir="auto">foreach($data as $field_name =&gt; $value){<br />
$func = $_CONFIG['check_table'][$field_name];<br />
if(!is_null($func)){<br />
$ret = $func($value);<br />
if($ret !== true)<br />
$errors[] = array($field_name, $ret);<br />
}<br />
}</p>
<p dir="auto">return count($errors) &gt; 0 ? $errors : true;<br />
}<br />
function reg_confirm($id){<br />
global $_CONFIG;</p>
<p dir="auto">$query = mysql_query("<br />
UPDATE ".$_CONFIG['table_utenti']."<br />
SET temp='0'<br />
WHERE uid='".$id."'");</p>
<p dir="auto">return (mysql_affected_rows () != 0) ? REG_SUCCESS : REG_FAILED;<br />
}<br />
?&gt;</p>
]]></description><link>https://dev.connect.gt/topic/14639/errore-undefined-index</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 12:12:39 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/14639.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Aug 2006 12:51:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to errore: Undefined index on Sat, 05 Aug 2006 06:54:08 GMT]]></title><description><![CDATA[<p dir="auto">ciao massy grazie x l'aiuto.<br />
il file che dice è questo.<br />
ma non capisco come togliere quel problema.</p>
<p dir="auto">&lt;?php<br />
function reg_register($data){<br />
//registro l'utente<br />
global $_CONFIG;</p>
<p dir="auto">$id = reg_get_unique_id();<br />
mysql_query("<br />
INSERT INTO ".$_CONFIG['table_utenti']."<br />
(name, surname, indirizzo, occupazione, username, password, temp, regdate, uid)<br />
VALUES<br />
('".$data['name']."','".$data['surname']."','".$data['indirizzo']."',<br />
'".$data['occupazione']."','".$data['username']."',MD5('".$data['password']."'),<br />
'1', '".time()."','".$id."')");</p>
<p dir="auto">//Decommentate la riga seguente per testare lo script in locale<br />
echo "&lt;a href="<a href="http://localhost/Articoli/autenticazione/2/scripts/confirm.php?id=%22.$id.%22%5C%22%3EConferma%3C/a%3E%22" rel="nofollow ugc">http://localhost/Articoli/autenticazione/2/scripts/confirm.php?id=".$id."\"&gt;Conferma&lt;/a&gt;"</a>;<br />
if(mysql_insert_id()){<br />
return reg_send_confirmation_mail($data['mail'], "test@localhost", $id);<br />
}else return REG_FAILED;<br />
}<br />
function reg_send_confirmation_mail($to, $from, $id){<br />
//invio la mail di conferma<br />
$msg = "Per confermare l'avvenuta registrazione, clicckate il link seguente:<br />
<a href="http://localhost/Articoli/autenticazione/1/scripts/confirm.php?id=%22.$id.%22" rel="nofollow ugc">http://localhost/Articoli/autenticazione/1/scripts/confirm.php?id=".$id."</a><br />
";<br />
return (mail($to, "Conferma la registrazione", $msg, "From: ".$from)) ? REG_SUCCESS : REG_FAILED;<br />
}<br />
function reg_clean_expired(){<br />
global $_CONFIG;</p>
<p dir="auto">$query = mysql_query("<br />
DELETE FROM ".$_CONFIG['table_utenti']."<br />
WHERE (regdate + ".($_CONFIG['regexpire'] * 60 * 60).") &lt;= ".time()." and temp='1'");<br />
}<br />
function reg_get_unique_id(){<br />
//restituisce un ID univoco per gestire la registrazione<br />
list($usec, $sec) = explode(' ', microtime());<br />
mt_srand((float) $sec + ((float) $usec * 100000));<br />
return md5(uniqid(mt_rand(), true));<br />
}<br />
function reg_check_data(&amp;$data){<br />
global $_CONFIG;</p>
<p dir="auto">$errors = array();</p>
<p dir="auto">foreach($data as $field_name =&gt; $value){<br />
$func = $_CONFIG['check_table'][$field_name];<br />
if(!is_null($func)){<br />
$ret = $func($value);<br />
if($ret !== true)<br />
$errors[] = array($field_name, $ret);<br />
}<br />
}</p>
<p dir="auto">return count($errors) &gt; 0 ? $errors : true;<br />
}<br />
function reg_confirm($id){<br />
global $_CONFIG;</p>
<p dir="auto">$query = mysql_query("<br />
UPDATE ".$_CONFIG['table_utenti']."<br />
SET temp='0'<br />
WHERE uid='".$id."'");</p>
<p dir="auto">return (mysql_affected_rows () != 0) ? REG_SUCCESS : REG_FAILED;<br />
}<br />
?&gt;</p>
]]></description><link>https://dev.connect.gt/post/354832</link><guid isPermaLink="true">https://dev.connect.gt/post/354832</guid><dc:creator><![CDATA[giangi80p]]></dc:creator><pubDate>Sat, 05 Aug 2006 06:54:08 GMT</pubDate></item><item><title><![CDATA[Reply to errore: Undefined index on Fri, 04 Aug 2006 17:27:56 GMT]]></title><description><![CDATA[<p dir="auto">Qual è il file reg.lib.php?<br />
Alla riga 51 dovrebbe starci un qualcosa tipo:<br />
if ($_POST['action'], $_SESSION['action']; $var['action']) etc etc non definita.</p>
<p dir="auto">Non è un errore ma un warning.</p>
<p dir="auto"><img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/54a3bffb-5e4a-4eb8-81dc-99b2072e5d05-175.gif?v=12b9555a9a1" class="not-responsive emoji emoji-customizations emoji--ciauz" style="height:1.4em;width:auto;vertical-align:middle" title=":ciauz:" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/354827</link><guid isPermaLink="true">https://dev.connect.gt/post/354827</guid><dc:creator><![CDATA[massy]]></dc:creator><pubDate>Fri, 04 Aug 2006 17:27:56 GMT</pubDate></item><item><title><![CDATA[Reply to errore: Undefined index on Fri, 04 Aug 2006 13:29:17 GMT]]></title><description><![CDATA[<p dir="auto">i file che uso sono quello di prima e questi due oltre al form.<br />
ma non riesco a risolvere quel problema</p>
<p dir="auto">register.php</p>
<p dir="auto">&lt;!--<br />
.style1 {<br />
color: <a href="/hashtags/ff0000">#FF0000</a>;<br />
font-weight: bold;<br />
}<br />
--&gt;<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
include_once("include/config.php");<br />
include_once("include/reg.lib.php");<br />
if(isset($_POST['action']) and $_POST['action'] == 'Invia'){<br />
$ret = reg_check_data($_POST);<br />
$status = ($ret === true) ? reg_register($_POST) : REG_ERRORS;</p>
<p dir="auto">switch($status){<br />
case REG_ERRORS:<br />
?&gt;<br />
&lt;span class="style1"&gt;Sono stati rilevati i seguenti errori:&lt;/span&gt;&lt;br&gt;<br />
&lt;?php<br />
foreach($ret as $error)<br />
printf("&lt;b&gt;%s&lt;/b&gt;: %s&lt;br&gt;", $error[0], $error[1]);<br />
?&gt;<br />
&lt;br&gt;Premere "indietro" per modificare i dati<br />
&lt;?php<br />
break;<br />
case REG_FAILED:<br />
echo "Registrazione Fallita a causa di un errore interno.";<br />
break;<br />
case REG_SUCCESS:<br />
echo "Registrazione avvenuta con successo.&lt;br&gt;<br />
Vi è stata inviata una email contente le istruzioni per confermare la registrazione.";<br />
break;<br />
}<br />
}<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p dir="auto">config.php</p>
<p dir="auto">&lt;?php<br />
$_CONFIG['host'] = "localhost";<br />
$_CONFIG['user'] = "root";<br />
$_CONFIG['pass'] = "milano";<br />
$_CONFIG['dbname'] = "articolo_autenticazione";<br />
$_CONFIG['table_sessioni'] = "sessioni";<br />
$_CONFIG['table_utenti'] = "utenti";<br />
$_CONFIG['expire'] = 60;<br />
$_CONFIG['regexpire'] = 24; //in ore<br />
$_CONFIG['check_table'] = array(<br />
"username" =&gt; "check_username",<br />
"password" =&gt; "check_global",<br />
"name" =&gt; "check_global",<br />
"surname" =&gt; "check_global",<br />
"indirizzo" =&gt; "check_global",<br />
"occupazione" =&gt; "check_global",<br />
"mail" =&gt; "check_global"<br />
);<br />
function check_username($value){<br />
global $_CONFIG;</p>
<p dir="auto">$value = trim($value);<br />
if($value == "")<br />
return "Il campo non può essere lasciato vuoto";<br />
$query = mysql_query("<br />
SELECT id<br />
FROM ".$_CONFIG['table_utenti']."<br />
WHERE username='".$value."'");<br />
if(mysql_num_rows($query) != 0)<br />
return "Nome utente già utilizzato";</p>
<p dir="auto">return true;<br />
}<br />
function check_global($value){<br />
global $_CONFIG;</p>
<p dir="auto">$value = trim($value);<br />
if($value == "")<br />
return "Il campo non può essere lasciato vuoto";</p>
<p dir="auto">return true;<br />
}</p>
<p dir="auto">//--------------<br />
define('AUTH_LOGGED', 99);<br />
define('AUTH_NOT_LOGGED', 100);<br />
define('AUTH_USE_COOKIE', 101);<br />
define('AUTH_USE_LINK', 103);<br />
define('AUTH_INVALID_PARAMS', 104);<br />
define('AUTH_LOGEDD_IN', 105);<br />
define('AUTH_FAILED', 106);<br />
define('REG_ERRORS', 107);<br />
define('REG_SUCCESS', 108);<br />
define('REG_FAILED', 109);<br />
$conn = mysql_connect($_CONFIG['host'], $_CONFIG['user'], $_CONFIG['pass']) or die('Impossibile stabilire una connessione');<br />
mysql_select_db($_CONFIG['dbname']);<br />
?&gt;</p>
]]></description><link>https://dev.connect.gt/post/354833</link><guid isPermaLink="true">https://dev.connect.gt/post/354833</guid><dc:creator><![CDATA[giangi80p]]></dc:creator><pubDate>Fri, 04 Aug 2006 13:29:17 GMT</pubDate></item><item><title><![CDATA[Reply to errore: Undefined index on Fri, 04 Aug 2006 13:03:23 GMT]]></title><description><![CDATA[<p dir="auto">Se quello é il file che lanci non c'é una riga di codice, ma solo funzioni.<br />
Quindi che può fare?</p>
]]></description><link>https://dev.connect.gt/post/354826</link><guid isPermaLink="true">https://dev.connect.gt/post/354826</guid><dc:creator><![CDATA[margheritebianche]]></dc:creator><pubDate>Fri, 04 Aug 2006 13:03:23 GMT</pubDate></item></channel></rss>