logs archiveIRC Archive / Freenode / #php / 2015 / July / 2 / 1
learnhelp
Sorry , I'm going to use pastebin to explain better what do I mean
retran
good. because i eagerly await
learnhelp
http://pastebin.com/6mJZ2Fsv
In that link
delboy1978uk
put that class person in a separate file! then require_once(/path/to/class.php);
retran
the answer, yes.
hush, delboy
delboy1978uk
Person.php
retran
its an academic example
learnhelp
Sorry if I'm a little slow, I'm spanish, I need sometimes translate words that I don't understand
delboy1978uk
hush? :-P oh sorry i see
         

retran
np :p
learnhelp, the answer to your question is "Yes". and its the same thing i've been saying the whole time. You're implicitly creating a public property on your class Person
that's PHP's behavior
learnhelp
retran Ahhhh okkk
Then with the syntax: $this-> PropertyName = VALUE . I'm saying: I want to create a property with name:PropertyName , and I want that it get VALUE, Is it OK?
delboy1978uk
yes thats fine but get rid of the space, and either use camelCase or snake_case for the variable name, dont sart it with a capital
$this->property_name = hola amigo;
mchelen1
i used to like camel case, but for some reason i like snake case these days
delboy1978uk
me too
lol
mchelen1
maybe it's easier to read?
delboy1978uk
possibly
mchelen1
they both require using the shift key
delboy1978uk
but class names start with a CapitalLetterLikeThis
mchelen1
yeah that always kind of annoys me
learnhelp
delboy1978uk Ahhhh okkk, perfect
mchelen1
i think i just prefer lower case :D
(when i have the choice)
learnhelp
Thank you for your help :)
Dustin|Work
I never liked camelcase or all lower, I do $Var_Name = $Value; Blasphemy i know, but I find it more readable :P
monsterco
I am getting this error: PHP Notice: Undefined index: temp_name in /var/www/html/receive_file.php on line 15 when a POST FILE is made to me. Here is my code: http://pastebin.com/F8ZWNX9G
what is causing that?
delboy1978uk
learnhelp: you can also make properties private, and then make them accessible through a getter and setter http://codepad.viper-7.com/tTjLbi
monodesigns
monsterco: try $temp= $_FILES["attachment"]["tmp_name"];
monsterco
monodesigns - just an e less?
monodesigns
monsterco: yup
mchelen1
Dustin|Work: ah i am so accustomed to using the linux cli, where most everything is lowercase
         

monsterco
monodesigns - k no errors spit out but no file saved either
monodesigns
monsterco: well, you're one step closer.
learnhelp
The symbol: -> , Has it some functions? Because I see it for create a property: $this->name = $name; , and now for call to a method: $me->getName();
delboy1978uk
Dustin|Work
Yeah when I used linux explicitly I tended to use all lowercase to :)
monsterco
monodesigns
what am I missing to save the file?
mchelen1
good night all
monodesigns
monsterco: I'm not seeing anything in the code. What's the perms on the directory?
monsterco
uploaded/
oh
learnhelp
mchelen1 Good night
Jamesst20
Hi
monsterco
monodesigns - drwxr-xr-x
monodesigns
monsterco: try changing it to 775. That should work. I would hang around and help you through it, but it's quitting time.
monsterco
maybe file type issue? I am supposed to receive .tif but I have put image/tiff for file type
Jamesst20
I dont think it can be done in PHP, but I am taking a chance. I have few text field and one of them is for a URL. I would like once the URL is typed to fetch some informations from the url to fill some text field automatically
monsterco
thanks monodesigns
755 didn't help
where can I see the error? how can I turn on the debug?
Jamesst20
Anyone has some clues about my question?
retran
Jamesst, yes you can use PHP, but would have to be in conjunction with javascript
Jamesst20
retran: I don't know if it's possible, but can an even be thrown from JavaScript on url text changed and from JavaScript call from PHP code?
event*
Dustin|Work
^ Have Javascript keep an eye on the URL, when the field changes, use Javascript to send the url to PHP and then have PHP scrape the site for information
retran
monsterco, submit a pastie with output of the command "ls -Al" on the directory
Jamesst20
Dustin|Work: Can it call a PHP method or it has to be a GET/POST + page reload?
delboy1978uk
anyone using puphpet here right now?
retran
Jamesst, yes. that's a mundanely common thing to do with PHP
Dustin|Work
Depends on how you have the site setup, if you're using Ajax you can seemlessly run a php script from javascript and pass it some json information
Jamesst20
Dustin|Work: Sadly only using PHP + Html at the moment
delboy1978uk
^
Jamesst20
Dustin|Work: and Bootstrap with JQuery
retran
Jamesst, you would call PHP method indirectly through the HTTP interface using ajax method. also, you'd want to output it in an ajax friendly way.. like in JSON
Jamesst20
retran: Thanks you ! Will try to find some examples
delboy1978uk
bootstrap and jquery rock, if youre using that then youre sorted
monsterco
it's working - i guess i was impatient...
Jamesst20
delboy1978uk: How am I sorted? :)
retran
bootstrap is a big "meh". us back-end programmers like it. but designers hate it.
delboy1978uk
in the jquery document ready function you would say when the text box changes call this url. then in php on that url you find what you need and give it back in json
retran
bootstrap templates tend to uncessarily uses javascript based media queries
and the menus unecesarily use javascript
delboy1978uk
ive seen that in a few of them, yeah id agree with you on that
retran
bootstrap templates tend to be kinda... kludgy
but i love working with them on my side
Jamesst20
delboy1978uk: Right ! Just figured out I could also dynamically update my textfield from php without a reload x)
delboy1978uk
awesome :)
Jamesst20
frmo JavaScript*
retran
document.ready isn't needed anymore
just put wrap your closure like this $({...})
mentoc
no way really?
retran
yah, bro
mentoc
since when?
retran
couple years
mentoc
wow
delboy1978uk
when things happen asynchronously yes it is. you cant have js calling something that hasnt finished loading yet, so thats why that method is used
retran
no.. even when things happen "asynchronosly" it's not needed
delboy1978uk
(Action) checks jquery2 docs
retran
at any rate...aynchronous requests are an unrelated concept to why document.ready() was ever created/needed in jquery
delboy1978uk
retran
Dustin|Work
I've been using a lot of Javascript lately working on a little pokemon style game to get used to HTML5 and Canvas, but it uses PHP for the battle system, hehe
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 next »