logs archiveIRC Archive / Freenode / #php / 2006 / June / 7 / 24
kavok
xml_parse, im still pretty new to this
the xml parse struct might be what I need
but its a little bit confusing
moldy
korkl: $a==1 ? $b="foo" : ;
korkl: that throws a parse error
korkl
moldy: the problem is $b="foo"
Pol_
Do you recommend a class to use session (login and logout) in a website ?
korkl
moldy: you can't have an assignment in there
moldy
korkl: hmmm. but this seems to work: $a==1 ? $b="foo" : $c="bar";
korkl
moldy: the ?: construct is for returning a value.. like so: $some_variable = ($a == 1) ? 3 : 6;
moldy: well if you're going to use it as a single statement, why not just use an if.. especially if you don't want to do anything if the result is false
moldy
yes, of course i could use an if... i was just wondering if php had some equivalent to python's "pass" statement
korkl
moldy: nothing like that explicitly, but it works just like in C.. a ; by itself will not do anything
Pol_: I use a singleton class for sessions, if that helps
         

kavok
How do you echo two variables on one echo?
korkl
kavok: echo "$v1 $v2"
moldy
korkl: hmmm but it obivously does not work with the ternary operator, does it?
korkl
kavok: you can always concatenate
moldy: guess not, never really tried
moldy
ok korkl. thx.
Shadow_mil
if you use global at the start of the function to pull a variable into that function, and you change that variable inside that function, will the variable get changed globaly?
Wolfpaws
(Action) blinks at aukstas25
Stop it.
Shadow_mil
Looks like he is having internet problems
Wolfpaws
Then he shouldn't be here...
Shadow_mil
...
and why you say that?
Wolfpaws
he's floddiung the channel.
*flodding
If he continues, I'll give him a temp ban
jrots
Hi, how can I check if a script is run from CLI, (console)
when $_SERVER[_] is set? or isn't that safe?
aidan
jrots: $_SERVER is always set
jrots: if (defined(STDOUT))
there's a better way, I can't think of it though
get_php_handler or something will be CLI
Wolfpaws
ISn't there a constant which tell you where the script is called from? Like PHP_SAPI (or something)?
aidan
yeh, somewhere
php.net/features.commandline
Wolfpaws
php -r 'echo PHP_SAPI;' <-- returns 'cli' :)
aidan
there we go, php_sapi_name
or that constant
nuri
is there anway to go out to any site to see when it has been updated?
jrots
ok thanks for the answers!
alystair
lmao I'm such a bastard
our order numbers like 50 digits long
ok not really
but still you could imagine having to repeat the following over the phone?
660021730013110030-c6d5cc09030005c2202e0e387378a17a-028246-027-01-00
         

