i'm setting up nginx with fastcgi. php-cgi seems to want me to
pass 'fastcgi_param SCRIPT_FILENAME' set to some path. which script
is it asking for? my docroot index.php? or the linux php-cgi program itself?
what do you usually set your $SCRIPT_FILENAME to?
Hi to all people
redirect to self, check for SESSION, found message, display
message
it worked, btw
ok i c, curl is a chapter of its own though - i get what i need
from then returned header (since it is delimited by \n) but as you
say, most html host is
not linebroken though.. (but even when autogenerating html, i break
lines myself for the looks :p )
the question is, how can I be sure that exact page gets the
message, and not another page which loads before it
I have a simple problem with php. I've called a webservice
written in Java and it reply a simple string encoded. I don't know
how can I convert this string in a file in my php hosting script. If
you need a part of this string:
255044462d312e340a25e2e3cfd30a332030206f626a203c3c2f46696c7465722f466c6174654
can anyone help me?
You need to read the specification of the protocol to find
out what format it's in. Read the docs.
Does fetchAll method close cursor automatically in PDO?
there is no docs
If there are no docs, then you should tell your boss that the
task is impossible. You should have identified this as a risk in
your web design already.
I can't find out it from manual, only from comments.
So I'm not sure of that.
I've a little snip code of the webservice, maybe we can
understand it
I think you only need to close a cursor if you opened it
explicitly
If you unset all references do the PDO object, or allow it to fall
out of scope, its resources should be cleaned up by a well-behaving
PDO driver
(assuming you have no other refs)
Sorry, my minds not on it as i'm currently being DOS'd so
you're probably better off re-asking the channel right now
:p
http://sourcepost.sytes.net/sourcepost/sourceview.aspx?source_id=29468
is there some how make me use AutoComplete feature in HTML
forms but not from history i need make if come from db
i need something like free-text&drop menu
MarkL, I'm not explaining well anyway :P I'll figure it out
myself, thanks. You're DOS'd? What's your site so we all visit it
and see how it's DOS'd .. jk.. who's doing it?
something like i see in gmail when i try to type email address it make
me free to type what i need but in the same time it's drop down my
address list
no one can help me?
The Chinese .. just managed to get a hard reboot done ..
what do you want to convert it to?
Another question - is the result free after $stmt=null; without
closeCursor()?
killing-joke:Look this code:
http://sourcepost.sytes.net/sourcepost/sourceview.aspx?source_id=29468
I think it works but I'm not sure.
I can't check it.
MarkL, ... why would they?
this code create a simple string
encoded
I would like convert it in a file type
foo.xml
If the PDO driver is well behaved, it should close a cursor
if the object goes out of scope or is unreferenced. I don't know if
all of the drivers are good though
$stmt = null; is ok, but unset($stmt); is better (and end of a
function is even better)
killing-joke: look here
http://sourcepost.sytes.net/sourcepost/sourceview.aspx?source_id=29470
I'm using PDO commands directly and I don't know if I
shouldn't put it info a function.
this is the encoded file
this is a pdf
I would like to convert in PDF
sourcepost is stalled
stalled?
looks like 'sourceview.aspx' is hanging
the data are more
maybe they just decided they don't want to talk to me
anymore
bmaybe they just decided they don't want to talk to me anymore
/b
wait
Everything should be in a function. Writing code outside a
function is bad because there is no lexical scope in PHP
Hence it pollutes your globals namespace
255044462d312e340a25e2e3cfd30a332030206f626a203c3c2f46696c7465722f466c6174654465636f64652f547970652f456d626564646564
when running the 'php-cgi' on Linux as a daemon fastcgi
listener, what should my $SCRIPT_FILENAME be set to?
yes, you have the big long hex data. what do you want to do with
it?
convert in a file
by php
write "2550...6564" to a file on the hard disk?
???
do you want to write your long numbers to the hard disk?
create new files on disk?
killing-joke: do NOT use register_globals.
Wolfy[drawing]: i'm looking for a good definition of what it is,
so i can decide best
hosting how to (mis)use it.
which section of the manual can you suggest i dig into?
!+gv
Global Variables - this will show you everything that php
sees: prephp print_r($GLOBALS); ?hr size=5 noshadephp
var_dump($GLOBALS); ?/pre
wrong channel. oops.
Erm
god damnit.
All my PHP books suck.
!+register_globals
If register_globals is off, you'll need to use
$_POST['form_field_name'] or $_GET['form_field_name'] to get form
elements (as opposed to $form_field_name). See http://www.php.net/reserved.variables
for more information. Why did this change? See http://www.php.net/manual/en/security.registerglobals.php
for an explanation. Also see: vars
many many thanks, all
Hi everyone
I've got a question to the mail function. Is it possible to
insert paragraphs after 65 characters (or what it was)
automatically?
... but the web server and the persistent fastcgi children ar
not talking to each other properly yet, so i can't use the
suggested code to see the internal state of the php web hosting interpreters.
That depends on the client, not the mail function.
perhaps you are looking for the wordwrap() function?
Wolfy[drawing]: You mean the client has to insert it?
I'll take a look at it, I don't know
yes, seems to be that. cool!
Anyone know of a way to capture screenshots of a URL using
PHP?
Yes, it is very difficult.
yep
hey any ideas how to get data to php mysql web hosting DB ? im
making game in JS, so if i have won, JS should tell server that how
much it took and name of myself but then again, this cant be
security, i mean it can be faked, what is best way to do
it?
you write a web browser using PHP then screenshot the web
browser
uyou write a web browser using PHP then screenshot the web
browser /u
aa^way: If the game is using client side scripting for its
logic, it can be hacked easily. You can easiyl use an AJAX-type
call back to update or retrieve the scores, but it is trivially
hackable.
try to pick out data from mysql?
\o/
aa^way: My recommendation would be to try to set the game up
so that people have no motivation to hack it. e.g. don't offer a
prize.
yep thats hwo it works, its only a puzzle no point for it but
im still wondering witch is best way? Maybe some Session control or
whatever?
If you use cookies for your sessions, you can use them with
AJAX. Alternatively you can manually do it.
http://www.vectrex.org.uk/mark/web/webwords/game.html
So... can __set() and __get() only be used once per each class?
I'm having difficulty figuring out which scope and context they'd
be used in.
This book isn't helping.
Wolfy[drawing]: thanks again. i found a comprehensive list of
reserved variable names here - http://us.php.net/reserved.variables
dan__t, those hooks will only work on undefined
properties
good, good.
ok.
so essentially defaults for a get and a set?
yep
so from this book... boolean __set([string property_name],[mixed
value_to_assign])
propery name would be $arbitraryReturn, value would be like
"This is an error"?
And as a result, "$className-somewhackedoutproperty" would fail
if there was no property defined as like 'public
$somewhackedoutproperty;', and inside the __set() I could do things
such as record an error to a database or whatever?
hrm.
Guess I can't have a different accessor or mutator depending on
data type eh
That kindof sucks.
if anyones got 5 mins spare pleease could you priv PM me to
give me a bit of help with sessions?
How about you just ask?
Ask in the channel
im tryin to have users with different levels of access to 2
pages
level 1 can access index.php (where the header points to), then
level 2 should be allowed to admin.php too
admin.php is accessible via a hyperlink in index.php
i can start a session, but not sure how to have different users
in the same session, and how to differentiate between them
in order to grant or disallow access upon clicking the admin.php
link
on met quoi dans un manuel de maintenance ?
sesson_start(); if ($_SESSION['accesslevel'] 2) { echo "F off";
} die;
so accesslevel is an element in the session array and also a
field in my table?
Wolfy[drawing]: i went through all of my php workers and
found the one that was handling the requests. by running "strace
-s2000 -vfp $php_pid" on that worker, i was able to see the
complete syntax of the request coming from the web
server.
You have two problems, authentication and authorisation. You
can solve them both using sessions but you need to do something
else too, e.g. have a login page.
If you set it as such, sure.
ive got a login page
hold on
my error is not php-related, it seems.
404\r\nX-Powered-By: PHP/5.1.6\r\nContent-type: text/html\r\n\r\nNo
input file specified.\n\0
fall asleep there, ekneuss? heh
login.php:
http://pastebin.com/930146
a href="http://pastebin.com/930146"http://pastebin.com/930146/a
auth.php:
http://pastebin.com/930147
have you seen how edgeruby implements sessions? as encrypted
cookies. no files on the server.. is this viable for
php?
Don't ever do error_reporting(0).
MarkR42, you mean except on your live server
oh k
You could use encrypted cookies, but there is a limit to how
much data you could store
MarkL, 4k
No, I mean, don't set error_reporting(0), EVER!
4k ought to be enough for anybody (tm)
MarkR42, why
Because errors should not be ignored. If they happen, they're
really important
dan__t, was on another tab, what's your issue ?
I mean, why would you want people seeing your php errors on the
live server
I use error_reporting(E_ALL)
right
and I use error logging
error_reporting does not affect whether people SEE your errors
or not
Just still wondering about __get() and __set()
can anyone give me a few pointers?
It affects whether they're reported. You ALWAYS want ALL errors
reported, somewhere.
Also, most of the time you want any error to abort the page
immediately
And as a result, "$className-somewhackedoutproperty" would
fail if there was no property defined as like 'public
$somewhackedoutproperty;', and inside the __set() I could do things
such as record an error to a database or whatever?
MarkR42, how would you set that - custom error handlers?
I convert some errors to exceptions, and handle them
that's the alternative approach
and more robust in my opinion
bleh.
what must we write in maintenance manual ?
I normally use a custom error handler. It converts anything to a
exception.
In a few places these are caught, but in most they fall through
to a default exception handler which logs the error and context and
displays an error page (without error message) in
production
well "anything" could screw up the reporting
In development it throws out a stack trace
hey all
it throws the stack traceof the error handler
which is not what you really want
Technically it checks whether that type of error is included
in error_repoprting, otherwise ignores it
No, it throws the stack trace of the error.
Basically, I concluded that even an E_NOTICE usually means a bug or
a problem
So even they cause an exception to be thrown normally
nada de nada
the problem is very hard to me
quelle manual?
killing-joke, maintenance manual
cette manual? - http://www.php.net/manual/fr/
no
je pense que le logicial php n'a pas besoin de "maintenance",
non?
!+english
##PHP is an English only channel. If you need support in some
other language, please try elsewhere.
killing-joke, i'm not talking about php
ah, ok
i have a maintenance manual to write
sorry about that
I'm tryin to use phpBB, no one's up in #phpbb, thought maybe
someone here could help.
on this page, there are two buttons, they just look like white
squares. I need them to be readable. http://www.luminousnerd.com/bb/forum/viewforum.php?f=1
#phpbb
hm what is function for deleting everything in directory?
doing rmdir but says unable to access, probly it is full of files
thats why but is there any better way then opening dir and looping
over files and doing unset one by one?
unlink*
aa^way
rm -f
You can't delete non-empty directory
Jinx--: That's be rm -rf
Jinx-- I cant do it like that :P
*that'd
well, depends on if he wants to remove the content, or the
directory too
is there a java byte type in PHP?
aa^way, dunno then
A what?
I have a little code
that write a long string
Welcome to the club
a string encoded
!+enter
Don't use the enter key as punctuation. Think in complete
thoughts, then type.
I don't understand how to convert it by php
255044462d312e340a25e2e3cfd30a332030206f626a203c3c2f46696c7465722f466c6174654465636f64652f547970652f456d62656464656446696c652f4c656e6774682032203020522f5061726
I can't even remotely know, what the heck is that.
http://sourcepost.sytes.net/sourcepost/sourceview.aspx?source_id=29468
this code encode a simple pdf file in a simple string
and I would like to decode it with php
can you help me?
You've already asked this loads of times, no we can't help
you. You need the specification which tells you what format the
data are in, otherwise you're stuffed.
if you stop abusing enter
Why? "Warning: unlink() [function.unlink]: Unable to access
/user_puzzles/2612/17.jpg in image.functions.php"
thanks guys
oh user_puzzles chmod right?
na it already has =\
aa^way: user_puzzles is in the root directory?
no, it is in root/aron
aa^way: So fix it
eurocv3794, http://www.pgregg.com/code/hexstr.php
paste it in there and click hexstr
i want that script work on everywhere, maybe
cwd()."/user_puzzles" ?
cwd() isn't a function
I'm trying
getcwd i meant
unlink() [function.unlink]: Unable to access
/erti/aron/user_puzzles/4681/20.jpg in
/www/05/nero.pri.ee/erti/aron/image_functions.php on line 96,
Same
WOWOWOWOWOW
WORKS!!!!
where I looking for the hexstr.php
the source code?
http://www.pgregg.com/code/hexstr.phps
heh
Didn't Qube told you about pack() before?
not me
i only just woke up
THANKS
im checking "if(!$_SESSION['logged_in'])" when someone tries
to access my index page, and if it's true i use header(...back to
login page) ... but the login page is where it's set, so it's
initially saying undefined index.. surely this is a
catch22?
jesmond, not at all.
I don't seem to be able to assign values to my class vars via
a constructor; assigning with $myObj-myVar = $myValue; works fine..
Does anyone knows what's the reason for this?
know*
Pastebin the code
Ok, I made a very easy example
I still want the pastebin'd code.
http://pastebin.com/930161
PHP 4 or 5?
Should make things clear
woflits 5
Wolfy[drawing]: I mean
4.4.4
Then __construct won't work. php.net/oop
Wha?
nevfermind, just me going crazy, again
s/nevfermind/nevermind
Ah I see
Yes, the code was for 5, but it doesn't do what it's supposed to
on 4
Yes, the code was for 5, but it doesn't do what it's supposed to
on 4