logs archiveIRC Archive / Freenode / #php / 2006 / May / 22 / 1
Eleaf
I think I got that all figured out.
eIf
hello
Stormchaser
woof
foo
arpad: When you say one step afterwards, you mean in a foreach or something?
eIf
i would like to make a mail function that sends a socket to telnet 0 25 and uses this service for sending mail. can you help me with some more intel about this?
Stormchaser
eIf: Sure. Use phpmailer
eIf
Stormchaser what's phpmailer?
a pear module?
foo
google
:)
arpad
foo: no, like $file_list = preg_grep('/(?<!\.src)\.rpm$/i', $file_list);
         

foo
arpad: ahhh, thanks. I'll check that out.
eIf
but anyway, i would really love to use just a simple function, i'm sure i would manage to realise this with fsockopen
i just don't recall what commands should i use in order to send a message to a recepient from a sender, with a subject and a message
sloloem
Is there any simple thing to escape " and / characters in a variable?
janez
hi
why the MDB2 dont catch de values of the sql query? http://phpfi.com/119093
Stormchaser
!+pear
php-bot
[PEAR] PHP Extension and Application Repository, a framework and distribution system for reusable PHP components. ##PHP does not support PEAR, please see http://pear.php.net/support.php.
vinadelmar
who use pear anyway
sloloem
preg_quote is turning <img src="img/29.gif" alt="Smiley#29" /> into \Smiley#29
arpad
sloloem: use addcslashes() for that
sloloem
Hm
foo
arpad: So that regex basically says, "Return all elements that end in .rpm but do not end in .src.rpm." I think that's what it ends in... some of that regex is a tad out of my knowledge. hmm
sloloem
What if I want " in the charlist for addcslashes?
arpad
foo: right
sloloem
I need to escape it in the list?
arpad
sloloem: php.net/types.string
sloloem
Yes would've worked
foo
Can I do mysql_query("QUERY 1; QUERY2"); ?
Stormchaser
no
sloloem
How does this charlist work?
foo
Stormchaser: Thanks
         

