Putting Web Collected Data into Opt Fields at subscribe time

earwicker

New Member
I would like to be able to collect data from list subscribers directly at signup time and have it be put directly into the list file (Opt1, Opt2, etc).
I found a forum post on adding Company data to the collection script and was able to successfully do that in my script.
I would like to be able to add the Date, a Source word identifying the List collection source, and data from three check boxes to the OPt fields. I have set the preferences in MLM to rename the fields and set their data type.
I have been trying to add the checkbox data to the form by the same method used to add the company data, but don't seem to be having much success. Nothing seems to show up in the Opt fields, whether I give them a name like "Opt3" or "Retail" (what i renamed Opt3 to).
Can you give me any advice on how to proceed with this, or let me know if it's not possible?
While I'm waiting for an answer, I'm going to try to do a Date field and the Source field.
My current test script is at http://www.wingedseed.com/Scripts/lm/html/Newsletter4.php
 

stanbusk

Administrator
Staff member
Re: Putting Web Collected Data into Opt Fields at subscribe

The field names have to be Opt1 to Opt20. In 'PARAMATER CHECKING' you have to add:
Code:
if ( isset( $_REQUEST['opt1'] ) && !empty( $_REQUEST['opt1'] ) ) { $opt1 = $_REQUEST['opt1']; }
if ( isset( $_REQUEST['opt2'] ) && !empty( $_REQUEST['opt2'] ) ) { $opt2 = $_REQUEST['opt2']; }
...etc...
Then you have to add those parameters to the MLM URL in 'PARAMETER CHECKER & ERROR HANDING':
Code:
$url = $lm_path . "?cmd=$cmd&list=$list&email=$email&firstname=$firstname&lastname=$lastname&opt1=$opt1&opt2=$opt2";
Then add the field to the form using the same names.
 

earwicker

New Member
Re: Putting Web Collected Data into Opt Fields at subscribe

Thanks. I've done that; added the fields you suggested and changed all my filed names to Optx. Still doesn't seem to be working. I will recheck my code.
In the meantime, however, I noticed that data I manually entered into the list after download was not there this morning,and that I probably needed to upload the local changes back to the remote list. When I tried to do that (with a replace) for my test list (that has 9 records) I got an Error 400 (bad request) and the correct path for the remote lm.php file.
I had previously added a php.ini file and an .htaccess as suggested in the troubleshooting section.
I can't remember how my test files got uploaded previously, as that was in February when I was trying to get this going the first time (I'm now up against a deadline--I have to get this operatoinal soon or I will have to switch to Constant Comment or one of those pay-per-message systems. I think they were uploaded before I got my mySQL installation working.
 

stanbusk

Administrator
Staff member
Re: Putting Web Collected Data into Opt Fields at subscribe

What version of MLM are you using right now? I recommend you to use very last v3.0.7. It is available here.
 

earwicker

New Member
Re: Putting Web Collected Data into Opt Fields at subscribe

OK, I was on 3.0.6 and have upgraded to 3.0.7. It doesn't seem to solve the problem--I'm still getting the Error 400.
I've got the rest of my problems solved and am able to add data from the checkboxes and stuff to the test file.
I have two further issues: 1. I have a Dreamweaver template for my emails. The current version has an unsubscribe link built into it so it will send an email through the user's email system to get unsubscribed. This was the system that worked with my old email program. My procedure is to use the template to generate a web page that is posted on the website; then importing the page to MaxProg. Is there a way I can insert the [Unsubscribe] tag or the php equivalent into the template so it will allow one-click unsubscribe? (using the recipients email address).
2. My second issue is that my mail provider doesn't seem to like bulk mail being sent. They post a warning message on telenet and they slow stuff way down. I also have some Godaddy accounts, but they are limited to 250 per day. I used to be on Earthlink and that worked fine--apparently no limits.
 

stanbusk

Administrator
Staff member
Re: Putting Web Collected Data into Opt Fields at subscribe

1. I have a Dreamweaver template for my emails. The current version has an unsubscribe link built into it so it will send an email through the user's email system to get unsubscribed. This was the system that worked with my old email program. My procedure is to use the template to generate a web page that is posted on the website; then importing the page to MaxProg. Is there a way I can insert the [Unsubscribe] tag or the php equivalent into the template so it will allow one-click unsubscribe? (using the recipients email address).
Yes, just paste the [Unsubscribe] tag into your message.
2. My second issue is that my mail provider doesn't seem to like bulk mail being sent. They post a warning message on telenet and they slow stuff way down. I also have some Godaddy accounts, but they are limited to 250 per day. I used to be on Earthlink and that worked fine--apparently no limits.
No server likes bulk email and most of them will show you that warning. This is the default welcome message. There are however servers dedicated to bulk emailing like:

