Re: [PHP] Question about apache-php concurrent process control

2005-07-22 Thread Liang ZHONG
Thank you Richard, I think I'd better explain a little about the project and 
then you or somebody else might give some good suggestion upon the 
restrictions of the project.



The project is to implement a digital library protocol, called oai_pmh 
(http://www.openarchives.org/OAI/openarchivesprotocol.html)
It acts as a broker for the harvester client to get meta data from libraries 
that have Z39.50 server. The database resides on libraries, and vary alot in 
speed, number of records, way to accept connection from z39.50 client. The 
number of records from some libraries might be over million. So the part 
that getting data from those libraries behave very differently.


The harvester client sends http request, normally through program, like perl 
LWP. It normally sets 180 time out for connection.


According to the protocol, the oai_pmh data provider act on respond to 
harvester http request, it begin to connect to specific library's z39.50 
server, get data in, write them to disk, and translate to another xml 
format, then send to harvester client. If the records are too many, oai_pmh 
should send back partial data with resumption token. The harvester can later 
send out http request with same url but with the resumption token as one of 
the POST variable to get further data records. This process can be 
continueing till all the records has been send.


Thus I noramlly use perl program to send the http request and get content 
instead of BROWSER. The behavior of buffer should not due to the setting of 
the browser.


I can not echo the metadata directly back, since xlst need to use to 
transform and new xml file(s) are writen. The header() redirction is very 
nature to use if it can close the connection before I do something very time 
consumming after that.


The exec with & and the cron job are hard to use, since connection to z39.50 
with a lot of state variables like connection id, etc can not easily be 
passed to another script.


The harvester user normally is not a human with browser but a piece of code, 
while looping and sending out http requests if the page it gets back has 
 tag. (it replace the element between open and close tag of 
, append to the next http request as POST variable for next 
records page). But the problem is each http request posts a timeout of 180 
seconds.


Thus I have to return partical data within 3 minutes while the whole process 
might take hours or even days. Then the process continue to get data from 
library server and transform it, then write to disk in a particular 
directory. The next request with resumption token comes in, the program will 
check for the existing of the directory and return if yes. If not existing, 
program will check to return within 3 minutes or send back not available 
information.


Sorry for the long writting. I hope some one has some suggestion for me. 
Thank you very much.


---


> I now encounter a problem with flow control of my program with PHP. This
> is
> very crucial to the design of a pretty big project. This is what I want 
to

> do in the program:
>
>  do_A();
> header("Location: ".$result_of_do_A);

Depending on the buffering options in php.ini and/or Apache, this may or
may not just end your program, as I understand it.

Once you send the Location header, everything else is irrelevant, or at
least not reliable.

You could do:
echo $result_of_do_A;
flush();

and the user will see what happened with A, while waiting for B.

> do_B();
> ?>
>
> Since it takes do_B()  quite a while to finish, so I want the http 
client
> get the partial result from do_A() by redirect a page to them before 
start

> do_B(). But it seems that the redirection will only occure after the
> entire
> php program finishes, i.e., after do_B(). I sent http request through
> browser, curl comman line with -N (no buffer) option and with a perl LWP
> program I wrote. All of them suggest that header(), although is put 
before
> do_B() in code, gets executed only after all the php code finished. I 
add

> flush() after header() too, but no work.

If that is what you are seeing happen, you probably have output buffering
turned "on"

The Location: header is acted upon by the BROWSER, not by PHP, not by your
server.  The BROWSER sees that header and then jumps to somewhere else.

> My question is: Is there any way that I can return to the client though
> http
> response and then continue my progress with my program?

You could also look into the pcntl stuff to fork() or, depending on
various settings, you might get:
exec("do_B() &");

to get B to happen in the background.

With all that said:  As a general rule, when I found myself doing this
kind of stuff, I later realized that I hadn't really designed my
application very well for an end-user experience.

If it takes THAT long to finish B, then you're probably MUCH better off
putting something in a "ToDo List" in your database, and doing

Re: [PHP] Tracking a mobile phone

2005-07-22 Thread Richard Lynch
On Mon, July 18, 2005 12:15 pm, Thomas said:
> I was wondering if anybody has attempted to track a mobile phone through a
> country. I know that this is usually more a case for the FBI . a friend of
> mine is going on a 4 month bike tour and I would like to 'track' him for
> locations. I thought of an sms receiving system, but if could do any other
> way would be great.

Having just a few months ago spent a great deal of time finding a cell
phone that would just tell me my own long/lat where I was, without the
for-fee fancy directions or my non-existent boss tracking me features, I
ran into a fair amount of info in this topic, mostly by accident.

I also wanted an SSH client so I could do emergency surgery on websites if
needed.

You'd be AMAZED how hard it is to get a cell phone company to tell you if
it has these two features or not and on which models it actually worked...

[I got the Nextel + Blackberry 7250 and it has them.  YMMV]

There are at least two distinct systems in different cell phones:
1. Cell Tower location
2. GPS location

I'm not sure #1 can use multiple signals and triangulate or not.  Even so,
it ain't gonna be real reliable in the case that you want to know EXACTLY
where somebody's cell phone is in case of an emergency...

#2 works better the more GPS satellites it can find.
I've seen results with 5 satellites and an error margin of 3 meters, as I
recall.  (Maybe that was 4 satellites?  Definitely 3 meters, though)

Some phones have both #1 and #2 and use #1 as fall-back.

US Cell Phone companies were required by law to have 911 calls provide
caller location by [some past date] to 911 operators.

Every one of these companies filed for, and received, an extension of that
deadline.

All the filings had different extended deadlines, as they all filed the
paperwork at varying times with varying reasons why they were not going to
make deadline.

So, in short, nobody knows when they'll actually get the damn things to
work right for 911.

The idea that you could arbitrarily track your friend's phone is, at best,
a Privacy Nightmare...

But let's assume your friend somehow can "sign off" or provide consent for
you to receive the data you desire, or wants to take some action every day
to tell you where they are, or even wants to program their phone to do it
automatically...

If he/she/it has a fancy enough cell phone with working GPS and/or Tower
location system, and if that phone allows the installation of new
applications, then, in theory, there could be an application "out there"
that would automatically surf to some URL to report their location.

Otherwise, you can just give them a form on a website to surf to and let
them tell you where they are, or maybe they could use their cell phone as
a PHONE and call you to tell you where they are or...  Well, you get the
picture.

I don't think anybody has written that automated location notifier
application yet, EXCEPT the guys who will charge your $40 a month to track
your employees' cell phones, which allegedly *IS* an available service for
some cell phones with some providers...

Though I believe I heard at least one person state that this was still in
the vaporware stage of development as far as the end user is concerned --
That there were still some bugs to work out and while they were "close" to
having it work reliably, it wasn't "working" yet.

If you did write such an application it would probably be in Java or Palm
OS or ... Well, it almost for sure will *NOT* be in PHP, since, as far as
I know, PHP is not installed on any commercially sold phones.  Though I
think there was a Linux-based Palm-like device that might maybe have had
PHP working on it...

This was all the state of things several months ago, far as I could tell,
and I'm probably already horribly out of date.

-- 
Like Music?
http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Translating english into amglish

2005-07-22 Thread Richard Lynch
On Tue, July 19, 2005 1:12 pm, Murray @ PlanetThoughtful said:
> I'm based in Australia but my blog is predominantly read by Americans. I'm
> wondering if anyone knows of a class that will translate Australian / UK /
> Canadian / Whathaveyou English spellings into their American English
> equivalents?

But maybe they LIKE your quaint spellings! :-)

