hi
you have no starttags but 2 endtags
functionname { // starttag
} // endtag
if ( $today ) { // starttag
echo 'not tomorrow';
} // endtag
In your second script, remove thos two '}'
or create some matching STARTTAG
because they have no startag to match them
Aalso use in beginning, when debug php script ALWAYS
error_reporting ( E_ALL ); // DEBUG, remove after you got script working
try this:
<?php
error_reporting ( E_ALL ); // DEBUG, remove this line after script is working
// Test if anything was posted to this page, from POST form
// check if variable $_POST['text1'] IS set, has got a value
if ( isset( $_POST['text1'])) { // START TAG
$text1 = $_POST['text1'];
$text2 = $_POST['text2'];
$sendto = "director@company.com";
$subject = "test";
$notes = "my notes can be put here";
// CREATE a STRING variable $headers; start with an empty string variable
$headers="";
// ".=" means add to an EXISTING string,
// if not variable $headers was created before,
// this command will give, display a DEBUG error_reporting() NOTICE
$headers .= "<b>test form</b> \n\n";
$headers .= "From: $text1 \n";
$headers .= "Request: $text2 \n";
mail( $sendto, $subject, $notes, $headers );
exit ( 'mail was sent' ); // stop script with a confirmation message
} // ENDIF endtag
// ELSE nothing POSTED , variable $_POST['text1'] was NOT set
else { //START ELSE
exit ( 'nothing was posted, so not sent anything' ); // give error info
} // END ELSE
?>
hop it work
halojoy
🙂