I have (as normal) several questions;
1)
What is wrong with this? The error is:
Parse error: parse error, unexpected T_VARIABLE in /pathl/send_process.php on line 74
<?
$totalChar1 = 3; // number of chars in the password
$salt1 = "0123456789"; // salt to select chars from
srand((double)microtime()*1000000); // start the random generator
$ran_num3=""; // set the inital variable
for ($i1=0;$i1<$totalChar1;$i1++) // loop and create password
$ran_num3 = $ran_num3 . substr ($salt1, rand() % strlen($salt1), 1);
$totalChar2 = 2; // number of chars in the password
$salt2 = "0123456789"; // salt to select chars from
srand((double)microtime()*1000000); // start the random generator
$ran_num2=""; // set the inital variable
for ($i2=0;$i2<$totalChar2;$i2++) // loop and create password
$ran_num2 = $ran_num2 . substr ($salt2, rand() % strlen($salt2), 1);
$totalChar3 = 1; // number of chars in the password
$salt3 = "0123456789"; // salt to select chars from
srand((double)microtime()*1000000); // start the random generator
$ran_num1=""; // set the inital variable
for ($i3=0;$i3<$totalChar3;$i3++) // loop and create password
$ran_num1 = $ran_num1 . substr ($salt3, rand() % strlen($salt3), 1);
$totalChar4 = $ran_num1;
$salt4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
srand((double)microtime()*1000000);
$ran_word=""; // set the inital variable
for ($i4=0;$i4<$totalChar4;$i4++)
$ran_word = $ran_word . substr ($salt4, rand() % strlen($salt4), 1);
?>
<?
if ($spam == "0") {
?>
<?
$date = date ("l dS of M Y h:i:s");
?>
<?php
$to = $form_to_name . " <" . $form_to_email . ">";
$headers = "From: \"".addslashes($form_sender_name)."\" <".$form_sender_email.">\n";
$headers .= "Reply-To: ".$form_reply_to."\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: Microsoft Outlook Express 6.00.2800.1158\n";
$headers .= "X-server: Wouldn't you like to know :P!\n";
$headers .= "Return-Path: <".$form_reply_to.">\n";
$headers .= "Received: (qmail 3299 invoked by uid 417);
$date -0000\n";
$headers .= "Received: from unknown (HELO noone.noone.net) (00.000.00.0)\n by 000.255.0.0 with SMTP;
$date -0000\n";
mail( $to, $form_subject, $form_message, $headers ) or print "Error handling message. message not sent.";
?>
The email to <? echo ("$form_to_name");?> (<?=$form_to_email?> ) Was send successfully.
<?
} else {
?>
<?
$to2 = $form_to_name . " <" . $form_to_email . ">";
$headers2 = "From: . "$ran_word" . <" . $ran_word@$ran_word.$ran_word . ">\n";
$headers2 .= "Reply-To: ".$ran_word@ran_word.$ran_word."\n";
$headers2 .= "MIME-Version: 1.0\n";
$headers2 .= "X-MSMail-Priority: Normal\n";
$headers2 .= "X-Mailer: Microsoft Outlook Express 6.00.2800.1158\n";
$headers2 .= "X-server: Wouldn't you like to know :P!\n";
$headers2 .= "Return-Path: <".$ran_word@$ran_word.$ran_word.">\n";
$headers2 .= "Received: (qmail 3299 invoked by uid 417);
$date -0000\n";
$headers2 .= "Received: from unknown (HELO $ran_word.$ran_word.$ran_word) ($ran_num2.$ran_num3.$ran_num2.$ran_num1)\n by $ran_num3.$ran_num3.$ran_num1.$ran_num1 with SMTP;
$date -0000\n";
mail( $to2, $form_subject, $form_message, $headers2 ) or print "Error handling message. message not sent.";
print "The email to $form_to_name ($form_to_email) Was send successfully.";
?>
<?
}
?>
2.)
How do you make a thing work X number of times? (like a process but in a loop)
Alex.