Codice PHP:
<?
$db_host = "localhost";
$db_user = "draccan";
$db_password = "*******";
$db_database = "my_draccan";
$db_tabella = "Registrazione2";
$connessione = mysql_connect($db_host,$db_user,$db_password);
?>
Quest si trova nel file database2.php !
Dunque ecco la pagina dove prendo i dati :
Codice PHP:
<PHP>
<?
session_start();
$_SESSION['nome2']=$nome2;
$_SESSION['datan']=$datan;
$_SESSION['cognome2']=$cognome2;
$_SESSION['logmail']=$logmail;
$_SESSION['job']=$job2;
$_SESSION['language']=$language2;
$_SESSION['engaged']=$engaged2;
$_SESSION['born']=$born2;
if(!isset($_SESSION['nome2'])) { header("Location:**********.php"); }
?>
<HEAD>
<META NAME="GENERATOR" Content="AlterVista - Editor HTML">
<TITLE></TITLE>
</HEAD>
<BODY bgcolor="red" text="white">
<table width="100%">
<tr>
<td width="300" heigth="300"></td>
<td width="900" heigth="300" bgcolor="black"><font size="7" align="center">Edit your Profile Info</font></td>
<td width="300" heigth="300"></td>
</tr>
<tr>
<td width="300" ></td>
<td width ="900" ><form action=" " method="POST"><br><br>Where are you born? <input name="born" type="text" maxlength="50" size="20" value="Ancona" onfocus="if(this.value == 'Ancona') this.value=''; return true;" ><br> Are You Engaged? <input name="engaged" type="text" maxlength="3" size="20" value="Yes/No" onfocus="if(this.value == 'Yes/No') this.value=''; return true;"><br>The Name of your school/agency <input name="job" type="text" maxlength="50" size="20" value="Lawyer" onfocus="if(this.value == 'Lawyer') this.value=''; return true;" ><br>I Speak .. <input name="language" type="text" maxlength="50" size="20" value="English" onfocus="if(this.value == 'English') this.value=''; return true;" ><br><br> <input type="submit" value="Confirm"></form></td>
<td width="300"></td>
</table>
<?php
@include("database2.php");
$job2=$_POST['job'];
$language2=$_POST['language'];
$engaged2=$_POST['engaged'];
$born2=$_POST['born'];
$var=@fopen("Modifica.txt","a+");
@fwrite($var,$nome2);
@fwrite($var,$cognome2);
@fwrite($var,$datan);
@fwrite($var,$logmail."\n");
@fwrite($var,$job2."\n");
@fwrite($var,$language2."\n");
@fwrite($var,$engaged2."\n");
@fwrite($var,$born2."\n");
$connessione=mysql_connect($db_host,$db_user,$db_password);
$database=mysql_db_query($db_database," query ",$connessione);
mysql_db_query($db_database,"insert into ".$db_tabella."(Nome, Cognome, Data, Mail, Password, Sex, Luogo, Lingua, Lavoro, Fidanzato)values('".$nome2."','".$cognome2."','".$datan."','".$logmail."','no','no','".$born2."','".$language2."','".$job2."','".$engaged2."')",$connessione);
session_start();
$_SESSION['job2']=$job2;
$_SESSION['language2']=$language2;
$_SESSION['engaged2']=$engaged2;
$_SESSION['born2']=$born2;
if($born2 != null)
{
header("location:************");
}
?>
</BODY>
</PHP>
Grazie Mille :) nel frattempo ti dico che tutti i campi hanno il "tipo" giusto come "nome" prende del testo lo stesso dovrebbe valere per "luogo " !