Seriously, though.

I don't think you need to "translate" for them.

If they can't figure out "neighbour" and "colour" they're in real trouble...

Now, you start using slang or something, yeah, maybe...

Even then, probably not.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Ok, why is this happening...

2005-07-22 Thread Richard Lynch
On Tue, July 19, 2005 10:26 am, John Nichel said:

> There's some freaky math going on there or something.  I added a couple
> of other echos in to see and for some reason it seems to be losing
> single digit value (subtracting, rounding down, I don't know).
>
> $calculatedGross  = $originalNet + ( $originalNet * $commissionPct * 0.01
> );
>
> echo ( "Gross : " . (int)$calculatedGross ." = ". $originalNet ." + ( ".
> $originalNet ." * ". $commissionPct ." *.01 )\n" );
>
> $calculatedNet= $calculatedGross / ( 1 + ( $commissionPct * 0.01 ));
>
> echo ( "Net : " . (int)$calculatedNet." = " . (int)$calculatedGross . "
> / ( 1 + ( " . $commissionPct . " * .01 ) )\n" );

Floating point mathematics is inherently "unreliable" in computers.

Consider, for example, 1/3 in decimal notation:

1.33...

PHP can only write so many digits down in a 32-bit floating point
representation, just as you can only write down so many digits before your
hand cramps up or you run out of paper or you get lazy and put "..." on
the end. :-)

Now, the thing to remember is, the problem won't appear where you expect
it to from your experience with DECIMAL numbers all your life because
floating point numbers are being stored in a binary/hexidecimal notation.

If you are feeling particularly masochistic, you can Google for "floating
point internal representation mantissa exponent" and you're gonna find out
EXACTLY how those numbers get stored.  Set aside a good chunk of time to
absorb it all... :-)

Even something as simple as:


could, in theory, print out something like:
1.
and be "correct" as far as Computer Science is concerned.

If you need PRECISE mathematics, you should use integer and count pennies
instead of dollars -- or even 1/10th of pennies or whatever resolution you
need.

Of course, every step you take on the right, you can only store 1/10th as
large a number of dollars as your maximum amount.  But you are starting
with 2 billion as your max, so that's a lot of room to play with.

If you *need* float numbers and precision out to decimal point N, look
into BC_MATH and that new-fangled Math package PHP has for this very
reason. You'll still be dealing with this issue, but you'll know your
numbers are accurate to the Nth decimal point, and it will be painfully
obvious in your code that it is so.  [It will also be SLOWER than just
plain float numbers.]

If you just don't care about the damn penny, but want your code to work,
something like:

if (1.00 <= $x && $x <= 1.01){
  // $x == 1, really
}
may suffice for your everyday work-a-day computing needs...

Though that can also turn into a lot more problems than you think, down
the line...

Remember 2nd Grade when long division was "tricky"?  Yeah, well, computers
are a hell of a lot more stupid than 2nd Graders, any day of the week.

Note that there *ARE* computer languages where are prefectly happy to work
in fractions (Lisp is one such language) because somebody has programmed
the algebraic rules of fraction arithmetic into the language:
(let ((x 1/3)
  (y 2/3))
  (print (+ x y))
will cheefully and with 100% accuracy print out "1" every single time.
[Apologies to Guy Steele if my 10-years-unused Lisp syntax is not spot on.]

Lisp stores fractions as 2 integers, not as floating point numbers.
[Though of course you can ask it to convert and round off if you like.]

You could, if you so desired, whip up a PHP "class fraction {" code-base,
or even just store fractions as 2-element arrays (numerator, denominator)
and write some procedural functions to work with them.

It's not exactly Rocket Science to do that.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question about apache-php concurrent process control

2005-07-22 Thread Rasmus Lerdorf
Read this chapter of the manual:

http://www.php.net/manual/en/features.connection-handling.php

Liang ZHONG wrote:
> I now encounter a problem with flow control of my program with PHP. This
> is very crucial to the design of a pretty big project. This is what I
> want to do in the program:
> 
>  do_A();
> header("Location: ".$result_of_do_A);
> do_B();
> ?>
> 
> Since it takes do_B()  quite a while to finish, so I want the http
> client get the partial result from do_A() by redirect a page to them
> before start do_B(). But it seems that the redirection will only occure
> after the entire php program finishes, i.e., after do_B(). I sent http
> request through browser, curl comman line with -N (no buffer) option and
> with a perl LWP program I wrote. All of them suggest that header(),
> although is put before do_B() in code, gets executed only after all the
> php code finished. I add flush() after header() too, but no work.
> 
> My question is: Is there any way that I can return to the client though
> http response and then continue my progress with my program?
> 
> Thank you very much for your kindly help.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question about apache-php concurrent process control

2005-07-22 Thread Richard Lynch
On Tue, July 19, 2005 5:32 am, Liang ZHONG said:
> It sounds interesting. But since I am pretty new to PHP, I have some
> questions, naive maybe, about what you wrote.
>
> "#!/bin/sh\n/path/to/script/Send.php 12 &\n"
>
> What does the Send.php look like? I do not have idea how a shell
> interprets
> an php script and what the parameter 12 means here. If you do not mind,
> could you please also let me look at your Send.php?

I dunno what his Send script looks like, but that 12 isn't a 12 at all.

It's a 1 with a > symbol and then a 2.

The > symbol probably got eaten by somebody's email program somewhere
along the way.

See, in some Linux/Un*x shells (errr, like DOS prompt only not broken)
there is the idea of "standard output" which is where your basic output
messages go.

There is also "standard error" where your ERROR messages go.

On Linux/Unix file systems, stdout (standard output) is bound to a
"special" file which lives in /dev/1 -- it's not really really a file, but
a "device" but to send stuff to the "standard output" -- which is
generally your screen, you can just write it to /dev/1 and it gets there.

For shorthand, in shell scripts, you can just use "1" to mean "/dev/1"

Similarly, "standard error" is "/dev/2" and you can use "2"

So, what he really had was 1>2 which was saying:
Take anything that was supposed to go to 1 (standard output) and send it
(the > symbol) into 2 (standard error)

So he's telling the shell (operating system) to combine any normal output
into the error output so it's one big mess of output.

You can learn more about this stuff (though it may be a bit overwhelming
at first) by searching for "man bash" or reading an introductory Linux
textbook or resource on-line.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rasmus' 30 second AJAX Tutorial - [was Re: [PHP] AJAX & PHP]

2005-07-22 Thread Rasmus Lerdorf
Richard Lynch wrote:
> On Thu, July 21, 2005 3:50 pm, Rasmus Lerdorf said:
> 
>>I find a lot of this AJAX stuff a bit of a hype.  Lots of people have
>>been using similar things long before it became "AJAX".  And it really
> 
> 
> Call me silly, but...
> 
> Didn't a LOT of us move a bunch of code to PHP instead of JS because JS
> was so flaky, because browser implementations were so... diverse...,
> because you never knew if the user even *HAD* javascript, really, and you
> just didn't want to rely on it?
> 
> Is anybody going to claim that any of the fundamental problems with
> client-side scripting have changed?  Got a bridge to sell, too?
> 
> If it's just eye-candy, and doesn't matter to the functioning of your
> web-site, go for it.
> 
> If you NEED it to work, JS is simply not the right way to go, even with
> today's landscape.

Browser technology has advanced a bit since then.  Today we are no
longer dealing with a pseudo-SGML hack called HTML like we were 10 years
ago.  Today's web browser is a DOM Tree viewer.  In Firefox you can
click on Tools->DOM Inspector and click through the tree of the page you
are on.

The language to manipulate this DOM Tree is Javascript.  And yes,
Javascript gets this DOM manipulation right, because it is so closely
integrated with the actual parsing of the tree.  If it didn't work, the
browser wouldn't work either.  For example, take this JS:

   foo = document.getElementById('some_id').value;

This obviously gets the value of the field with some_id.  This prods the
same DOM tree with the same code that the browser itself uses when it
wants to know what the value is in a given element of the tree.  So at
this level Javascript is fine, and yes, you can count on it working in
all modern browsers.  If any of them can't do this, they won't be around
long.

It gets a bit dicier when you try to extend out beyond simple document
manipulation, but that is really no different than trying to push the
boundaries of CSS or trying to get IE to speak CSS2.  The bar keeps
getting raised.  In my opinion it has been raised well above basic
Javascript for quite a while now.

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is there a way to get a variable name as a string?

2005-07-22 Thread Richard Lynch
On Mon, July 18, 2005 8:24 pm, Ryan A said:
> I didnt totally understand you q in the beginning (and still dont fully),
> but



He wants a function that, if you put in $x, you get out 'x'

For *ANY* $variable.

There is no such function.

Usually the person asking it is doing something very newbie-ish, and very
wrong.

I know, cuz I was that person, many many years ago. :-)