- Unified Email
- Authsmtp
- RealSender
- SMTP.com
- MailJet
- SendGrid
- Email Server Hosting
 

earwicker

New Member
Re: Putting Web Collected Data into Opt Fields at subscribe

[Unsubscribe] put after name of URL to import from web page puts base-ref of URL, then appends the script path, then appends the original unsubscribe mailto: URL in the web page. Obviously doesn't work.

I then replaced the mailto in the web page with [Unsubscribe]. This shows on the web as [Unsubscribe] but when imported into the MBM email it shows as a link in the email--but appends the script path to the Web page base-ref. So that doesn't work.

I haven't found where I can control the insertion of the base-ref from the imported web page.

Hmmm. Now that I'm looking at the source code or the link mouseover in the HTML version of the email, I't seeing script path and coding inserted into all links in the email.
Here is the link produced in the browser, which of course resolves to a blank page:

http://www.wingedseed.com/nl/www.winged ... test5.html. I think this is from the message with the [Unsubscribe] inserted after the Web Page URL.

What is going on?
 

stanbusk

Administrator
Staff member
Re: Putting Web Collected Data into Opt Fields at subscribe

Are you sure MLM is properly installed? Have you tried to log into MLM with your browser, add a list and a new subscriber to that list? Any error or weird behavior?
 

earwicker

New Member
Re: Putting Web Collected Data into Opt Fields at subscribe

MLM appears to be working fine. I did upgrade to the latest version per your question upthread, but I have tested it and it seems to be working correctly.
The problem appears to be with MBM. It appears to be inserting a call to the lm.php script into any link in the imported web page. I just did another test; removing the brackets from the [Unsubscribe] in my template and then upgrading the online web page (http://www.wingedseed.com/nl/test6.html. I then reimported that into a new MBM message and sent it out to my test list, freshly downloaded from the website after having a new address added by MLM. The message to be sent, in preview, shows an lm.php script call with a long code inserted into each link: ><a href="www.wingedseed.com/Scripts/lm/lm.php?tk=Um9iIFN0aXR0CQkJcm9ic3RpdHRAd2luZ2Vkc2VlZC5jb20JW0Fubl0gVGVzdGluZyBvZiBUZXN0NiB3aXRoIG5vIHVuc3Vic2NyaWJlIGJyYWNrZXRzCTcJVGVzdAkyCWNsaWNrCXllcwlubw==&url=http%3A%2F%2Fwww.wingedseed.com%2F" target="_blank">www.wingedseed.com</a>
The other links appear to have the same code inserted.
When received as an email it comes out with the base href inserted. There is no base href shown in the source code for the test6.html on the web, nor in the template. However, the Preview page in MBM clearly has <BASE HREF="http://www.wingedseed.com/nl/">
right after the <head> tag. That appears to be what is causing the scripts to run improperly. Any idea how it gets there? I do not have a base href in the images path!
 

earwicker

New Member
Re: Putting Web Collected Data into Opt Fields at subscribe

OK, I have come up with a fix for my problem. However, I think the actual problem is your problem, so you might want to figure out how to fix it so some other unsuspecting user doesn't get caught.

Apparently what is happening is that when you import a web page by putting the URL in the message box, MBM inserts a base href into the code at the beginning of the <head>. In my case that was http://www.wingedseed.com/nl/.
Then when it sends a call to the lm.php script it puts the base href ahead of the path to the lm.php script and thus nothing happens, since that is a broken path.

I first tried to put my base url in as the base href, but it still added that to the script call so it was still broken. Interestingly, when I put my own base href in, the base href for the original page wasn't inserted by MBM.

What I ended up doing was putting in a null base href (=""). This appears to solve the problem for me. The script calls now have "" appended at the start so they work OK.

I'm not sure I've solved my upload problem, but I'll start a new thread if that is still a problem.
 

stanbusk

Administrator
Staff member
Re: Putting Web Collected Data into Opt Fields at subscribe

The BASE HREF tag has an effect on relative URLs only. MLM should never be a relative URL but an absolute URL. What URL have you entered for MLM in the MaxBulk Mailer preferences?
 

earwicker

New Member
Re: Putting Web Collected Data into Opt Fields at subscribe

www.wingedseed.com/Scripts/lm/lm.php

Could the lack of http:// be affecting it?

And why is MBM sticking a base href statement for the path of the imported web page. (which it doesn't do if the imported web page has its own base href--instead it uses that one).
 

stanbusk

Administrator
Staff member
Re: Putting Web Collected Data into Opt Fields at subscribe

A URL with no 'http://' is not a URL, it is just a peace of text or depending on tags around it, a relative URL. The BASE HREF is there to make sure the relative URLs will be interpreted properly by the recipient mail reader. With no BASE HREF all the relative URLs will fail.
 
Top