08/04/2008, 12:04
|
| | Fecha de Ingreso: marzo-2008
Mensajes: 1.020
Antigüedad: 16 años, 8 meses Puntos: 21 | |
(Ayuda) Sacar partes del codigo para.. hola! quisiera que alguien me guie o ayude para dejar solo los campos:
*Nombre*Mail*Boton Suscribir*Eleccion HTML solamente*boton de opcion de seleccion de newsletters.
para q hacer esto?...pq quiero ponerlo en el index de mi sitio ya que sino es muy grande y ocupa gran parte en la pagina principal:
les dejo el codigo:
<?php
include('config.php');
IF (!isset($_REQUEST['lang']))
$_REQUEST['lang'] = $langdefault;
include("language/".$_REQUEST['lang'].".php");
include('header.php');
IF (!isset($_GET['caseid']) || $_GET['caseid'] == '' || $_GET['caseid'] != 'home' && $_GET['caseid'] != 'archive' && $_GET['caseid'] != 'unregister')
$_GET['caseid'] = 'home';
SWITCH ($_GET['caseid'])
{
CASE 'home':
IF (isset($_POST['form']) && isset($_POST['newsletter']))
{
echo " <TABLE Width=$maintablewidth Align=$maintablealign Border=0 Cellspacing=0 Cellpadding=2 Class=boxborder>
<TR>
<TD><BR>
<TABLE Border=0 Width=300 Cellspacing=0 Cellpadding=2 Align=Center Bgcolor=$background>
<TR>
<TD Class=boxborder><P>$text_name:</TD>
<TD Class=boxborder><P>";
IF ($_POST['name'] != '')
echo stripslashes($_POST['name'])."<BR></TD></TR>";
ELSE
{
echo "<FONT Color=Red>$text_errorname<BR></TD></TR>";
$error = true;
}
echo " <TR>
<TD Class=boxborder><P>$text_email:</TD>
<TD Class=boxborder><P>";
IF (ereg("^.+@.+\\..+$", $_POST['email']))
echo $_POST['email']."<BR></TD></TR>";
ELSE
{
echo "<FONT Color=Red>$text_erroremail<BR></TD></TR>";
$error = true;
}
echo ' </TABLE>
</TD>
</TR>
<TR>
<TD Height=10></TD>
</TR>
</TABLE>';
IF (!isset($error))
{
PageTitle("Newsletters Chosen.");
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=1 cellspacing=0 cellpadding=2 Bordercolor=#000000 Class=boxborder>
<TR Bgcolor=$background>
<TD><P>$text_newslettertitle</TD>
<TD><P>$text_newsletterdesc</TD>
<TD><P>$text_status</TD>
</TR>";
$numrows = count($_POST['newsletter']);
FOR ($i = 0; $i < $numrows; $i++)
{
$query = " SELECT tipnl_title, tipnl_description
FROM newsletters
WHERE tipnl_id = '".$_POST['newsletter'][$i]."'
AND tipnl_status = '1'";
$result = @mysql_query($query);
$row = @mysql_fetch_array($result);
extract($row);
echo " <TR>
<TD Valign=Top><P>".stripslashes($tipnl_title)."</TD>
<TD><P>".stripslashes($tipnl_description)."</TD>
<TD><P>";
$query1 = " SELECT tipnm_newsid, tipnm_email
FROM newslettermembers
WHERE tipnm_newsid = '".$_POST['newsletter'][$i]."'
AND tipnm_email = '".$_POST['email']."'";
$result1 = @mysql_query($query1);
IF (@mysql_num_rows($result1) > 0)
echo $text_statusmsgnosub;
ELSE
{
echo $text_statusmsgsub;
$query = " INSERT INTO newslettermembers (tipnm_id, tipnm_name, tipnm_email, tipnm_newsid, tipnm_mailpref)
VALUES ('', '".$_POST['name']."', '".$_POST['email']."', '".$_POST['newsletter'][$i]."', '".$_POST['mailpref']."')";
$result = @mysql_query($query);
$mail = "true";
}
echo " </TD>
</TR>";
}
IF (isset($mail) == 'true')
{
$ip = $_SERVER['REMOTE_ADDR'];
include ('class.phpmailer.php');
$mail = new phpmailer();
$mail->IsSMTP();
$mail->Host = $sockethost;
IF ($smtpauth == 'TRUE')
{
$mail->SMTPAuth = true;
$mail->Username = $smtpauthuser;
$mail->Password = $smtpauthpass;
}
$mail->From = $socketfrom;
$mail->FromName = $socketfromname;
$mail->AddReplyTo($socketreply, $socketreplyname);
$mail->IsHTML(False);
$mail->Subject = "Signup For $sitename Newsletters";
$mail->AddAddress($_POST['email'], stripslashes($_POST['name']));
$mail->Body = "
Signup Details\n
The details are as follows:\n
NAME: ".stripslashes($_POST['name'])."
EMAIL: ".$_POST['email']."\n
Gracias por subscribirte al boletin mensual de $sitename.
Si usted no se subscribio o no quiere recibir este boletin,
por favor valla a $siteurl to unsubscribe\n";
$mail->Send();
$mail->ClearAddresses();
IF ($adminmail == 'TRUE')
{
$mail->AddAddress($siteemail, $sitename);
$mail->Send();
}
$mail->ClearAddresses();
}
echo '</TABLE>';
}
ELSE
{
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=1 cellspacing=0 cellpadding=2 Bordercolor=black Class=boxborder>
<TR>
<TD Align=Center><BR>
<P>$text_errormsg.<BR>
<INPUT Type=Button Value=$textai_back onClick=history.back()><BR><BR>
</TD>
</TR>
</TABLE>";
}
echo ' </TD>
</TR>
</TABLE>';
}
ELSE
{
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<FORM Action=".$_SERVER['PHP_SELF']." Method=POST>
<TR>
<TD><BLOCKQUOTE>
<LI>$text_joinmessage<BR>
<LI>$text_unregistermessage<BR><BR>
</TD>
</TR>
</TABLE>";
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<TR>
<TD><BLOCKQUOTE><P>$text_name:</TD>
<TD><P><INPUT Name=name Size=30></TD>
<TD><P>$text_mailpref:</TD>
<TD Align=Right><P>$text_html:</TD>
<TD Align=Right><P><INPUT CHECKED Type=Radio Name=mailpref Value=html></TD>
</TR>
<TR>
<TD><BLOCKQUOTE><P>$text_email:</TD>
<TD Colspan=2><P><INPUT Name=email Size=30></TD>
<TD Align=Right><P>$text_plain:</TD>
<TD Align=Right><P><INPUT Type=Radio Name=mailpref Value=plain></TD>
</TR>
<TR>
<TD Height=10></TD>
</TR>
</TABLE>"; |