TestInG-CaKz0Rz
$10 P/M - 500 Slot Shoutcasts - Upto 500KB/S - PM Me For More Info
Wolfpaws
*blink*
should do it... I hope....
(Action) pokes lilo
coax
Hi, ant anyone help me with this error: sh: phpize: command not found
bentob0x
is it a way to display the name of an instance using $this within the class?
colder
bentob0x, the name of an instance ? wtf ?
bentob0x
the variable name of an instance
like $test =& new object
and within object I want to do:
print("the object " . $this->??? . " hasn't been initialised ok");
and $this->??? would return 'test'
colder
bentob0x, you want the name of the class ?
ah, no.
bentob0x
no, the name of the variable used to instanciate the class
:)
colder
I wonder why you need something useless like that.
bentob0x
because I'm using various instances of the same object but with different db tables
mazzanet
http://www.quakenet.org/verify/?MgmMCTGsHs9KXwf46d617a7a616e6574h112caa <--- that must seriously be the most horrid captcha ever
bentob0x
and when one db table isn't setup proprely, I want to know which instance it is
colder
mazzanet, heh
_DunK_
hey all
i was wondering if someone could suggest a really good php editor (php, css, html, javascript: the usual) that will highlight properly (a lot of them seem to have problems with mixed files) and also handle indentation properly... any ideas?
RvGaTe
_DunK_: what os ?
bentob0x
try Vim _DunK_
_DunK_
xp
Vim is a bit too low level for me :(
brokencard
try crimson editor
www.crimsoneditor.com
it's good freeware
vchrizz
http://www.weaverslave.ws/ is also a nice editor ... or http://www.scintilla.org/
_DunK_
cool
alystair
oh
Notepad++ :D
wisewitch
can someone help? here?: http://pastebin.com/764937
alystair
_DunK_: http://notepad-plus.sourceforge.net/uk/site.htm
wisewitch
the prob is the sql command at line64
it gicves this error: 0You have an error in your SQL syntax near '' at line 2
McFly
SELECT 'user, id'
wisewitch
does it have to be like that?
aidan
wisewitch: next time, paste only the line you have having a problem with
korkl
colder: back to what you said about hidden input instead of a captcha... isn't a hidden input more effective than a captcha? afterall, the bot can still guess the captcha. then perhaps captcha is overrated and really just a fad?
aidan
wisewitch: no, http://dev.mysql.com/select
alystair
It's not a fad
It's just that people are too lazy to solve the captcha thing
colder
korkl, well, if a bot is made to work on your website only, it will pass easely the protection
alystair
since there are so many types
You could look into KittenAuth
where you need to click on the picture of 3 cats in a 3x3 array of images ;)
Mc_Fly
.
wisewitch
aidan: it still gives the same error
You have an error in your SQL syntax near '' at line 2
an this is the code for the sql:
$sql = "SELECT id, user FROM `user` WHERE $add_sql";
$result = mysql_query($sql) or die(mysql_error());
while ($user = mysql_fetch_assoc($result)) {
$arr_name[$user[id]] = $user[user];
}
alystair
uhm
does ` work? I thought it's '
replace ` with ' around user
wisewitch
still the same >.<
colder
alystair, `is to enclose db/table names
wisewitch
the same error
colder
db/table/column
alystair
oh
(Action) shuts up
troozers
hey guys, i am trying to run phpize on my rhel4 server and get the a load of "PHP_WITH_PHP_CONFIG, PHP_EXT_DIR", etc errors - anyone whats happening there?
colder
wisewitch, keep using `.
wisewitch, what is the content of $add_sql ?
wisewitch
colcder: ok but then it still won't work>.<
$add_sql = "";
$start_rank = 50 * ($_GET['page'] - 1);
$sql = "SELECT `id`, `rank` FROM `ranking` WHERE `rank` > 0 AND `active` = 0 ORDER BY `rank` LIMIT 50";
$result = mysql_query($sql) or die(mysql_error());
while ($ranking = mysql_fetch_array($result)) {
$arr_id[$ranking[id]] = $ranking[rank];
$add_sql .= " || id=" . $ranking[id];
}
that the code where $add_sql is created
colder
Wolfpaws, *plop*
mazzanet
...zee heck?
zanzina
don't paste your code here
mazzanet
i just clicked on an rss feed link in firefox
and a new firefox window, internet explorer, wordpad and notepad all opened displaying the feed
wisewitch
zanzina sorry but they asked for what the content was of $add_sql can someone help?
colder
wisewitch, paste the resulting SQL query on a pastebin and go to #mysql.
wisewitch
I did and they sended me to here >.<
can no one help?>.>
>.<
Wolfpaws
colder: who? What?
oh
alystair
(Action) opens the door
Wolfpaws
arf
alystair
..
(Action) closes door disapointedly
Wolfpaws
colder: Sowie... I was afk at the time
colder
no problem :)
Wolfpaws
wisewitch: Care to read the guidelines now?
colder
wisewitch, please, echo the resulting SQL query, and put it on a pastebin.
CAiRO
hi
is there a faster way than md5 to get a unique identifier for a big number of longer texts?
« 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 37 38 next »