logs archiveIRC Archive / Freenode / #php / 2015 / November / 20 / 2
Alphos
Sorunome lolwut ?
fyn
Sorunome: yeah, the problem was that I'm on ancient PHP, and this is an Asian character
Sorunome
Alphos: else you set half of a byte, as two hex digits are a byte, but yeah, as i said, i might be wrong
Alphos
Sorunome again, lolwut ?
numbered entities are just &#<codepoint>;
there are plenty of chars that have an odd codepoint
Sorunome
also fyn var_dump(html_entity_decode('아')); decodes fine for me, using PHP version 5.6.15
asterismo
mail() https://paste.debian.net/334066/
Bad_Advice_Cat
Fenaer, your code would look something similar to this: http://dpaste.com/1EC9CY3
Sorunome
Bad_Advice_Cat: you mean instead of doSomethingInteresting() $this->db instead of $db, right?
Alphos
Sorunome http://codepad.org/Hzzm8okR for an example. chr(41) is the closing round bracket/closing paren in ASCII
and guess what : decoding ) gives a closing bracket
         

Sorunome
yes i know of that syntax Alphos, but then again, 41 are two digits, so a full byte, while 50500 are five digits so 2.5 bytes
that was my point
asterismo
Bad_Advice_Cat: the mail() code says "ail_success" but the mail is not coming out
Bad_Advice_Cat
Sorunome, yeah. It's $this->db->prepare(... ...);
Lol
asterismo
not reaching the destination
fyn
Sorunome: can I use named arguments in PHP 5?
Sorunome
asterismo: check your mail error logs
Alphos
>_>
fyn
Sorunome: I have to specify encoding in PHP 5.3 or it won't do anything
utf8_decode(html_entity_decode($_POST['message'], ENT_COMPAT | ENT_HTML401, 'UTF-8')
asterismo
Sorunome: i have nothing in /var/log/mail.err .info or .warn
Sorunome
asterismo: do you have an SMTP server running?
Bad_Advice_Cat
asterismo, might be a good chance the mail server is blocking spam. :p
Sorunome
or that
Bad_Advice_Cat
I forgot the terminology for it, but you need it
Sorunome
fyn: this might be stupid but in your text editor, did you set the encoding of your php source files to UTF-8? IDK if that would make a difference, though
asterismo
Sorunome: how to check that?
i have postfix i think
but postfix provides the sendmail right?
Sorunome
the mail you are trying to send.....is it from the same server you have php on?
*the webserver
or are you trying to send email via some remote SMTP server?
asterismo
the same server
fyn
General question: does PHP support named argument?
__adrian
fyn: no
Sorunome
asterismo: did you verify your mail setup with existing clients already? If not, do that first and then come back again
         

fyn
suppose I have a function foo with two default arguments, what's the best way to avoid overriding the first, default value?
jenni_lib
hello, Im having problems with mysql FOR UPDATE and LOCK IN SHARE MODE in a PHP loop. I end up with a number that is the same for all the objects updated in the loop but when I call it one at a time, it updates correctly, can anyone see what Im doing wrong?
asterismo
SupaYoshi: how to check if i have a mail server blocking that port?
fyn
is it foo(NULL, second_arg)?
__adrian
passing the same value as the default :)
asterismo
Sorunome: how to check if i have a mail server blocking that port?
__adrian
passing null will set the first arg to null.
Sorunome
what i sometimes do is pass NULL and inside the function check for NULL and if NULL set a default
jenni_lib
__adrian
fyn: is this a function you're writing? or an existing function
Sorunome
asterismo: what I am asking you to do is verify the functionality of your SMTP server before trying to send emails via PHP. Such help is out-of-scope for this channel, though.
asterismo
Sorunome: i understand that, but where can i ask for help in that matter?
Bad_Advice_Cat
asterismo, ah, that's right. It's this thing called SPF.
asterismo
SPF?
Sorunome
asterismo: try your favourite search engine?
__adrian
fyn: if it's a function you're writing, then you could set the default to null (as Sorunome described), or you could accept an associative array as a sole arg (thus simulating named args).
fyn
__adrian: existing - it's html_entity_decode()
thanks.
__adrian
fyn: if it's an existing function, then wrap it with your own function, and apply one of the above strategies :)
Sorunome
Bad_Advice_Cat: SPF and DKIM have nothing to do with being able to send emails at all, though ;)
Alphos
Sorunome https://3v4l.org/tnB9R from the hangul jamo block ( U+11Cx, that char is U+11C1, html dec ᇁ , html hex ᇁ , note that the html hex and the UTF-8 hex match, which is completely expected )
Bad_Advice_Cat
asterismo, sometimes, you need to test with more than one email address. Some services got aggressive anti spam set up (e.g. Hotmail email service.)
Sorunome
Alphos: does that mean your problem is solved?
Alphos
Sorunome i didn't have one to start with, but your theory that only even codepoints existed has been successfully debunked, imho
Bad_Advice_Cat
Sorunome, servers simply block without things like this set up. o_O
Fenaer
Ok, now I'm getting an error about a call on a non-object http://pastebin.com/0nfLPPNx
Sorunome
oh, ok, good to know for future stuff i guess, thanks Alphos ^.^
Alphos
Fenaer what line ?
Fenaer
Alphos, Not giving me one
Bad_Advice_Cat
It is possible that asterismo got a bad ip address (that ip is blacklisted, has a reputation of being responsible of sending spam mail/virus and etc)
Alphos
Fenaer sure it is
Fenaer
But it says function set() so I assume line 18
Alphos
Fenaer definitely possible
Fenaer
Alphos, ?
Alphos
Fenaer $f3 is not defined inside that ::__construct()
php.net/variables.scope
Sorunome
Fenaer: global $f3; at the beginning of your function
Alphos
Sorunome >_<
__adrian
Fenaer: NO GLOBALS
ingore that!!!
Alphos
Sorunome please allow me to debunk your theory once again
DON'T USE GLOBAL !!!
Bad_Advice_Cat
asterismo, it's not really your phpmailer code, it's beyond the scope of php and this channel. I would spend time enabling logs and such from SMTP, reading the manual and testing from various servers/using various emails if I were you. Also, looking up SPF for email.
Oh hell !+no
php-bot
Oh hell, no!
Bad_Advice_Cat
NO GLOBALS!
__adrian
Fenaer: if your object needs something in order to do its job (in this case, whatever $f3 is), that means it should be passed in as an arg.
Alphos
Fenaer you'll want to pass $f3 as a parameter to your ::__construct(). it's called "dependency injection", and it's the proper way to go, as it allows you to avoid monolithic code, thus making modularity easy
Fenaer
Ah alright, will do
Alphos
code reuse is a definite timesaver, and if you use global <whatever>, that goes down the drain
__adrian
HOWEVER, in this case, you have a constructor which is doing WAY TOO MUCH.
Bad_Advice_Cat
Fenaer, the reason for No globals is because you want to avoid the nasty "spooky action at a distance" problem, while testing and maintaining your code.
__adrian
costructors don't do business logic. they only **construct** the object
they make the object *ready for use*. they don't do anything more.
Bad_Advice_Cat
With this specific problem, it will make your live testing/upgrading/adding features to code annoying. The next person who maintains the code will have an AX, and he/she will know where you live, Fenaer.
Alphos
Sorunome we really don't mind you staying here, but we'd all rather you didn't spew misleading information. feel free to stay and learn a bit first, just the way i did a few years ago : you'll learn best practices, and get rid of your bad habits in the process :)
Bad_Advice_Cat
life*
__adrian
Sorunome: +1 to Alphos
Sorunome
Ok I'll try my best :)
__adrian
sounds good!
Alphos
Sorunome cheers :)
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 next »