I think what I needed that time was "variable variables"...

The other thing that tends to bring up this question is somebody trying to
write a custom error handler, not knowing about
http://php.net/trigger_error and friends.  Though that only gets you the
line number and filename where the error occured, not a specific variable
name.

If for some reason one *NEEDS* to have "names" and variables and to know
what a variable's "name" is, you *probably* want to use an associative
array and use the "keys" as your names.

Hopefully this is helpful to the Original Poster, or somebody some day.

PS

It's true that your variable could/would/should appear in debug_backtrace,
but how would you pick it out from all the other variables that would
appear in your debug_backtrace?

For that matter, it's in $_GLOBALS, but how would you pick it out?

You could print out all variables that were equal to your variable, and
have a list of candidates...

\n";
  }
?>

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Char encoding using fget or curl

2005-07-22 Thread Richard Lynch
On Mon, July 18, 2005 2:14 pm, Marcelo Volmaro said:
> I need to get some information from a webpage, that is served as UTF-8.
> I need that information because the page contains different language
> characters. The problem is that no matter if I use fget or the CURL
> libraries, i got the information in ISO-8859-1.
> How can i overcome this? Take in consideration that not all UTF-8 can be
> converted to ISO-8859-1 (chinese, for example)

WILD GUESSES!!!

There might be a CURLOPT_CHARSET or similar constant that is not
documented on php.net, and that might not have made it into PHP as a
constant even, but if you read the original curl docs will tell you how to
do it...

You might have to do something like:
if (!defined('CURLOPT_CHARSET')) define('CURLOPT_CHARSET', 47);
just to have the constant available.


It's also entirely possible that curl, by default, sends some kind of
default "Accepts: charset=ISO-8859-1" header or something similar, and you
just need to send some *other* header to tell the web-server that your
browser "understands" UTF-8.  Or maybe even that you specifically want the
results in Chinese or whatever...  I know a lot of webservers/browsers
don't implement the language-preference for the browser/user, but *MAYBE*
it will have some effect.

Just some ideas from a guy who knows he's WAY too stupid to ever have
multi-lingual anything working on his own web-site. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP from CLI with SAPI

2005-07-22 Thread Richard Lynch
On Mon, July 18, 2005 1:49 pm, Fredrik Tolf said:
> very huge undertaking. I realize that Apache is huge, but that's just
> because it has so insanely many features -- an HTTP server in itself
> shouldn't need to be very complex, the way I see it.

There are innumerable other HTTP servers.

Some of them support PHP (and vice versa) to varying degrees.

I know there were posts about at least *ONE* of them I recall I wanted to
try "some day" and I'm pretty sure it was because that server gave you
more control over the PHP User.

Now, what the name of that server was, I have NO IDEA...

It was probably about 2 or 3 years ago.

I vaguely recall the name was maybe somehow related to "dragon" ???

At any rate:  The web-servers PHP supports officially is pretty short, and
you should check those out.

There are probably a bunch MORE web-servers that claim to work "just fine"
with PHP -- but possibly only as CGI, at which point suexec and the
faithful standard Apache is probably a better idea anyway, unless you have
more reasons not yet posted for dis-liking Apache.

I don't think Apache really loads *that* much stuff in if you set yourself
the goal of paring down your httpd.conf to the features you NEED.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with a home-grown function

2005-07-22 Thread André Medeiros
On Thu, 2005-07-21 at 13:37 -0700, Dan Trainor wrote:
> Hello, all -
> 
> I've been looking around for a function that would tell me if a $value
> in a $key=>$value array was empty, and I could not find one.  So I
> decided to make my own.  Even if I am re-inventing the wheel, I thought
> that the practice might be good for me.
> 
> However, my function doesn't *quite* work, and I'm having a difficult
> time finding out why.  The code is as follows:
> 
> function findMissingVals($workingArray) {
>   $newcount = count($workingArray);
>   for ($i = 0; $i <= $newcount; $i++) {
>   if (empty($workingArray['$i'])) {
>   return 1;
>   }
>   }
> }
> 
> So it takes in $workingArray as an array, runs a loop, checks $i, yada
> yada.  The thing is, that sometimes the function does not return 1, even
> when it should.
> 
> I was hoping some experienced eyes could take a gander at this and give
> me some pointers.
> 
> Thanks!
> -dant
> 
8<-
function findMissingVals( &$workingArray ) {
$arrayMissingVals = Array();
foreach( $arrayMissingVals as $key => $value ) {
if( is_array( $value ) ) {
array_merge( $arrayMissingVals, findMissingVals( 
&$value ) );
}
else if( empty( $value ) ) {
array_push( $arrayMissingVals, &$workingArray[$key] );
}

}

return( $arrayMissingVals );
}
8<-

Recursive function that will check arrays and return references to the
empty keys. Then, you can do whatever you like.

If you need something simpler, do

8<-
if( in_array( $workingArray, null ) ) {
// Do something
}
8<-

Same goes for 0, '', etc.

Good luck!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Affiliate Tracking [Management] program

2005-07-22 Thread Matt Darby

Eugene Voznesensky wrote:


I' looking for free PHP/MySQL Affiliate Tracking
[Management] program. Would appreciate any advice/idea

fd.

 



Have you looked over sourceforge.net?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is there a way to get a variable name as a string?

2005-07-22 Thread Edward Vermillion

Richard Lynch wrote:

[snip]



PS

It's true that your variable could/would/should appear in debug_backtrace,
but how would you pick it out from all the other variables that would
appear in your debug_backtrace?

For that matter, it's in $_GLOBALS, but how would you pick it out?

You could print out all variables that were equal to your variable, and
have a list of candidates...

\n";
  }
?>



What I was thinking with debug_backtrace() is that you could get the 
information for the function that called the function you want the 
variable name for, *reducing* the likelyhood of duplicate values, but 
admitedly not eliminating it.


You could also pass the name of the variable to the function:

someFunction($foo, $varName=""){ print $varName; }

call it with -> someFunction($bar, 'bar');

That would definately get you what you want, but again it would be messy 
to look at.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] RE: [SPAM 6.0] [PHP] Session help!?

2005-07-22 Thread Programmer
I did not specify all versions; older versions worked fine, but I.E.
that shipped with WINXP, before any service packs had these issues.  

