logs archiveIRC Archive / Freenode / #php / 2006 / June / 1 / 1
Kartagis
Wolfpaws: I guess not because it says URL not found
how should it be?
Wolfpaws
<?php echo $yourstuffhere ?>
chronos-work
I need to use preg_replace to put one div after my body tag like as vim.
CakerLatvia
is it possible
Kartagis
oh, right
Wolfpaws
no
CakerLatvia
if in class isn't defined var foot;
Kartagis
thanks
chronos-work
s/\(<body.*>\)/\1<div>/
         

CakerLatvia
can it be defined outside?
Wolfpaws
!+enter
php-bot
Don't use the enter key as punctuation. Think in complete thoughts, then type.
CakerLatvia
outside from class?
Wolfpaws
CakerLatvia: no.
chronos-work
but, I don't know special char to use in preg_replace that identify search string, somebody can help me?
CakerLatvia
Wolfpaws so it must be defined in class like var $foo; ?
Wolfpaws
CakerLatvia: No, you can declare it outside the class, but when you do, the variable is not usavle within the object.
CakerLatvia
Wolfpaws i can check all class vars with get_class_vars() ok?
Wolfpaws
chronos-work: have you read the manuals?
chronos-work
I helping friend
Wolfpaws
CakerLatvia: yes
CakerLatvia
Wolfpaws so if some vars doesn't exist, i cannot define them outside class?
Wolfpaws
chronos-work: Meaning...?
chronos-work
but I test on regex-coach and see that char is \&
correct?
Wolfpaws
CakerLatvia: N.O.
Stephanie
Classic bash.org quote of the day: http://bash.org/?309397
Wolfpaws
steph: ouch
Stephanie
Not the best one ever, but still great.
TML
Stephanie: I've always been a fan of the meta-argument one
         

