logs archiveIRC Archive / Freenode / #php / 2015 / July / 14 / 1
retran
usually just get 500 "Thats an errtor"
danbower
netameta, you might find https://developers.google.com/apis-explorer/#p/translate/v2/ useful
let's you play with the end-points and gives the response and request
netameta
Thanks danbower, will look into farther, played with it a little before not too much though
phpNoob
Anyone got experience with phpmailer? I keep trying for hours to find out what causes "Could not instantiate mail function."
I think i nailed it down to class.phpmailer $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
As $rt is empty, i don't know how to debug this
Happy_the_Exceed
O__________________________________O
Amanej
Does anyone have a good example of php script of a button that uploads and store files in a mysql database ?
danbower
netameta, that's pretty much the crux of interacting with it. if your code doesn't work then match up the playgrounds request with the request your code generates
phpNoob
Amanej: why would you store files in a database?
Amanej: what you want is to store the files on the server in a folder
probably* ^
netameta
danbower, yap is what i am trying now
         

danbower
phpNoob, unfortunately i have experienced with phpmailer. every part of it awful
netameta
danbower, phpmailer aint that bad mate, swift is pretty nice though
swiftmailer*
phpNoob
Well any pointers on what i can do to debug it would be really useful as my frustration levels are getting to the max
danbower
well to be fair i haven't used its recent code base but i've had to deal with legacy phpmailer code on old sites :(
phpNoob
danbower: +++++ ^
laszlof
phpNoob
Amanej: what are you trying to do exactly?
danbower
phpNoob, does a simple php script with `<?php mail('foo@bar...)` work?
theskillwithin
var_dump($ASIN) outputs: object(SimpleXMLElement)#3 (1) { [0]=> string(10) "B002ZVVH5O"} how do I access 0?
phpNoob
danbower: good point
theskillwithin
$ASIN->{0}; ?
laszlof
try it
phpNoob
danbower: brb
Amanej
phpNoob: yes
netameta
laszlof, first off, i did not know that http_build_query is a function i built one my self :-). other then that its exactly waht i am doing
theskillwithin
yeah I tried that didnt work
laszlof
netameta: then your good. as long as you give something valid to google it wont throw an html page
properly encoded it should give you a nice json result to parse
thats an example of error so you can base your error messages on it
netameta
laszlof, i think that the fact that i gave google the none urlencoded string return the html page
laszlof
yup
most likely
Amanej
phpNoob: I am trying to upload files from a button on the frontpage, sort of a call-to-action. The thing is the file must be stored in a database or at least its info.
         

netameta
i will do 2 error tests, 1 will be curl http_code for anything different then 200, and inside check for google error
phpNoob
Amanej: i would store its info in the database, store the files in a folder
Amanej: there should be loads of articles/tutorials on it. Basic googling will help you out
danbower
Amanej, i would do what phpNoob said. file systems are for files after all :)
phpNoob
their info*
netameta
Amanej, Usually the follow is, you upload the file with multipart or ajax or whatever you want, to a certain folder, and you only save a link to it in the db
Amanej, a link or location or some indiaction on how to fatch it at later times
theskillwithin
ASIN->{1}->[0] ???
sorabji
theskillwithin2: consider using DOM instead of simple xml
theskillwithin2
ooo
will do
they should rename the notSoSimpleXml_load_string
reanme it to*
sorabji
yes, the simple is misleading
phpNoob
danbower: Amanej: does google SMTP require SSL cert?
as the phpmailer was set up to use php's mail function
And if yes, how should i handle this being on a dev env ?
Amanej
phpNoob: i dont know
danbower
phpNoob, did the simple `mail` call work?
jbc8
why are cachegrind file names written backwards?
phpNoob
sry Amanej i meant to say netameta
danbower
i don't know either but curious why you asked
phpNoob
danbower: working on it
jbc8
if you put ".cachegrind" as the extension the files can be opened with double-clicking
theskillwithin2
phpNoob
theskillwithin2: i'm sure you're popular in daily standups
theskillwithin2
daily? you mean nightly
danbower
phpNoob: what exactly are you trying to achieve? do you actually want phpmailer sending out emails in your dev environment?
phpNoob
would it be a bad idea?
orders on production are failing because of a problem with sending emails
theskillwithin2
Your momma's so fat, she needs preg_replace() just to make her fit in a page!
laszlof
what does that even mean
baako
hi guys, how can i stop this query http://kopy.io/0Vsav from return the same user_id. the post id is different which is one but i only need it to give me the first record it find for the user e.g. if a user made more than 1 post it should only return the first one. e.g. if __adrian|brb, laszlof and phpNoob were my users and they have all posted 100 something i ony 1 record for each of them meaning the total result should be 3
danbower
phpNoob, is this the same error that's occurring on the production server?
theskillwithin2
phpNoob
danbower: at this point i can't tell as i've fixed other things as well and haven't deployed it back
baako
but with that query above am i am getting more than 1 results for some users. i am using php and mysql db
phpNoob
danbower: there were no errors shown on production as reporting was turned off
danbower
what about the error log?
phpNoob
What error log
danbower
i don't know exactly what configures it but production can prevent errors being spat out into the browser but still output to a log file on the server
phpNoob
It was empty
jbc8
is there any better PHP profiler than win cache grind?
danbower
if you're on some virtual hosting like virtualmin it could be getting logged elsewhere
netameta
phpNoob, i missed your question what was it again ?
sorabji
baako: try asking in #mysql
phpNoob
enabling logging is on the "backlog" way back
danbower
it'd be mental to totally suppress errors on production
theskillwithin2
I am so fu*king tired, I could go to sleep right now
phpNoob
netameta: SMTP + google, do you require SSL cert ?
theskillwithin2
when I was a kid I used to email people from admin@cox.net
netameta
phpNoob, I am not sure, but i think you dont
phpNoob
Okay
danbower: brb :)
Happy_the_Exceed
theskillwithin2, it would be ideal if you sleep now. Don't want to make drowsy zombie-like accidents.
like derping and deleting everything. or changing a setting and can not remember it xD
theskillwithin2
what is this derping? I don't belive its in the CRUD model
I bring to you CRUD2 Create. Read. Update, Delete, Derp
theres always that little panick attack when you start typing rm -rf, just one star away from everything derping
bear`
Derp?
theskillwithin2
Yes Derp
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next »