sloloem
do I just put the characters right in a line or delimit them or what? Nothing's simple enough in the manual.
vinadelmar
Stormchaser, are you really sure about this ?
sloloem
Why are these functions stripping off half of my bloody string?
Stormchaser
vinadelmar: I am, documentation is, and developers are... Any more questions?
Alystair
http://byster.net/?page_id=48 <--- really cool function speed comparison thing
arpad
sloloem: if you're looking at it in a web browser it's probably being interpreted as html
sloloem
Just noticed that...preg_replace is still complaining about it though
vinadelmar
Stormchaser, yes one more : what is the meaning of life?
bullrage
42 *rolls eyes*
arpad
sloloem: oh i didn't realise you're putting it into preg_replace(), what's the whole line?
vinadelmar
there is no man pages for life :/
kuja
vinadelmar: Because you're not supposed to be alive to read them.
sloloem
Which line? I'm setting pattern in a var then calling preg_replace like $retval = preg_replace($pattern, $iconlink, $retval);
vinadelmar
that sucks :)
arpad
sloloem: but you're escaping the whole pattern?
sloloem
I'm escaping...I don't know
vinadelmar
well if you do not expect resource, i thought you could put more than one update statements in a row :/
sloloem
$pattern = "/" . addcslashes($happy,"\"<>") . "/";
bullrage
pah, i was told to shorten a string using an array yesterday, i could have done the same using substr
kuja
...
arpad
sloloem: why aren't you just using str_replace() ?
sloloem
Because I've yet to figure out what I'm doing
arpad
sloloem: forget preg_replace() unless you need regex
sloloem
Guess I don't need it at this stage, a straight match this time around...
harleyg
sloloem...
sloloem
dot dot dot?
harleyg
my code = http://www.mypastebin.com/?code=1798558244
sorry...
anyway
it works now when i use my 1st user in the table, harleyg
but if i try the 2nd or 3rd it doesnt
mmm? any ideas?
kuja
Stormchaser: Do you go by "Whitehawk Stormchaser?"
foo
Alright, I'm all about automation. If it can save me time, then let's do it. This is what I am thinking: A way to get form input into a database as easy as possible. How about having form elements with something in the format of name:tablename=thename ... where name = the name of the function, tablename=the name of the table, and thename= thename... or I could even do name=tablename, actually. Then I could have a foreach go through $_POST and add the variables wi
Stormchaser
kuja: yes
kuja
Stormchaser: Oh okay, was just browsing through the amaroK credits and thought that name might be yours.
harleyg
oh no wait.. it works now
seriously wtf :|
Stormchaser
kuja: :)
harleyg
ok no problems
Stormchaser
harleyg: Apparently the second username / password yeilds 0 results.
harleyg
not anymore :)
foo
Stormchaser: I'd like your input on something like that, as I see you very knowledgeable with this PHP stuff :)
Stormchaser
foo: ask kuja.
foo
(Action) looks over at kuja
sloloem
str_replace isn't complaining but it's not working either
Wait got it
lilkid
http://hashphp.org/pastebin?pid=6788 i get an error Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/drunknig/public_html/images/index.php on line 45
or should i ask in
a mysql channel?
foo
kuja: What do you think about something like that?
bubblenut
likid: Your query is failing, check that the query succeeded before attempting to traverse the result set.
sloloem
drunknig_images?
Stormchaser
foo: just ASK, dammit... Don't spend time and energy asking people if you can *ask* them :P
foo
Stormchaser: haha, I asked already :)
bubblenut
foo: If you're interested in the opinion of a mere mortal I'd say you probably want to be giving as little away about your internal architecture as possible. Also, where would the for commit to?
kuja
foo: Sorry, I just got back from a smoke.
lilkid
sloloem: yes? o.o
kuja
foo: Rephrase.
bubblenut
foo: Would you be having one single entry point to handle all database updates? If so, this could get a little complicated, if not, I don't really see the advantage.
s/for/form/g
foo
kuja: Alright, my task is to make data going from a form to a database as easy as possible. I would have a form that would contain different input types with names in the format of fieldname=table-row ... where table is the mysql table and row= the row. I would then on the following page have a functiont foreach's through $_POST, explodes by = and - ... and creates a query that will be executed .
bubblenut: ^^ Is that more clear? HM
kuja
foo: Sounds like a bunch of insecure crap.
foo
Oh, shoot. I didn't even consider the possibilities of someone changing those names...
kuja: Bleh, scratch that, then. Thanks for the insight
sloloem
str_replace is eating far too much of my string
bullrage
I need to learn OOP, but not many places explain it well
Dovid
Can anyone here help me with libssh2 ?
I installed it and tryin to run a basic php script and I get this
Fatal error: Call to undefined function: ssh2_connect() in /home/crap/public_html/p86/dovid.php on line 2
?
vinadelmar
bullrage, i suggest that you invest in some books then
bullrage
vinadelmar: I have the Professional PHP 4 book, but it decides to use starting a car engine as its example
vinadelmar
uh?
bullrage
exactly
vinadelmar
i mean, learn OOP itself first
Dovid
Can anyone help me with libssh2 ?
bullrage
oh just in general, not OOP in PHP or Java etc
any books you suggest vinadelmar?
vinadelmar
nope, ask kuja
bullrage
kuja: any suggestions on books for learning oop?
kuja
bullrage: No, I've never learned programming methodologies from books (let alone programming languages)
bullrage: OOP is a simple concept.
bullrage
ok...
sloloem
GAH!
kuja
bullrage: You have an object, and object has methods. Methods are functions that are called on an object that tell the object to do something. A method is a message, the message is delivered to the object. For example, $car = new Car(); $car->startEngine(); // Here we're telling the car to start its engine.
vinadelmar
that's a short intro
kuja
It's the most relative.
Singleton and friends are more irrelevant.
vinadelmar
after, you go on design patterns and there you get totally screwed up
bullrage
ok, i understand that..
it's putting it into practice ill struggle with :)
kuja
bullrage: Objects also contain properties. A property is like a variable, except the object holds it. For example, $car->fuel = 100; // Here we're setting the car's fuel.
vinadelmar
the main idea behind the design patterns is that there is no spoon
kuja
Just like methods are functions called on an object, properties are variables kept in an object.
bullrage: That's really as simple as PHP's OO model gets.
bullrage
ok i understand that so far
kuja
Other languages may get a bit more complex and pure with OOP.
vinadelmar
like... VB
itrebal
or ruby
Stormchaser
o.O
schmalls
kuja: what about visibility
vinadelmar
i deserve a kick
thaGZA
Hi. I have a site that uses variables in the URL (site.com?action=AboutUs), and I'm making a Contact page. I want to use the $_POST method, but will it be safe linking to the form handling page, if I use a variable in the URL? Like, the contact page would be ?action=Contact, and the form handling page would be ?Action=Submit
Stormchaser
(Action) bi**hslaps vinadelmar
vinadelmar
no kick?
Stormchaser
no kick
kuja
schmalls: Visibility isn't important.
vinadelmar
it's because you are lazzy to turn into an evil op...
bullrage
so basically.. if i was to make a polling system, id have methods like.. get_results, post_results, display_poll etc? :s
Xyphoid
OO design is all about encapsulating entities into easy-to-understand chunks. rather than having a car abstract data type and a bunch of functions which take pointers to car structs or whatever, you attach the car-manipulating functions to the car data type directly
kuja
bullrage: Something like that.
bullrage
oh, thats not too difficult kuja
schmalls
kuja: what do you mean not important
kuja
$car->changeEngine(new V8Engine());
schmalls: Visibility is not important. That's what I mean.
Python makes a good example of that.
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 next »