i have been busy on this form. my problem began when i added the values into the forms. since this form does work when you need to add the values on the form itself. i tried differant things on getting the variables defined ( like putting them on the smail.php page but it didnt work. )
on submit click it just wont see that it already has a mailto, subject , and a body.
how do i fix this ? ( or better yet how do i fix this and get it all to happen on one page ? )
my code
Code: Select all
<?
// FORM.PHP
<?
require 'include/config.php';
require 'include/styles.php';
$year = date("Y");
$day = date("d");
$month = date("F");
?>
<body CLASS="V" text=white>
<h1 class="r">XML MAILER</h1>
<form name="mail" method=post action="smail.php">
<table width="200" border="1" class="v" bgcolor="#cccccc" bordercolor="#0000000" cellpadding="10" cellspacing="0">
<tr>
<td>
<center>
<b>Subject:</b>
</center>
</td>
<td>
<input type="text" name="mailsubject" value="<? echo ("$year $day $month");?>" size="35">
</td>
</tr>
<tr>
<td>
<div class="r"><b>Destinacion:</b>
</td>
<td><select name="mailto">
<option value=1><?echo $url_CAE?>
<option value=2><?echo $url_TAT?>
<option value=3><?echo $url_MIK?>
<option value=4><?echo $url_TMS?>
<option value=5><?echo $url_GMAN?>
<option value=6><?echo $url_ES?>
<option value=7><?echo $url_AAESEC?>
</option></select>
<?/*
if ($url_CAE ==1) {
$mailto.=$url_CAE;
}
if ($url_TAT ==1) {
$mailto.=$url_TAT;
}
if ($url_MIK ==1)
{
$mailto.=$url_MIK;
}
if ($url_TMS ==1) {
$mailto.=$url_TMS;
}
if ($url_GMAN ==1) {
$mailto.=$url_GMAN;
}
if ($url_ES ==1) {
$mailto.=$url_ES;
}
if ($url_AAESEC ==1) {
$mailto.=$url_AAESEC;
}
*/?>
<input type="HIDDEN" name='mailto' value="( Cant get this to work $MAILTO) " >
</tr></td>
<tr>
<td>
<center>
<b>Message:</b>
</center>
</td>
<td>
<textarea name="mailbody" cols="40" rows="10">
<?
$file = ("resulta.xml");
$openfile = fopen ($file, "r") or die ("error: $file");
while(!feof ($openfile))
{
$xml_out = fgets($openfile, 2);
echo "$xml_out";
}
?>
</textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="hidden" name="Submit" value="Send it">
</div>
</td>
</tr>
</table>
</form>
<p></p>
</body>
</html>Code: Select all
// SMAIL.PHP
<?php
if (empty($mailto)) {
die ("¿ Correo ?");
}
if (empty($mailsubject))
{
die ("Pongo el Dato de hoy dia por favor..");
}
if (empty($mailbody))
{
die ("llama con el TMS de mas rapido.. ");
}
$mailsubject = date("FdY");
$result = mail($mailto, $mailsubject, $mailbody);
if ($result)
{
echo "<center>XML Enviar!</center></h1>";
}
else
{
echo "<h1><center>No se peudo mandar el XML contacto el administrador de mas rapido..</center></h1>";
}
?>
<?php
echo ("$mailsubject<br>");
echo ("$mailbody");
?>