Stephanie
Yeah, that's by far the best.
But you have to admit...the ones where people leave out words/mistype things are also rather amusing. :D
enygma
(Action) laughs
surfdue
how do i get the ip of the user?
enygma
$_SERVER['REMOTE_ADDR']
surfdue
ty
paddy2706
hello chan. i have a hopefully rather simple question: im including the part of a website, of which i have no control, and its every line starts with document.write (". so i try to do $tarife = strtr($tarife, "document.write \(", ""); but it doesnt do anything at all. i first thought it was because of the empty replace string, but even setting a value there doesnt solve the problem
Wolfpaws
TML: http://storm.homeunix.org/misc/bts/sonorabattle.jpg
document.write? javascript?
paddy2706
right. normally tis script is being included by a js
(fyi - heres it is: http://www.tariftip.de/besttarif-mini.asp) and i want to include it into a js-free website, just by "including" it
Kartagis
what should I use instead of NOW() so that datetime is stored at the time of query?
Wolfpaws
*how* "doesn't do anything"?
Kartagis: #mysql.
Kartagis
okay
paddy2706
Wolfpaws, it just leaves the code unchanged
m00kie_
is there a way to get php to execute something as another user?
paddy2706
Wolfpaws, I echo the result once before executing strtr and once afterwards
m00kie_
im having conflicts with php and sendmail :(
paddy2706
m00kie_, suphp or php via fcgi
m00kie_
suphp?
im running php as an apache module
Wolfpaws
paddy2706: Are you *sure* you're using the function in the right way?
m00kie_
im editing a file: /maillist.dat - php requires 757 to edit, sendmail refuses to touch it if it's group writable
Wolfpaws
because strtr *isn't* str_replace
paddy2706
Wolfpaws, well, im not ;) thats why im asking here. this is the very line:$tarife = strtr($tarife, "document", "a");
kamoricks
m00kie_: chwon it to your user associated with php?
Donkano
(Action) is back.
kamoricks
Wolfpaws: That's a boolean return. Not a replacer. See http://php.net/strstr (for what you're using) and http://php.net/str_replace (for what you should use)
Wolfpaws
!tell Donkano about away
kamoricks: any ideas, why are you telling *me* that?
kamoricks
Whoops, sorry.
paddy2706
kamoricks, lmc
Wolfpaws
let's see...
kamoricks
paddy2706: Read the thing I sent to Wolfpaws...
Wolfpaws
!+func str_replace
php-bot
mixed str_replace(mixed search, mixed replace, mixed subject): Replaces all occurrences of search in haystack with replace
Wolfpaws
!+func strtr
php-bot
string strtr(string str, string from, string to): Translates characters in str using given translation tables
Wolfpaws
looks fine to me :)
BrainyRon
Is there a builtin function to check if a number is even or odd? I'm browsing the manual but can't find any reference to this.
kamoricks
Hmm? That's new... sorry bout that, I'll just... walk over here. Sure.
Wolfpaws
hehe
kamoricks
BrainyRon: $val%2==0.
BrainyRon: Returns true if even, false if odd.
Wolfpaws
BrainyRon: yes... It's called a "modulus" operator... php.net/operators
TestiCalls
kamoricks.. what about 0
:P
kamoricks
TestiCalls: 0 is even.
||cw
kamoricks: actualy it returns the remainder
TestiCalls
(-1) 0 is ?
||cw
which with %2 can only be 0 or 1
Wolfpaws
0 is special number.
kamoricks
||cw: Ehm, I put the ==0 on it...
TestiCalls: 0.
TestiCalls
;)
kamoricks
TestiCalls: It's even, though. Between two odd numbers and evenly divisible by two. Unless there's some new standard for even...
TestiCalls
nah
just saying 0 is a funny number
;)
aridese
what does this mean? Warning: touch(): Unable to create file htaccess.php because Permission denied in /home/spellta/public_html/clanmct/database/index.php on line 81
that i don't have write access to the folder?
TestiCalls
check your priviledges?
mattmcc
Or the file.
kamoricks
aridese: Yep.
Wolfpaws
actually... 0 is 0...
||cw
aridese: it means the user apache runs as can't make files there
aridese
ok, if i try to make "../htaccess.php" it still can't make files -- but i know i have the rights to do that
Wolfpaws
probab;y not
kamoricks
It's 777'd?
Wolfpaws
7... 7... Ew...
aridese
644'd
||cw
aridese: and owned by the users apache runs as?
aridese
ah.
apache usually won't run as superuser?
kamoricks
Yeah. Tis missing a bit there...
aridese: Apache has its own user.
aridese: You CAN make it run as root...
zircu
in most cases
aridese
i see
kamoricks
aridese: But say someone got a nice CGI script, or a new bug...
Wolfpaws
aridese: Sane people run apache as non-priviledged user
zircu
Wolfpaws: start it? or run 'as'?
aridese
just one last question, can i pass "../file.php" to touch() and have it create the file.php one folder above it?
kamoricks
Open outside access and god-mode don't work well together.
aridese
or do i need to do an absolute path?
zircu
oh wait.. i thought i was in #apache
kamoricks
aridese: Yes.
aridese
ok, thanks guys
Wolfpaws
zircu: You *have* to start apache as root, since only root can start programs which use ports <=1024
kamoricks
Unless you don't use port 80.
zircu
Wolfpaws: there is sudo, that is why i asked
kamoricks
sudo is not 1337 like root.
Wolfpaws
zircu: "su" do
||cw
sudo is root
Wolfpaws
*nod*
kamoricks
su && 'cmd' && logout
Same diff.
zircu
no it isn't
Wolfpaws
yes it is
TML
There's a bit more to it than that
||cw
sudo is simply a fine controled way if allowing users to do things as root
TML
ACLs and whatnot
Wolfpaws
TML: like?
kamoricks
Yeah, the user group setup of allowed sudoers.
zircu
sudo can grant based on what su aka root wants to have a person use
TML
kamoricks: Or the commands you allow them to run
zircu
i can limit one person to be able to do apachectrl via sudo, and they have no other permissions
cgardner
doesn't sudo have to be set up for a specific user before they can use it properly?
||cw
actualy sudo can allow any user, not just root
zircu
sudo can be setup via unix groups or your own custom groups
TML
Wolfpaws: It has very find-grained control
Kartagis
later all
TML
s/find/fine/
Wolfpaws
TML: I know that... I just thought there is any difference in the final effect :)
zircu
i just setup sudo privs for mysqld_safe this morning
Wolfpaws
my account has all sudo rights without password :)
TML
Wolfpaws: No, but it's disingenuous to say it's nothing more than "su && 'cmd' && logout"
cgardner
Hey guys, what would the best way to find out why my mysqli::prepare isn't working like it should?
zircu
i will never give su (aka root) pass to joe a user that needs to only do certain things
« 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 28 29 30 31 32 33 34 35 36 next »