logs archiveIRC Archive / Freenode / #php / 2015 / November / 20 / 1
Guest27576
Shoosh Alphos
Alphos
again, zingers, late, no obligation...
besides, getting renamed by services kinda made the whole thing painful, dinnit ?
Guest27576
Alphos, just stop
Alphos
please tell me you waited that long on purpose
Guest27576
Do you do anything other than wait for irc msg's ? Because I do
Alphos
i noticed
Bad_Advice_Cat
(Action) slaps Guest27576 with a stop sign!!
Guest27576
(Action) roundhouses Bad_Advice_Cat back into the alley
bango2
(Action) drives right though intersection, dies
         

fyn
What's the appropriate way for me to get debugging feedback for PHP? What I'd use print / cout in most other langauges
is it just error_log()?
ppalmieri
print_r / var_dump ... but preferably look into xdebug
NiLon
for simple stuff var_dump works great but for more complex stuff logging / debugger is also nice
fyn
thanks!
Bad_Advice_Cat
fyn, !+why not print_r
php-bot
fyn, print_r() is a very poor way of knowing what a variable actually holds. print_r( json_decode( '[null,"\u0000\u0000\u0000","0","a\u0000\u0012bc\u0008d",0,{"b":""}]', true) ) will for instance not tell you there are LOTS of non-printing chars, won't make the difference between null and an empty string or an integer and its string representation. var_dump() will : use var_dump().
Bad_Advice_Cat
http://www.commitstrip.com/en/2015/07/15/a-brief-history-of-flash/ <--- loool
NiLon
let me guess: exploits everywhere
SmashingX
when I get a value with DBTransact like this: $example = DBTransact(defaultDB(),"SELECT table from field where id = $ID");
and I try to get its value it says that I have 1
in every case
it's suppose to be an array but I try to do $example[0] and I don't get anything
how can I get its value?
sorabji
what is DBTransact?
SmashingX
It says this: VALUE:=>ARRAY:
[0][example]=> '23.00'
but when I use it like $example I get 1
or $example[0] I get NULL
or $example["example"] I get NULL too
sorabji
consider looking at the docs for whoever procided DBTransact
droid909
i have a problem
i don't wanna code a certain task
i hate it
how can i start loving it?
asterismo
hi ppl
i'm trying to run phpmailer
and i'm getting this error
https://paste.debian.net/334050/
droid909
and i'm serious
nobody had this problem?
fyn
print_r goes to the page though
ppalmieri, NiLon: shouldn't I be printing to some access log?
NiLon
fyn not maybe access log but take a look into monolog
Sorunome
droid909: i usually just push myself to do it and then i'm happy once i managed to do it, well, yeah, just push yourself to do it, see it as your homework :p
droid909
Sorunome: thank you, i'll try
asterismo
         

Sorunome
i have no idea, sorry, i've only used php's mail() function and it never failed for me yet, so yeah
Bad_Advice_Cat
(Action) pokes Sorunome with swiftmailer -__-
Sorunome
but if mail() works? :P
Fenaer
Hey, am I missing a semicolon or something? This isn't running http://pastebin.com/5p798na3
Bad_Advice_Cat
Sorunome, works nice for spammers too ;)(
;)
Fenaer
The $f3 function calls are in __construct actually, my bad. But same error on line 7 regardless
Sorunome
Fenaer: can't do such function calls there in your class
private $db;
and then in your contructor
Fenaer
Alright
Sorunome
$this->db = new DB\SQL blahblabhalh
same with the other private things there
outside of the controctor you can only set static stuff
Bad_Advice_Cat: i fail to see how that has to do with it, it doesn't matter which mailing method you use, you have to secuire it behind some logic so that it won't be abused.
Fenaer
Sorunome, Ah ok
Sorunome
also Fenaer in $user and $recipe you use $db, but i bet you mean $this->db ;)
Guest27576
Hey cutie pie
Bad_Advice_Cat
Fenaer, you can not just instantiate using properties like that.
Sorunome
also your constructor is missing a global $f3 if you mean the $f3 you defined outside of the class
Bad_Advice_Cat
Fenaer, in face. That entire code is wrong. It will result in parse errors.
NiLon
Fenaer it's good idea to start using autoloader or so and remove requires/includes from class files
Bad_Advice_Cat
Exactly like NiLon said.
asterismo
Sorunome: can you help me with mail() function then?
Bad_Advice_Cat
Fenaer, I would just rewrite that. that code will NOT run.
Sorunome
asterismo: it worked out-of-the-box for me, sorry :P
asterismo: mail($reciever_email,$subject,$message);
Fenaer
Bad_Advice_Cat, Yeah I am now
NiLon
Fenaer right now your class is more like a namespace than a class, maybe you are bit confused about the difference?
Sorunome
Bad_Advice_Cat
asterismo, don't use mail() - Mainly for security reasons. Are you aware of how that stuff works under the hood? There are libraries that you can use that fixes the problems with using mail()
fyn
How do I decode a string like 아 to utf8?
NiLon
Fenaer http://pastebin.com/xuZ1LV5y that would make more sense :p
Sorunome
Bad_Advice_Cat: which security reasons? It should be fine as long as you have it behind logic that doesn't open it to anybody to send email, of cource, but that's the same with any other code that sends email.
Bad_Advice_Cat
asterismo, here is an example. http://swiftmailer.org/
Sorunome
fyn: html_entity_decode()
fyn
Sorunome: thanks, I tried, but it seems to leave the string unmodified.
print_r(html_entity_decode($_POST['message'])); seems to still return the exact same 아 entities
Bad_Advice_Cat
Sorunome, proper escaping is required. Do you know exactly what his/her code looks like?
asterismo
Bad_Advice_Cat: but nothing works, so i'm trying phpmailer
mail()
everyone say to me to install he-favourite-mail-thingie
i'm trying phpmailer
tried mail() with no success
Bad_Advice_Cat
asterismo, you're not going to get support here without even showing your code attempt.
asterismo
ok, i will post both codes, the mail() and phpmailer one
just a sec
Bad_Advice_Cat
asterismo, you did not mention if a message appeared in mail()
!+doesn't work
php-bot
"doesn't work" or "not working" is not a useful metric to debug or solve your problem. More information is needed to address the issue you are experiencing. For example, start by: providing the code in question; describing what you expect the code to do; what it's doing that you didn't expect; and include all error information relevant to your issue (see error reporting) in a pastebin.
Sorunome
fyn: is that entity even valid? I thought with the &# syntax required an even number of hex, you have an odd one htere
but i might be wrong
asterismo
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 next »