logs archiveIRC Archive / Freenode / #php / 2006 / March / 12 / 1
urupica
dools: that doesn't solve my problem. What if $user='a&b' and I want to pass the user: echo "index.php?user=a&b";
dools
urupica: oh right, urlencode
A2K[]
or use another var value sending method
get/post
Dustin22
hello, can someoene help me out, I installed php5 and am trying to install forums on my localhost, it says: This PHP environment does not have support for any of the databases that PunBB supports. PHP needs to have support for either MySQL, PostgreSQL or SQLite in order for PunBB to be installed.
I have php 5 installed and mysql installed
A2K[]
php.ini
extensions
Dustin22
A2K[], I already set the extensions directory also
; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:/php/ext"
A2K[]
do you have mysql extension?
minDscrm
when i get a resource id #17 when i try to echo a variable.. does that mean it's an array?
Dustin22
A2K[], yes still not working
         

dools
minDscrm: you need www.php.net/mysql_fetch_array
minDscrm
ahhhh sweet
thanks
A2K[]
try mysql_connect('127.0.0.1','user','pass');
if it works try to use another forum :)
IPB or SMF
Dustin22
I like punbb, and used punbb locally before
it's odd its not working
A2K[]
mysql_connect does not work???
starkhalo
sup Kronuz
Kronuz
:)
hey, one question... how come I can't do: $something=function() or return(false);
it works with die
StarkHalo
try : $something=function() or 1;
0 that is
or 0 ^^
Kronuz
hmm
A2K[]
$something=function() or 'false';
StarkHalo
but I don't see the use of it, the value false with or doesn't matter
Kronuz
but that doesn't return from the function, that's what I want
StarkHalo
then change the function, try wrapping it
Kronuz
like "breaking" the function execution if something fails
StarkHalo
more specifically, what do you want to do?
Kronuz
just that, if and assignment fails return from the function with a false... I just wanted to avoid the use of an if()
like if(!$var=funct()) return false; works, but I wanted to do: $var=funct() or return false;
'cause it's simpler to write
suedoh_
hi guys, if i get the following:
Premature end of script headers: /usr/local/www/cgi-sbin/php-sbox
when I'm trying to upload a file, anyone have any ideas where I could begin to debug?
StarkHalo
Kronuz: your logic is flawed ^^ as I told you, 'OR' with false DOESN'T matter, it works with die, because if the first function fails, it then executes die()
Kronuz
I know, but I thought return was a function
so if the first assignment fails, return would be called and the function would end
StarkHalo
oh I see, you want to BREAK the function and return immediately
         

Kronuz
but it doesn't work, as return is probably not a function
yep
remember above: if(!$var=funct()) return false;
StarkHalo
well, as you've wrote it, return() will only execute when funct() is false
Kronuz
oh, I would need extra parenthesis?
StarkHalo
I don't know, let me write some test code
Kronuz
well, the weird thing is that it works with die(), but not with return()
it does die, but it doesn't return :P
StarkHalo
ok, checked it
it gives an unexpected return
what I did was to wrap the return function with myReturn
Kronuz
so? what's the veredict?
StarkHalo
function myReturn($ret) { return $ret } <-- works
then, you can do $var = fun() or myReturn(false);
but it won't break the function
so there...
Kronuz
but that won't break the calling function, just your myReturn
exactly
StarkHalo
yup, can't have it both ways :P
Kronuz
I guess I'll use the if() :P
StarkHalo
try the ternary operator :P
Kronuz
just lazy
lol
weird how it works with die()
I'd suppose it should work with return() as well
StarkHalo
well, not really
return is not a function per se, but a control structure
Kronuz
'cause return() is not a function
right
that's what I figured
calamari
sorry for this absolutely basic question: how do I read form post data?
StarkHalo
:)
calamari : $_POST array
Kronuz
StarkHalo: I still think it should work :P
StarkHalo
Kronuz: hehe, but it doesn't :D
Kronuz
and don't give me that purism crap about not being a function ;)
calamari
StarkHalo: thanks
StarkHalo
oh well, read the php docs
Note: Note that since return() is a language construct and not a function,
it's right there
Kronuz: nps, anytime
Kronuz
yeah, but it doesn't say: "it won't work when you need it" :P
j/k
StarkHalo
lol
ironpig
anyone know why I would get a parse error on the last line of my .php file? Where the " ?> " is ?
fires
ironpig, look for a missing ;
sesstreets
hello?
fires
hi sesstreets ^_^
sesstreets
Hey can somebody help me with a quick script?
Kronuz
does call_user_func() return the return value of the called function?
(it doesn't say anything about it in the docs)
sesstreets
On a couple of forums ( I think IBP forums) they show the php usage, mysql usage, and time take to make the page
Does anybody know how to do this? Or can anybody point me to a script for it?
ironpig
hey fires, thanks :)
sesstreets
anybody?
fires
one sec sesstreets, i'm looking for it
sesstreets
You do know what I mean right?
fires
yep
StarkHalo
<Kronuz> does call_user_func() return the return value of the called function? <-- YES
fires
sorry mate, i was thinking i might find it in the reserved variables section of the docs
good luck to you
StarkHalo
sesstreets : use microtime() for page creation time, and with http://mx2.php.net/manual/en/ref.info.php you can extract lots of into from the runtime
lots of info*
sesstreets
well
im actually looking to make a wordpress plugin
but to be honest
in #wordpress they dont help me
so i came here
StarkHalo
as long as you have php questions, we can help
sesstreets
i always do
Kronuz
is a heredoc in php much slower than doing: ?> <?
?
Larry
what's the 2 ways to do PHP_REMOTE?
the older way?
wait er
PHP_SELF*
sesstreets
ok next question
StarkHalo
Kronuz : I would think they pretty much perform the same, both of them turn off the interpreter
sesstreets
I made a script that logs ip addresses
Kronuz
but a heredoc does interpolation, right?
sesstreets
and it uses a file called logfile.txt to write down
like the date and time accessed as well as the ip of the user
the problem is that i dont know how to get the absolute path of it
since the call to it is logip();
and that page that logip(); is not on the main page how do i get it that it automatically finds it
StarkHalo
sess: realpath()
sesstreets
as in how
i want to use an absolutepath like http://www.domain.coim/logfile.txt
but when i put that in the string it doesnt work
StarkHalo
that can work only for reading logfile ^^ AND if you have URL wrappers enabled
you've got to use the filesystem if you want to open/read a file
if you use http, you can still read the logfile, but you can't write to it
sesstreets
damn
the problem is that the call to the logfile would look in the directory its in
IE wp-content/themes/theme/header.php
hmm wait a sec
StarkHalo
[16:58] <Kronuz> but a heredoc does interpolation, right? <-- YES, my mistake, then ?> TEXT <?PHP should be faster for displaying PLAIN text
koolmansam375
FlamingCows, hello?
StarkHalo
sess: use ../.. as necessary
sesstreets
it works if i use the /home/sess/public_html/logfile.txt way
but this plugin is for other ppl
StarkHalo
but you can get from wp-content/themes/theme/header.php to /home/sess/public_html/, say include("../../../logfile.txt")
Ralle
is MBzle still here?
sesstreets
so it just looks inevery directory till it finds the file basically?
« 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 next »