Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Basi di dati ~ informatica triennale > help PHP
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
pintu
.illuminato.

User info:
Registered: Jul 2010
Posts: 248 (0.05 al dì)
Location: Novara
Corso: informatica
Anno:
Time Online: 2 Days, 0:46:30 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
help PHP

Ciao a tutti, devo creare un form per la registrazione di utenti in un sito. I dati del form devono essere inviati e salvati ad un database. Quando inserisco i dati e faccio invia però mi dice "Impossibile visualizzare la pagina" e ovviamente nel database non compaiono i dati inseriti. Posto i due mini-script sperando che qualcuno mi sa dire dove sbaglio!

---> file form_reg_user.php

<html>
<body>


<form action="reg_user.php" method="post">
Nome: <input type="text" name="nome" value=""> <br />
Cognome: <input type="text" name="cognome" value=""> <br />
E-mail: <input type="text" name="email" value=""> <br />
Username: <input type="text" name="username" value=""> <br />
Password: <input type="text" name="password" value=""> <br />
<input type="submit" name="bottone" value="Invia"> <br />
</form>


</body>
</html>


---> file reg_user.php

<?php

$conn_string = "host=localhost port=5432 dbname=immobili user=postgres password=4FZB53QK";
$db = pg_connect($conn_string);

$nome = $_POST["nome"];
$cognome = $_POST["cognome"];
$email = $_POST["email"];
$username = $_POST["username"];
$password = $_POST["password"];


$insert = pg_query($db, "INSERT INTO immobili.utente(username, password, nome, cognome, email)

VALUES(''.$username.', '.$password.', '.$nome.', '.$cognome.', '.$email.');


?>

04-05-2012 18:51
Click Here to See the Profile for pintu Click here to Send pintu a Private Message Find more posts by pintu Add pintu to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
CowBoy
.arcimaestro.

User info:
Registered: May 2006
Posts: 294 (0.04 al dì)
Location: Milano
Corso: F49 - Informatica
Anno: Laureato F49
Time Online: 3 Days, 13:40:27 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Controlla parentesi/apici/doppi apici nello script reg_user.php... un debugger ti potrebbe venire comodo.

Ciao!

__________________
.. ±·ø·±-`` MuSiC iS My LanGuAGe ´´-±·ø·± ..

Last edited by CowBoy on 09-05-2012 at 01:28

09-05-2012 01:18
Click Here to See the Profile for CowBoy Click here to Send CowBoy a Private Message Find more posts by CowBoy Add CowBoy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
pintu
.illuminato.

User info:
Registered: Jul 2010
Posts: 248 (0.05 al dì)
Location: Novara
Corso: informatica
Anno:
Time Online: 2 Days, 0:46:30 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Grazie della risposta cowboy, comunque ho risolto, il problema era immobili.utente perchè nel mio DB lo schema era public e non immobili :)

09-05-2012 19:46
Click Here to See the Profile for pintu Click here to Send pintu a Private Message Find more posts by pintu Add pintu to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 10:40.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.034 seconds (66.73% PHP - 33.27% MySQL) con 29 query.