<?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[form in php]]></title><description><![CDATA[<p dir="auto">Ciao, ho un problemone con php.<br />
devo creare un form di autenticazione con user e password che mi permette di accedere al database di consultazione di libri presenti in una biblioteca.<br />
premetto che sono alle primissime armi con php!!!<br />
allora, ho creato il form, ma devo capire come faccio a connetterlo al db, a dare messaggio di errore se l'utente non è registrato, e come permetto all'utente vuovo di registrarsi inserendo nel db una nuova user e password. grazie mille</p>
<p dir="auto">questo è il codice che ho scritto fino adesso ( e credo sia pieno di errori)</p>
<p dir="auto">[php]<br />
&lt;?php<br />
require_once("config.php");<br />
require_once("funzioni.php");<br />
?&gt;<br />
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<br />
"<a href="http://www.w3.org/TR/xhtml11/DTD/html11.dtd" rel="nofollow ugc">http://www.w3.org/TR/xhtml11/DTD/html11.dtd</a>"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;form&lt;/title&gt;<br />
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
if ($_SERVER ["REQUEST_METHOD] =="GET")<br />
{<br />
?&gt;<br />
&lt;h4&gt;consulta i testi&lt;/h4&gt;<br />
&lt;form method="post" &lt;?php echo "action="",$_SERVER ["PHP_SELF"], """; ?&gt; &gt;<br />
Username: &lt;input type="text" name="utente" size="10"/&gt;<br />
Password: &lt;input type="text" name="password" size="10"/&gt;<br />
&lt;br/&gt;<br />
&lt;input type="submit" value="entra"/&gt;<br />
&lt;input type="submit" value="registrati"/&gt;<br />
&lt;/form&gt;<br />
&lt;?<br />
}<br />
else<br />
if (!utenteValido($_POST["utente"], $_POST["password"]))<br />
{<br />
echo "non sei registrato";<br />
?&gt;</p>
<p dir="auto">&lt;?<br />
$connessione = mysql_connect ("localhost" ,"root", "")<br />
or die ("connessione non riuscita");<br />
mysql_select_db ("registrati")<br />
or die ("selezione del db non riuscita");<br />
?&gt;</p>
<p dir="auto">&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/php]</p>
]]></description><link>https://connect.gt/topic/45766/form-in-php</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 12:53:32 GMT</lastBuildDate><atom:link href="https://connect.gt/topic/45766.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Sep 2007 08:43:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to form in php on Thu, 06 Sep 2007 15:12:27 GMT]]></title><description><![CDATA[<p dir="auto">non do supporto PVT... lsa soluzione è semplice... se vuoi posta qua, ciao</p>
]]></description><link>https://connect.gt/post/594439</link><guid isPermaLink="true">https://connect.gt/post/594439</guid><dc:creator><![CDATA[skyline]]></dc:creator><pubDate>Thu, 06 Sep 2007 15:12:27 GMT</pubDate></item><item><title><![CDATA[Reply to form in php on Thu, 06 Sep 2007 10:52:30 GMT]]></title><description><![CDATA[<p dir="auto">se hai un database mysql è corretto</p>
]]></description><link>https://connect.gt/post/594438</link><guid isPermaLink="true">https://connect.gt/post/594438</guid><dc:creator><![CDATA[skyline]]></dc:creator><pubDate>Thu, 06 Sep 2007 10:52:30 GMT</pubDate></item></channel></rss>