J

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 21, 2005 9:04 PM
To: Programmer
Cc: 'Richard Baldwin'; php-general@lists.php.net
Subject: Re: [PHP] RE: [SPAM 6.0] [PHP] Session help!?

On Thu, July 21, 2005 2:21 pm, Programmer said:
> The biggest gotcha that I have ran into concerning sessions is this:
>
> If your client's browser is I.E. and the domain is named with
> _(underscores), -(dashes), etc.  I.E. discards the session and starts
a
> new one.  I don't know if this is fixed under SP2.

This cannot be true for many versions of IE...

I would have noticed. :-)

Though IE *is* giving me fits on this page:
http://uncommonground.com/artist/

They "login" okay, but can't get to following pages.

These are users for whom the question: "what browser version do you
have?"
yields answers like "Windows 2000"...

Is it that goofy mini privacy policy crap?  Like the bad guys won't just
LIE.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] how to post a question?

2005-07-22 Thread Chirantan Ghosh
I was wondering how can I ask a question to the other subscribers?


[PHP] Konqueror does not like my Website

2005-07-22 Thread Michelle Konzack
Hello *,

I an developing a tool which let me scroll in a very big
(some 1000 km²) topographical map.

For testing I have installed a citymap of Offenburg/Germany
but I get only en empty HTML-Page in Konqueror, but ist
works in Mozilla, Firefox and InfernalExploder.

The Link is:


Does anyone know this Bug ?

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] how to post a question?

2005-07-22 Thread John Nichel

Chirantan Ghosh wrote:

I was wondering how can I ask a question to the other subscribers?



Don't look know but, you just did.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: how to post a question?

2005-07-22 Thread Michelle Konzack
Am 2005-07-22 09:55:47, schrieb Chirantan Ghosh:
> I was wondering how can I ask a question to the other subscribers?
- END OF REPLYED MESSAGE -

Coucou...

I can see your question.  :-)

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


RE: [PHP] how to post a question?

2005-07-22 Thread Shaw, Chris - Accenture

Posting a question on how to post a question.

:)

-Original Message-
From: Chirantan Ghosh [mailto:[EMAIL PROTECTED]
Sent: 22 July 2005 14:56
To: php-general@lists.php.net
Subject: [PHP] how to post a question?


*

This e-mail has been received by the Revenue Internet e-mail service.

*




This message has been delivered to the Internet by the Revenue Internet e-mail 
service

*

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread eoghan

Shaw, Chris - Accenture wrote:

Posting a question on how to post a question.

:)


you gotta start somewhere

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Konqueror does not like my Website

2005-07-22 Thread John Nichel

Michelle Konzack wrote:

Hello *,

I an developing a tool which let me scroll in a very big
(some 1000 km²) topographical map.

For testing I have installed a citymap of Offenburg/Germany
but I get only en empty HTML-Page in Konqueror, but ist
works in Mozilla, Firefox and InfernalExploder.

The Link is:


Does anyone know this Bug ?


You mean the 'posting a totally non-php question to a php list' bug?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Remote HTM not printing via PHP

2005-07-22 Thread Chirantan Ghosh
Sorry Guys for the previous ignorant Q I thought I was emailing the Help desk, 
do forgive.


I am trying to print a remote header menu in a html page without frames.

