single_fixed.php

musicx

Member
And before when I tried to use the sub-fixed.php on my site - there was other code that popped up - that wasn't in the demo - can you tell what that is - and do I need it or can it be removed. 8)
 

musicx

Member
There is a error code in the source - this doesn't seem to be correct - I can't test the sub/unsub - when I try it opens my email to send me a message - if I get to the point where I can submit the sub request - a window pops up with the source code - I don't get the window saying that your request has received succesfully.

Can you Help?
 

stanbusk

Administrator
Staff member
The place where you have data entry is called a form. Your form code actually starts with:

<form id="www.soundinproductions.com" action="subscribe_single_fixed.php" method="get" name="www.soundinproductions.com">

This is wrong. Its should be:

<form id="www.soundinproductions.com" action="www.soundinproductions.com" method="get" name="www.soundinproductions.com">
 

musicx

Member
Stan I made the changes - now i'm a error stating that my URL is not on the server. Can you help with this before you leave today?
 

musicx

Member
I'm using the code form that you mentioned in the previous reply - I'm using my url - www.soundinproductions.com.

I've seen 2 code sources for the mailing list - which one should I use and what changes should be made if any:

Code Source 1.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>Mailing List Subscription</title>
<style type=text/css>
A:link { color: #396D84; font-weight: normal; text-decoration: underline }
A {
CURSOR: hand; TEXT-DECORATION: none
}
A:visited { color: #396D84; font-weight: normal; text-decoration: underline }
A:active { color: #86B82D; text-decoration: underline }
A:hover { color: #86B82D; font-weight: normal; text-decoration: underline }

input[type="text"], input[type="password"], textarea {font-weight: bold;}
select:focus, textarea:focus, input:focus {background-color: #ffffee;}
</style>
</head>

<body>
<div align="center">
<br />
<br />
<table width="500" border="0" cellspacing="2" cellpadding="0">
<tr bgcolor="#0059a5" height="22">
<td height="22">
<div align="center">
<font color="white" face="Verdana, Arial, Helvetica, sans-serif"><b>Mailing List Subscription</b></font></div>
</td>
</tr>
<tr bgcolor="white" height="16">
<td height="16"></td>
</tr>
<tr>
<td>
<div align="center">
<form id="FormName" action="subscribe_single_fixed.php" method="get" name="FormName">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-1" color="#0059a5" face="Verdana"><b>Your E-mail Address</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="email" size="30" value="" /></td>
<td height="24"><font size="-2" color="#ff9c9c" face="Geneva,Arial,Helvetica,sans-serif">Required</font></td>
</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-1" color="#0059a5" face="Verdana"><b>Your First Name</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="firstname" size="30" value="" /></td>
<td height="24"><font size="-2" color="#ff9c9c" face="Geneva,Arial,Helvetica,sans-serif">Required</font></td>
</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-1" color="#0059a5" face="Verdana"><b>Your Last Name</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="lastname" size="30" value="" /></td>
<td height="24"><font size="-2" color="#ff9c9c" face="Geneva,Arial,Helvetica,sans-serif">Required</font></td>
</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<input type="hidden" name="list" value="list1" /></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="radio" name="cmd" value="subscribe" checked="checked" /><font size="2" face="Arial"> Subscribe <input type="radio" name="cmd" value="unsubscribe" /> Unsubscribe</font></td>
<td height="24"></td>
</tr>
<tr height="20">
<td colspan="3" valign="top" height="20"></td>
<td valign="top" height="20"></td>
</tr>
<tr>
<td width="40%">
<div align="center"></div>
</td>
<td width="15"></td>
<td>
<div align="right">
<font size="-1" face="Verdana"><b><input type="submit" name="submit" value="Submit" /> <input type="reset" value="Clear Form" /></b></font></div>
</td>
<td></td>
</tr>
</table>
</form>
</div>
</td>
</tr>
<tr height="10">
<td height="10">
<div align="center">
</div>
</td>
</tr>
<tr bgcolor="white">
<td>
<div align="center">
<hr />
<font size="-2" color="#636363" face="Verdana, Arial, Helvetica, sans-serif">Maxprog List Manager v1.0 - <a href="http://www.maxprog.com/">Max Programming, LLC</a> - Copyright (c) 2008 - 2009</font></div>
</td>
</tr>
</table>
<br />
<br />
</div>
</body>

</html>

Code Source 2.

<?php

if ( isset( $_REQUEST['cmd'] ) && !empty( $_REQUEST['cmd'] ) ) { $cmd = $_REQUEST['cmd']; }
if ( isset( $_REQUEST['email'] ) && !empty( $_REQUEST['email'] ) ) { $email = $_REQUEST['email']; }
if ( isset( $_REQUEST['list'] ) && !empty( $_REQUEST['list'] ) ) { $list = $_REQUEST['list']; }
if ( isset( $_REQUEST['firstname'] ) && !empty( $_REQUEST['firstname'] ) ) { $firstname = $_REQUEST['firstname']; }
if ( isset( $_REQUEST['lastname'] ) && !empty( $_REQUEST['lastname'] ) ) { $lastname = $_REQUEST['lastname']; }

if ( isset( $_REQUEST['submit'] ) ) {
$errors = array();
if ( $email == "" ) { $errors[] = "Enter your email address in the email address text box"; $wrong['email'] = TRUE; }
if ( $email !== "" && ( stristr( $email, "." ) == FALSE || stristr( $email, "@" ) == FALSE ) ) { $errors[] = "The e-mail address you have entered is not valid"; $wrong['email'] = TRUE; }
if ( $firstname == "" ) { $errors[] = "Enter your fist name in the fist name text box"; $wrong['firstname'] = TRUE; }
if ( $lastname == "" ) { $errors[] = "Enter your last name in the last name text box"; $wrong['lastname'] = TRUE; }

if ( count( $errors ) == 0 ) {
$url = "../mlm.php";
$url .= "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname";
header("Location: $url");
}
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>Mailing List Subscription</title>
<style type=text/css>
A:link { color: #396D84; font-weight: normal; text-decoration: underline }
A {
CURSOR: hand; TEXT-DECORATION: none
}
A:visited { color: #396D84; font-weight: normal; text-decoration: underline }
A:active { color: #86B82D; text-decoration: underline }
A:hover { color: #86B82D; font-weight: normal; text-decoration: underline }

input[type="text"], input[type="password"], textarea {font-weight: bold;}
select:focus, textarea:focus, input:focus {background-color: #ffffee;}
</style>
</head>

<body>
<div align="center">
<br />
<br />
<table width="500" border="0" cellspacing="2" cellpadding="0">
<tr bgcolor="#0059a5" height="22">
<td height="22">
<div align="center">
<font color="white" face="Verdana, Arial, Helvetica, sans-serif"><b>Mailing List Subscription</b></font></div>
</td>
</tr>
<tr bgcolor="white" height="16">
<td height="16"></td>
</tr>
<tr>
<td>
<div align="center">
<form id="www.soundinproductions.com" action="www.soundinproductions.com" method="get" name="www.soundinproductions.com">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-1" color="#0059a5" face="Verdana"><b>Your E-mail Address</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="email" size="30" <?php echo " value=\"$email\""; ?> /></td>
<td height="24"><font size="-2" color="#ff9c9c" face="Geneva,Arial,Helvetica,sans-serif">Required</font></td>
</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-1" color="#0059a5" face="Verdana"><b>Your First Name</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="firstname" size="30" <?php echo " value=\"$firstname\""; ?> /></td>
<td height="24"><font size="-2" color="#ff9c9c" face="Geneva,Arial,Helvetica,sans-serif">Required</font></td>
</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<font size="-1" color="#0059a5" face="Verdana"><b>Your Last Name</b></font></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="text" name="lastname" size="30" <?php echo " value=\"$lastname\""; ?> /></td>
<td height="24"><font size="-2" color="#ff9c9c" face="Geneva,Arial,Helvetica,sans-serif">Required</font></td>
</tr>
<tr height="24">
<td width="40%" height="24">
<div align="right">
<input type="hidden" name="list" value="list1" /></div>
</td>
<td width="15" height="24"></td>
<td height="24"><input type="radio" name="cmd" value="subscribe" <?php if ( $cmd == "" || $cmd == "subscribe" ) { echo "checked=\"checked\""; } ?> /><font size="2" face="Arial"> Subscribe <input type="radio" name="cmd" value="unsubscribe" <?php if ( $cmd == "unsubscribe" ) { echo "checked=\"checked\""; } ?> /> Unsubscribe</font></td>
<td height="24"></td>
</tr>
<tr height="20">
<td colspan="3" valign="top" height="20"></td>
<td valign="top" height="20"></td>
</tr>
<tr>
<td width="40%">
<div align="center"></div>
</td>
<td width="15"></td>
<td>
<div align="right">
<font size="-1" face="Verdana"><b><input type="submit" name="submit" value="Submit" /> <input type="reset" value="Clear Form" /></b></font></div>
</td>
<td></td>
</tr>
</table>
</form>
</div>
</td>
</tr>
<tr height="10">
<td height="10">
<div align="center">
<?php

// --- ERROR CHECKING ---

if ( isset( $_REQUEST['submit'] ) ) {
if ( count( $errors ) > 0) {
echo "<table width=\"500\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\">";
echo "<tr bgcolor=\"#ff0000\" height=\"22\">";
echo "<td height=\"22\">";
echo "<div align=\"center\">";
echo "<font color=\"white\" face=\"Verdana, Arial, Helvetica, sans-serif\"><b>Sorry but we can't process your request</b></font></div>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<font size=\"-1\" color=\"red\" face=\"Verdana, Arial, Helvetica, sans-serif\"\>";
echo "<b/>Please fix the following issues</b/><br />";
for($i=0; $i<count($errors); $i++){
echo $errors[$i]."<br />";
}
} else if ( count( $successes ) > 0) {
echo "<font color=\"blue\" face=\"Verdana, Arial, Helvetica, sans-serif\"\>";
echo "<b/>Your request has been processed successfully:</b/><br />";
for($i=0; $i<count($successes); $i++){
echo $successes[$i]."<br />";
}
}
}

?></div>
</td>
</tr>
<tr bgcolor="white">
<td>
<div align="center">
<hr />
<font size="-2" color="#636363" face="Verdana, Arial, Helvetica, sans-serif">Maxprog List Manager v1.0 - <a href="http://www.maxprog.com/">Max Programming, LLC</a> - Copyright (c) 2008 - 2009</font></div>
</td>
</tr>
</table>
<br />
<br />
</div>
</body>

</html>
 

stanbusk

Administrator
Staff member
What is the index page on your site? Is it 'http://www.soundinproductions.com/index.html'? If so it is the URL you have to use in the forma to call the script.
 

stanbusk

Administrator
Staff member
Use the page you were already using. The form ope tag should be:

<form id="FormName" action="http://www.soundinproductions.com/index.php" method="get" name="FormName">

As you can see you have to rename your file 'index.php'.
 

musicx

Member
Stan - copied & pasted the previous code you sent me.

Do have to change/place a file/folder name index.php in my webdocs, also?

And do I have to change my index.html to index.php in my website pages in golive?
 

stanbusk

Administrator
Staff member
You have to change your web index page to 'index.php'. It is the only way to make it work actually.
 

musicx

Member
I changed the index page to index.php - when I tried to preview it - the source page popped up - not the web page - also, when I tried to upload it couldn't do it - do I need to add this into the webdocs - to allow action to take place. If I do what do I name the file/folder? :(
 

stanbusk

Administrator
Staff member
Not sure I understand your question. Use a FTP software and rename the file to 'index.php'. That's all. It is the just a matter of changing the file extension.
 

musicx

Member
I tested the List Sub thur IE & Safari - and I received this error message:

Site error: the file /netapp/whnas-apricot/s0/s0/00086/www.soundinproductions.com/webdocs/mysql.cls.php requires the ionCube PHP Loader ioncube_loader_sun_5.0.so to be installed by the site administrator.

What does this mean?
 

stanbusk

Administrator
Staff member
The best is to contact the site admin and ask what that message means. It looks like the site lacks something.
 
Top