PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Oct 16, 2019 7:45 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Fri Feb 02, 2007 7:27 am 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
magic_quotes still confuses me at times. It's a "feature" PHP has which adds \ characters before things like " and ' and and \. It causes more of a nuisance than a helping hand so it's being dropped in future releases of PHP. Not only does it cause a problem, there are 3 variations of it: "gpc", "runtime" and "sybase".

You're right in that I'm the main developer. I'm actually the sole developer as of now. I'm hoping to open up the project on SourceForge to new developers once the new version settles in.

Glad you got it working anyway :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 3:39 pm 
Offline
Forum Newbie

Joined: Thu Feb 01, 2007 9:17 am
Posts: 15


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 4:58 pm 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
Note that version 3 include a (simple) Address object:

Syntax: [ Download ] [ Hide ]
$sender = new Swift_Address("Foo@bar.com", "Mickey Jones");


It's completely optional, but if you don't use it, Swift will parse the string form of the address and produce an address object anyway.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 1:19 pm 
Offline
Forum Newbie

Joined: Mon Feb 12, 2007 1:08 pm
Posts: 4


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 4:09 pm 
Offline
DevNet Resident

Joined: Thu Mar 10, 2005 6:27 pm
Posts: 1027
Location: Southern Ontario
Your code is expecting to be on. Apparently your server has it off (as it should, as it poses a fairly large security risk).

The correct way to access GET and POST variables is to use $_GET and $_POST.

Syntax: [ Download ] [ Hide ]
if ($_POST['recip'] == 'fish') { //...and so on (assuming your form uses POST)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 5:33 pm 
Offline
Forum Newbie

Joined: Mon Feb 12, 2007 1:08 pm
Posts: 4
nickvd,

Many thanks.. works perfectly.

Regards,

Lunarman


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 13, 2007 6:22 am 
Offline
Forum Newbie

Joined: Mon Feb 12, 2007 1:08 pm
Posts: 4


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 13, 2007 6:41 am 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
The regexp will accept "g" or "foo" or "bar" etc as valid email addresses. Internal mailing software often uses "local addresses" in this form.

If you'd rather not allow that, just take out the trailing "?" in $email_re

Syntax: [ Download ] [ Hide ]
$email_re = '(?#Start of dot-atom

                )[-!#\$%&\'\*\+\/=\?\^_`{}\|~0-9A-Za-z]+(?:\.[-!#\$%&\'\*\+\/=\?\^_`{}\|~0-9A-Za-z]+)*(?#

                End of dot-atom)(?:@(?#Start of domain)[-0-9A-Za-z]+(?:\.[-0-9A-Za-z]+)*(?#End of domain))'
;


PS: When posting PHP code in the forums please use [php ] [/php ] tags not [code ] [/code ] ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 13, 2007 6:51 am 
Offline
Forum Newbie

Joined: Mon Feb 12, 2007 1:08 pm
Posts: 4


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 6:48 pm 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
FYI, here's the version 3 form-to-mail tutorial:

http://www.swiftmailer.org/wikidocs/v3/form2mail


Top
 Profile  
 
 Post subject: Checkboxes (in v2)
PostPosted: Tue Mar 27, 2007 8:01 am 
Offline
Forum Newbie

Joined: Thu Feb 01, 2007 9:17 am
Posts: 15


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 8:32 am 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
$_POST["marketsource"] will be an array (that's what the [] are for in the form). implode() it:

Syntax: [ Download ] [ Hide ]
$marketsource = implode(", ", $_POST["marketsource"]);


EDIT | PS, please start using [php ] [/ php] tags rather than [code ] [/ code] tags when posting PHP code :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 6:33 am 
Offline
Forum Newbie

Joined: Thu Feb 01, 2007 9:17 am
Posts: 15


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 7:08 am 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
What does:

Syntax: [ Download ] [ Hide ]
var_dump($_POST["marketsource"]);


Show?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 7:19 am 
Offline
Forum Newbie

Joined: Thu Feb 01, 2007 9:17 am
Posts: 15
Thanks for the diagnostic command. It shows
Syntax: [ Download ] [ Hide ]
string(5) "Array"


UPDATE
Should I be doing this?
Syntax: [ Download ] [ Hide ]
$marketsource = array();

$marketsource = implode(", ", $_POST["marketsource"]);

Does that somehow clarify it's an array before imploding it? I'm just Googling and reading similar-but-different problems.

UPDATE to the UPDATE
Well, so far, that was my only guess after reading various other forums and such. Unfortunately, that solution doesn't do anything.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group