Please read it before using
I did!
hello
preg_match("[a-zA-Z]", $test)==0) echo "You're text is
acceptable"
can you define a costant array ?
Then you're saying you simply didn't understand it?
[] will get interpretted as delimiters, but the pattern
a-zA-Z still shouldn't match "123"
and $test is 123 in this case
php.net/pcre
Please look at the URL I sent you
Now read the first paragraph
thb
thx
Note: that's *still* not what you did wrong...php -r
'var_dump(preg_match("[A-Za-z]", "123"));' returns
int(0)
adema, it appears to be an issue with using localhost as the
domain. works fine when i remove that. not sure why it is a problem
though
it seems i don't understand it
gsm4, thx
Which part of "The expression should be enclosed in the
delimiters, a forward slash (/), for example." do you not
understand?
gsm4, but i'm also using mediawiki on localhost, and i can
see the cookies of mediawiki
it's strange :/
whats a delimiter?
adema, do those cookies define localhost as the Domain
hosting in the cookie or does it leave it blank?
It's "a forward slash (/), for example."
seriously though, what is a delimiter
It's something that delimits, or "marks the start and end point"
of something.
gsm4, when i leave it blank in my setcookie, it doesn't work
better
right thanks
can anyone please help me with my alternating page question?
im sure it's not that complicated.
Try dictionary.com if you come across words you don't
understand, rather than just ignoring them.
gsm4, and the cookies of mediawiki use localhost for host
too
I still haven't figured out how you have two files named
index.html in the same directory...that's pretty key to me being
able to help you.
I thought it was a programming term and therefore wouldn't be
in the dictionary
adema, removing it works, while an empty string i would expect
to fail.
Most programming terms are in the dictionary
that's good to know
how
you're wright
if i remove "localhost"
i just keep the path "/"
it works oO
well I found the problem anyhow
Now, let's talk about your actual problem.
index.php needs to include an alternating page. page1.php and
page2.php. I need each of those pages to load an equal amount of
time.
Oh, you finally managed to figure out what preg_match
returns
it was a 1 set to a 0
no I knew what it returns
and I had it set right at one point
It returns a 0 if it fails to match
Rather, it returns false
must've ctrl-z'd once to many times and not noticed
Which is == 0
yey it's all working now
to make it a little more complicated. im not actually loading
pages into index.php. im loading alternating conditions.
well, preg_match, as preg_match_all returns integers, hence 0,
not false /nitpicking
inside those conditionas are the actual page rules and what
not.
What does "an equal amount of time" mean? Do you mean "Every
other HTTP request must ALWAYS alternate which page is loaded"?
"Every second, the page needs to change"? "Roughly half of requests
should get one page, roughly half the other?"
yes. 50% one 50% the other
if there were three pages it would be 33.333 and so on..
I gave you three options, and your response clarifies
nothing.
who are you talking to, me?
yes
Which of the three options I mentioned most closely matches your
need?
They're all VERY different
the last option.
it's not actully a pag that im worried about though. its two
conditions..
You started with "page", I'm going to keep using "page"
because it's not significant to the response whether it's a page or
something else
exactly..
php.net/mt-rand
i found that earlier and tried it. since i dont know php
hosting im not sure where to take it.
Well, you should probably start by learning PHP
if (mt_rand(0,1) % 2) { thing1; } else {thing2;}
that would be a collosal waste of time..
TML, err, is % 2 relevant in this case ?
Fair enough.
im not loking to learn or master php. i just need a quick
solution to a question that has been made overly complex.
Wrong channel for that, then. We're here to help people learn
PHP.
if (mt_rand(0,1)) { /* ~50% */ } else { /* ~50% */ } ?
heh. well, you didnt really help me learn either. so maybe
it's the wrong channel for you to?
You are to blame for your continued ignorance, not I
just out of curiousity, what would your respnse have been if i
said option 2?
or even one?
option two would have been based on time()%2
one would have probably been a semaphore
i get that i need to Random. I need to spcfy "how" random.
and then i need to specifiy what exactly is going to randomized. ut
i do not get the syntax.
FWIW, I went the "%2" route because he mentioned earlier he
might need to expand beyond 2 options.
Not that it invalidates your point at all.
You said you know Java, so help me understand which part of this
construct doesn't make sense to you, as I'm having trouble figuring
out where it's significantly different from an equivalent java servlet hosting
expression: if (mt_rand(0,1))
ok, so i get it now.
it's the same. and as i said earlier (if you noticed) i found
mt_rand hours ago. that wasnt the problem. it was everything
else
if you're trying to prove a point- you're wasting your
time.
JBandP, well for more than one option maybe a switch on an
mt_rand call?
Who's trying to prove a point. You just said you don't
understand the syntax.
What part of the syntax do you not understand?
I got it working. since it was smarty i needed to wrap
everything in {php}{/php}. after doing that 100 times it seems to
be working properly now. thanks all.
hi , array_values return an array , say, array_values($arr1),
is there any way to get something like array_values($arr1)[0] work
in php ?
basically I tried to avoid using temp array
got it, thanks
hengha, nope, you can't what you want in this case is
reset($arr1);
anyone know of a good php script displays a random image host from a folder AND
subfolders?
Machness, your own maybe (or maybe not)
implode(array_values($arr1))
well...I could do my own...but I would have to learn a lot of
the stuff
and I dont really have the time for that
hengha, why are you using array_values ?
$arr1 is an assoc array
so ?
whose key is in an iteration , that is, unpredictable
yes, so?
hengha, it still has an order, implode will work fine with
assoc. arrays.
yes, that works perfect in my case, hehe
glad to see glue is an optional param
What's the right regex to match a string that is any letters
and ends in 'RO'?
for definitions of "perfect" which include "does a bunch of
work it doesn't need to", sure
I tried /*RO/ and got no luck
stahnma, /.*RO$/
it's not less "predictable" than the result of
array_values.
stahnma, as long as you don't care what comes before the RO
at all
That array_values() call does nothing but waste cycles
TML ?
no one can help me?
What do you mean "?"
I don't, so thank you very much
TML:: dont get your comment above,
implode($arr1) does *exactly* the same thing as
implode(array_values($arr1)), with less work
array_values() doesn't sort them
"them" being the values
And implode() doesn't require a numerically index array
well, $arr1=array($key=$value); so implode($arr1) will return
$value ?
So the call to array_values() just complicates your code and
wastes CPU cycles to no avail
mt_rand(0,1). The pages do not seem to alternate 0,1,0,1,0,1
. it looks like it does alternate- just not equal.
JBandP, 50% - 50% is not the same as alternation
got what you said, thanks a lot
Remember how I gave you three options and you chose the one that
is "Roughly half of requests should get one page, roughly half the
other?"
Well, you've just bumped into the "roughly" part
well, roughly looks like it could be 10-1.
thats not do roughly
JBandP, php host
-r '$result = 0; for ($i = 0; $i 10000; $i++) $result +=
mt_rand(0,1); echo $result/10000;'
0.5034
hi
ekneuss. nie!
nice!
of course, if you take only 4 experiences, the chances that it
will be 50% are low;
please help! http://pastebin.ca/624971
a function assigned reference of a var in this function scope to
a global var. but the global returned to its original value after
the function.
php4.4.4
what is php -r?
i want to write an extension where you can include files via
a function but can restrict the functions you can use inside the
template. is that possible as an external extension? where should i
start?
doesn't php
hosting have a "random number generator" function?
hello, i use query strings to load the content of my page,
but the whole page refreshes (including the flash banner, so this
replays again). how can i only load the content and the rest (flash
banner) stays
JBandP, using php from the command line, you can give him
content to execute directly through -r
oh, i see.
Yes, it does. More than one, in fact.
hey all, can I force php to use ldap protocol version 3 instead
of default to 2?
rand
some php.ini setting?
TML please help!
i don't even understand the concept
so wouldn't an easier solution be a random number between -1
and 1 (0 or 1) and the result of that generation affecting what the
page loads?
rather than all this complex math?
if a var in a function scope still is referenced by others
after the function, should gabbage collector collect it?
uif a var in a function scope still is referenced by others after
the function, should gabbage collector collect it?/u
Who's doing complex math?
The solution we gave him was if(mt_rand(0,1))
I just thought ekneuss's looked rather farfetched
I won't lie I don't really understand it but it looks
complicated!
ekneuss was showing how, over a large sample, mt_rand(0,1)
will generate 1's roughly half the time
ahhh
Pollita help please
DavidHKMrPowers, that's not an issue of garbage
collection
ekneuss then what's it?
It's an issue of not understand references, but I don't have the
time to get into that subject ATM
s/understand/understanding/
DavidHKMrPowers, $a = 2; $b = &$a; $c = 3; $b = &$c;
echo $a // 2 not 3
hello
One too many &'s
$a = 2; $b = &$a; $c = 3; $b = $c;
TML, no, that would give 3
php -r '$a = 2; $b = &$a; $c = 3; $b = &$c;
var_dump($a);'
int(2)
php -r '$a = 2; $b = &$a; $c = 3; $b = $c;
var_dump($a);'
yes, which is the "issue" he's encountering
int(3)
he's getting the $a unchanged and he wonders why
I misunderstood what you were doing. I thought you were
demonstrating what he should have done, not what he did
wrong.
TML, nah, I was just demonstrating that it could be repoduced
without any objects, functions, globals, only that it's how
references work
hey all, can I force php to use ldap protocol version 3
instead of default to 2? maybe some php.ini setting?
how do you get the key of a known index value of an array? for
example: $foo[0] is the same as $foo['test'] how do i extract the
'test' from foo if i only know the index number value?
i want to write an extension where you can include files via
a function but can restrict the functions you can use inside the
template. is that possible as an external extension? where should i
start?
foreach / array_keys
TylerJGillies, you could go through array_values and then access
it numerically
ekneuss TML i understand this
ekneuss: thnx
DavidHKMrPowers, that's exactly what's happening in your
case, global $a; can be rewritten as $a =&
$GLOBALS['a'];
hello. i need to break up a string into search terms, which
can include quoted phrases.
$b = "b"; function x() {global $b; $a = new StdClass(); $b =
&$a;} xx(); var_dump($b); // "b"
explode/preg_match FlimFlamMan
Instead, define the funciton as: function x(&$b) { $a = new
StdClass(); $b =& $a; } x($b);
$b = $a, DavidHKMrPowers
walnut cherry "cinnamon raisin", it would break it out into
'walnut', 'cherry', and 'cinnamon raisin'
you will need to use regular expressions, FlimFlamMan
ekneuss TML ThinkMedical ya, but i need to create large objects
within the function so i don't want to create it and then duplicate
it
ok...
why are you using globals/references
anyway,DavidHKMrPowers?
so use pass-by-ref, like I said
except don't copy my mistake
function x(&$b) { $a = new StdClass(); $b = $a; }
x($b);
Let's say I have a bunch of images in a folde
and i go to my webpage
what would i use to make the first image come up, and a next and
previous button
TML still don't work
Is there a way in regex to say "accept ONLY a-z" without
saying "don't accept (everything accept a-z)"? if you understand
what I mean
oh you
've new version
the images are numbered from 1 to some number
[:alpha:] , RubberDucky132? not php either
Lke I said, don't copy my typo
you want to load a specific pic, Some_Person? header('Location
...
thanks ThinkMedical I'm using it in a PHP script though so...
kind of :P
DavidHKMrPowers, you're suing php5 right ?
TML so, in your example, is the stdClass duplicated?
using*
php4.4.4 ekneuss
meh
ThinkMedical i use global here to make it simple
i want it to autoload the first picture
and i want a next and previous button to go to the next and
previous picture
hmm, DavidHKMrPowers, elegant vs simple and crude... i guess
i know which side youre on
Well, for starters, try and remember that PHP is copy-on-write.
That is, most of the time, you probably don't need to use
references.
function x(&$b) { $a = new StdClass(); $b = $a; } x($b);
// How many stdClass has there been actually?
one
why not do $b = new StdClass(); ?
ThinkMedical i am elegant
TML does that copy-on-write mean assigning by values is also
effective?
I'm unable to translate that question into English
ThinkMedical cause i need to give that ref to other vars too
$a = new X(); $ref1 = $a; $ref2 = $a;
DavidHKMrPowers, for your earlier question "how many", there
will be "2" in that case
Err...how do you figure?
That should only result in one
leaving the copy on write appart, $b = $a will result in a
copy
Zend won't perform a copy until it has to
function x(&$b) { $a = new StdClass(); $b = $a; $a-foo = 2 }
will leave $b without the "foo" member
THAT would create two copies, sure.
yeah sure, but there will be two distinct objects
that's why I added the quotes around "2"
for php, there is at that moment two objects but that both
reference the same as it hasn't been changed yet hence no memory
implication if the function doesn't affect the object
That's splitting a semantic hair pretty fine
function x(&$b) { $b = new StdClass(); $c =&$b; would
be the only way to have both $b and $c referencing the same object
inside the function, without killing the reference with the outer
variable
well, I simply made that distinction so he's not surprised to
see that affecting the object in $a in his function has no effect
on the object assigned to $b
http://img405.imageshack.us/img405/5301/mockupsc4.png
where when you go to the page it loads "/img/1.png"
and the next and previous go back and forward
and the the go to, say you type in 43 in the go to, it goes to
"/img/43.png
can someone show me how to do this in php?
imgsrc.php?src=%2Fgallery%2Fhere%2F1184277458-n46400581_30254106_2428.jpg
does anyone see anything wrong with that?
Some_Person, well, you can get the current number in, i.e.
$_POST['picture'] now you simply have to work with that
variable
what?
Some_Person, you probably want to learn the basics first,
take a look at php.net/tut
Well ThinkMedicals didn't work. PCRE doesnt like [:alpha:]
apparently
argh, that tutorial page on php.net needs work.
So, any other ways in PCRE / PHP in general to check a string
is ONLY a-z / A-Z (and basic punctuation) and nothing
else?
caffinated, yeah, really :]
I was asked a while ago to consider helping with the phpdoc
project. I may join just to fix that.
caffinated, do that, philip will be uber-happy
it just swallows my soul every time I go to the "something
useful" section
RubberDucky132, it's [[:alpha:]], by the way, and you can use a
simple character class like [a-zA-Z.,_-]
did domxml_open_file() get removed from php5, or did i just
not build php5 with the right flags?
domxml is gone in PHP5
but that doesn't account for allowing ONLY that
Anyone here work on the eclipse PDT plugin? Or know of an IRC
channel with people that do?
Sure it does, as long as you use your metacharacters
correctly
I had the idea of using preg_match_all and then comparing the
result to a strlen
Pretty sure no one here does, but you could try #php on
efnet
RubberDucky132, justuse boundaries, ^ and $
thanks TML
Hehe, havn't learnt metacharacters yet, I know what ^ and $
are though so ok I'll try that
The entire domxml extension is removed from the core as of 5
That's why if you look on the function pages, they say "PHP 4 =
some 4.x.y"
can I use \w \s as well with PCRE?
php.net/pcre.pattern.syntax
RubberDucky132, sure, look at
php.net/reference.pcre.pattern.syntax
seems like you need the "reference" on that one
thanks
TML, well i was confused because PHP 5 is = PHP 4
will do, thanks
caffinated, speaking of which, the security section would
need to work done too
some "security experts" were asked to help but they're probably too
busy feeding the trolls.
yes. it's mostly a question of time with me
it's about the only thing that's stopping me from doing anything
right now.
yeah, same here, I considered rewriting it completely, but I
just don't have the time, so I started improving it parts by
parts.
which is still PHP4"
If it meant PHP5 as well, it would say something like: "PHP4
= x, PHP5"
For example, php.net/substr
ekneuss but...one of my question is...why would it return to its
previous value?
DavidHKMrPowers, it doesn't "return" to its previous value, its
value was never changed
$b = "b"; function x() {global $b; $a = new StdClass(); $b =
&$a;} xx(); var_dump($b); // "b"
DavidHKMrPowers, $b inside the function stop being a
reference of the outer $b when you reassign it as a reference of
$a
ekneuss so..inside the function $b is a ref to $a
yes
after leaving the function, it should still be a ref to
$a?
no
because $a is collected?
is it possible to create a new instance of a class from
within the same class? (ie: in the case of needing array of same
objects)
$a = 2; $b = &$a; $b = &$c; $b = &$d; but rather
like that: $a = 2; $b = &$a; $c = &$b; $d =
&$c;
it has nothing to do with collection, as I said earlier
ok.. so here's a theory question... sort of ... so i have
this script which uses the GD library and outputs a dynamic
image... like index.php?text=text and the script would echo the
text over the image... that's fine and all... what i was wondering
is if you could do something like this with flash? in the index.php
script i have it sets the header content type to png and then
outputs the image.. can this be done with flash?
$b =& $a; destroys the "global $b" and makes a new local
variable $b
That would be a better question in a flash channel
DavidHKMrPowers, $a = 2; $b = 3; $c =&$a; $c =&$b; //
here $c is no longer a reference of $a, but of $b. $a is left
unchanged.
i don't necessarily need to put anything over top of the
flash file, just output but have the URL look like an image
k
piece of cake with flash...but not the place for flash
questions
well i just needed to know if it's possible before i bothered
researching/googling it.. thanks
file2"); to replace newlines from a dos text file.
has anyone been able to run sed without errors? I keep
getting 'unterminated s command'
http://sql-servers.com/nopaste/?show=9154
-- im trying to get the output variables @prmErrorDesc and
@prmOrderID from the stored procedure -- any ideas?
What's wrong with dos2unix?
DavidHKMrPowers, the manual is talking about it (a bit wrongly
though) http://php.net/language.references.arent
ekneuss TML i see!! so it's not possible to change the value
of the source by a ref? unless changing properties in an
object?
Wolfpaws, it's not working.
which part?
cheeby, maybe php is interpreting the \r and \n before
passing to sed. try single-quoting thew exec command
string?
why isn't this doing the task I mentioned earlier
^[\w\s\-_,.'()]$ ?
DavidHKMrPowers, not sure what you mean, but YES! :]
Wolfpaws, not sure. I run dos2unix file1 and it doesn't
change the file.
gsm4, I'll try that.
RubberDucky132, is the period in the [] being misinterpreted
as any character? [not sure what you mentioned earlier]
well using RegexBuddy set to PCRE it says no.
[.] is a literal dot
RubberDucky132, er, either that or it is likely trying to
match exactly one character
like i said, not sure what you were trying to do earlier
\w includes numbers, for one thing
lol, great.
I'll switch that to (?i)a-z then
Once again, something you'd have known had you bothered to read
the docs
DavidHKMrPowers, you can't join two sets of references, if
that's what you mean. [a b c] [d e], you can't say that c is also a
reference of d making it [a b c d e], it's either [a b c d] [e] or
[a b] [c d e] whether it's $c = &$d; or $d
=&$c;
i want to write an extension where you can include files via
a function but can restrict the functions you can use inside the
template. is that possible as an external extension? where should i
start?
qual a melhor maneira de validar um campo UNIQUE do
mysql
I knew \w meant word character and in my mind word doesn't
include numbers.
tipo, alguém poderia me ajudar a criar uma
função
sei la
The question doesn't make sense, but you should start with
Sara Golemon's excellent book "Extending and Embedding PHP"
!+es
Para los usuarios PHP de habla hispana que requieren la
ayuda, ensamble por favor el canal del #php-es
does anyone know of a firefox plugin that times an entire
request? e.g. all redirects, DNS query times, page load times,
network delay... firebug dhows you the content load times, but it
seems to ignore the time between the request and the
response.
it does, but thank you.
No, it really doesn't.
oh yes it does.
Just for starters, you never defined what the word "template"
means in the context of your question
So anything following that word is pure noise
i meant the file you're including
file2'); works. Thanks.
cheeby, np
Wolfpaws, not sure what's up with dos2unix. it worked fine
until yesterday.
There's an easy way to do that (but it forces you to use
OOP), a clever (but not accelerator safe) way to do it. And a hard
(but safe) way to do it.
May I introduce the author of "Extending and Embedding
PHP"
ekneuss got it, am now testing
Sorry, didn't see you come back from your earlier /part
thank you Pollita, thank you TML.
s'alright, I was having routing issues (still am)
what do you mean by "not accelerator safe"?
Things like APC, turck, etc.
ah, i c.
are you talking about autoloading classes not being accelerator
safe? I had thought that was resolved in APC. I had been meaning to
look that up.
well it totally should be.
No, I'm not.
Different topic
aah, ok
I'm caling about overriding function entries to use the disabled
functions handler
s/calling/talking/
I missed the initial subject.
guys, I am trying to include a php file that is in another
directory...however that php file opens up a directory. so when I
include it...it is using the wrong directory path
is there a way I can tell it to check where it is
do you know, offhand, if class autoloading is now accelerator
safe?
would alteration of the disabled funcitons handler be local to
the file i would include?
The "not accelerator safe" part is that multiple processes share
the same function entry
Nope (see previous message)
what's a good way to pull out xml portion of a curl response?
xml ... to the last
It works fine when you're not using an accelerator, but adding
SHM to the mix changes the rules
hum. ok. would there be any problems with using OOP?
Sounds like a job for regex
Just architectural issues
Currently, OOP call overloading only works for instance methods
(though I'm commiting a patch to php6 on friday which enables
static call overloading)
So you'd end up having to either force your users to instantiate
the class (to use clean __call() based dispatching), or force them
to use a wrapper function (which is just as bad)
ah. i just got what you meant on the OOP-part
hi there
ok, thank you. i think best way would be the third and hard
way, right?
For your user's sake, it'd be the cleanest, though, as
mentioned, it's the hardest
can it be done as external extension and could it be done as
a language construct?
i have a question about e-mailing using php. can i ask it
here?
Well, since we're not talking about something that'll get
mainlined, it'll be easiest (long term) for you if you make it an
extension.
I would argue that external extension and language construct
are mutually exclusive states
ok, thank you. both of you.
You can't make language constructs from external extensions
Just in case that wasn't clear...
That can ONLY be done from the engine by modifying the
lexer/parser
And it's a severely black art
i had a look on the code before and saw require, include and
eval being kinda thrown together. if they weren't, it'd be easier,
i guess.
yeah, they are, but that's not really a problem here
ok, i have a problem. i use a free hosting provider for my
site. i need to send dome emails. but my hoster doesn't open smtp
port and sockets are closed too. the same is about mail() function
and sendmail. is there a way to send mails, let's say, through
gates through 80th port? maybe you know the way how i can do
that?
spammer!
ok, we'll see. where should i start?
NO
get him!
what's that function that get's the arguments passed into a
function?
s/get's/gets
not a spam site, i can give you URL
func_get_args()
get_func_args?
err what Pollita said
there we go
thanks
You'll need to override the DO_FCALL and DO_FCALL_BY_NAME opcode
handlers
just notifications on forum end so on
^[A-Z]$ is this looking for a string with any ONE character
in the alphabet?
Examples of overriding handlers can be found in pecl/overload
and pecl/apc
ReALF, I don't want your v14gr4!
v14gr4? what is that?
yes it is (well I already knew that)
RubberDucky132, I think that looks for a string of exactly one
capital letter
Any ONE UPPERCASE english letter, yes.
ok, i'll have a look. thank yo Pollita!
ok joke over
i've got (?i) at the start
so its any letter
my problem is I want it to look for any number of letters and be
happy.
Is your blog down?
add * at the end
RubberDucky132, ^[a-zA-Z]*$
well, http://real4ever.org.ua/ , this is
my site
ReALF, does the server allow any outgoing ports?
that's all I wanted to hear :3 thanks!
I can't read Cyrillic so that proves nothing!
appearantly so, yes
holy shit, it's noon
I can read Cyrilic, but not russian version.
http://195.242.220.87/ What
am I doing wrong please?
jamey-uk, you fscked it up... and my mind reading powers
don't work over irc
but I am guessing you have misconfigured mod_php.
jamey-uk: either 1) you didn't restart your webserver after
installing php, or 2) you're missing an addtype declaration in your
apache configuration.
you probably 1. don't have mod_php loaded
!+at
For Apache to be able to parse your .php files, you need to
add this line to your config "AddHandler application/x-httpd-php
.php". To make .phps files work too, you need to add "AddHandler
application/x-httpd-php-source .phps" also. You must restart Apache
after adding either or both of these lines.
or 2). no addtype
sorry, addhandler
Hi all!
sorry, got disconnected. cyth, i am on awarspace.com hosting.
they closed everything, even get_file_contents() function.
actually, i wanted to use very this function and my own smtp
server
ReALF, looks like you need to take your business elsewhere
disallowing outgoing mail... nerd please, I wouldn't give them my
money.
maybe you're right, but this hosting is perfect for me, esxcept
mail. i can't find another hosting
I have a function that receives a $hooks array which contains
arrays. Like this: array(0=array(...), 1=array(..)) And in the
function I would like to make the array_intersect of the arrrays in
the $hooks array. . Any nice way to do this?
this hosting is free
Currently I use eval which is as unelegant as possible
ReALF, have you tried talking to them?
NovakAron, what about call_user_func_array?
what are you talking about? they are too busy
...
I have the PHP 5 module loaded and I checked, in
/etc/apache2/mods-enabled/ there is a file with two AddType and
another with LoadModule. Does that mean I'm missing an AddHandler
somewhere?
so should I create a wrapper around array_intersect? Because
as i know call_user_func_array works for functions -defined by the
user
what keeps you from just using array_intersect?
Wolfpaws, yes, i know it sounds weird but...
I don't know how many elements the array can have. So I have to
put these into an array, I can imagine that I should use something
like call_user_func_array for internal functios
NovakAron, it works fine when i just tested it
I take that as you didn't even bothered to ask the host\
Is there a way to rearrange YYYY-MM-DD into DD-MM-YYYY with
PHP?
is it possible to change a $_SERVER[''] var from outside my php
file so that it overwrites my $_SERVER['SERVER_ADDR'] ?
are they recursive? i still don't see a problem
because i need to know the server ip to check if it's online
or just local for testing
date()?
ekneuss TML please help again. $b=""; for($i=0 ; $i10 ; $i++)
{$a=$i; $b=&$a} var_dump($b); //how to new an object for $a in
each loop so that $b can have 1, 2, 3...?
no, they are not recursive. I'll try out to use
call_user_func_array.
or just copy the array elements if it allways has the same
format
Can anyone help me with my Apache configuration problem
please?
whyever. :|
you see, they have written ToS. I read them. And i asked at
forum, if there are exceptions. No exceptions. That's why i'm
breakin my brain at this subject
can date() do that? rearrange?
no
ekneuss TML , in this case all the 10 elemetns of $b are
9
my fault
if you have allways the same format you can just copy part of the
string
ReALF, well if you find a way around it, wouldn't that be
violating the TOS?
i do have always the same format
Wolfpaws any idea please?
so I copy first 4 then 5-8 and 9-11 or something like that
and paste them back...
i think no. smtp etc are closed on awarspace.com. i'm not
gonna make spam, and i'll not use their server as a mailer. why is
it violating that TOS?
DavidHKMrPowers, I don't get your question
i'm trying to handle a form with a text area using php, and i
want php to explode where there's a blank line, so i have it set to
explode the string with the delimiter as "\n\n", but the returned
array only has 1 key/value and it's the original string.
help?
DavidHKMrPowers, what are the "elements" of $b ?
$b=array(); for($i=0 ; $i10 ; $i++) {$a=$i; $b[]=&$a}
ekneuss sorry...forgot to write array
what would I use to take out a part of a string?
substr
DavidHKMrPowers, why do you want references in this case ?
each element is a reference of $a, the last value $a takes is 9,
hence all elements will be 9
thanks looks like it'll do the job perfectly
ekneuss ya, it's not what i want
the call_user_func_array really works (thanks gsm4!), now
I'll try out what happens if i call array_intersect to the
multidimensional array directly
how to make them to be 1, 2, 3, etc? ek
don't use references then
what are you trying to do? get an array of 10 numbers?
for ($i = 0; $i 10; $i++) { $b[] = $i; } // end of
story
but I guess that was a simlification and you've something in
mind involving objects ?
simplification*
are you by chance searching for
array_intersect(array_values($array));?
$b = range(1,10); would be a simplification
I have installed Apache with the correct PHP module, it is
loaded (afaik) and the AddType declarations are there too. Yet this
still happens: http://195.242.220.87/ Can anyone
enlighten me as to why and how I could get it working?
fyrestrtr, that would be 0,9 by the way, but that's not the
problem.
what would?
ekneuss fyrestrtr, actually i am trying to do this. hope i
can explain it. $people=array(); foreach($creatures as $creature){
if($creature-isHuman()) { $people[]=$creature;
$creature-isMan()?$men[]=$creature:null;}
When I try to call array_intersect($multi_dim), it makes an
error. And no, it's important to me that the value have to be in
all of the sub-arrays. With array_intersect(array_values($array)),,
i only get the union of the sub-arrays, not?
fyrestrtr, youre range() call, according to my for
conditions, and his, the correct range() call would be
range(0,9).
ekneuss fyrestrtr, which means i need to create a set of people
while $men is a subset of it
$foo) { $people[] = &$creatures[$key]; } otherwise,
$creature will be a copy
you want to have an intersection of the arrays inside of
$array(or however you may call it?), no?
exactly
so, unless I missed something, $c-isHuman() then $p[] = $c;
$c-isMan() then $m[] = $c;
ekneuss ya, i've thought of this ref is really something
difficult to be controlled
well.. try array_intersect(array_values($array)); then.
DavidHKMrPowers, especially in PHP4 :]
fyrestrtr ya, but that would duplicate two humans
so if there any way to send and receive data using php via port
80?
ekneuss really??
& is better in 5?
foeach($Bs as &b) up to now, have seen this only
so a man is not human?
hmmm how would I force a number between 1 and 12 in PCRE?
[0-1][0-9] allows 19 and [0-1][0-2] only allows 1,2,12.
yes, you're right sorry, it took me so long time to
understand your elegant solution. The only excuse me is the high
temperature inside (~33C)
Does anyone know what's the proper way of specifying an rpath
for ld when compiling php?
whats the function that catches all outputs into a
buffer?
fyrestrtr a man is human but i want that man to be a ref to
the human object
$creatue) { $creature = &$creatures[$key]; .... }
RubberDucky132, /^[1]{0,1}[0-9]$/ I think
RubberDucky132, er, thats wrong
no need to excuse
cyth, so if there any way to send and receive data using php
via port 80?
[0-1] gsm4 ?
DavidHKMrPowers, and then, you can easily do $human[] =
&$creature; .. $man[] = &$creature;
is
do you know what's right :p
RubberDucky132, /^(1[0-2]{1})|[0-9]$/ i think
whats the function that catches all echos and prints and stores
it in a variable?
I'll test it now
err if i output something to a php file.. shouldnt that be
able to read it as stdin ?
ReALF, just using port 80? and when httpd is already bound to
it... I ain't saying it's impossible, but good luck :/
DavidHKMrPowers, speacking of PHP5, the OO implementation was
rewritten, an object is no longer stored in the variable, but only
its handle is. Hence when you copy the handle, both variables are
not references but they both point to the same object.
(0|1){0|1|2)
Have you tried it out? Wrong parameter count for
array_intersect() - I get this again.. I just try to use
array_intersect(array_values($array)).
nope picks up 13
DavidHKMrPowers, you can still use references of course, even
for objects, but it has few obscure uses
foreach(array_keys($creature) as $key) { $human[] =
&$creatures[$key];}
do you mean (0|1)(0|1|2)?
put emails in a queue written in xml or other format that can
be seen in text: make sure it's behind authentication, have a
script read it every once in awhile and process emails.
yes
i thought someone knows about maybe some kind of gate or smth
like that
no, i didn't i'm sorry it didn't work out. it should
though.
ReALF, define 'gate'
it doesn't recognise 9, i'm going to guess it will recognise
09 though?
DavidHKMrPowers, that would be alright too
nope it doesn't pick 09 up either
ekneuss so objects need to be duplicated with clone function
in php5? but can be directly duplicated with assigning in
php4?
yes, it sounded so logical, that's why I started to feel
glad
im just trying it out
you need a backreference to make it work.
did you mean that?
I guessed as much
when i say gate, i mean a mechanism, which allows you to send
some string from one website to another server, and the 2nd one
will send this message using a regular smtp or mail() or smth else,
no matter
DavidHKMrPowers, that's right
is there any built-in way (or nice function floating around)
to get all the local ip's on a machine?
RubberDucky132, /^((1[0-2]{1})|([0-9]{1}))$/ -- old one didnt
have enough parens
wait nevermind i found a regex library with the answer
{1} is a bit useless though
Ill try it
ekneuss, well yes, but it keeps my head on straight reading
it
ekneuss thanks haven't really figured out that kind of thing
before. i've nevered used & much before. always duplicaing. so
hope to use & to increase performace this time
err.. how do i execute a php script and still have stdin working
?
that works
ta
o.O I personally find it more confusing than anything
else
everythinglog.php
where everythinglog.php accepts STDIN
ReALF, yeah there's a million ways to do that, you just need
an outgoing port that isn't bound to already
DavidHKMrPowers, note that & won't increase the performance,
it will decrease it most time. Use references only when you
_require_ its functionnability
can you talk to me in private, cyth?
only if you keep your clothes on
Assid, fopen('php://stdin',
'r')
unless you're female
send it to the background.
)))
then I might reconsider
so for days would I change that to.... (give me a sec)
err. i have the fopen stdin ..
but it just gets appended
i also have a #!/usr/local/bin/php as well.. and made it
executable
Assid, well thats because its | no
*not
hrmm
((3[0-1]{1})|([0-9]{1}))
i just saw that array_values returns an array itself. it
worked for me on.. was it pg_prepare? i dont remember
exactly
problem.. thats my input as
appends to a file, | send to stdin of a program
yeah
RubberDucky132, if you are tring to do date validation, have
you tried the built-in funcitons?
*facepalm* don't tell me date() does it
ekneuss, o.O really shocked to know it doesn't increase
performace
my input sends me as
so i gotta figue that out
RubberDucky132, try checkdate maybe depending on your
needs
thanks sorry for wasting your time
DavidHKMrPowers, as TML also mentionned before, PHP4 uses a
copy on write mechanism, hence $a = "biiig data"; $b = $a; at this
point, the data is shared between the two variables, no copy is
made
is append to a file, it does not execute it, you need to pipe
it to the app with |, that will make your shell execute the php and
put the data in stdin
RubberDucky132, np try the manual first next time maybe
though
it'd be call_user_func_array('array_intersect', $array);
yeah im trying to figure out how to ghet the input to pipe it
to me instead of
yes, thanks, this is the line that I committed into the
repository a few seconds ago.
Yep, trouble is checkdate is for "american" dates (Gregorian
MM DD YYYY) not DD MM and the script to swap months with days etc
is long
I think it might actually be easier to do regex validation
is there any difference between mysql and mysqli in connecting
speeds?
RubberDucky132, try strtotime followed by date?
no
the script is suppopsed to connect.. insert.. disconnect
DavidHKMrPowers, the copy will be made internally only when you
affect either $a or $b. Now that mechanism doesn't mix very well
with references, that is: you can't mix normal variables and
references in that pool of shared data. Hence $b = "biig data"; $a
=& $b; /* no copy so far */ $c = $a; // BANG, copy made
here
RubberDucky132, and what do you mean that the script to swap
days and months is long? depending on format explode and use
indices?
I want foo.php and bar/baz.php to both include whatever.inc,
which outputs html referencing images/some.png. The image relative
URL is broken for bar/baz.php because bar/images/ does not exist.
Is there a simple way to do includer-includee directory conversion?
add ../s or remove directory levels, as required.
ekneuss heh i think i got it i've made some bugs in
referencing to itself before which made firefox hanged with using
$1GB memory
Assid, it may be better to make your app log to a FIFO, then
open the FIFO with php and so a fgets() so you get the data one
line at a time if thats what you want
just people have posted "how they've done it" at http://uk.php.net/checkdate and
its quite a long script. at least how they've done it
DavidHKMrPowers, uh ? referencing has nothing to do with firefoy
wasting memory
oh i do get 1 line at a time.. its actually gonna be executed
for 1 line only
is there a way to get a thumb at a specific frame of a SWF
file ?
ekneuss var_dump does
recursive loop in it
only use references when you require them
var_dump will detect those eventually
&$a); // i.e. will get detected
anyway, exam tomorrow, enough time used on irc, cu
s,cu,see you
RubberDucky132, date_parse to make an array out of the date
you are getting as a string then use checkdate?
ok, but you should check count() anyway
hiya all
the date i am getting is in the format dd-mm-yyyy is that
ok?
RubberDucky132, though I am not sure that would work
right
I'll give anything a shot ^.^
RubberDucky132, preg_replace with
"/^([0-9]{1,2})-([0-9]{1,2})-([0-9]{4})$/" to "$3-$2-$1" then use
the built in stuff maybe...
ekneuss see you thanks
(i havn't tested that regex for the record)
How i install php5-socket on debian ?
oh ffs, strtotime("25-12-2007");
if that's the regex im using it works fine
would that be signifigantly faster than explode?
ask in #debian
oh, nm
\?xml.+$ i'm trying to use this pattern to match all xml, but
it stops after a \n
I don't want to turn it into a unix timestamp... do i?
how can i make it ignore that with preg_grep?
all I want is a validation rule
fedya, take a look at the PCRE_DOTALL modifier "s"
and you don't need this $
RubberDucky132, then why not explode on "-" and send it through
checkdate?
hey
i ma not sure if i should use PHP or php/pylons
why not indeed! *goes to try it*
anyone here have any exprince with both and want to let me know
?
can i do OCR in php
You can find a C OCR library and write a PHP extension for
it.
Or you can call an OCR program from the command line.
tesseract is a good free OCR for UNIX if you need one
cyth,
hmm
what is the function that prints out the contents of an object?
kinda like print_r except for objects....
anyone else want ot give me some input php vs pylons not sure
what to use
kaje, print_r()?
that doesn't work on objects, does it?
it does
oh, neat, thanks!
but it does not get everything IIRC, especially with the
predefined stuff
what is best way to use regex ? preg_match_all? and then do
$matches[0][0] ?
fedya, for what?
cyth, how can i make a time out for my script at the mailing
side, e.g. 30 minutes
You can set a timeout on unix with pcntl_alarm and pcntl_
signal.
Do you only want the first match?
whats faster performance wise for web development PHP or Python
?
Faster in development time or execution time?
execution
i'm not sure, that i'm allowed to use those signals
i know it all depends on code
but
a general estimate
Python is probably faster, but that would not matter much.
The bottleneck is typically the database, doing tough queries
etc. That takes as much time in Python as it does in
PHP.
well i was looking at some pylons / apps and they were not
quite reonsive ish
i can't get SOAP to work on ubuntu feisty. I did apt-get install
php-soap. then i tried all kinds of code
If you want your application to run faster, you should profile
it and optimize the slowest parts.
phpinfo() can probably tell you whether you have Soap
enabled.
that's really the wrong way to do it
you identify what operations in your application are too slow, and
you profile those
yup i did that and it is enabled
it makes no sense to go on some kind of global quest for
speed if only certain parts are affected
preg_match($pattern, $curl_response, $new, PCRE_DOTALL); any
ideas?
fedya, PCRE_DOTALL i dont believe is a valid flag for
preg_match...
fedya, you just use s in the regex
/bla/s
you wouldnt happen to know some perl would you
nope, not really....but i could probably understand it, i just
can't write it
hrmm
k
in perl.. but i cant just change it to | and make it
work
you didn't like the fifo idea, huh?
nah.. i wanna just pipe it instead
otherwise i would have to cron it to read the perl files
output
hello everyone!
maybe you should /join #perl
is there anyone 'code php for food'
yeah im there.. tyring to get some help
whatcha cookin? :-)
you were saying...?
okay apparently its open() in perl
!tell ReALF about away
im still reading this perl code :P
i have a question about gettext library
it's very long
if you're interested in
http://forums.devshed.com/php-development-5/gettext-showing-unique-characters-in-different-alphabets-460618.html#post1856026
thanks
ew.
are there anyone interested in??
http://forums.devshed.com/php-development-5/gettext-showing-unique-characters-in-different-alphabets-460618.html#post1856026
I'm building a web app and we have a business guy who's actually
somewhat technologically sophisticated, used to be a dbase
programmer back in the day. He likes filemaker now, and wants to
use filemaker to munge through the site data and see what's going
on.
Don't repeat. Please.
Including the logs.
So what I'm thinking is, convert all of my error_log() calls (and
there are a lot, at least one for each page) to use a semi-regular
format; everwhere I print out a data element, e.g. use something
like [variable=[value]]. Use a similar markup for page
names.
CSV
Then I can build a simple perl script that parses the logs and
generates a stupid database table with a column for each variable
name used, so the business guy can play with that data to his
heart's content.
[RainMkr]: Yeah, probably output it as CSV that he can import
into filemaker.
Where do you log to now?
Apache logs.
hi all
He thinks he's going to load apache logs into FM and do
anything useful?
He's asking about adding some sort of log-to-database-table
so he can do clickstream analysis, etc.
lol, you can't unless you use and audit tracking too.
Point him towards Google Analytics and tell him to have
fun.
[RainMkr]: Heh, yeah. That's why I'm thinking my approach
will be useful. I already have a lot of log statements, and I tend
to log important data points, so if I log them with a consistent
syntax that my script can recognize and convert to a biog CSV, then
he can play all day.
[RainMkr]: It's a webapp, you have to log into it, etc.
So...
Hm, I guess I could have a hacked version of error_log() that
includes the user's session cookie as well.
Better yet, just invite him in here so that we may berate his
beloved FireWaker to his face.
Hee.
has filemaker grown out of dos yet
[RainMkr]: Filemaker.
If it keeps him busy making pretty charts and graphs, and keeps
him from asking ME to make him pretty charts and graphs... I'm all
for it.
I get paid good money to convert people from FM to a real
database, I'll call it whatever I like.
[RainMkr]: You do a lot of filemaker then?
[RainMkr]: Which real database?
*FAR* too much.
(((
[RainMkr]: Good, I'll keep you in mind if we need a
consultant :-).
Dude! Get a clue... MS Access rox0rz ur s0x0rz!
No, seriously, did you just call MS Access a "real
database"?
most any RDBMS will do.
No... Access is little more than Excel on steroids.
Glad you said that.
So I didn't have to.
Actually, filemaker looks pretty handy as a gui ODBC client to
mysql.
Last project with this guy, I gave him ssh-tunneled read-only ODBC
access to the mysql database.
There is a case where Access *is* better.
Though I'm trying to avoid that here; will probably mirror
the database so he can hammer the mirror to his heart's content
without endangering the live site.
Just give him a 500k line file, that'll put a stop to his FM
uselessness.
Hee. Yeah, it will come to that eventually.
if you navigate with query strings, how can you make sure
your header doesnt reload/refresh when navigating?
Anyone here uses screem as ide?
hi
What functions, object is good for doing file shit. like
pulling the extension and stuff?
Hello!
header in PHP?
php.net/header
josh[n00b]: I know how to use header, thanks. But it seems to
ignore the Server: header altogether.
I want my class to implement an Iterator. The iteration will
be over an array, that is a property of the class, which type of
iterator should I implement? Ex.: instead of
foreach($myObject-myArray as $x), I would like to do
foreach($myObject as $x) but with the same meaning. I'm thinking
about implementing IteratorAggregate but how can I return an
interator from a array?
$arrObj = ArrayObject($array); $it =
$arrObj-getIterator();
mrpondsign thats the whole point of using header
Are you using Apache as your httpd?
what can be the php.ini directive which doesn't allow me to
execute phpinfo and exec functions ?
grep disable php.ini
ok
nothing in disable_functions and disable_classes
Then it's not in php.ini
Look at a phpinfo() page
got to report a bug (if it is) the mb_ encoding things could
make apache hang if it tried to change from an incorrect
encoding
on windows
T/
TML, nothing special in the phpinfo
oh safe mode on
what cant you execute? phpinfo or exec?
what status code do you get from exec?
exec
it's strange, phpinfo tells me that safe mode is on
safe_mode = Off
are you using the correct php.ini?
yes
the one referenced by the phpinfo
phpinfo says its using that same ini?
/etc/php5/apache/php.ini
yes
ok so why do you think you cant use exec?
cat /etc/php5/apache/php.ini | grep 'safe_mode = '
safe_mode = Off
because phpinfo says that I'm in safe mode
I think it's because of that
have you tried doing exec?
on localhost I can exec('ls -l');...
yes nyc-h0st
is your remote user allowed to execute shell commands?
the user the php worker is running under
does php support polymorphism?
Hey everyone -- I've got a question, I've two tables I'm
working with in mysql, using PHP as the backend. When I add a
record to one table, it has an auto incrementing field for the ID.
That auto incremented number needs to be included in one of the
fields in the next table when I add the records. I'm adding both
records at the same time. is this possible?
AustLaw google php polymorphism
nyc-h0st, how can I know? :s
jessy_ can you ssh to that machine?
yes
can you ls -l when you ssh in?
yes
I have root access...
does apache run under root
or another user?
how can I know ?
ps -e u | apache
ok
sorry
| grep apache
4
0
and many many like the second one
correct
how does exec respond to you?
what is the return code?
nothing, return status 127
and the php reference says what about that code?
I tried with other command
it's exec() it always returns 666
sounds satanic
nyc-h0st, nothing special... :s
It's exec()/system()/passthru()/`` it's PHP's axis of
evil.
nyc-h0st, I think the main problem is that my php.ini contains
safe_mode = Off and phpinfo says it's turned On... don't you think
so ?
*dun dun dun*
not sure if safe mode would disable exec
Oh heck yea it would!
nyc-h0st, ok
Hey everyone -- I've got a question, I've two tables I'm
working with in mysql, using PHP as the backend. When I add a
record to one table, it has an auto incrementing field for the ID.
That auto incremented number needs to be included in one of the
fields in the next table when I add the records. I'm adding both
records at the same time. is this possible?
I tried to restart apache but nothing change
jessy
reload apache
PHP is the middleware, MySQL is your backend.
nyc-h0st, ok
!m mysql_insert_id
never tried this, but is it possible to have an application
which *is* its own project?
whoops, wrong channel
you can also force safe mode off by passing php directives
through your virtual host entries
sexyken, do you mean in one query?
within apache
nyc-h0st, ok now safe mode is Off but exec doesn't seems to work
better
ok what is the status code now?
What I mean is -- I am adding one row to one table, this
table automatically assignes an id to a certain field. I need that
ID that was assigned to the field to assign it to a field in the
next query to a different table
sexyken if so, i think so, but I am not sure on syntax
php echo exec('whoami'); ?
nyc-h0st, oh no, sorry, it is the sql.safe_mode which is off,
the safe_mode is always On :'(
hi, im looking for a text-mode (terminal screen control) that
works with PHP, i know about ncurses but it says that is
experimental, anyone know another one?
Hello
jessy_ is it on in the php.ini or not?
!+mysql_insert_id
nyc-h0st, no it is off
sexyken - myqsl_insert_id
Why doesn't ZipArchive::extractTo() not supply any sort of error
messages on failure?
something is crooked with your php setup
php-bot: you are the most useless piece of drivel I've come
across in ages!
you are absolutely sure
it is using the same php.ini?
but how phpinfo can say the php.in is in
/etc/php5/apache/php.ini
[RainMkr]: you meant to add func in front of that?
Okay fine, I lied...I'm using mssql -- :-\ Dont see an
mssql_insert_id
this php.in has safe_mode = Off...
!+func mysql_insert_id
int mysql_insert_id([int link_identifier]): Gets the ID
generated from the previous INSERT operation
see?
No, I mean for the bot to work like just about any other bot
in any other channel!
Yea -- but I lied :-\
You have to run a query to get the inserted ID, "SELECT
@@IDENTITY"
SahneN -- that's for MSSQL?
Yes
[RainMkr]: It does. But it doesn't have sufficient data to do
what *you* want
Got it. So do I use p_connect so the connection statys
open?
I wasn't here for your original question, just the part about
not seeing the insert_id function
What I mean is -- I am adding one row to one table, this
table automatically assignes an id to a certain field. I need that
ID that was assigned to the field to assign it to a field in the
next query to a different table
SELECT @@IDENTITY also works with MySQL.
though I would really suggest using mysql_insert_id()
I'm using MSSQL
Just run another query with SELECT @@IDENTITY to pull the ID,
you might be able to use it inline also (ie: INSERT INTO table
(col) VALUES (@@INSERTID)
Ack
Sorry, I thought you where using MySQL, by bad.
s/INSERTID/IDENTITY
jessy_ i just dont see how this could be happening
unless apache is passing parameters to php
Any idea how it knows what insert id I'm talking about?
nyc-h0st, me too, I know you certainly think I'm crazy but it's
true, phpinfo gives me the path to a php.ini which has safe_mode =
Off and also this phpinfo have safe_mode setted to On :'(
It grabs the last identity assigned
Well I'm the only one that matters!
jessy
is this a virtual host within apache?
F34r mI /c134r n00b3tz!!!!11111
i'm assuming its default
throw this in the virtual host config
php_admin_flag safe_mode off
nyc-h0st, I don't really know :s
where do you put this on the server?
/var/www...
/home/web/www/admin-mag.com
so yes there is a virtual host config somewhere
look in
/etc/apache2/sites-available
Having trouble compiling php, can anybody help?
ok
it's apache1.33
look for that particular one
ok
error: utf8_mime2text() has new signature, but U8T_CANONICAL is
missing. This should not happen. Check config.log for additional
information.'
and the last bits of config.log are http://attachr.com/8893
http://phpfi.com/25065
opps
http://phpfi.com/250651
jessy_ what is in there?
nyc-h0st, I'm looking right now in a web admin console called
webmin, I saw some tools to config virtual hosts
anyway have that line in the virtual host config file and it
should force the safe mode off
php_admin_flag safe_mode on
off!!!
here is this fucking directive!!!
oops sorry
oh this is what you see in there now?
it works
thank you so much nyc-h0st
np have fun
is there a way to replace only the first string preg_replace
comes to?
why not just use str_replace()?
preg_replace() has a fourth parameter called `limit'
hi all
php.net/preg-replace
=P
session_start() [function.session-start]: Node no longer
exists how does this happen?
maybe deleted your session file
i dont know
do you have a valid session
print_r($_SESSION);
do you get any output
nah you wouldnt if the session is not starting
sessions are over rated, real programmers use Monks, quills, and
papyrus
Hi! Does anyone knows how can I do to submit only the voted to
the next page? http://img410.imageshack.us/img410/320/untitledbg3.jpg
Thanks
I am trying to use tidy with php and its works in the cli, but
not within apache, can anyone help me figure out why and how to fix
it?
I'm an idiot, thanks
[RainMkr]: and a bunch of Chinese people in the basement to
memorize data
in PHP5 using its XML parser?
$xml-mark-up-tag;
I *HATE* CSS!
Delixe, some interesting hard work
yes
Yeah, I have no idea how to parse something like that
[RainMkr]: Having problems with browser compatibility?
sorry about the delayed response
But the website that I am trying to parse the file from has
markup like that archivist.
Shit like your-drinkCoffee/your-drink
Yea, it's not compatible with *ANY browser I have!
Read the topic, this is your one and only warning.
Delixe, so write a parser to suit
Ah mmk
You can do it like this: $xml-{'your-drink'};
Just found out.
That's crazy huh?
I've never seen that
I know who to pass a radiobutton value from one page to the
other, but how can I find the associated checkbox id?
why does in_array(array(1), array(1)) return false?
does anybody know how to remove empty (or white-space-filled)
text nodes from a DOM document?
because you're looking for an array within that same array?
in_array(1, array(1)) would be true.
yeah, because the array doesn't contain another array
in_array looks for elements in the array.
There's no array in the $haystack.
oh ok
I was thinking I could check for multiple values
anyone familiar with QuickForm_CAPTCHA?
soooo... anybody know how to deal with the XML DOM in
PHP?
Sure Romes.
is there a native way check for the existence of any elements in
array('value', 'value2') in another array?
You could do an intersect....
Allowed memory size of 8388608 bytes exhausted (tried to
allocate 35 bytes
Related Topic:
Well you can choose to not authorize online but the auth code to put back in has to come from adobe yet one only