ok hey flowOver i think i didnt explain well enough before I already have connectivity between mysql and php
loadHTML()
Stormx2 which function please?
www.php.net/xml
Stormx2 ok, i read xmldom then, since mine is php4
domxml
i dont like the XML hosting parser functions at all personally
will php webhosting be able to use port 110 without being root?
i’ve read. i don’t like it neither
(on debian)
david php.net/domxml slightly better but still not as nice as the 5’s dom extension
i never settle for working on 4 anymore. its out of the game in 4 months
i am trying to interact with a query in mysql. what is the best html/php function to do this (ie listbox, or selectbox type thing)? i want to select a group of records in a mysql table and interact with that selection…
can i use session.save_path = “N;MODE;/path” without N;
johnyd – i like the mysqli functions
what is the different in mysql and mysqli?
i can be used as objects
flowOverdo i need to install anything extra for mysqli?
shouldn’t
oh ok, so it crate an object. that pretty nice.
evilx – you don’t have to. it has regular functions as well
yeah i seee, hum
ill have to rebuild php now with mysqli
i’m not sure about speed , but i find it more manageable
one thing i like is $result-numrows
oops num_rows, sorry
TML, searching thru the page i can’t only find one “named subpattern” in it
s/cant’/can
ok hey flowOver i think i didnt explain well enough before. I already have connectivity between mysql and php. like i can out put entire tables to html. im looking to put it into a listbox or some other form to interact with. do you know of a good way to do this?
any tips for imageloadfont() … since from manual i dont fully understand how to use ttf fonts ;s
vBm, loadttftext?
hi!
what’s is the PHP’s way to object construction… use __construct method or same class name method ?
php5 = __construct()
gah, php must have a function to convert from å to å :-/
what encoding is used in case o session files ? i just checked one and it doesn’t contain typical serialized data… ?
*of
why do you need such a function?
kn11px, thank’s! is deprecated other way?
yes
and i don’t see why php “must” have such a function, seems a pretty uncommon “need” to me
Evilx, since im in php world for 3 days now … can you give me any link for it … since i cant find it on google and dont see at manual
same as var
www.php.net/loadttftext
sorry
imagettftext
heh
i typed it wrong
kn11px,
for RSS-feed, å etc isn
oh … tnx Evilx
‘t allowed
and php has functions for just about anything else
are there any admins in here?
LIT check out http://uk.php.net/manual/en/function.get-html-translation-table.php
/msg chanserv access ##php list
dope
I have a feeling you’re not on there.
whats the fuction to print an array?
var_dump, print_r
thx, got it working using get_html_translation_table()
i have two varibles that are numbers and i want to make sure they are the same, however chances they might be strings, so in that case this if both vars = 7 then this would be false? if ($var1 == $var2) {} ?
or one var is a string one var is a number?
Drstroker, if( (int)$var1 === (int)$var2 ) …?
mew
/ “;
does this look right?
no
or am i missing an escape?
how’s the tablet, Slynderdale?
echo ‘a href=”cidr_info_query.php?PSI=’ , $PSI , ‘”CIDR Information/a’;
that should do it
Wolfy[drawing]: Evil! . I can’t find any local retailers who sell them..I might have to order it online now. Also how have you been? Its been a while.
Nope that didn’t work ..
interesting it worked here
how can i tell why types they are
if (is_number($var1) && $var1 === $var2) {}
gettype
All the cool people seem to get lost on the way to ##php. Where have you been?
first it checks if $var1 is number and if it is it compares two variables with type comparision
Wolfy[drawing]: Eh, was a bit busy with life and went through a bit of a rough patch. Though I have been keeping up with your comic. Damn you Wolfy, you got me addicted to it .
there is no such a function
is_number
either is is_numeric or is_int
-is
sorry, is_numeric
then your comparison doesnt work
is_numeric returns true on numeric string
hm
ok
is_int
ctype_digit()
what about if $var2 is string?
it return false
ctype_digit — Check for numeric character(s)
again
numeric string
he needs a type check
php can’t add? $number = (1 – $one) * $twenty-five; Now number should = 0 but it equals 25? (1 – 1 = 0)*25=0
anyone familiar with GD? is there any way that it can be used to convert a few jpgs into cross fading animated GIFs? i want to turn several pics into a slideshow, but i dont want to resort to the evilness of flash
i just did $var1 = 7; $var2 =’7′; if( (int)$var1 === (int)$var2 ) { print ‘yes’; }
^_^
and it works.
i like to type cast though
i dont know if thats possible with GD
As you can see, almost every comic is drawn better
rza any idea of tools that could do it? imagemagik ?
mikko@todellisuus:~$ php -r ‘var_dump( ( 1-1 )*25 );’
int(0)
pecl.php.net/imagick
rza oh cool… thanks!
but with the 2 variables it cant do it
show it
here
mikko@todellisuus:~$ php -r ‘$one = 1; $twentyfive = 25; var_dump( ( 1 – $one ) * $twentyfive );’
int(0)
Wolfy[drawing]: I noticed Keep up the good work.
I will try it.
have you kept up with my SA account as well?
rza, no
the issues is it going to equal 0
( 1 – 1 ) * 25 = 0
oh it get 25
heh
are you smoking crack?
i get int(0) here
i know
im mentally gone now
Wolfy[drawing]: http://furrywolfy.sheezyart.com/ ? Yea, I have been checking up on it now and then SOrry for the delay, I was eating dinner.
Slynderdale:
Looks familiar? http://www.sheezyart.com/view/1332073/
sup homeys
so creating a thumbnail with gd seems to take insane resources =/
“homeys”?
yes, it likes memory
yah, or should it be homies?
i don’t think spelling matters in eubonics
have php4 installed gettign fatal error undefined function domxml_open_mem()
how about “neither”?
aint that base?
Wolfy[drawing]: i don’t know… how bout it? that seems less fun
you don’t have domxml installed
Wolfy[drawing]: Haha, Inuyasha xD Kind of reminds me of the cartoon “My gym partner is a monkey” where instead of reading books, they eat them.
o.O
–with-dom
:/ i’ll do a make distclean
no… –with-domxml
hrmph don’t see that in ./configure –help
checking
./configure –help |grep dom
in PHP4 that should be present.
eep!
x.x Darn it
hehe
http://pastebin.ca/632637 — So thats my script with the weird maths. Ive tripled checked it.
I’ve scanned recent doodles of mine… Give me few minutes…
Nakamura, you can tell mysql to only give you back so many results
Thats what I have done?
-with-dom-xslt
is that what i should use?
i missed the second one, heh
–with-dom[=DIR] Include DOM support (requires libxml = 2.4.14).
–with-dom-xslt[=DIR] DOMXML: Include DOM XSLT support (requires libxslt = 1.0.18).
–with-dom-exslt[=DIR] DOMXML: Include DOM EXSLT support (requires libxslt = 1.0.18).
im tired, leave me alone. heh
are you sure page isnt 0 ?
So am I
page=1
I will check
http://wolfy.homeunix.org/random.jpg
Are you *SURE* that’s PHP4?
do you have this script somewhere running ?
yes
yes umm
4.4.7
hm
Nakamura, i see $_GET['page'], but then i see page_number in the uri
i stopped running php4 years ago
oh heh
im giving up and going somewhere else.
admin.php?page=users&page=”
page is there twice?
its an old freebsd 4.x box, so i aint screwing with much
was hard enough getting latest php4 on here
http://www.facka.net/te/admin.php?page=users
had to compile myself as ports is defunct hehe
page=users ?
you have page=users&page=1 ?
no
Yeah. My bad. looks like –with-dom is what you want
ok thanks
how can i login?
Oh I see
I got to pages
umm let me make a account
as
it not activated
hey, so I have a div that when you hover over it, it expands from 20px to 80px, and I was wondering if there was a way to make text stay inside the div, but run off the bottom so that when the div expands, the text would show, but before it expands, you would only see the first line
Opps, I fogot, it only allows normal users to log in, not admins
You havn’t activated you account yet
is there a simple way to do in_array with a regular expression?
foreach
oh
sorry, wrong room
array_walk ?
Wolfy[drawing]: Nice doodles. Even with doodles, you ssssssdefinatly show that your getting better. Antomony can be a pain in the ass.
NemesisD, what is it you want to do?
login script fixed, username + password= as
question, i have a field in mysql hosting that stores a bunch of ids separated by commas. These ids related to other data that I need to retrieve. So basically what I’m doing is fetching that field an exploding it, then running queries on the ids in the array.
Is there any better way to do this? if that made any sense.
and which one is the broken script?
Nakamura, didnt work
Nakamura, it went to the directory root.
yes
now goto http://www.facka.net/te/admin.php?page=users
Anathomy, too
naturally
page=users
you have $page = $_GET['page'] in your code
there that negative number again.
brb. Need to scan another page
I just released I have two pages.
http://pastebin.ca/632637 this code
it going off the string and making it 0 , so 0 -1 = -1 * 25
change one to pageS
uses $_GET['page']
what?
$_GET['pages'] with a s
oo now php error
are you changing the code as we speak?
yes
how is it possible to debug
anyway your problem was that you use $_GET['page'] in pagination
yes you said thats what I am changing.
so your math becomes $number = (“users” -1 )*25;
Wolfy[drawing]: Bah..stupid spelling..Don’t mind me..I’m just tired. . Happen to have some spare sugar on you?
i kinda said that ten minutes ago
I must of missed it.
Im not used to this irc client, it doesn’t color messages with my name in them.
actually i think this could be solved with an &&
squat
lo
http://wolfy.homeunix.org/random2.jpg
can i concatenate within an argument like preg_match(‘/^’ . $string . ‘$/i’, $foo); ?
Wolfy[drawing]: Nice poses o.o
getimagesize takes forever, is that normal?
I’m still learning
NemesisD, no point for that.
around 1 second per image that is
how big are images?
Evilx, i was not sure how to deal with the variable having an $, if i escape it won’t it treat the $ as a literal dollar sign?
use preg_quote
800×700 is the largest
NemesisD, what is it your trying to do? look for a string with at $ at the end?
like ’string$’?
Thern there is something bedly wrong
i have troubles parsing an html page i haven’t made, http://rafb.net/p/zrGj4L76.html i have no idea how to delete this black circle at the begining, and removing ‘ ’ doesn’t work
these are images hosted remotely
Recursion_Duck, that because it noy
not*
(data) out of a string, I am using this |img src=”(.*?)”.*?|i any ideas?
does it have to download the entire image to check?
YES
=/
Evilx, i have an array that has both normal strings and strings containing patterns, i’m in a foreach and i have an if that checks to make sure that $key does not match either the regular strings nor the pattern
trim() doesn’t remove the whitespaces either
so I guess there is no solution if the file is on a different host?
Recursion_Duck, where is this charecter comming from, your html file?
transfer them to your own \
yes
do you need it in there?
i don’t, but i don’t make the page either
interesting.
is that not working?
AustLaw, it is , sorry
0A2E = “
What’s the PHP regex to search a $string for “_s” and replace with “_o” ?
you really want to use regex for that?
What do I want?
just use str_replace()
Thanks.
any idea about how i can do to parse this string? when i paste the ” in emacs it give: “^[%Gâ\200¢^[%@"
working on it
ok
Wolfy[drawing]: I need to start drawing more o.o I wish I had a scanner or a tablet right now..would make it a bit easier to get my work online.
humm
hexdump says it A2E, but i cant get it to display again, bah
you… Don’t… Have… Scanner… o.O
Wolfy[drawing]: Mine broke .
Recursion_Duck, told to the owner of the html file, heh
They areally aren’t that expensive these days
is there anyway i could apply something on each variable in my code or do i have to process each variable separately
http://www.pagesjaunes.fr/ don’t know why… i have the feeling he won’t care about me ^^
a href=”http://www.pagesjaunes.fr/”http://www.pagesjaunes.fr//a don’t know why… i have the feeling he won’t care about me ^^
when linking to a file with a http reference. it seems to replace spaces with %20 and a # is %23.. but its not escaping brackets or single quote, and this works
Recursion_Duck, ?
where you getting this charecter at on that page?
this is the homepage of the site the html host i’m parsing comes from
is there a function to check if a variable is a number?
neither the urlencode or rawurlencode function does this.. to my knowledge, i get a broken link
it’s on the search results
Gimme back mah scanner!
x.x Is it pick on SLynderdale day?
Scanner for pants x.x
idk, im giving up
i need a mental break
never mind all.. i found that i was calling rawurlencode twice.. duh
is there a function to check if a variable is a number?
sanmarcos is_numeric
search numeric
sanmarcos also could use is_int()
in the context of a loop of some sort, can one put a variable where one would normally put a key, say $foo[$bar] ?
jes
*yes
alright cool, thank you
gn8 so far
4 am =(
i’m trying to thing of a term for development where we should stop progressing and patch up problems in the current code before proceeding is there a term for this?
Recursion_Duck, i can only think it unicode
/b, which parts of those have to be escaped?
i guess so, but how to delete it? can i find the position of the first ‘ ’ of the string? it allways follow it, and i need to delete it too so…
echo ‘btext/b’; or “… ?btext/bphp …”
cooner750 – none of those,”&\ to name a few
the HTML would be going in this line
$lang['rac_location'] = ‘In order to make sure you are not a spam bot, please answer this question. What is the color of grass?’;
should do fine
Cooner750, blue
lol
it true
kentucky blue grass
the grass isn’t blue here in Kentucky
If I have an mp3 with a unique code in a filename, like “the_title_ABCDEFG.mp3″ how do I extract “the_title” if it’s in a directory?
redtricycle, you have a file called the_file_something.mp3 in a directory and you want to get the file name and extract just the_file ?
what are the rules for the “unique code”?
Um, alphanumberic
like, 5 characters long
I can always do something like [^.]* to grab it, maybe
I wouldn’t know how to use php to check in a directory, though
I originally did it in bash, but I’m trying to change it over to all php
Evilx, yep
but I use the code to find it, though if I put it in its own directory, I wouldn’t need to use the code to find it
that’s an alternative
you could use glob, but that only supports shell globs, or you could use opendir, readdir, closedir and preg_match
$title = preg_replace(‘/^(.*)_[a-zA-Z0-9]+.mp3$/’, ‘\1′, $filename);
sorry, $title = preg_replace(‘/^(.*)_[a-zA-Z0-9]+\.mp3$/’, ‘\1′, $filename); missed the escape of ‘.’
Thanks Recursion_Duck
would /^(.*)_+\.mp3$/ be the same?
How would I have it check which
directory though?
Just started learning PHP 30 minutes ago … got a question … http://rafb.net/p/7OkjCr81.html Why won’t this appear when I access the HTML page ?
Like…how owuld preg know where to look?
opendir?
CVirus, is the file .php?
capturing if you examined the capture, it would
no .. html
CVirus, that why
I guess I got it .. thanks
OK, I’m trying to set up PHP/MySQL, but I can’t figure it out.
Digital
be more specific
what’s your distro ?
Arch
PHP 5.2.3
what is the problem facing you ?
$files = scandir($dir); foreach($files as $file) { if(is_file($file) { $title = preg_replace(‘/^(.*)_[a-zA-Z0-9]+\.mp3$/’, ‘\1′, $filename); }
$files = scandir($dir); foreach($files as $file) { if(is_file($file)) { $title = preg_replace(‘/^(.*)_[a-zA-Z0-9]+\.mp3$/’, ‘\1′, $filename); }
I’m afraid I don’t really know, any more than my PHP app says it has no MySQL access….
Recursion_Duck, ooo
mine wrong heh
I’ll try that out
I know about $_SERVER['REQUEST_URI'] but that just gets the action page, is there a way to get the FULL url?
check this http://wiki.archlinux.org/index.php/LAMP
Just wondering…how often do people use php and use “exec(shellcommand)” to use as a shell script? o_o
Is it a no-no?
echo ‘pre’. print_r($_SERVER) .’/pre’;
I didnt want to mix bash and php
AND mysql
i do things like that for cgi scripts that allows me to admin my route (suid root scripts, for iptables, iproute…)
okay, I dont feel so bad now ^_^
i like python for such things as what redtricycle doing, heh
DavidCraft, something behind # ?
Evilx, =P
python is great, heh
DavidCraft take a look at echo var_dump($_SERVER);
i think what david wants is the full url like www.ok.net/something.php?whatever
Evilx I think so too
yes
thats what I was talking about
so he just had to take a closer look to echo var_dump($_SERVER);
Its all in
Tabakhase, mine dont give a full uri in server
(Thats the way I learned to help others) Tell them NEVER what they need, tell them how they get it on their own
Evilx I know
so build it
Thank you very much. You have no idea how much that helped me.
http_host + XXX + request_uri
yah well sometimes just telling some one what they need is easier for both involved… I knew how to get it *shrugs* but I didnt even know if it did infact contain what I wanted
i dont know what the XXX is , but ok
Evilx look at the var_dump
i know what $_SERVER looks like
or var_export
hi all. what’s a good way to write this in a clean way: if ( $a == $b && $c == $d && $e == $f && $g == $h )
if you subsitute the variable letters with longer var names it will be a looong if statement
Artnez, depends on what are you doing
i’m just comparing a bunch of values
they are all seperate variables
that alot of vartiables to compare.
yes
i have 2 similar objects, both are arrays of objects
http_host + / + request_uri + ? + query_string
the objects contain location data. some values are latitude, longitude and title
REQUEST_URI should give you the query_string
if latitude, longitude, and title all match for the 2 objects in the comparison function — i continue the loop and dont do anything to it
http_host + / + request_uri just them both @ Evilx
i just want to make it look cleaner :]
request uri should also have the /
longitude == $set2['longitude'] )
Evilx so its ok
I didn´t looked it up
i could set the values to check in a seperate array and create a new loop, but that seems bloated
don’t put whitespace arround the -
solved the problem using characters i’m sure of: preg_replace(‘/^[^a-z]*(.*[a-z])[^a-z]*$/i’, ‘\1′, $string)
why? i’ve been doing it for years
it’s ick, and makes it look like it’s operating on 2 different things
it’s my coding standard
ick to you, not ick to me
Artnez It works, but ist BAD
Recursion_Duck, cool
i like as much space between chars as possible, makes it easier for me and my co-worker to read
bar, $foo – bar or any other operator */
Artnez, new line it
$foo
Evilx, yea that’s what i have :-/
bar
i guess that’ll have to do
i’m a little warped tonight so i thought maybe i was missing something, guess not
$array[ 'value' ]
no, i do that myself
if ( stuff ){ … whitespace is fine, just not arround -
i’ve never had anyone complain, always get praises for cleanliness of code
it makes it look too much like every other operator in php, as far as my eyes go
except today, lol
Artnez, so its basically $object and $array comparation ?
kind of, i just compare specific values
others like, phone field and website field, i dont need to compare
You could drive a car with just 3 wheels. But 4 are better or?
function MyReadAbleIF($object,$array){ /* using.loops or those long.if */ }
thats the same with your code
Tabakhase, depends on how the car is built
would that be considered “bloat”?
Evilx go to a car, catch the front left wheel
adding a function for readibily, that is
*readability
cou could drive forward, backward and left, but not right
Tabakhase, ATC
atc?
$v) if ($array[$v] != $object-$k) return false; return true;
German and still go to school
tsk…. nevermind i beleive you can fix those if ()
umm, what does that do again?
yea, check my above posts. i considered using another loop, but i dont want to slow anything down by even a 100th of a millisecond for this
Tabakhase, guten morgen
Tabakhase, Du haben koffer?
how do you know the loop will be slower until you’ve timed it?
its not *THAT* big of an if statement, so it’s not worth adding a whole new loop
I have bag?
f00li5h, no idea for the ($object-$k) i feels not really sure also…
heh
ja
nein?
Evilx location?
USA
heh
i dont know, but you’re saying looping through both objects is exactly the same as the if statement?
But know german, nice
well, you’re keying $array with $v, which is a value from the array
i doubt it
im not very good in german, heh
little
few words.
wy?
no, i’m not saying anyting about it, other than, write both, and run them to see which is faster
f00li5h, my bad… $v == $object-$k
i just need to two sentences. I need a beer, and where the restroom
i’m sure you can use == and object_vars # or whatever it is
nah, i’ll just leave it as is. it’s obvious that the loop will take longer, even if its a 100th of a millisecond i’ll just avoid it
the if statement isn’t that bad, i was just hoping for a PHP-specific control structure for those kind of comparisons
Ich brauche Bier first Wo ist die Toilette 2nd
But wy can a american guy know german?
*an american
why not?
how is it obvious a loop will take longer?
do you guys know that weiner in german doesn’t mean hot dog?
it means “from vienna”
or “of vienna”
Evilx good question… I just wondering who teached it to you
myself
nice
this is very confusing in germany when they have high class restaraunts in Vienna call “Wiener [something]“
just looking up words and stuff, dont know very much and ive realized the entire thing can change due to the way the setence is, there like 5 different words that mean the same thing, and depending on how the sentences is you use whatever word
si hablo espanol?
yes, german is hard
i gave up on french the day i understood how they tell time… “What’s the time?” “13 minutes before 1pm”
granted i speak fluent russian, and we do the same… kind of
privet
angliski
I hate french!
ooooh, ti
krutoy americanitz
those are the only two words i know
pragramist is programmer
programist
we sorta need to stop chit chatting in here and join the php chat channel
which is #phpc
Wiener [something] = Wiener Würstchen
they will ban for socializing in here.
oh
shuts up, and go to sleep now
soon 5 am -.-
gn8 you both
l8
is it possible to store an array in mySQL without exploding it into a string?
i do not believe so
no, use serialize()
mark0293, yes it is
with serialize
heh
just read that searching through google.
what does serialize actually do to the array?
read up on it in the php docs
k
http://us.php.net/manual/en/function.serialize.php
really interesting and cool
yes, it is. i use it for communication between Flash and PHP
works perfectly
no one uses flash, geez
im sorry for you, heh
? www.fantasyinteractive.com
flash is incredible when used in the right situation and the right way
i just dont like it, because it a hog, heh
you couldn’t be more wrong
i guess it just depends, sorry.
lots of people use flash
but this isn’t really the place for a flash discussion
#phpc or #flash for that
true, apologies
told oyu, brb
who’s oyu?
you
anyone know the status of PHP6?
I havent really been keeping up with things like for that past months
anyone use vbulletin
try #vbulletin
ew, vbulletin
no such
dspDrew, ?
he’s trying to say that this isn’t a support channel for vBulletin
are you looking for php help or forum help?
i guess that indicates how many people use it
you need ask PHP specific questions
!tell dspDrew about g10
!tell Evilx about meow
yeah I jsut installed the damn thing and now I cant even login
haha
hi
odds are that the database isn’t there, or you haven’t finished the install
f00li5h, i like to know extra, they get to the point and make things easier in the end.
there’s likely a setup.php or an install.php
i was told to use a menu to avoid hard-coding links into every source. how would i use php for that
told ot use php*
excuse me?
yeah its all installed and it let me login initially
but once i logged out that was it
sperry-: include
f00li5h, let not worry about it.
sperry-: use the include function include a file called something like “navigation.php”
can you do $variable = print_r($other_variable); ??
Azio, no that points less
zackattack,
why would you do that?
it’s likely to return 1
oh.
zackattack, you need a second parameter, true
you could start a buffer and have the buffer drop everything into a string
Amenthes I want to print_r a variable to a file.
I want to print the contents of a variable into a file
into a file, why?
zackattack, http://us.php.net/ob_start
ob is not the answer here
it could be
zackattack, if you use the second paramter, set to true, it would not print the result, just return, anyway, it may be some other solution for what you want
i want to avoid hard-coding menu into every source. what should I do?
Well… this is my problem.
http://f00li5h.pin21.com/persisting_arrays_with_var_export.html
i didnt know that
I am calling a file, upload.php, via this nifty ajax-file upload script I found. I need to figure out what’s being passed to upload.php. Since I am ont viewing the script from the brwoser, i have no way of accessing $_POST and $_FILE
So I want to write the contents of those variables to a file.
i could do a foreach i guess
boop
boop?
as in, pay attention to me
ok
http://f00li5h.pin21.com/persisting_arrays_with_var_export.html
it’s more for config files, but it will do what you ask too
thanks.
anyone? what do i use to avoid hard-coding menu into every source
but maybe there is a better way of doing this?
like figuring out what is sent to upload.php, somehow?
better than stick-text-in-variable, stick-variable-in-file?
answer me fuckers
yea
sperry-: include your menu
sperry-: and stop being an arse
f00li5h it worked, shithead
thank you dickstick
ok, so it’s working, and you’re abusing people… interesting
sperry-, please watch your language, if people dont answer you, dont get a jerk about it.
abusing people worked
he’s trying to be funny, but he has asperger’s
sperry-, we are here to help each other.
sperry-: did it? you already had your answer about 20 minutes ago
before you started up the flood of abuse
f00li5h yeah it did, you idiots ignored me until i started abusing you
sperry-, nice way to thanks to that people
Amenthes fuck you
no op inhere?
Hmm… I need something more precise than microtime…
sperry-, please watch your language
Evilx fuck you sideways
php-bot: ops?
the pm system on my ajax chat is pretty much working no /msg command JUSt yet though
good stuff
link? i’d love to see where you’re at
http://atomiku.com/scripts/ajaxchat/chat.html
you see
the private messages arent really coming back in the right order
lemme just paste 3 lines:
syspm($sesdata['name'],”– Admin Help Menu –”);
- Makes the system bot talk”);
- Kicks a user”);
looking awesome
when they do /adminmenu
kick might be at the top… Let me show you how im doing this:
geeks like to be abused. they are masochist. they had to learn to enjoy others abusing them or they wouldn’t survive
mysql_query(“INSERT INTO `chat_pms` (`target`,`name`,`message`,`color`,`time`) VALUES(‘$target’,'$botname’,'$message’,'6′,’” . microtime() . “‘)”);
note the microtime()
sperry-: geeks have feelings too ;_;
I then loop through chat_pms ORDER `time` ASC and display the pms accordingly
is there any way to retrieve data with a where statement in the mysql query. But not for an exact match, so show only the results where some value is detected within the entry.
Not in the right order though…
don’t you want microtime to give you an integer, rather than the string of seconds-and-part-seconds it defaults to?
I really dont knwo
like %$escaped_data_from_user%
Why is the fopen() in my script working when I do it from the command line, yet failing when the script is called via AJAX by the webserver?
The script is chmodded 777
you’re running as a different user
don’t chmod things 777, unless you really want a world read/writeable executable
-rwxrwxrwx
are %’s wildcards?
for files, 644 should be fine
in like, yes
well, okay, fine. but it’s still not working!
oh ok, thanks, lemme see if it works
it’s because youre shell runs as a different user to your httpd (and hence php)
i’ve been on some shared hosts where *nothing* works besides 777
because they run Apache as user Nobody
lies.
666 would have worked too
Hey all.
okay, so what is the problem?
not for me
unless your php scripts were cgi scripts
neg
because +x is only there so you can run the script
../foods.php # more likely wrong than a solution
artinez because the users wasnt in the same group as the server?
stick passthru(‘id’) at thet op of your script
what’s the php function that checks if a string is part of another string?
if (stringfunc($code, $filename))
preg_match, strpos
because the server is run as Nobody, so it has write access to no files (it was a shared host)
they use it for security
as far as i know, im not a server guy
oh
why does your webserver need write access to your scripts again?
Can someone Please tell me how to fix this. Im ushing PHP 5 under IIS6 via the ISAPI. I tried setting the doc_root to the path where the scripts are located and I also tried editing it out. I only get this error when I dont specific a file in the URL, if i Do specify a file, either /index.php
or even /index.html it will work. I tried setting the default document to index.php even index.html but it still says “No input file speci
f00li5h, so people can write to it duh, heh
hOw can I make this work?
ah, so /everybody/ can write to it
it’s failing on 777, even though it’s overkill!
yeah
find out which user your webserver is running on
shared web host; I won’t be able to change anything anyway.
you still need to know
why?
I want a function that returns a nice number in mircoseconds that can be used in an int field on a mysql database D:
so you can know which user needs the freaking permissions
I just figured out what mircotime() returns, No wonder why it wasnt working
but what can I do other than 777!!!
why not just use now() in the sql statement?
isn’t it User, Group, Global?
ok, you’re off the team, no more help for you.
7 should give everyone permissions!
it’s running as ‘nobody’
at0miku, check out the first example on php.net/microtime
Anyone?
perhaps you can explain?
ok, right… can you write to /tmp?
how much do good servers with php+mysql support cost? any recommendations?
Can I?
yes.
microtime_float?
I can write to /tmp
jacks; godaddy.com does it for a couple bucks a month
right, and what are the permissions on /tmp?
ah alright, I see what it does now
f00li5h drwxrwxrwt
and when you write there, who do the files belong to?
“1185334074.32″ isnt precise enough though
f00li5h they belong to me
when you run through the webserver?
f00li5h no when i run as myself
at0miku, then may I suggest using a timestamp field and NOW()
and what happens when you run it though the webserver?
Someone? Help me figure out this “No input file specified.” error
okay, let me write a script to do this.
I dunno how
SigmaProject, code?
I need something like 1185334074.32344041
Or something… O_O
SigmaProject, and when do you get it?
got any links/references?
nvm
actually no… wtf
yes I can write to /tmp
Its not a code problem. I have PHP5 installed under IIS6. When I try to access the site root / it says that error, but if i specify /index.php it works
im confuzzled now
and it is owned by nobody
-rw-r–r–
SigmaProject, sounds like you didnt setup a index file
In IIS I set the defualt document to index.php but it refuses to go to it and instead says No input file specified.
or specifiy that index.php is a index file
i dont use IIS, sorry.
Does anyone know how to fix this No input file specified. error In PHP5/IIS6?
SigmaProject, im googling right now
I don’t think anyone knows, not in the whole world
I did the same, I tried the fixes they have said, but it doesnt seem to work
i see, and are you trying to write to the same file from the webserver that you were writing yourself from the slell?
oooooh. no… let me try that shit.
… /s/****/stuff; sorry.
SigmaProject, are you using php as cgi or not cgi?
not CGI, its as ISAPI
do you name all your sources as .php, even though they don’t have any php code?
SigmaProject, http://us2.php.net/windows
Why is it ##Php and not #php?
don’t set doc_root in php.ini to “cinetpub”! Just leave it empty or comment it out.
cause, its a info channel;
## means an info channel?
help, info, whatnot
sure
never seen that before
good to know
SigmaProject, try that and get back to me.
Saint_Marck, to stop bots
problem solved.
anyone know of a good set of sql control functions. ergo, to be able to access different types of databases from one syntax or whatever?
Saint_Marck, because the bot wont realize they got forwards and will still try to send to #whatever and not ##whatever.
oh?
ok i can’t find any good resources on google relating to why output buffering is a bad idea
oh, i’m retarded… i should’ve changed the permissions of the FOLDER to world-writeable, rather than the upload script.
Evilx, i love you for that link. It wasnt the doc_root problem, it was the one right below it saying “I made the mistake of setting a ‘wildcard application map’ for PHP on a Windows 2003 / IIS 6.0 / PHP ISAPI installation.”
after I removed that rule set, it worked. Thank you
indeed. your php scripts should generally be 644
ok
and the folder should be…
Chase-san: it means an “about” channel
755
NO COMMIES
N N
O XX XXXXXX O
XX XX
eh, I was close
J XXXXXXXXXX F
E XX XX A
W XXXXXX XX G
S S
5 in base10
Chase-san: as in: this is not the official channel owned and operated by the people who make PHP
NO NIGGERS
SigmaProject, you just need to learn how to use google.
purr?
?
766, not 755.
f00li5h you liked that, didn’t you
the bot doesn’t summon ops from what i know
755 is exec, not write privs.
meh, whatever, there’s a good reason we have /ignore
why 766?
great
i was just about to msg you mattmcc
Aww.
the directories /your scripts are in/ should be 755
“6″ means read and write.
I had such a clever kick msg too.
i love how the access list tell you who most recently alive
and the directories they are writing to should be 766.
the bot won’t summon ops -_-
I think I prefer it that way.
perlbot ops splits out a list of ops, and beeps everyone, phpbot ops just tells me to ask nickserv
Unless it was written carefully to avoid abuse.
pff, i hardly think calling ops is going to get abused
ops ops ops *isp banned*
f00li5h, youd be amazed
if someone’s abusing the bot, the ops do want to know about it, surely
perlbot ops?
yes, there is a bot, called perlbot, on #perl
ah you can’t compare that to here
i can’t think why they named it that though
it’s a bot, i can compare them
if you mess with #perl they will kline you from all of frrrnode
freenode*
i’ve been banned from ##php three times, and never from #perl
if you /join #perl they will kline you
different level of deterrence
#perl is assholes
please dont make me start trolling
make you eh?
and half the opers in #perl are also opers on every other big irc network
Wait a minute.
it not even written in perl, geez
well, you’re speaking ill of friends of mine
Why are you here?
and myself, actually
it bad enough phpbot not written in php
perl’s the devil’s tongue
python rocks, heh
PHP was originally written in Perl
now you all hate me.
php is not for writing bots, i’m glad it’s not
yes, it started out as syntactic sugar
Yeah, back when it was just a set of shortcuts.
f00li5h, over on the 2600network , we actually have bots written in php and they do great.
not me
I love when people mention that as if it has any bearing on the present day.
i’m sure they’re fantastic
why do you ask?
well it’s nice what they did with it, but why didn’t they keep the syntactic sugar
but can != should
f00li5h, depends
what do you mean? array_key_exists and nl2br are really easy to use
heh
htmlspecialchars (or is it html_special_chars …)
Weren’t you rather obnoxiously requesting to be banned within the last few days?
geese in a barrel are funnier
stabbing geese
that was then… this is now… no one cared to act upon it then
go ahead
i’m a vegetarian, shooting fish is not something i’m comfortable with
suits me just fine either way
I’m a vegetarian too
i see
Eh, I don’t care, I just find the inconsistency curious.
hey, we all have bad days… don’t judge a man by his worst moment
f00li5h some people I know eat fish and still call themselves vegetarians. fish isn’t real meat, they say.
umm er e… hum. anyone know a good multiple database control script or whatnot?
jacks-: yeah there are people who eat chicken and fish and still call themselves veggetarians
because everyone knows that chickens and fish are really forms of mobile plants
you could even say that about some people
There are a lot of vegetables out there.
hitler was a veggetarian and was anti-drug… so eat meat and do drugs or you’re a nazi!
he was anti-smoking too
jacks-: fish aren’t vegetables either
yah so you better start smoking everything in site or you’re a nazi!
sry, this is more for #phpc but i was banned from there lol
jacks-: if it has a nervious system, it’s automatically out
that’s why i was pissed the other day
any function to shrink all spaces to one space ?
it’s kinda looking like you get banned from many chans you go on, not just #perl then?
#phpc is for chat
i need a place to vent, i thought PHPC was it, i guess not
how do you get banned from a php chat channel
your flooding the channel with people needing help.
preg_replace(‘# +#’,’ ‘, $stuff)
not sure if thats considered racism or not… probably not unless you mention german’s
oh yah, but that doesn’t change the fact that #perl is assholes
it does make you less credible though
this ain’t no court of law yo, credibility can shove it
“dig up, stupid”
f00li5h thanks btw, since learnign regex, is # a limited?
limiter
I don’t think #perl are assholes
But I think some of them do need help, just not that can be suppied here
# is the delimiter
should i name all my sources as .php, even if they don’t have .php extensionshe sh
no afaik # has no special meaning
should i name all my sources as .php, even if they don’t have php code
Chase-san, i dont know, sincei cant see them.
I got banned from freenode the other day for referring to an oper with a racial slur when I was upset, but he accepted my apology
f00li5h abstrakt thanks ;
you should name things .php, if you want php to run them
unStoppable, if they contain no php, then there no point for .php
unless like any other character you could use, you use it as the delimiter… but it’s not special in any way
haha, good idea
Evilx just thought it would be more consistent
bad idea?
although, i think that having .php in a url is useless…
yes
seriously… there needs to be a channel where we can all say w/e tf we want
abstrakt i’ve only seen / { | before
wait a minute… i think there is… isn’t it called EFNet or something?
you can do what you want… # is unlikely to be in the pattern though
heh
Evilx but say that later i add some php code, i wouldn’t have to change all the links
unStoppable, because the server going to think it containts php in it and run it through the php interpeter, which is pointless.
yah, well you can use anything as a delmiter afaik
what about efnet?
f00li5h abstrakt fun
i often use # for a regex delimiter because i don’t often actually use it in my regex’s
unStoppable, I believe in never mixing html and php in the same file
Evilx is that expensive?
a lot of people use @ for the same reason
it not expensive. it time consuming and pointless.
abstrakt oh, regex is so flexible
Yah, I gerenally work the html into a template and import it and replace {foo} with whatever data needs to be there
delimiters? whaddya need those for
um… that really has nothing to do with regex specifically, that’s just the implementation of the preg_* functions in PHP
Evilx but you have to mix them, even if it means just php include
it’s a Perl convention
you dont have to mix them.
they let you use basically anything as a delimiter, specifically for the reason that / is a pretty common thing to match, e.g. in URLs and ending tags and file paths and stuff
unStoppable, have you ever looked at templating systems?
Evilx not sure what that is
so it’s kind of a bitch to have to escape a ton of /’s when you could just use something else as the delimiter
unStoppable, go look at phpbb, and see how it does it theme system. it doesnt mix html at all with php
I prefer to keep markup in a tree data structure so I can have random access to it
ok
abstrakt thanks, btw. can you think of a simple regex to get all url within tags in html?
Chase-san: that’s generally an inferior template method because A) it adds the overhead of parsing the template and B) you can’t put logic in there