The client side JS in located in this htm. ( 
http://www.dtcc.com/ThoughtLeadership/menu.htm )

I tried both INCLUDE, REQUIRE  with no avail. I am  a complete novice beginner 
so can anyone help me a bit please?

The code I tried:
==




  

 http://www.dtcc.com/ThoughtLeadership/menu.htm';
print getRandomLine($filename);

function getRandomLine($filename) 
{
global $errors;

  if (file_exists($filename)) {

mt_srand ((double) microtime() * 100);
$lines = file($filename);

$line_number = mt_rand(0,sizeof($lines)-1);
return $lines[$line_number];

  } else {
$errors['getRandomLine'][] = "File: $filename not found";
return FALSE;
  }
}
  ?>

  
  
 

...& On it Goes



Can you please let me know why can't print the remote HTM  in the current page 
(Though it is in a different domain)?

Thanks,

Chirantan
NYC
p2ren[at]aol[dot]com



Re: [PHP] Loading dynamic extension

2005-07-22 Thread Mathieu Dumoulin

Richard Lynch wrote:

On Thu, July 21, 2005 12:17 pm, Mathieu Dumoulin said:


2. Further more, i can't seem to find a way to know from which path or
drive my usbkey is operating. There is maybe something i missed
somewhere that's why im asking. Anyone ever found something about the
CLI current run path in $_ENV or $_SERVER var?



If your PHP script is on the same drive as the GTK lib, then you can use
phpinfo() to find out the variable name that has your drive letter.

Something like $script_filename or somesuch.

Insert the USB device, note the drive letter, run php -i | grep "X:"

Course, on a Mac or Linux box, your USB device won't have a drive "letter"
per se -- You'll have the correct PATH though, for the OS it's on, which
is far far more portable.



Sorry that doesn't work, just in case i tried erasing anything related 
to Apache, PHP and Perl on my home system. It seems by default, if PHP 
can't find a php.ini it sets all defaults to c:\windows instead of 
setting them to the current application run path.


I think my next step will be to check if i can recompile PHP manually 
for windows and change the code in it to reflect what i need in terms of 
defaults... Like using the application start path and stuff like that to 
load extensions and more.


Does that look like a good idea?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Ryan A
> I was wondering how can I ask a question to the other subscribers?

Dude, when you figure it out let me know too...

:-p

-Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Alan Milnes

Chirantan Ghosh wrote:


I was wondering how can I ask a question to the other subscribers?

 


Try reading this first:-

http://www.catb.org/~esr/faqs/smart-questions.html

Alan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Chirantan Ghosh

Hi Alan & Everybody who wasted time to read my 1st Letter,

SORRY guys, I do deserve the scorn but it was genuine mistake I didn't want 
to post garbage bugging other people.
I was under the impression that I was mailing to the HELP DESK( nonliving 
resp system).


If you can, Please do help me in my real PHP issue:
===
I am trying to print a remote header menu in a html page without frames.
The client side JS in located in this htm. ( 
http://www.dtcc.com/ThoughtLeadership/menu.htm )
I tried both INCLUDE, REQUIRE  with no avail. I am  a complete novice 
beginner so can anyone help me a bit please?


The code I tried:
==




 
   
http://www.dtcc.com/ThoughtLeadership/menu.htm';
   print getRandomLine($filename);

   function getRandomLine($filename)
   {
   global $errors;

 if (file_exists($filename)) {

   mt_srand ((double) microtime() * 100);
   $lines = file($filename);

   $line_number = mt_rand(0,sizeof($lines)-1);
   return $lines[$line_number];

 } else {
   $errors['getRandomLine'][] = "File: $filename not found";
   return FALSE;
 }
   }
 ?>

 
 
    

...& On it Goes


Can you please let me know why can't print the remote HTM  in the current 
page (Though it is in a different domain)?


Thanks,
Chirantan
NYC

- Original Message - 
From: "Alan Milnes" <[EMAIL PROTECTED]>

Cc: 
Sent: Friday, July 22, 2005 10:47 AM
Subject: Re: [PHP] how to post a question?



Chirantan Ghosh wrote:


I was wondering how can I ask a question to the other subscribers?



Try reading this first:-

http://www.catb.org/~esr/faqs/smart-questions.html

Alan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Edward Vermillion

Chirantan Ghosh wrote:

Hi Alan & Everybody who wasted time to read my 1st Letter,

SORRY guys, I do deserve the scorn but it was genuine mistake I didn't 
want to post garbage bugging other people.
I was under the impression that I was mailing to the HELP DESK( 
nonliving resp system).


If you can, Please do help me in my real PHP issue:
===
I am trying to print a remote header menu in a html page without frames.
The client side JS in located in this htm. ( 
http://www.dtcc.com/ThoughtLeadership/menu.htm )
I tried both INCLUDE, REQUIRE  with no avail. I am  a complete novice 
beginner so can anyone help me a bit please?


The code I tried:
==




 
   
http://www.dtcc.com/ThoughtLeadership/menu.htm';
   print getRandomLine($filename);

   function getRandomLine($filename)
   {
   global $errors;

 if (file_exists($filename)) {

   mt_srand ((double) microtime() * 100);
   $lines = file($filename);

   $line_number = mt_rand(0,sizeof($lines)-1);
   return $lines[$line_number];

 } else {
   $errors['getRandomLine'][] = "File: $filename not found";
   return FALSE;
 }
   }
 ?>

 
 
    

...& On it Goes


Can you please let me know why can't print the remote HTM  in the 
current page (Though it is in a different domain)?


Thanks,
Chirantan
NYC

- Original Message - From: "Alan Milnes" <[EMAIL PROTECTED]>
Cc: 
Sent: Friday, July 22, 2005 10:47 AM
Subject: Re: [PHP] how to post a question?



Chirantan Ghosh wrote:


I was wondering how can I ask a question to the other subscribers?



Try reading this first:-

http://www.catb.org/~esr/faqs/smart-questions.html

Alan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






Just out of curiosity, why are you just printing a random line from the 
file?


Then the next question is do you have your error reporting turned up:

error_reporting(E_ALL);

and display_errors = On in php.ini, only for a development server, or at 
least a log file to look at, for a production server?


I'm going to assume that you've checked the source of your script output 
and the random line isn't where you thout it would be?


The best thing to do would be to just print out the lines/files you are 
trying to get, without the rest of the HTML, to see what your getting 
from just the part your having trouble with.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Content Header

2005-07-22 Thread Matthew Weier O'Phinney
* "Richard Lynch" <[EMAIL PROTECTED]> :
> On Thu, July 21, 2005 4:55 am, Chris Shiflett said:
> > Christopher J. Umina wrote:
> > > I currently have a script which streams data out of a MySQL database,
> > > and prints the content headers correctly, however, when I use the
> > > following line:
> > >
> > > header("Content-Disposition: attachment; filename=\"". $filename ."\"");
> > >
> > > it prompts the user to download the file each time they go to the site.
> >
> > Then it works. :-)
>
> But it will only work on *SOME* browsers -- those which honor the
> johnny-come-lately Content-Disposition header.
>
> Use Content-type: application/octet-stream to guarantee it gets downloaded
> in ALL browsers.

The OP indicated s/he *was* setting Content-Type.

They were also sending Content-Disposition in order to indicate the
suggested filename -- and wanted to alternately either send the filename
*or* have the content echoed to the screen. The 'solution' was to use
different URLs, and set Content-Disposition to either 'attachment' or
'inline', respectively.

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Konqueror does not like my Website

2005-07-22 Thread Michelle Konzack
Am 2005-07-22 10:12:17, schrieb John Nichel:

> You mean the 'posting a totally non-php question to a php list' bug?

Because the page is generated by a couple of PHP scripts and
ONLY THIS PAGE is not working.

So I was thinking there is a problem with the file-extension
*.php and Konqueror can not handel this... (It is KDE 3.4)

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] how to post a question?

2005-07-22 Thread Nadim Attari
> Posting a question on how to post a question.

Here it goes:
http://www.collectionscanada.ca/obj/h9/f1/284-v3.jpg

Just put your hand on top of it and say "ABRACADABRA"

Nadim Attari

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Pascual De Ruvo
You just did it

On 7/22/05, Chirantan Ghosh <[EMAIL PROTECTED]> wrote:
> 
> I was wondering how can I ask a question to the other subscribers?
> 
>


Re: [PHP] how to post a question?

2005-07-22 Thread Chirantan Ghosh

Hi Edward,

I would simply like to print the remote Menu page( 
http://www.dtcc.com/ThoughtLeadership/menu.htm ) in a new page.
I did the Error report print because I had no idea for what reason my PHP 
code was working.


The menu is used  as a header as well(the root file is JS which I can't use 
as I don't know all the directories  of dtcc.com )
I am simply trying to impress a non technical person of the company so I can 
get a design contract.


How can print the menu in different domain html pages? ( I would like to use 
PHP as server  language)


Thanks,
Chirantan

- Original Message - 
From: "Edward Vermillion" <[EMAIL PROTECTED]>

To: 
Cc: "Alan Milnes" <[EMAIL PROTECTED]>
Sent: Friday, July 22, 2005 11:20 AM
Subject: Re: [PHP] how to post a question?



Chirantan Ghosh wrote:

Hi Alan & Everybody who wasted time to read my 1st Letter,

SORRY guys, I do deserve the scorn but it was genuine mistake I didn't 
want to post garbage bugging other people.
I was under the impression that I was mailing to the HELP DESK( nonliving 
resp system).


If you can, Please do help me in my real PHP issue:
===
I am trying to print a remote header menu in a html page without frames.
The client side JS in located in this htm. ( 
http://www.dtcc.com/ThoughtLeadership/menu.htm )
I tried both INCLUDE, REQUIRE  with no avail. I am  a complete novice 
beginner so can anyone help me a bit please?


The code I tried:
==


TOPMARGIN=0

MARGINWIDTH=0 MARGINHEIGHT=0>

 
   
http://www.dtcc.com/ThoughtLeadership/menu.htm';
   print getRandomLine($filename);

   function getRandomLine($filename)
   {
   global $errors;

 if (file_exists($filename)) {

   mt_srand ((double) microtime() * 100);
   $lines = file($filename);

   $line_number = mt_rand(0,sizeof($lines)-1);
   return $lines[$line_number];

 } else {
   $errors['getRandomLine'][] = "File: $filename not found";
   return FALSE;
 }
   }
 ?>

 
 
    

...& On it Goes


Can you please let me know why can't print the remote HTM  in the current 
page (Though it is in a different domain)?


Thanks,
Chirantan
NYC

- Original Message - From: "Alan Milnes" <[EMAIL PROTECTED]>
Cc: 
Sent: Friday, July 22, 2005 10:47 AM
Subject: Re: [PHP] how to post a question?



Chirantan Ghosh wrote:


I was wondering how can I ask a question to the other subscribers?



Try reading this first:-

http://www.catb.org/~esr/faqs/smart-questions.html

Alan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






Just out of curiosity, why are you just printing a random line from the 
file?


Then the next question is do you have your error reporting turned up:

error_reporting(E_ALL);

and display_errors = On in php.ini, only for a development server, or at 
least a log file to look at, for a production server?


I'm going to assume that you've checked the source of your script output 
and the random line isn't where you thout it would be?


The best thing to do would be to just print out the lines/files you are 
trying to get, without the rest of the HTML, to see what your getting from 
just the part your having trouble with.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Konqueror does not like my Website

2005-07-22 Thread Duncan Hill
On Friday 22 July 2005 16:33, Michelle Konzack typed:
> Am 2005-07-22 10:12:17, schrieb John Nichel:
> > You mean the 'posting a totally non-php question to a php list' bug?
>
> Because the page is generated by a couple of PHP scripts and
> ONLY THIS PAGE is not working.
>
> So I was thinking there is a problem with the file-extension
> *.php and Konqueror can not handel this... (It is KDE 3.4)

Konqueror cares not for your extension, it cares for what the data itself is.  
If you've got buggy javascript or similar, you should see a red bug in the 
bottom right.

-- 
My mind not only wanders, it sometimes leaves completely.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Konqueror does not like my Website

2005-07-22 Thread John Nichel

Michelle Konzack wrote:

Am 2005-07-22 10:12:17, schrieb John Nichel:



You mean the 'posting a totally non-php question to a php list' bug?



Because the page is generated by a couple of PHP scripts and
ONLY THIS PAGE is not working.

So I was thinking there is a problem with the file-extension
*.php and Konqueror can not handel this... (It is KDE 3.4)


The file extension is irrelevant.  This is not a php problem.  More than 
likely you have an error in what you're outputing to the browser; 
JavaScript if I was a betting man.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Ryan A
Hey,
Getting the code from the remote site is easy enough, you just gotto find
the images now, but heres something
that should get you the basic code including the javascript:

http://www.dtcc.com/ThoughtLeadership/menu.htm');
echo $filename;
?>

once you have the code, start converting the relative image paths to full
image paths,
should work.

Cheers,
Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Chirantan Ghosh

Hi Ryan,

I tried that first & also after you wrote with no avail. ( This should be
very elemental)
=
http://www.dtcc.com/ThoughtLeadership/menu.htm');
echo $filename;
?>
=

I am trying this html in a local machine. I preview it Internet Explorer
(which has access to net).
Does it matter if the HTML file is not residing in a domain?( I didn't think
so but no harm asking)

Thanks a bunch for taking interest,
Chirantan


- Original Message - 
From: "Ryan A" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>
Cc: "php" 
Sent: Friday, July 22, 2005 12:10 PM
Subject: Re: [PHP] how to post a question?



Hey,
Getting the code from the remote site is easy enough, you just gotto find
the images now, but heres something
that should get you the basic code including the javascript:

http://www.dtcc.com/ThoughtLeadership/menu.htm');
echo $filename;
?>

once you have the code, start converting the relative image paths to full
image paths,
should work.

Cheers,
Ryan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Ryan A
Hey,
The problem might be with your php settings,
run phpinfo() and see if allow_url_fopen is set to ON

heres where i uploaded what i did so far, little more needs to be done
so that the mouseover images work:
http://php-php.com/a2ztips/test.php

The way I did it is in a *very very very dirty way*, I suggest you dump my
code and use a RegEx there (am too lazy to write one) instead of the
multiple
str_replace calls but my code should give you a good starting point.


http://www.dtcc.com/ThoughtLeadership/menu.htm');
$filename= str_replace("../dtcc.css","http://www.dtcc.com/dtcc.css";,
$filename);
$filename= str_replace("images/","http://www.dtcc.com/images/";, $filename);
$filename= str_replace("/http:","http:", $filename);
$filename= str_replace("..http:","http:", $filename);

echo $filename;
?>

Cheers,
Ryan

On 7/22/2005 6:11:27 PM, Chirantan Ghosh ([EMAIL PROTECTED]) wrote:
> Hi Ryan,
>
> I tried that first & also after you wrote with no avail. ( This should be
>
> very elemental)
> =
>  $filename =
> file_get_contents('http://www.dtcc.com/ThoughtLeadership/menu.htm');
> echo $filename;
> ?>
> =
>
> I am trying this html in a local machine. I preview it Internet Explorer
> (which has access to net).
> Does it matter if the HTML file is not residing in a domain?( I
> didn't think
> so but no harm asking)
>
> Thanks a bunch for taking interest,
> Chirantan
>
> - Original Message -
> From: "Ryan A" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: "php" 
> Sent: Friday, July 22, 2005 12:10 PM
> Subject: Re: [PHP] how to post a question?
>
>
> > Hey,
> > Getting the code from the remote site is easy enough, you just gotto
find
> > the images now, but heres something
> > that should get you the basic code including the javascript:
> >
> >  > $filename =
> > file_get_contents('http://www.
> dtcc.com/ThoughtLeadership/menu.htm');
> > echo $filename;
> > ?>
> >
> > once you have the code, start convert

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Edward Vermillion

Chirantan Ghosh wrote:

Hi Edward,

I would simply like to print the remote Menu page( 
http://www.dtcc.com/ThoughtLeadership/menu.htm ) in a new page.
I did the Error report print because I had no idea for what reason my 
PHP code was working.


The menu is used  as a header as well(the root file is JS which I can't 
use as I don't know all the directories  of dtcc.com )
I am simply trying to impress a non technical person of the company so I 
can get a design contract.


How can print the menu in different domain html pages? ( I would like to 
use PHP as server  language)


Thanks,
Chirantan



First try this:

print 
htmlentities(file_get_contents('http://www.dtcc.com/ThoughtLeadership/menu.htm'));


?>

That will let you see the HTML in your browser. If you don't get 
anything then either your request is being blocked by a firewall or you 
don't have fopen wrappers enabled. I'm betting on the latter though.


Are you running a local install of php or through a remote server? You 
should be generating some kind of errors if your not getting anything back.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Ryan A
Hey,
Some more _dirty code_ as posted on http://php-php.com/a2ztips/test.php,

http://www.dtcc.com/ThoughtLeadership/menu.htm');

$o=array("../dtcc.css","images/","/http","..http:");
$n=array("http://www.dtcc.com/dtcc.css","http://www.dtcc.com/ThoughtLeadersh
ip/images/","http","http:");
$filename = str_replace($o, $n, $filename);

$old =
array("http://www.dtcc.com/ThoughtLeadership/images/dtcc_banner_logo.gif";,
"http://www.dtcc.com/ThoughtLeadership/images/dtcc_banner_top_middle.jpg";,
"http://www.dtcc.com/ThoughtLeadership/images/banner_topright.jpg","http://w
ww.dtcc.com/ThoughtLeadership/images/thoughtmenu_r2_c3.jpg","http://www.dtcc
.com/ThoughtLeadership/images/searcharrow.gif");

$new  = array("http://www.dtcc.com/images/dtcc_banner_logo.gif";,
"http://www.dtcc.com/images/dtcc_banner_top_middle.jpg";,
"http://www.dtcc.com/images/banner_topright.jpg","http://www.dtcc.com/images
/thoughtmenu_r2_c3.jpg","http://www.dtcc.com/images/searcharrow.gif";);
$filename = str_replace($old, $new, $filename);

echo $filename;
echo "done";
  ?>

You would still have to replace the links to the full path instead of the
relative path that it now has.
The str_replace calls are kinda expensive IMHO, a good regex would be better
(like I said in my last mail)
another thing to note is sometimes the remote server times out or is too
slow so the script times out...

I hope this helped dude...will take down the page from there in a few hours.

Cheers,
Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Konqueror does not like my Website

2005-07-22 Thread Matt Darby
The easiest way to fix this is to validate your output. Konqueror is 
likely more picky about correct code.


Here is validator output:
http://validator.w3.org/check?uri=http%3A%2F%2Fmichelle.konzack.home.tamay-dogan.homelinux.net%2Ftdlandmap%2F

Michelle Konzack wrote:


Hello *,

I an developing a tool which let me scroll in a very big
(some 1000 km²) topographical map.

For testing I have installed a citymap of Offenburg/Germany
but I get only en empty HTML-Page in Konqueror, but ist
works in Mozilla, Firefox and InfernalExploder.

The Link is:
   

Does anyone know this Bug ?

Greetings
Michelle

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Chirantan Ghosh

Hello Edward,

I did try your approach in this page
http://www.homecare1.biz/public_html/PHPsiteTest01.html with no avail.
How would I find out if I have  fopen wrappers enabled?
This page is remote hosted ( Hosted by Godaddy.com who state I have
PHP/MySQL enabled).
CODE USED:
===

 
   
http://www.dtcc.com/ThoughtLeadership/menu.htm'));

?>

 
 


Thanks for the help,
Chirantan


- Original Message - 
From: "Edward Vermillion" <[EMAIL PROTECTED]>

To: "Chirantan Ghosh" <[EMAIL PROTECTED]>
Cc: 
Sent: Friday, July 22, 2005 12:26 PM
Subject: Re: [PHP] how to post a question?



Chirantan Ghosh wrote:

Hi Edward,

I would simply like to print the remote Menu page( 
http://www.dtcc.com/ThoughtLeadership/menu.htm ) in a new page.
I did the Error report print because I had no idea for what reason my PHP 
code was working.


The menu is used  as a header as well(the root file is JS which I can't 
use as I don't know all the directories  of dtcc.com )
I am simply trying to impress a non technical person of the company so I 
can get a design contract.


How can print the menu in different domain html pages? ( I would like to 
use PHP as server  language)


Thanks,
Chirantan



First try this:

print 
htmlentities(file_get_contents('http://www.dtcc.com/ThoughtLeadership/menu.htm'));


?>

That will let you see the HTML in your browser. If you don't get anything 
then either your request is being blocked by a firewall or you don't have 
fopen wrappers enabled. I'm betting on the latter though.


Are you running a local install of php or through a remote server? You 
should be generating some kind of errors if your not getting anything 
back.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: gloabl & reference behavior question?

2005-07-22 Thread Surendra Singhi

"Richard Lynch" <[EMAIL PROTECTED]> writes:
> The & operator is not, as far as I know, defined for an array assignment
> operation.
>
> True, you can use & in the parameter list in some versions to keep PHP
> from copying the whole array.  But that does not legitimatize what you are
> doing, I don't think.

I never claimed, what I was doing was correct, rather I didn't knew well
enough that 'PHP is not C++', and I was misunderstanding how reference and
global variables work in PHP.
>
> I could be 100% wrong. I've never even *TRIED* to use a reference to an
> array because I simply don't want to write code that confusing in the
> first place.

I don't think it will make the code confusing, but the person looking at the
code should understand how reference and global variables work. Using
reference variables avoids unnecessary extra copying of objects, and while
using large arrays it can make a big difference in speed. 

The lesson to learn from this thread is that variables declared in a function
as global (using global keyword) are new reference variables to the actual
global variable. And, so when these global variables in functions are assigned
a new reference, it breaks the old reference and makes them refer to the new
location, and the actual global variable is not affected. 
But in contrast, if the global variables in the function are assigned a new
value, this does changes the value of the variable in the outer global scope.


-- 
Surendra Singhi

http://www.spikesource.com

http://www.public.asu.edu/~sksinghi/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Konqueror does not like my Website

2005-07-22 Thread Rick Emery

Quoting Michelle Konzack <[EMAIL PROTECTED]>:


Am 2005-07-22 10:12:17, schrieb John Nichel:


You mean the 'posting a totally non-php question to a php list' bug?


Because the page is generated by a couple of PHP scripts and
ONLY THIS PAGE is not working.

So I was thinking there is a problem with the file-extension
*.php and Konqueror can not handel this... (It is KDE 3.4)

Greetings
Michelle


I just opened it in Konqueror 3.4.1 to look for any javascript errors, 
and it seemed to load and work fine.


Sorry I wasn't any help,
Rick
--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
with your eyes turned skyward, for there you have been, and there
you will always long to return"
 -- Leonardo Da Vinci

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Is there a way to get a variable name as a string?

2005-07-22 Thread Daevid Vincent
> What I was thinking with debug_backtrace() is that you could get the 
> information for the function that called the function you want the 
> variable name for, *reducing* the likelyhood of duplicate values, but 
> admitedly not eliminating it.
> 
> You could also pass the name of the variable to the function:
> 
> someFunction($foo, $varName=""){ print $varName; }
> 
> call it with -> someFunction($bar, 'bar');
> 
> That would definately get you what you want, but again it 
> would be messy to look at.

Well if you called someFunction('bar');

Function someFunction($myVar)
{
global $$myVar;
echo "the variable name is '$myVar' and has the value of ".$$myVar;
}

But that relies on the global and is also a bit messy in a recursive
situation.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Is there a way to get a variable name as a string?

2005-07-22 Thread Daevid Vincent
> He wants a function that, if you put in $x, you get out 'x'
> 
> For *ANY* $variable.
> 
> There is no such function.


> Usually the person asking it is doing something very 
> newbie-ish, and very wrong.

Actually it's not either...

Since you can't easily debug when generating XML, as malformed XML will STB,
I have this function which dumps out an array and recursively sub arrays.

It would be very useful to dump out the name of the variable as part of
this, as a lot of text is on the screen with all the tags and such. 

It always annoyed me about print_r() that it doesn't tell you the variable
name either, so you have to always prefix it with an echo/print just above
the print_r.

/**
* Print out an array in XML form (useful for debugging)
* @access   public
* @paramstring $myArray the array to output in XML format
* @version  1.0
* @date 07/19/05
* @todo It would be nice if we could extract the array's variable
name and output that as an attribute
*/
function print_r_xml($myArray)
{
print xmltag('ARRAY', null, 1);
foreach($myArray as $k => $v)
{
if (is_array($v))
print_r_xml($v);
else
print xmltag($k,htmlspecialchars($v));
}
print xmltag('ARRAY', null, 2);
}

/**
* Add the starting, or ending, or both xml tags
*
* @return   string xml formatted tags and data
* @paramstring $xmltag  is the tag name to surround
* @parammixed $data data to output between the tags, if $data is
an array, it will be expanded as KEY=VALUE in the tag
* @paramint $tagType 1=start tag only, 2=end tag only, 3=default
* @version  1.2
* @date 06/14/05
*/
function xmltag($xmltag, $data, $tagType = 3) 
{
// remove spaces and make uppercase
$xmltag = str_replace(' ','_', $xmltag );
//$xmltag = strtoupper( $xmltag );

$data = str_replace('&','&', $data );   // fix data with &
$data = str_replace('<','<', $data );// fix data with <
$data = str_replace('>','>', $data );// fix data with >

if ($tagType == 3) 
{
if (isset($data))
{
if (is_array($data))
{
$tmp = '<'.$xmltag;

if (is_array($data))
{
foreach($data as $key => $value)
$tmp .= '
'.$key.'="'.$value.'"';
}

$tmp .= " />\r\n";

return $tmp;
}
else
return
'<'.$xmltag.'>'.$data.'\r\n";
}
else
return '<'.$xmltag." />\r\n";
}

if ($tagType == 1)  
{
$tmp = '<'.$xmltag;

if (is_array($data))
{
foreach($data as $key => $value)
$tmp .= ' '.$key.'="'.$value.'"';
}

$tmp .= ">\r\n";

return $tmp;
}

if ($tagType == 2)  return '\r\n";
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to post a question?

2005-07-22 Thread Edward Vermillion

Chirantan Ghosh wrote:

Hello Edward,

I did try your approach in this page 
http://www.homecare1.biz/public_html/PHPsiteTest01.html with no avail.

How would I find out if I have  fopen wrappers enabled?
This page is remote hosted ( Hosted by Godaddy.com who state I have 
PHP/MySQL enabled).

CODE USED:
===

 
   



All you need to have in the page is this code:

htmlentities(file_get_contents('http://www.dtcc.com/ThoughtLeadership/menu.htm')); 



?>



you don't need this either:


 
 


Thanks for the help,
Chirantan



Since it's a remote server, it's quite lilely that they've disabled 
fopen wrappers. It can be a security concern for hosting providers. All 
you can do is ask them if they allow it, they should be able to tell you 
but I really doubt that they do.


You can check what they have configured php for by running this in a page:



That should give you a pretty page with a lot of information about what 
is available for you to run through php.


Good luck!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] On register_shutdown_function: What might be the problem?

2005-07-22 Thread Liang ZHONG




When the time_limit is set to 0, the redirect page will be shown in 20 
second after the file ccc is created.
When the time_limit is set to 5, the redirect page will be shown in 5 second 
and the ccc file is not created. The error from curl command line tool is 
as:

---

Fatal error:  Maximum execution time of 5 seconds exceeded 
in/./y.php on line 6



What might be the problem that my register shudown function can not 
continuously run after the main program end?
What is the correct way to keep the function running after I redirect a 
existing page to http client and then  immediately close the connection?


Thank you very much for your help.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] On register_shutdown_function: What might be the problem?

2005-07-22 Thread André Medeiros
Given it's a fatal error, it's as bad as a syntax error. It cancels
everything it's doing and leaves.

Remember that, even the shutdown function has to obey the time limit. 

On 7/22/05, Liang ZHONG <[EMAIL PROTECTED]> wrote:
>  
> set_time_limit(0);
> function f(){
> $count=1000;
> for($i=0; $i<$count; $i++){ }
> 
> exec("touch  /tmp/ccc");
> }
> 
> 
> register_shutdown_function('f');
> 
> header("Content-type: text/plain");
> header("Location: y.html");
> ?>
> 
> 
> When the time_limit is set to 0, the redirect page will be shown in 20
> second after the file ccc is created.
> When the time_limit is set to 5, the redirect page will be shown in 5 second
> and the ccc file is not created. The error from curl command line tool is
> as:
> ---
> 
> Fatal error:  Maximum execution time of 5 seconds exceeded
> in/./y.php on line 6
> 
> 
> What might be the problem that my register shudown function can not
> continuously run after the main program end?
> What is the correct way to keep the function running after I redirect a
> existing page to http client and then  immediately close the connection?
> 
> Thank you very much for your help.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] On register_shutdown_function: What might be the problem?

2005-07-22 Thread Liang ZHONG
I want the http client see the page ( here y.html) immediately after I call 
header function, and then close the connectiion, and the function f running 
in the background. But trying many  many times, the result seems that I have 
to either set the time limit to small to send the the html page sooner but 
also terminate the background running function which was registered as a 
shutdown function, or set the time to long enough for the shutdown function 
to finish while keeping the http client waiting until function return.


I doubt that register_shutdown_function meant to behave this way by its 
design. I would like to find out what could be wrong of my code, 
configuration of php or apache?


My Question is:
What is the correct way to keep the function running after I redirect an 
existing page to http client (which I want the client get immediately) and 
then immediately close the connection?


Thank you very much.



Given it's a fatal error, it's as bad as a syntax error. It cancels
everything it's doing and leaves.

Remember that, even the shutdown function has to obey the time limit.

On 7/22/05, Liang ZHONG <[EMAIL PROTECTED]> wrote:
> 
> set_time_limit(0);
> function f(){
> $count=1000;
> for($i=0; $i<$count; $i++){ }
>
> exec("touch  /tmp/ccc");
> }
>
>
> register_shutdown_function('f');
>
> header("Content-type: text/plain");
> header("Location: y.html");
> ?>
>
>
> When the time_limit is set to 0, the redirect page will be shown in 20
> second after the file ccc is created.
> When the time_limit is set to 5, the redirect page will be shown in 5 
second
> and the ccc file is not created. The error from curl command line tool 
is

> as:
> ---
> 
> Fatal error:  Maximum execution time of 5 seconds exceeded
> in/./y.php on line 6
> 
>
> What might be the problem that my register shudown function can not
> continuously run after the main program end?
> What is the correct way to keep the function running after I redirect a
> existing page to http client and then  immediately close the connection?
>
> Thank you very much for your help.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] On register_shutdown_function: What might be the problem?

2005-07-22 Thread Jasper Bryant-Greene

Liang ZHONG wrote:
What is the correct way to keep the function running after I redirect an 
existing page to http client (which I want the client get immediately) 
and then immediately close the connection?


Use the execution functions to call an external script that performs the 
tasks you want performed. If you execute, for example, 
"/some/path/somescript &", then the exec() function will return 
immediately and somescript will continue to run.


Jasper

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: System specific information gathering

2005-07-22 Thread Vidyut Luther

Ok,
 If I use the file_get_contents.. how do I actually parse the  
contents on /proc/uptime

cat /proc/uptime
1400293.13 1317047.64

What do I do with those two numbers ?

man uptime doesn't really talk about that file.. :/



On Jul 22, 2005, at 2:42 AM, Jasper Bryant-Greene wrote:


Vidyut Luther wrote:


Hello,
 I have a question on how to get Server side system specific   
information via PHP, or just general direction on how to parse  
some  of the information found in /proc




I just use file_get_contents() on the files in /proc. I would  
expect that would be a lot faster than using system() to execute  
'uptime' etc.


Jasper

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: System specific information gathering

2005-07-22 Thread Ramil Sagum
On 7/23/05, Vidyut Luther <[EMAIL PROTECTED]> wrote:
> Ok,
>   If I use the file_get_contents.. how do I actually parse the
> contents on /proc/uptime
> cat /proc/uptime
> 1400293.13 1317047.64


The first number is the total uptime in seconds, the second number is
the total idle time.

-- 




ramil
http://ramil.sagum.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] On register_shutdown_function: What might be the problem?

2005-07-22 Thread Rasmus Lerdorf
Liang ZHONG wrote:
> My Question is:
> What is the correct way to keep the function running after I redirect an
> existing page to http client (which I want the client get immediately)
> and then immediately close the connection?

ignore_user_abort(true);

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] On register_shutdown_function: What might be the problem?

2005-07-22 Thread Liang ZHONG

I think I did not express myself clearly.

What I want is to be able to redirect user an existing page (let them get it 
immediately), and to close the connection actively, NOT passively by user 
abort, at last, to run the function in background.


But the redirecting using function header() with location has a problem that 
header() always does return the page to user after the entire program, 
including registered showdown function finish running, which is against the 
will. I put a time consuming task into a function that registered to be a 
shutdown function and hoping it runs after the user has got the redirected 
page and the connection has been closed. But experiements (using browsers, 
curl command line tool as well as perl::LWP code) show that the user got the 
redirected page only after the shutdown function finished, which is against 
the description of register_shutdown_function at php website.


It seems only header() function use to redirect page has this problem (not 
executed until register_shutdown_function finished) while other functions 
like print()/echo(), exec() have not.


The code looks like:
-

-

http client who sends the request to the php program will only get the page 
back as response after function f finsihes (file aaa created). Changing the 
$count will make a lot difference.


My BIGGEST question is:
How to make user get the redirect page immediately after the header() is 
called, and not until function f() ends, while making sure that the function 
f() will finally fully (and might slowly) execute?


Thank you very much for kindly replying.

With high respect,

Liang




Liang ZHONG wrote:
> My Question is:
> What is the correct way to keep the function running after I redirect an
> existing page to http client (which I want the client get immediately)
> and then immediately close the connection?

ignore_user_abort(true);

-Rasmus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php