Re: [Mailman-Users] Syntax question using the Web Interface with PHP

2016-05-17 Thread Mark Sapiro
On 05/16/2016 12:55 PM, Terence Ronalds via Mailman-Users wrote:
> I'm trying to use the Web Interface from a PHP page and I have a problem when 
> trying to add a person to a list. I can get it to work fine if I just add an 
> email address to the list, however I can't figure out the syntax needed to 
> also include their real name. Here's what I have that works so far:
>  $name='Adam B. Tester';
> $email=a...@somewhere.com';
> $sub_url = 
> "http://lists..com/admin.cgi/members-.com/members/add?subscribe_or_invite=0_welcome_msg_to_this_batch=0_to_list_owner=0=_upload=;;
> $content=file_get_contents($sub_url . $email );
> echo $content;?>


There are a few issues in the above. Some, like the missing ' in
$email=a...@somewhere.com'; and members-.com instead of
members_.com in the cPanel list name, I will assume are just typos
introduced when you tried to make a redacted version of a working
script, but for the rest, I don't know what you tried, so I don't know
why it didn't work, but I would use 'subscribees' rather than
'subscribees_upload'[1], and the syntax you need for the name/address is
described at .

Also since your real name has a period in it, it needs to be quoted as

$name='"Adam B. Tester"';

Then you can do something like

$content=file_get_contents($sub_url . "$name <" . $email . ">");

I didn't actually try this, so you may find you need to do something like

$content=file_get_contents($sub_url . urlencode("$name <" . $email . ">"));

[1] I didn't write the FAQ at , but I
have just edited it to change subscribees_upload to subscribees and to
add a pointer to .

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


[Mailman-Users] Syntax question using the Web Interface with PHP

2016-05-17 Thread Terence Ronalds via Mailman-Users
I'm trying to use the Web Interface from a PHP page and I have a problem when 
trying to add a person to a list. I can get it to work fine if I just add an 
email address to the list, however I can't figure out the syntax needed to also 
include their real name. Here's what I have that works so far:
http://lists..com/admin.cgi/members-.com/members/add?subscribe_or_invite=0_welcome_msg_to_this_batch=0_to_list_owner=0=_upload=;;
$content=file_get_contents($sub_url . $email );
echo $content;?>
The page at https://wiki.list.org/DOC/Additional%20web%20administration%20tools 
doesn't explain well enough how to use the _realname parameter to get the 
person's name included in the transaction. Can anyone please show me how to 
change the above coding to do this?
Thanks!
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org