I am working on a simple newsletter/emailer
which will send from the email database.
Using <a href””> the textarea, when submitted, the
texarea variable fails, and the <a href> link is lost.
I cannot find a problem, am I missing something?
Here is the code:
[code=php]<?php
// ////////////////////////////// send message test ///////////////////
// ///////////////////////////////////////////////////////////////
if($_POST[send_message] == 1){ // form first
// code removed
}else{ // from if post send_message = 1;
// /////////////////////////////// end send message test //////////////////
// ///////////////////////////////////////////////////////////////////
// ////////////////////// edit contents /////////////////////////////
// //////////////////////////////////////////////////////////////////
if($_POST[edit_contents] == 1){ // edit contents
// retrieve form variables
$subject = $_POST[subject];
$reply_to = $_POST[reply_to];
$from = $_POST[from];
$date = $_POST[date];
$message = $_POST[message];
?>
<html>
<body>
edit contents<br>
<form method=”post” action=”<?php $_SERVER[PHP_SELF]; ?>”>
<input type=”text” name=”subject” value=”<?php echo $subject;?>” onclick=”this.select()”><br>
<input type=”text” name=”reply_to” value=”reply_to” onclick=”this.select()”><br>
<input type=”text” name=”from” value=”<?php echo $from;?>” onclick=”this.select()”><br>
<!– textarea –>
<textarea name=”message” rows=”20″ cols=”75″>
<?php echo $message; ?>
</textarea><br>
<input type=”hidden” name=”form_initialized” value=”1″>
<input type=”hidden” name=”preview” value=”1″>
<input type=”submit” value=”Preview”>
</form>
</body></html>
<?php
}else{ // if edit_contents =1
// ///////////////////// preview ////////////////////////////////////
// //////////////////////////////////////////////////////////////////
if($_POST[preview] == 1){ // display preview
// retrieve form variables
$subject = $_POST[subject];
$reply_to = $_POST[reply_to];
$from = $_POST[from];
$date = $_POST[date];
$message = $_POST[message];
?>
<html>
<body>
preview contents<br>
<table>
<tr><td><?php echo $date;?> </td></tr>
<tr><td><?php echo $subject;?> </td></tr>
<tr><td><?php echo $from;?> </td></tr>
<tr><td><?php echo $message;?> </td></tr>
</table>
<!– //////////////////// begin edit contents button //////////////// –>
<form method=”post” action=”<?php $_SERVER[PHP_SELF]; ?>”>
<input type=”hidden” name=”edit_contents” value=”1″>
<input type=”hidden” name=”date” value=”<?php echo $date; ?>”>
<input type=”hidden” name=”subject” value=”<?php echo $subject; ?>”>
<input type=”hidden” name=”from” value=”<?php echo $from; ?>”>
<input type=”hidden” name=”message” value=”<?php echo $message; ?>”>
<input type=”submit” value=”Edit Contents”>
</form>
<!– //////////////////// end edit contents button ////////////////// –>
</body>
</html>
<?php
} // from if post preview =1
// ///////////////////////////// end preview /////////////////////
// ///////////////////////////////////////////////////////////////
?>
<?php // do not show form once filled
if($_POST[form_initialized] != 1)
{ ?>
<html>
<body onLoad=”document.thevariables.subject.focus()”>
<!– /////////////////// initial form ///////////////////////// –>
<!– /////////////////////////////////////////////////////////// –>
initial form<br>
<form name=”thevariables” method=”post” action=”<?php $_SERVER[PHP_SELF]; ?>”>
<!– msg , recipient , subject , reply_to , from , date –>
<input type=”text” name=”subject” value=”subject” onfocus=”this.select()”><br>
<input type=”text” name=”reply_to” value=”reply_to” onclick=”this.select()”><br>
<input type=”text” name=”from” value=”from” onclick=”this.select()”><br>
<!– textarea –>
<textarea name=”message” rows=”20″ cols=”75″>
<html>
<a href=”http://www.epourania.com/mailScripts/emailblast/form_test01.php”>form test</a>
</html>
</textarea><br>
<input type=”hidden” name=”form_initialized” value=”1″>
<input type=”hidden” name=”preview” value=”1″>
<input type=”submit” value=”Preview”>
</form>
<!– //////////////// end initial form /////////// –>
<!– ///////////////////////////////////////////// –>
</body>
</html>
<?php
} // end if form_initialize !=1;
} // from else if edit_contents =1;
} // from else if send_message_test =1;
?>
<html><body>
<a href=”form_test01.php”>refresh</a>
</body></html>
During preview it will display:
[ATTACH]14760[/ATTACH]
and the $message variable fails.