I'm getting this error:
Parse error: syntax error, unexpected T_VARIABLE in /web/htdocs/www.immobiliare-deamicis.com/home/mail_segnala.php on line 1

I don't understand, any modify I made (even if I write 'print "hello";') it returns me this error.

thank you

<?php

$ipaddress=$_SERVER; //IP remote

// $_GET var

$lang=$_GET;

if (!$lang) $lang="it";

// $_POST var

$form_email = stripslashes ($_POST);

$type = stripslashes ($_POST);

$form_riferimenti = stripslashes ($_POST);

$form_accessori = stripslashes ($_POST);

$form_zona=$_POST;

$form_stato = stripslashes ($_POST);

$form_regione = stripslashes ($_POST);

$form_provincia = stripslashes ($_POST);

$form_localita = stripslashes ($_POST);

$form_contratto = stripslashes ($_POST);

$form_tipologia = stripslashes ($_POST);

$form_vani = stripslashes ($_POST);

$form_prezzo_min = stripslashes ($_POST);

$form_prezzo_max = stripslashes ($_POST);

// Verifica campi obbligatori

if (!isset($form_email) && $form_email == "") {

header("Location: trova.php?lang=$lang");

exit;

}

// Include in lingua

$err=@include ("gestione/bin/definizioni_$lang.php");

if (!$err) header("Location: " . $_SERVER);

include ("gestione/bin/inc_config.php");

include ("gestione/bin/inc_db.php");

dbconnect($conn, $conn, $conn, $conn);

$contratto_descrizione=explode(",", $LNG_contratti);

$destinatari=$form_email;

$oggetto=$LNG_segnala . " - Agenzia Immobiliare De Amicis - Bordighera";

$messaggio = ' here a long string for the messagge ';


require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.server.it"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "userr"; // SMTP username
$mail->Password = "pwd"; // SMTP password

$mail->From = "from Address";
$mail->FromName = "Immobiliare De Amicis";
$mail->AddAddress($destinatari);

$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML

$mail->Subject = $oggetto;
$mail->Body = $messaggio;
//$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}

echo "Message has been sent";

header("Location: /index.php?lang=$lang");

exit;

?>

Welcome to DaniWeb! Here are some basic guidelines to get any problem solved here:
When posting code of any sort, it's important to use code tags. Here's an example:

[code=php] <?php echo "Hello world."; ?>

[/code]
And your code will look like this:

<?php
echo "Hello world.";
?>

This way, each line is numbered, the syntax is highlighted, and the start and stop points of the code are clearly defined. The Toggle Plain Text option also creates a way to easily copy/paste the code into an editor and test it.
You're issue is on line 1, but what is in line 1? thank you? What if your error was on line 57?
Also, the thread title should clearly define your problem, not just state help.

I didn't get an error with this code. It seems that you probably have a problem in the setup of your LAMP environment. Hard to know what that might be unless someone had a similar problem and managed to fix it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.