if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>
PETITION
to implement the
Universal Declaration of Human Rights
We the undersigned citizens hereby state:
THAT abuses of human rights are a widespread problem and give rise to ethnic, racial and religious conflicts,
THAT in 1948, the United Nations adopted the Universal Declaration of Human Rights which is now endorsed by all nations of the world,
THEREFORE, we urge that this Declaration be broadly displayed and promoted; with human rights education made available to children and adults throughout the world.
Fill out the following form:
( *Required Fields )
} else {
//
//this first part adds the person's data to the petition
//
//the form elements
//concatenate them into a tab-delimited string
$string_data = $fname . "\t" . $lname . "\t" . org.csi.structuredview.tools.EmailTool@14d6b74 . "\t" . $address . "\t" . $city . "\t" . $state . "\t" . $zip . "\t" . $country . "\r\n";
$strBody = $fname . " " . $lname . "\r\n" . org.csi.structuredview.tools.EmailTool@14d6b74 . "\r\n" . $address . "\r\n" . $city . ", " . $state . ", " . $zip . "\r\n" . $country;
$recipient = $_POST['recipient'];
mail($recipient, "Youth for Human Rights International - Petition Signature", $strBody, $strHeader);
//the destination file
$myFile = "petition.txt";
//prepare the file to be appended to
$fh = fopen($myFile, 'a') or die("can't open file");
//append the data
fwrite($fh, $string_data);
//close the file
fclose($fh);
//
//this part increments the counter (how many have signed)
//
//the counter text file
$myFile = "counter.txt";
//read the current value
$fc = fopen($myFile, 'r+') or die("can't open file");
$count = (int) fread($fc, 20);
//close the file
fclose($fc);
//increment the counter
$count++;
//increment the value in the file
$fc = fopen($myFile, 'w') or die("can't open file");
fwrite($fc, $count);
//close the file
fclose($fc);
?>
Thank You for Signing the Human Rights Education Petition
You are the echo $count; ?> person to sign the petition.
NOW GET INVOLVED
Make Human Rights a Reality
|
|