[PHP] Persistent connections

2013-10-26 Thread Nibin V M
Hello,

I have been reading docs and many are telling that persistent connections
are kept open indefinitely. But I found in PHP docs that it will not close
after script execution like requesting  a page; so should it close after
the request is over?

So when exactly a persistent connection should close?

Please advice.

-- 
Regards

Nibin.


[PHP] Script execution after window close

2012-03-04 Thread Nibin V M
Hello,

I need to run a few commands when a user close the browser tab. That is, I
have a php page ( index.php ) and it will create a temporary file to track
some stuffs. That temporary file should be removed, when the user close the
browser tab. Is there any way to achieve this?

Thank you,

-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] Script execution after window close

2012-03-04 Thread Nibin V M
in factI really need to remove the file ( which will be created for
every access - making a copy from another location ). I can't leave that
file alone for ever in the user disk space! :(

On Sun, Mar 4, 2012 at 9:01 PM, Ashley Sheridan 
a...@ashleysheridan.co.ukwrote:

 **
 On Sun, 2012-03-04 at 20:49 +0530, Nibin V M wrote:

 Hello,

 I need to run a few commands when a user close the browser tab. That is, I
 have a php page ( index.php ) and it will create a temporary file to track
 some stuffs. That temporary file should be removed, when the user close the
 browser tab. Is there any way to achieve this?

 Thank you,



 Not reliably. There are events in Javascript that you can use to trigger
 an Ajax call (such as onbeforeunload and onunload) but these work slightly
 differently from browser to browser and may not allow you to execute
 anything on the browser if the user is navigating away from the site or
 closing the tab/window.

 Why can't you use the session for this, and allow the session to expire
 after a certain period of inactivity, which would be better than
 reinventing what sounds like session behaviour.

   --
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk





-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] Script execution after window close

2012-03-04 Thread Nibin V M
ok..I have script which will run based on  some values  in user's
homedir. In fact I have tried to run the script from a various locations;
but it didn't work as expected like it run from each users homedir. So,
when the user access the page, it will copy the actual script to the user's
homedir and executes it. I don't want to leave it there for ever; so I have
to remove it from there when the user close the browser ( or after a period
of in activity ). But I don't know how to code it :(

On Sun, Mar 4, 2012 at 9:08 PM, Govinda govinda.webdnat...@gmail.comwrote:


  in factI really need to remove the file ( which will be created for
  every access - making a copy from another location ). I can't leave that
  file alone for ever in the user disk space! :(

 Fine, so delete it after a period of inactivity

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




-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] Script execution after window close

2012-03-04 Thread Nibin V M
ok..thanks guys...I will check further then. thanks for your inputs :)

On Sun, Mar 4, 2012 at 9:59 PM, Govinda govinda.webdnat...@gmail.comwrote:

  in factI really need to remove the file ( which will be created for
  every access - making a copy from another location ). I can't leave
 that
  file alone for ever in the user disk space! :(
 
  Fine, so delete it after a period of inactivity
 
  ok..I have script which will run based on  some values  in user's
 homedir. In fact I have tried to run the script from a various locations;
 but it didn't work as expected like it run from each users homedir. So,
 when the user access the page, it will copy the actual script to the user's
 homedir and executes it. I don't want to leave it there for ever; so I have
 to remove it from there when the user close the browser ( or after a period
 of in activity ). But I don't know how to code it :(

 My suggestion is to sort out the real issue, rather than try to fix it
 with the workaround of copying that file to each user's homedir.  It
 sounds like you are just adding unnecessary complexity to your work.

 Maybe make a new post/thread where you describe THAT issue very
 carefully.. and what you have tried that is not working the way you thought
 it should.  So far it is not clear enough to me anyway - to help.  But that
 could be because of my shortcomings more than your post's shortcoming; I am
 not expert on many topics covered on this list, especially in the area of
 managing your webserver.

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




-- 
Regards

Nibin.

http://TechsWare.in


[PHP] curl equivalent in PHP

2012-03-02 Thread Nibin V M
Hello,

I am trying to display the website content through a php code ( my own
websites; doesn't cause copy right issues ).

I use curl to display the page via the following simple code.

?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, http://mytest.com;);
curl_exec ($curl);
curl_close ($curl);
?

But on some of my servers, curl isn't enabled! Is there any equivalent code
to  achieve the same?

Thank you,

-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] curl equivalent in PHP

2012-03-02 Thread Nibin V M
Thanks Marc. But that need to add the DOM parser to the server. What I am
looking for something like iframe in html and that doesn't require any
additional PHP modules ( I do would like to avoid additions to the current
php; that is why I didn't compiled in curl )

On Fri, Mar 2, 2012 at 7:58 PM, Marc Guay marc.g...@gmail.com wrote:

 http://simplehtmldom.sourceforge.net/

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




-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] curl equivalent in PHP

2012-03-02 Thread Nibin V M
Thanks Marc. But that need to add the DOM parser to the server. What I am
looking for something like iframe in html and that doesn't require any
additional PHP modules ( I do would like to avoid additions to the current
php; that is why I didn't compiled in curl )

On Fri, Mar 2, 2012 at 8:10 PM, Nibin V M nibi...@gmail.com wrote:

 Thanks Marc. But that need to add the DOM parser to the server. What I am
 looking for something like iframe in html and that doesn't require any
 additional PHP modules ( I do would like to avoid additions to the current
 php; that is why I didn't compiled in curl )


 On Fri, Mar 2, 2012 at 7:58 PM, Marc Guay marc.g...@gmail.com wrote:

 http://simplehtmldom.sourceforge.net/

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




 --
 Regards

 Nibin.

 http://TechsWare.in




-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] curl equivalent in PHP

2012-03-02 Thread Nibin V M
Thanks guys :)

Now another problem...I use a test domain ( say blahblah.com ) for testing
this, which isn't registered yet. So with the given code the index page is
loading fine. But when I try to click on any links, it will redirect to the
original domain which isn't exists!

( I have actually pointed the test domain to my server via hosts file on
the server )

So I wanted to browse the website via a PHP script, same as if I use a
browser on the server.

Hope you get me! :)

Is there any way to achieve this via PHP?

What I wanted to

On Fri, Mar 2, 2012 at 9:37 PM, Jim Lucas li...@cmsws.com wrote:

 On 03/02/2012 06:26 AM, Nibin V M wrote:

 Hello,

 I am trying to display the website content through a php code ( my own
 websites; doesn't cause copy right issues ).

 I use curl to display the page via the following simple code.

 ?php
 $curl = curl_init();
 curl_setopt ($curl, CURLOPT_URL, http://mytest.com;);
 curl_exec ($curl);
 curl_close ($curl);
 ?

 But on some of my servers, curl isn't enabled! Is there any equivalent
 code
 to  achieve the same?

 Thank you,


 As long as you do not need to perform posts to the other website via the
 PHP request, you could include, file_get_contents, fopen + fread, etc...

 All you need to make sure is that allow_url_fopen is enabled.

 --
 Jim Lucas

 http://www.cmsws.com/
 http://www.cmsws.com/examples/
 http://www.bendsource.com/




-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] curl equivalent in PHP

2012-03-02 Thread Nibin V M
Hmm..I am a php newbie ( just started learning it )...

what my need is to display website from my server always for a
non-registered domain.This is the code I use now to display the website

?php
$opts = array(
  'http'=array(
'method'=GET,
'header'=Accept-language: en\r\n .
  Cookie: foo=bar\r\n
  )
);

$context = stream_context_create($opts);

$fp = fopen('http://www.blahblah.com', 'r', false, $context);
fpassthru($fp);
fclose($fp);
?

Of course blahblah.com isn't registered yet. This will load the index page
of blahblah.com fine ( since I use hosts file to resolve blahblah.com on
the server ). But if we click on any link, it will give server not found
error since my local machine is trying to resolve blahblah.com this time.
I need to avoid it and want to load my domain always from the server when
I click any link on the webpage, etc .

How can I modify the above code to make it work! If possible, I request
somebody to tell me the exact code that I need to change in the above
script - since most of the php part is still greek to me :)

Thank you,



On Fri, Mar 2, 2012 at 10:09 PM, Micky Hulse rgmi...@gmail.com wrote:

 Hello,

 On Fri, Mar 2, 2012 at 8:07 AM, Jim Lucas li...@cmsws.com wrote:
  But on some of my servers, curl isn't enabled! Is there any equivalent
  code
  to  achieve the same?

 I've used a combination of output buffering [1], readfile() [2] and
 caching (specific to the framework I was using).

 Simply, you could resort to:

 ?php readfile('http://www.google.com'); ?

 Ofc, the links would need to be absolute in order for the assets to load.

 Good luck!

 Cheers,
 Micky

[1] php.net/ob-start
[2] php.net/readfile

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




-- 
Regards

Nibin.

http://TechsWare.in


[PHP] Website preview script

2012-02-29 Thread Nibin V M
Hello,

I am very new to PHP coding. I am trying to achieve a task via PHP,
regarding which I have been googling around for a few days and now come up
with emtpy hands!

Ok, what I need to write is a website preview script. That is I need to
display a website hosted on serverA and pointing elsewhere, from ServerA (
via curl possibly ).

For example: I have configured techsware.in and google.com on ServerA ( of
course google.com pointing to their IP ). I need to display the contents of
google.com on my server , if I call http://techsware.in/google.php which
has some curl coding in it! Note, what I have is the domain name (
google.com ) and the IP on which it is hosted on serverA to achieve this.
Any way to achieve this?

I can achieve this if I put my IP google.com in /etc/hosts file ( its
Linux ). But I need to run this script for normal users as well, which
won't have super user privileges and thus unable to edit /etc/hosts file.
So I want to specify somewhere in the PHP script that, google.com points to
my IP. I can do this with this little script.

# cat curl.php
?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, http://mytest.com;);
curl_exec ($curl);
curl_close ($curl);
?


Hope someone from this forum will come back a solution [image: :)]

PS: web server is apache and php version is 5.2

Thank you,

-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] Website preview script

2012-02-29 Thread Nibin V M
No..what I am trying to write a website preview plugin attached to a
control panel.. :)

since I am a newbie, I don't know how to achieve this without modifying
hosts file ( I am basically a linux sys admin ) :)

@Martin -  I will check it. Since I am a beginner ( of course, just started
to learn PHP today ) I need to start from scratch. If yo could provide some
sample code, it will be great :)

thanks for your input guys..

On Thu, Mar 1, 2012 at 12:11 AM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 **
 On Wed, 2012-02-29 at 19:29 +0100, Matijn Woudt wrote:

 On Wed, Feb 29, 2012 at 7:07 PM, Nibin V M nibi...@gmail.com wrote:
  Hello,
 
  I am very new to PHP coding. I am trying to achieve a task via PHP,
  regarding which I have been googling around for a few days and now come up
  with emtpy hands!
 
  Ok, what I need to write is a website preview script. That is I need to
  display a website hosted on serverA and pointing elsewhere, from ServerA (
  via curl possibly ).
 
  For example: I have configured techsware.in and google.com on ServerA ( of
  course google.com pointing to their IP ). I need to display the contents of
  google.com on my server , if I call http://techsware.in/google.php which
  has some curl coding in it! Note, what I have is the domain name (
  google.com ) and the IP on which it is hosted on serverA to achieve this.
  Any way to achieve this?
 
  I can achieve this if I put my IP google.com in /etc/hosts file ( its
  Linux ). But I need to run this script for normal users as well, which
  won't have super user privileges and thus unable to edit /etc/hosts file.
  So I want to specify somewhere in the PHP script that, google.com points to
  my IP. I can do this with this little script.
 

 How about just doing a str_replace[1]?

 - Matijn

 [1]http://www.php.net/str_replace


 Why can't you use an iframe, or are you trying to offer this other
 websites content as if it were on your own site? If so, I would first check
 to see if you're actually allowed to do that, as that will bring up quite a
 few copyright issues otherwise, which can be very expensive.

   --
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk





-- 
Regards

Nibin.

http://TechsWare.in


Re: [PHP] Website preview script

2012-02-29 Thread Nibin V M
HI all,

But what my requirement here is, I need to display the website configured
on our server. No matter where the domain actually points to :)

Perhaps it can call a proxyhere is the actual intention of creating
this script.

Suppose X created a new website on serverA, but the domain actually
pointing to ServerB. So to test his new website on ServerA, he either has
to edit hosts file or use serverA/~user. I don't want him not to use
either method. I would like to provide him a PHP feature on my control
panel says site preview through which he can view his website on serverA.
Its just like a website preview option in plesk control panel :)



On Thu, Mar 1, 2012 at 1:25 AM, Simon Schick simonsimc...@googlemail.comwrote:

 Hi, Ashley

 The question is what this function does ;)
 I think it really takes a screenshot of the server - whatever is shown
 there right now. But how to get a browser running there in full-screen?

 I came around that post for a couple of weeks ago and thought it could be
 useful for someone here:
 http://www.phpgangsta.de/screenshots-von-webseiten-erstellen-mit-php

 Bye
 Simon


 2012/2/29 Ashley Sheridan a...@ashleysheridan.co.uk

 **
 On Wed, 2012-02-29 at 19:54 +0100, Simon Schick wrote:


 Hi, Nibin

 I wonder what you'd call a website preview ...
 Do you mean a screenshot or the HTML-response from the server, specially
 prepared (sounds like you want to create a proxy ;))?

 Bye
 Simon

 2012/2/29 Nibin V M nibi...@gmail.com

  No..what I am trying to write a website preview plugin attached to a
  control panel.. :)
 
  since I am a newbie, I don't know how to achieve this without modifying
  hosts file ( I am basically a linux sys admin ) :)
 
  @Martin -  I will check it. Since I am a beginner ( of course, just started
  to learn PHP today ) I need to start from scratch. If yo could provide some
  sample code, it will be great :)
 
  thanks for your input guys..
 
  On Thu, Mar 1, 2012 at 12:11 AM, Ashley Sheridan
  a...@ashleysheridan.co.ukwrote:
 
   **
   On Wed, 2012-02-29 at 19:29 +0100, Matijn Woudt wrote:
  
   On Wed, Feb 29, 2012 at 7:07 PM, Nibin V M nibi...@gmail.com wrote:
Hello,
   
I am very new to PHP coding. I am trying to achieve a task via PHP,
regarding which I have been googling around for a few days and now
  come up
with emtpy hands!
   
Ok, what I need to write is a website preview script. That is I need
  to
display a website hosted on serverA and pointing elsewhere, from
  ServerA (
via curl possibly ).
   
For example: I have configured techsware.in and google.com on ServerA
  ( of
course google.com pointing to their IP ). I need to display the
  contents of
google.com on my server , if I call 
http://techsware.in/google.phpwhich
has some curl coding in it! Note, what I have is the domain name (
google.com ) and the IP on which it is hosted on serverA to achieve
  this.
Any way to achieve this?
   
I can achieve this if I put my IP google.com
  in /etc/hosts file (
  its
Linux ). But I need to run this script for normal users as well, which
won't have super user privileges and thus unable to edit /etc/hosts
  file.
So I want to specify somewhere in the PHP script that, 
google.compoints to
my IP. I can do this with this little script.
   
  
   How about just doing a str_replace[1]?
  
   - Matijn
  
   [1]http://www.php.net/str_replace

  
  
   Why can't you use an iframe, or are you trying to offer this other
   websites content as if it were on your own site? If so, I would first
  check
   to see if you're actually allowed to do that, as that will bring up
  quite a
   few copyright issues otherwise, which can be very expensive.
  
 --
   Thanks,
   Ash
   http://www.ashleysheridan.co.uk
  
  
  
 
 
  --
  Regards
 
  Nibin.
 
  http://TechsWare.in
 


 It does sound more like a proxy than a preview script.

 What about using something like this:
 http://uk3.php.net/manual/en/function.imagegrabscreen.php

 I've never used it, but on first appearances it looks like it should
 produce the preview you require.


   --
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk






-- 
Regards

Nibin.

http://TechsWare.in


[PHP] different php.ini for virtual host on apache2 with mod_php5

2010-03-17 Thread Stanislaw V. Smetanin
Hi there.

the problem:
I want to disable mail() function in the one of virtual hosts' that
use PHP(I use mod_php for apache2), and regarding to the
http://www.php.net/manual/en/ini.core.php#ini.disable-functions I
can't use directives like php_value, etc, because value of
disable_functions can be set only in php.ini, but I don't want to
disable mail() on the all of my virtual hosts, just on one.

the question:
Can I use different php.ini for virtual hosts, in my case I want to
use php.ini for one host, where disable_functions = mail will be.

Here backgrounds:
stanis...@smetanin:~$ uname -rv
2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010

stanis...@smetanin:~$ dpkg -l libapache2-mod-php5 | tail -n1
ii  libapache2-mod-php5  5.2.10.dfsg.1-2ubuntu6.4
 server-side, HTML-embedded scripting language (Apache 2
module)

stanis...@smetanin:~$ apache2 -v
Server version: Apache/2.2.12 (Ubuntu)

Thanks to the community for any help.


-- 
Stanislaw Smetanin. http://stanislaw.su/

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



[PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread V S Rawat

If you provide paid help in code development/ testing/ troubleshooting
related to php or other software areas, please feel free to drop a line
to me at my id mentioned below. Please don't write here as some other
members might find this off topic.

Sorry for bothering the rest of you. I hope you wouldn't really mind if
some of our colleagues who are doing such a lovely volunteer work here
get to earn some money for a bottle of beer and more. Rest assured that
it is no fraud/ scam/ cheating. I am very much here to take the brickbats.

Thanks.
--
V
vsrawat at gmail dot com

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



Re: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread V S Rawat

On 8/19/2008 4:53 PM India Time, _metastable_ wrote:


Imo, it is both off-topic and inappropriate.


That could be individual opinion. :-)

Moreover, I have not seen your name in any of the topics on this list or 
remembered it in any reply, 


Your memory might be playing tricks on you:
http://groups.google.co.in/group/php.general/browse_thread/thread/de49b2b04c4eaa89/f59226fdf1b539ba?hl=enlnk=gstq=vsrawat#f59226fdf1b539ba
Newbie problem: Php script not running in browser.

I have posted about that in c.l.php also.

I had also posted a thread about aioe bouncing posts to php groups on 
account of HTML Tags.


as opposed to many others who take time from 
their busy schedules to give something back, free of charge. This does 
not inspire much confidence in your qualities or determination.


you seem to be bent on not inspiring that.



There are many channels out there that would be beneficial to your 
goals, e.g. wendo, ogone and the likes.

Please take your commercial goals there.


You seem to be having something against commercial dealings. Seems you 
dad-in-law has enough money.




Just my two cents.

Stijn


Thanks.
--
V

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



[PHP] Re: Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread V S Rawat

On 8/19/2008 5:06 PM India Time, _Colin Guthrie_ wrote:


metastable wrote:

V S Rawat wrote:

If you provide paid help in code development/ testing/ troubleshooting
related to php or other software areas, please feel free to drop a line
to me at my id mentioned below. Please don't write here as some other
members might find this off topic.

Sorry for bothering the rest of you. I hope you wouldn't really mind if
some of our colleagues who are doing such a lovely volunteer work here
get to earn some money for a bottle of beer and more. Rest assured that
it is no fraud/ scam/ cheating. I am very much here to take the 
brickbats.


Thanks.
--
V
vsrawat at gmail dot com


Imo, it is both off-topic and inappropriate.
Moreover, I have not seen your name in any of the topics on this list or 
remembered it in any reply, as opposed to many others who take time from 
their busy schedules to give something back, free of charge. This does 
not inspire much confidence in your qualities or determination.


There are many channels out there that would be beneficial to your 
goals, e.g. wendo, ogone and the likes.

Please take your commercial goals there.


Have I read the mail wrong, or is he asking if anyone out here 
*provides* paid for help? 


Right. if someone here could provide paid help on php issue or could 
develop some software, I wanted to contact him/ them.


i feel there was nothing wrong in sending one such post here.

e.g. he is saying, I need someone to provide 
me with support and I'm willing to pay for it.


To me this is not a commercial but a call for help.

Or have I read this wrong?

Col


Thanks.
--
V

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



Re: [PHP] Re: Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread V S Rawat

On 8/19/2008 5:22 PM India Time, _Stut_ wrote:


On 19 Aug 2008, at 12:36, Colin Guthrie wrote:

metastable wrote:

V S Rawat wrote:
If you provide paid help in code development/ testing/  
troubleshooting
related to php or other software areas, please feel free to drop a  
line
to me at my id mentioned below. Please don't write here as some  
other

members might find this off topic.

Sorry for bothering the rest of you. I hope you wouldn't really  
mind if
some of our colleagues who are doing such a lovely volunteer work  
here
get to earn some money for a bottle of beer and more. Rest assured  
that
it is no fraud/ scam/ cheating. I am very much here to take the  
brickbats.


Thanks.
--
V
vsrawat at gmail dot com


Imo, it is both off-topic and inappropriate.
Moreover, I have not seen your name in any of the topics on this  
list or remembered it in any reply, as opposed to many others who  
take time from their busy schedules to give something back, free of  
charge. This does not inspire much confidence in your qualities or  
determination.
There are many channels out there that would be beneficial to your  
goals, e.g. wendo, ogone and the likes.

Please take your commercial goals there.
Have I read the mail wrong, or is he asking if anyone out here  
*provides* paid for help? e.g. he is saying, I need someone to  
provide me with support and I'm willing to pay for it.


To me this is not a commercial but a call for help.

Or have I read this wrong?


Seems to me like a job ad which we generally tolerate, but a couple of  
thing concern me about this one...


1) Rest assured that it is no fraud/ scam/ cheating.

This is something only fraudsters, scammers and cheater would feel the  
need to say up front.


Some generalization.



2) There is absolutely no mention of what company he represents or  
what type of work they do.


I don't represent anyone.

Why should I?

Are only representatives of companies allowed to post messages in this 
ng seeking paid help?


Anyone legitimately looking for talent (ie. who is not gonna screw  
people over) is more likely to provide more details about who they  
are. 


Will be provided to those who contact, in email conversations.

Seems you are interested in knowing what it is.

Something like we are an outsourcing company looking for top  
quality talent for occasional sub-contracting would be better, and  
including a link to their website would be even better. 


That was not provided because I am not an outsourcing company. No 
website link. Simple.


Add the gmail  
address and I'd avoid this like the plague.


Now where's my 0.98 change from that dollar?

-Stut



All should concede that our fellow php veterans in this ng would be 
intelligent enough not to fall for tricks.


--
V

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



Re: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread V S Rawat
, I can't say, wait, I am learning.


I thought I could find some persons to help me against humble payments. 
I could get some tips from them on cryptic parts of of JavaScript, Perl, 
PHP,  etc. that I can't yet manage. Then, I would be able to do projects 
needing interfacing with these also. The missing part of the puzzle.


I just needed one person - or 2 or 3 just because of timeline 
differences, who could give me tips/ algorithms/ commands to develop my 
code, and if I still can't get it working - to check my code and tell 
the problem line point blank or may be correct it. Payment would be 
small and made then and there - irrespective of whether or I I get paid 
by my client in due course or not. In all probability, due to repeated 
interactions with same persons, a periodic cycle will get formed when I 
pay a variable or fixed retainership fee weekly, etc.


And how much can I cheat you if I promise to pay for help and don't pay 
you afterwards? $5? $10? $20? You wouldn't go broke on not getting such 
amounts and i would loose my credibility and none of you would help me 
on my next question and I stop getting further project.


There are bigger projects also that I come to know of but I don't touch 
them as I know I wouldn't be able to clinch them even with help here. If 
the persons who would have helped me felt that they can do such 
development, I could forward such projects to them as such projects are 
of no use for me. Thus, my humble payments would get partly supplemented 
by the earnings they would do through such developments.

--


If the suggestion of help against payment is really so offending to you 
guys, my sincere apologies.




Stijn


--
V

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



Re: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread V S Rawat

On 8/19/2008 5:49 PM India Time, _metastable_ wrote:



I stand by my point though. Had it actually been an advert, which it was 
not, a post count of 9 would not inspire confidence in his qualities as 
a determined support engineer.


I think incorrigible is the word for you.

V S rawat java
http://groups.google.co.in/groups/search?ie=UTF-8oe=utf-8q=V+S+rawat+javaqt_s=Search
284 hits,

V S rawat javascript
http://groups.google.co.in/groups/search?ie=UTF-8oe=utf-8q=V+S+rawat+javascriptqt_s=Search
212 hits,

V S rawat perl
http://groups.google.co.in/groups/search?ie=UTF-8oe=utf-8q=V+S+rawat+perlqt_s=Search
122 hits

V S rawat crack
http://groups.google.co.in/groups/search?ie=UTF-8oe=utf-8q=V+S+rawat+crackqt_s=Search
56 hits
(that crack was for serial/keygen/ cracks type of crack. Not what you 
just thought.)


V S rawat
http://groups.google.co.in/groups/search?ie=UTF-8oe=utf-8q=V+S+rawatqt_s=Search
13,000 hits.



regards,

Stijn



I foresee you now declaring me the biggest spammer on ngs.

I am on ngs since when Groups.Google was not born and Deja (what was the 
name?) was ruling the roost which was then bought by Google to get 
content for groups.google.


--
V

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



Re: [PHP] Semi-ADVERT, not really spam, sorry for it

2008-08-19 Thread V S Rawat
 it in a sustainable way if it's going to be a  
success. If you can make a success of freelancing you can do very well  
out of it so I wish you the best of luck.


-Stut


Thanks.
--
V

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



Re: [PHP] Why PHP4?

2008-08-08 Thread V S Rawat

On 8/8/2008 3:59 AM India Time, _Micah Gersten_ wrote:


You can't steal it, but you can't do anything with it either, so what's
the point of having it?


They are getting it printed and processing the printed hard copy 
further. That's all.


They even have full fledged working programs (say, in good old foxpro) 
to keep track of a clients work progress, next action date, reminders, 
track of payment from the clients, to the agents who get the work done, 
so on.


I mean it is a complete working system as it was in 80s.

--
V



Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



V S Rawat wrote:

I was surprised to see some very busy and well to do Chartered
Accountants, Company Secretaries still using those 8086 pcs with
Wordstar and lotus that were there on mid 80s.

They say these are no more available so data in these pcs and these
formats are much more safer than that on a latest machine/ software.



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



Re: [PHP] Why PHP4?

2008-08-07 Thread V S Rawat

On 8/7/2008 7:42 PM India Time, _Judson Vaughn_ wrote:


Kudos to Richard.

If its fixed, don't break it.

Jud.



==



Per Jessen wrote:

Richard Heyes wrote:

  

I'm interested - why are people still using PHP4? It's been over 4
years (I think) - plenty of time to upgrade to five.


Migration issues for instance - we have quite a bit of code that uses
sablotron - in PHP5 that's been changed to libxslt, which requires
extensive code-changes. 


Also, something about setlocale() got regressed (and never fixed) in
4.3.10 or thereabouts, which means we have at least one app that's
running on 4.3.8. 


Finally - why migrate? What's the rush?  Lots of people are still
running back-level software - e.g. apache, mysql, php, gcc, linux, you
name it.  *In our shop, migrating working PHP code has one of the lowest
priorities*.


/Per Jessen, Zürich



I was surprised to see some very busy and well to do Chartered 
Accountants, Company Secretaries still using those 8086 pcs with 
Wordstar and lotus that were there on mid 80s.


They say these are no more available so data in these pcs and these 
formats are much more safer than that on a latest machine/ software.

--
V

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



Re: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread V S Rawat

On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:


On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat [EMAIL PROTECTED] wrote:

I have put the first php script to hello.php file:

html
 head
  titlePHP Test/title
 /head
 body
 ?php echo 'pHello World/p'; ?
 /body
/html

I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b

http://localhost/ is E:\wamp\www

I put the hello.php file to E:\wamp\www. drag/dropping it to browser
shows the above source code in ff3/ie6

putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
to browser shows the same source code.

However, putting it to E:\wamp\www\php_ex but giving
http://localhost/hello.php shows a blank screen

I have forgotten some situation where it had appeared as

Hello World

'; ?

on the browser.

E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
LoadModule php5_module e:/wamp/bin/php/php5.2.6/php5apache2_2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

On double clicking the php file in windows explorer, it opens in notepad
for edit, instead of getting opened in firefox that is my default.

Please give me the starting push.
-- V




If you simply drag-and-drop the file from an explorer window into
Firefox, Firefox will display the page directly from the file system
instead of serving it through your web server. (You can tell this
because your address bar will say file:///E:/wamp/www/hello.php.) Your
browser won't parse the PHP as script; it will just think it is
malformed HTML and it would show the output you listed above.
Double-clicking the file, or dragging it into IE will try to open the
file with whatever program is associated with that extension in
Windows. (If there isn't a file association for *.php files, it will
either prompt you for a program to handle the file or it might do the
same as Firefox. I'm not sure, and I'm not really interested in
changing my file associations to test.)

IF the file is located at E:\wamp\www\hello.php AND PHP is configured
correctly AND your web server's document root is E:\wamp\www\, THEN
opening http://localhost/hello.php should work.

Andrew


Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a 
blank screen. What has gone wrong?


--
V

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



Re: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread V S Rawat

On 8/6/2008 4:20 PM India Time, _Chetan Rane_ wrote:


Hi

You need to check if your Apache is up and running do the following

Right click on My Computer and select manage
Next click on Services and Applications
After that Click on Services

And check if Apache is running



Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local
system, and

wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the
following entries in apache_error.log

[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal --
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled.
Child process is ending.
[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have
exited.
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6
configured -- resuming normal operations
[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said your port 80 is
not used and the following entry got added in error_log:

[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to
listen on port 80.

Thanks.
--
V




Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 2:53 PM

To: php-general@lists.php.net
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:


On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat [EMAIL PROTECTED] wrote:

I have put the first php script to hello.php file:

html
 head
  titlePHP Test/title
 /head
 body
 ?php echo 'pHello World/p'; ?
 /body
/html

I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b

http://localhost/ is E:\wamp\www

I put the hello.php file to E:\wamp\www. drag/dropping it to browser
shows the above source code in ff3/ie6

putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
to browser shows the same source code.

However, putting it to E:\wamp\www\php_ex but giving
http://localhost/hello.php shows a blank screen

I have forgotten some situation where it had appeared as

Hello World

'; ?

on the browser.

E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
LoadModule php5_module e:/wamp/bin/php/php5.2.6/php5apache2_2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

On double clicking the php file in windows explorer, it opens in notepad
for edit, instead of getting opened in firefox that is my default.

Please give me the starting push.
-- V



If you simply drag-and-drop the file from an explorer window into
Firefox, Firefox will display the page directly from the file system
instead of serving it through your web server. (You can tell this
because your address bar will say file:///E:/wamp/www/hello.php.) Your
browser won't parse the PHP as script; it will just think it is
malformed HTML and it would show the output you listed above.
Double-clicking the file, or dragging it into IE will try to open the
file with whatever program is associated with that extension in
Windows. (If there isn't a file association for *.php files, it will
either prompt you for a program to handle the file or it might do the
same as Firefox. I'm not sure, and I'm not really interested in
changing my file associations to test.)

IF the file is located at E:\wamp\www\hello.php AND PHP is configured
correctly AND your web server's document root is E:\wamp\www\, THEN
opening http://localhost/hello.php should work.

Andrew


Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a 
blank screen. What has gone wrong?





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



Re: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread V S Rawat

On 8/6/2008 7:28 PM India Time, _Chetan Rane_ wrote:


Can you please check what the Document Root in http.conf


windows explorer search didn't threw any file matching http.conf.

The file E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf has

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot e:/wamp/www/


thanks.
--
V




Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 7:22 PM

To: Chetan Rane
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 4:20 PM India Time, _Chetan Rane_ wrote:


Hi

You need to check if your Apache is up and running do the following

Right click on My Computer and select manage
Next click on Services and Applications
After that Click on Services

And check if Apache is running


Hi Chetan,

Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local 
system, and


wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the 
following entries in apache_error.log


[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal -- 
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled. 
Child process is ending.

[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have 
exited.

[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited 
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 
configured -- resuming normal operations

[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said your port 80 is 
not used and the following entry got added in error_log:


[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to 
listen on port 80.


Thanks.



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



[PHP] Newbie problem: Php script not running in browser.

2008-08-05 Thread V S Rawat

I have put the first php script to hello.php file:

html
  head
   titlePHP Test/title
  /head
  body
  ?php echo 'pHello World/p'; ?
  /body
/html

I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b

http://localhost/ is E:\wamp\www

I put the hello.php file to E:\wamp\www. drag/dropping it to browser
shows the above source code in ff3/ie6

putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
to browser shows the same source code.

However, putting it to E:\wamp\www\php_ex but giving
http://localhost/hello.php shows a blank screen

I have forgotten some situation where it had appeared as

Hello World

'; ?

on the browser.

E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
LoadModule php5_module e:/wamp/bin/php/php5.2.6/php5apache2_2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

On double clicking the php file in windows explorer, it opens in notepad
for edit, instead of getting opened in firefox that is my default.

Please give me the starting push.
-- V

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



Re: [PHP] PHP code will not work

2008-07-09 Thread Mike V

I had this problem and just figured it out.  I was copying and pasting the
code snippet from the tutorials page to my test editor and in the process
picked up an invisible ctrl char.  Doh!!


Joseph Subida wrote:
 
 
 The error I get when I try
 
 ?php
 echo $_SERVER['HTTP_USER_AGENT'];
 ?
 
 is
 
 Parse error: syntax error, unexpected T_VARIABLE in 
 /Library/WebServer/Documents/test.php on line 106
 
 I tried Googling T_VARIABLE and haven't found any useful solutions. 
 Any ideas? Thanks!
 
 -J.C.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

-- 
View this message in context: 
http://www.nabble.com/PHP-code-will-not-work-tp17811807p18362005.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] CSS vs. Tables OT

2007-04-17 Thread Anna V

On 4/17/07, Robert Cummings [EMAIL PROTECTED] wrote:


On Tue, 2007-04-17 at 18:53 -0500, Larry Garfield wrote:
 On Tuesday 17 April 2007 3:40 pm, Robert Cummings wrote:

   BTW, any web developer worth his or her salt with a reasonable
amount of
   practice can make CSS layouts that resize as well as table based
layouts
   everyday of the week. I will refer you to
http://www.csszengarden.com/
 
  Only with hacks.

 Using tables for layout *is* a hack.  A common one, but still a hack.

No, it's old school, the only way to do complex layout in the past. At
least tables are backward and forward compatible. CSS is only
semi-forward compatible.

Cheers,
Rob.



I've never never had used tables for layouts (I worked on pretty
complicated projects)... Heck, http://espn.com is CSS based, and it looks
pretty darn amazing.  Just my quick thought on this. :)
--
Anna Vester
Web Designer
http://www.veanndesign.com


Re: [PHP] CSS vs. Tables OT

2007-04-17 Thread Anna V

On 4/17/07, Robert Cummings [EMAIL PROTECTED] wrote:


On Tue, 2007-04-17 at 21:28 -0500, Anna V wrote:
 On 4/17/07, Robert Cummings [EMAIL PROTECTED] wrote:
 
  On Tue, 2007-04-17 at 18:53 -0500, Larry Garfield wrote:
   On Tuesday 17 April 2007 3:40 pm, Robert Cummings wrote:
  
 BTW, any web developer worth his or her salt with a reasonable
  amount of
 practice can make CSS layouts that resize as well as table based
  layouts
 everyday of the week. I will refer you to
  http://www.csszengarden.com/
   
Only with hacks.
  
   Using tables for layout *is* a hack.  A common one, but still a
hack.
 
  No, it's old school, the only way to do complex layout in the past. At
  least tables are backward and forward compatible. CSS is only
  semi-forward compatible.
 
  Cheers,
  Rob.
 
 
  I've never never had used tables for layouts (I worked on pretty
 complicated projects)... Heck, http://espn.com is CSS based, and it
looks
 pretty darn amazing.  Just my quick thought on this. :)

They certainly use CSS AND they use table for the main layout. Thank
you, thank you very much.

Cheers,
Rob.
--



Looks like, the only table they use is for the ad_container.

--
Anna Vester
Web Designer
http://www.veanndesign.com


Re: [PHP] CSS vs. Tables OT

2007-04-17 Thread Anna V

On 4/17/07, Paul Novitski [EMAIL PROTECTED] wrote:


At 4/17/2007 07:53 PM, Robert Cummings wrote:
On Tue, 2007-04-17 at 21:28 -0500, Anna V wrote:
   I've never never had used tables for layouts (I worked on pretty
  complicated projects)... Heck, http://espn.com is CSS based, and it
looks
  pretty darn amazing.  Just my quick thought on this. :)

They certainly use CSS AND they use table for the main layout.


Just to be accurate: if you look at the espn.com source you'll see
that the only table on the page contains an advertisement in the
masthead and doesn't contain the main layout.  Because it's the
exception and because it's an ad, my guess is that it's markup
imposed on the designers from the outside.  I didn't see a similar
structure on the few sub-pages I glanced at, so it doesn't appear to
be part of the overall layout strategy.

Regards,

Paul



Exactly, that's what I was trying to express... sometimes you can not
control what is coming to your website through advertisements' content.

--
Anna


Re: [PHP] Explicit Stream Flush with fsockopen()

2006-12-06 Thread Oliver John V. Tibi

Hi Richard,

Thanks for the help, and I almost forgot to thank you for it. Reason for
the timeout to occur in the posts that I have mentioned before was a
simple End Of Transmission character (EOT, ASCII 4) that terminates
every message sent to and from the server.

And by the way, thank you. :)

O.J.

Richard Lynch wrote:

http://php.net/fflush


On Sun, June 4, 2006 9:51 pm, Oliver John V. Tibi wrote:

Hi Guys,

I know this may sound fundamental to some of you, but do you know any
way of explicitly flushing out stream buffers off to the socket using
fsockopen()/fputs() combos? Hope to hear from you soon.

Note: I'm not using http, and I'm connecting to some other arbitrary
port other than http, so I don't know if ob_flush() and its family of
functions will work.

Thanks! :)

--
Oliver John V. Tibi
Software Programmer/Web Application Developer
IAMD Software Solutions
[EMAIL PROTECTED]
Live free() or die().

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








--
Oliver John V. Tibi
Software Programmer/Web Application Developer
IAMD Software Solutions
[EMAIL PROTECTED]
Live free() or die().

Support PayPal Now for Philippines! (http://paypalnow.com.ph/)

-BEGIN GEEK CODE BLOCK-
Version: 3.1
GIT d- s: a-- C+++$ UL$ P+ L++$ E W+++$ N++ o K w+$ O M V- PS !PE
Y+ PGP+ t+ 5 X+ R* tv-- b+ DI+++ D+ G++ e+ h r- y?
--END GEEK CODE BLOCK--

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



[PHP] Explicit Stream Flush with fsockopen()

2006-06-04 Thread Oliver John V. Tibi

Hi Guys,

I know this may sound fundamental to some of you, but do you know any 
way of explicitly flushing out stream buffers off to the socket using 
fsockopen()/fputs() combos? Hope to hear from you soon.


Note: I'm not using http, and I'm connecting to some other arbitrary 
port other than http, so I don't know if ob_flush() and its family of 
functions will work.


Thanks! :)

--
Oliver John V. Tibi
Software Programmer/Web Application Developer
IAMD Software Solutions
[EMAIL PROTECTED]
Live free() or die().

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



[PHP] Socket Functions in PHP

2006-05-07 Thread Oliver John V. Tibi

Hi all,

I suspect I'm having problems with socket functions within my PHP 
application running on Red Hat 2.4.21-4.EL #1/PHP 4.3.2/Apache 2.0.46.


Below is a sample code listing:



function sendRequest($strRequest) {
$parser = NULL;
$logman = new LogManager();

$resource = socket_create( AF_INET, SOCK_STREAM, SOL_TCP );
$logman-append(Connecting to OLS Server...);
$socket_conn = socket_connect( $resource, $serverIP, $serverPort );
if( $socket_conn ) {
		$logman-append(Connected to {$serverIP}:{$serverPort}. Sending XML 
request...);

socket_write( $resource, $strRequest );
$logman-append(XML request sent. Waiting for XML 
response...);
$document = ;
$data = socket_read( $resource, 1024 );

while ($data != ) {
$document .= $data;
$data = socket_read( $resource, 1024 );
}
$logman-append(XML response received.);

$parser = new OlsResponseParser;
// parse the received document using our parser
$parser-parse($document);
}

if ($parser != NULL) {
return $parser-getOlsResponse();
}

return $parser;
}


The following listing is from the logs I have created...


|+---+-++
| LogId | LogDate | LogMessage 
   |

+---+-++
|37 | 2006-05-03 15:39:28 | /new_userpage_process.php initialized. 
Creating buffer...  |
|38 | 2006-05-03 15:39:28 | Connecting to OLS Server... 
|
|39 | 2006-05-03 15:39:28 | Connected to (server):(port). Sending 
XML request... |
|40 | 2006-05-03 15:39:28 | XML request sent. Waiting for XML 
response...  |
|41 | 2006-05-03 15:40:34 | XML response received. 
   |
|42 | 2006-05-03 15:40:34 | Buffering complete. Redirecting to 
thanks.php?actiontype=2 |

+---+-++

 

As you can see, there is a lapse of more than one minutes between 
LogId's 40 and 41, which is very slow on a production environment. The 
script above acts as a client to another application server listening on 
a remote port, running on Java. What the remote application reports is 
that it receives the connection request, receives the request data, and 
transmits the response data at the same second, while my application 
receives the response one minute after the request was sent!


Other implementations in the enterprise using different architectures 
and technologies/languages do not experience the same issue as my app does.


Please help. Comments, suggestions and thoughts through the group or 
private mail are deeply appreciated.


Thanks!
--
Oliver John V. Tibi
Software Programmer/Web Application Developer
IAMD Software Solutions
[EMAIL PROTECTED]
Live free() or die().

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



Re: [PHP] array problem

2006-04-23 Thread Brian V Bonini
On Sat, 2006-04-22 at 15:31, Martin Alterisio wrote:
 You're wrong, he isn't using an associative array, since the keys used
 are only integers.

Well, if you really want to argue semantics then technically we're both
wrong because there are no different indexed and associative array types
in PHP, what was that you said?...  (read the manual!!!)

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



Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-23 Thread Brian V Bonini
On Sat, 2006-04-22 at 14:16, Jochem Maas wrote:
 with regard to Suresh - do you, Brian, know how many times he has posted 
 similar
 question to this list this year? (this is the first time he has even given
 an indication that he knows where the manual is let alone opened it btw) do 
 you
 know how many times he's been waiting for a reply/answer? how many times 
 people
 have given him answered? how often he has replied (like saying thank you for
 instance) to anyone of the repsonses to his questions in any form whatsovever?
 

Did you need some recommendations on a new email program? Most have a
delete button, not sure how the authors of yours missed that

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



Re: [PHP] array problem

2006-04-22 Thread Brian V Bonini
On Sat, 2006-04-22 at 07:09, suresh kumar wrote:
  sorry.earlier i mistyped some values. 

   I am facing one project in my project .

   this is my  code:

   a=array(0=10,1=10,2=40,3=30,4=30,5=10);
   b=array();
   b=array_unique($a);
   print_r($b); 
   o/p  getting from above code is  b[0]=10,b[2]=40,b[3]=30,b[5]=10;

   but i want the o/p be b[0]=10,b[1]=40,b[2]=30,b[3]=10;


That will return:

Array
(
[0] = 10
[2] = 40
[3] = 30
)

If you want:

Array
(
[0] = 10
[1] = 40
[2] = 30
)


Don't use an associative array for $a 
$a=array(10,10,40,30,30,10);

Or iterate through $a to re-sequence the index in $b.

$a=array(0=10,1=10,2=40,3=30,4=30,5=10);
$a=array_unique($a);

foreach($a as $v) {
$b[] = $v;
}

print_r($b);

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] array problem + humor (all those with joke allergies beware)

2006-04-22 Thread Brian V Bonini
Jochem's site:

 snip 
http://iamjochem.com/mariecke/index.php

Mariecke's daily ramblings (almost) in dutch  english... this page is
using output from a drupal system.
If nothing else they have a nice logo. ;)


Warning: main(./../blog/parse.php): failed to open stream: No such file
or directory in /home/sites/com/moulin/iamjochem/www/mariecke/blog.php
on line 24

Warning: main(): Failed opening './../blog/parse.php' for inclusion
(include_path='.:/usr/share/php4:/usr/share/php') in
/home/sites/com/moulin/iamjochem/www/mariecke/blog.php on line 24

Fatal error: Call to undefined function: parse_feed() in
/home/sites/com/moulin/iamjochem/www/mariecke/blog.php on line 25

 // snip 

Perhaps you should take some of your own *advice*... ???

[EMAIL PROTECTED]  /dev/null

On Sat, 2006-04-22 at 09:48, Jochem Maas wrote:
 suresh kumar wrote:
   sorry.earlier i mistyped some values. 
 
I am facing one project in my project .
 
this is my  code:
 
a=array(0=10,1=10,2=40,3=30,4=30,5=10);
b=array();
b=array_unique($a);
print_r($b); 
o/p  getting from above code is  b[0]=10,b[2]=40,b[3]=30,b[5]=10;
 
 the OUTPUT is not what you say it is - why don't you take 5 seconds
 to cut and paste the *actual* output of print_r() ???
 
 in fact if your going to send some code - THEN SEND SOME CODE and
 not some hastily typed psuedo code that doesn't run (notice the missing
 dollar signs in front variaous variables??)
 
 
but i want the o/p be b[0]=10,b[1]=40,b[2]=30,b[3]=10;
 
i searched php.net .i am not able to fine any solution.i am breaking 
  my head for last  5 hours.
 
 you may have searched but you didn't read very far - in five hours it's
 probably possible to read every about arrays on php.net; but anyway read the 
 following
 2 pages over and over until you fully understand them - understanding php's
 array datatype is practically the foundation to getting anywhere with php:
 
 http://php.net/manual/en/language.types.array.php
 http://php.net/manual/en/function.array-values.php
 
  i am waiting reply from any one
 
 tell every one here that your waiting does come accross very well -
 I'd stop saying it if I we're you.
 
 get the feeling I'm picking on you? well your absolutely right,
 you non-responding, dumb-question-asking, lack-of-problem-solving-initiative
 oddball. Anytime you come to this list I'm going to beat programming ethic
 into you until you 'get it' - either you'll end up looking like something
 that resembles a real coder OR I'll end up start a inter-continental racewar -
 lets see how it pans out.

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



[PHP] mktime() vs date()

2006-04-18 Thread Jasper V. Ferrer
hi, is mktime() actually faster than date() or any other date functions?

tnx.

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



Re: [PHP] binding adodb

2006-03-02 Thread Brian V Bonini
On Wed, 2006-03-01 at 19:25, Chris wrote:
 Raúl Castro Marín wrote:
  I got a little question, I just start to use binding adodb but I got a 
  problem: my primary query on Oracle is:
  
  $query = SELECT munici_mun, UPPER(nombre_mun) 
  FROM MUNI 
  WHERE departa_dpt = ? AND 
  munici_mun = 994;
  
  It is execute with any problem, but when I add another clause with keyword:
  
  AND UPPER(nombre_mun) LIKE '%?%'   then next sentence is execute but no 
  record is returned
  $query = SELECT munici_mun, UPPER(nombre_mun) 
  FROM MUNI 
  WHERE departa_dpt = ? 
  AND munici_mun = 994 
  AND UPPER(nombre_mun) LIKE '%?%' 
  
  I think that adodbd doesn't parse ? like a variable on clause LIKE '%?%'. 
  What can I do to write this sentence correctly?

Does it return anything if you run it directly against the DB?



-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] xml to array

2006-02-05 Thread Brian V Bonini
On Sun, 2006-02-05 at 06:32, Tod Thomas wrote:
 Just a quick shot it the dark...
 
 http://www.w3.org/TR/REC-xml/#NT-Name
 
 Go up about a half page to this:
 
 [Definition: A Name is a token beginning with a letter or one of a few 
 punctuation characters, and continuing with letters, digits, hyphens, 
 underscores, colons, or full stops, together known as name characters.] 
 Names beginning with the string xml, or with any string which would 
 match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization 
 in this or future versions of this specification
 
  From quick read maybe if you wrap the numbers in quotes that might work?

Right on... Making it work is pretty much a non-issue... I can always
prepend something to the string, e.g.,
idx_0foo/idx_0
idx_1bar/idx_1
etc.

Just was not aware if an int. was actually and invalid token... Could
not recall ever seeing it used, but, could also not ever recall reading
it was not OK Learn something new everyday... Thanks for finding
that in the spec...

-Brian


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] xml to array

2006-02-04 Thread Brian V Bonini
On Fri, 2006-02-03 at 16:23, Richard Lynch wrote:
 I've got my money on the XML spec REQUIRING an alphabetic start to
 tagnames, and subsequent characters can be alphanumeric...
 
 In other words, it doesn't work because 0 is not a valid XML tag.


Yeah, that was my instinct too... Just could not find anything to
confirm it after a quick browse through the spec. Though can you find
anything in the spec via a quick browse.. ;-)

However, after a closer look I still can't find (at least in plain
English) anything that says this is NOT OK. Though the parser does
return '[xml_error] = not well-formed (invalid token)'.

Good stuff

-Brian


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] xml to array

2006-02-03 Thread Brian V Bonini
AD_DATA
SESSION_INFO
FIRST_NAMEJoe/FIRST_NAME
LAST_NAMEShmoe/LAST_NAME
TEST_KEY
foofoo/foo
barbar/bar
/TEST_KEY
OPTIONS
0DNR/0
1OPT/1
2FOO/2
3BAR/3
4CWS/4
5AVS/5
/OPTIONS
HEIGHT72/HEIGHT
WEIGHT96Kg/WEIGHT
/SESSION_INFO
PAA
logCount0/logCount

etc...

$xml_data = $xml;
$parser = xml_parser_create(); 
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); 
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0); 
xml_parse_into_struct($parser, $xml_data, $values, $tags); 
xml_parser_free($parser);

each time I print out the tags or vals it stops at the options node:

[13] = Array
(
[tag] = OPTIONS
[type] = open
[level] = 3
[value] = 

)

[OPTIONS] = Array
(
[0] = 13
)

Something to do with the numerical node names..?? If I change them to
non-numeric vals all is good... What Am I missing??

-B


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] XML and htmlentities conditionally?

2006-01-29 Thread Brian V Bonini
On Sun, 2006-01-29 at 02:01, Adam Hubscher wrote:
 I have a block of XML that looks as follows:
 
 namelt;*_~_*gt; Røyken VGS lt;*_~_*gt;/name

 My question is, can I in any way efficiently (i -stress- efficiently, if 
 anyone read my previous XML and special characters post its a rather 
 large XMl file (breaking 18mb now) and speed is of the essence) cause 
 html_entity_decode to not decode those tags?

What's the end results your looking for?

If you are trying to pass that data straight through the parser try
wrapping it in CDATA.

name![CDATA[lt;*_~_*gt; Røyken VGS lt;*_~_*gt;]]/name

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] query problem.

2006-01-24 Thread Brian V Bonini
On Wed, 2006-01-25 at 08:01, Angelo Zanetti wrote:
 Hi guys.
 
 I got an entry in a field called emailfrom in my table (MySQL db).
 
 The data in that field is: Sams Bank [EMAIL PROTECTED]
 
 I then do the following to retrieve the info, using a DB class
 
 $recordset=$conn-Execute(SELECT * FROM wiml_history WHERE id = $task_id);
 $row=$recordset-GetArray();
 
 $emailfrom=$row[0]['emailfrom'];
 
 then I echo what I get out and I just get Sams Bank
 
 It doesnt bring back the whole entry in that field,
 however when I manually change the info in the field in the DB to:
 
 Sams Bank [EMAIL PROTECTED], it retrieves it correctly.
 
 Why does the   cause that not to be displayed? or is it retrieving it 
 correctly but not showing it because of the   (which might be 
 conflicting with HTML tags?
 
 thanks in advance


$emailfrom = htmlspecialchars($row[0]['emailfrom']);



-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] thought stdin was supposed to default open

2006-01-07 Thread matt V

hello,
I read that in the cli version of php, the 3 files, sterror, stdout and 
stdin are already open thus saving having to open them and close them each 
time.  Well, I decided to test that idea and it appears that stdin infact 
is not pre-opened, but my code may be wrong too, who knows.
I made a little test script (see below), but either it ends up outputting 
nothing, or i get the ... assumed 'STDIN' and supplied argument is not 
a valid resource but on the same line.

anyway, code is below

?php
while(STDIN != '\n');
{
$line = fgets(STDIN);
echo $line;
}
?

simple script, but it appears not to work.  is it my code, or is STDIN not 
opened by default in php4.4

this is on slackware linux version 10.2 running php -v 4.4
matt

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



[PHP] worked around STDIN problem from before

2006-01-07 Thread matt V
hmm, it seems php -a likes to complain heh, so I decided to do my little 
STDIN tests in an actual script and not interactively and turned off error 
reporting..things are all happy again in matt land lol


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



Re: [PHP] insert to DB

2005-12-18 Thread Brian V Bonini
On Sun, 2005-12-18 at 07:41, Anasta wrote:
 It just wont insert new data into DB--any ideas as i have gone over and 
 over.

Your not doing any inserts, two selects and one update... 

insert in t1 values('foo','bar','1 1 2 3 5 8 13');


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: Fw: [PHP] Load from db into select-list

2005-12-18 Thread Brian V Bonini
On Sun, 2005-12-18 at 15:22, Gustav Wiberg wrote:

  Ajax? What is that?


Asynchronous JavaScript and XML, or Ajax, is a web development technique
for creating interactive web applications using a combination of:

- XHTML (or HTML) and CSS for marking up and styling information
- The Document Object Model manipulated through JavaScript to
dynamically display and interact with the information presented
- The XMLHttpRequest object to exchange data asynchronously with the web
server. (XML is commonly used, although any format will work, including
preformatted HTML, plain text, JSON and even EBML). In some Ajax
frameworks and in some situations, an IFrame object is used instead of
the XMLHttpRequest object to exchange data with the web server.


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Intersecting Dates

2005-11-27 Thread Brian V Bonini
On Sat, 2005-11-26 at 16:18, Shaun wrote:
 Hi,
 
 Given a start day and month and end day and month (i.e. 01-01 to 31-03) how 
 can one check if another set intersects these dates?


Convert each to epoch and test for  floor  ceiling, just a thought.

$a = array(mktime(0, 0, 0, 1, 1, date('Y')), // floor
   mktime(0, 0, 0, 4, 1, date('Y')), // ceiling
   mktime(13, 45, 0, 3, 15, 2005)// random date
  );

echo ($a[3]  $a[1]  $a[3]  $a[2]) ? in range : out of range;

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



Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)

2005-11-20 Thread Brian V Bonini
On Sun, 2005-11-20 at 05:44, Łukasz Hejnak wrote:
 Hello again, here's some more extra info on my case that came out while 
 Suhas Pharkute was helping me find a resolution:
 So the safe-mode is off, that's for sure, I turned it off at compile stage.
 
 I delete the file after each run of the script, the folder  where the 
 script is located has 777 permissions and the ownership is given to uid 
 1027 gid 1020, whereas these are the uid/gid set for apache to run with 
 (and it does!).
 The script:
 
 $data=some data;
 $file=file.txt;
 $handle = fopen($file,w);
 fwrite($handle,$data);
 fflush($handle);
 fclose($handle);
 if (is_writable($file))
   echo Is writablebr;
 else
   echo Isn't writablebr;
 
 works when I run it as root, from the shell (php script.php),
 but when it's run from the server, it doesn't.


I missed the beginning of this thread...

You are saying:

From the CLI you can write to a file all day long, no prob.
From the web, if the file does not exist it is created, however, no
content is appended to it. Furthermore, IF there is content in the file
it can be appended to via web, but if it's an empty file it will not get
written too. Am I following correctly?

-Brian


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)

2005-11-20 Thread Brian V Bonini
On Sun, 2005-11-20 at 09:38, Łukasz Hejnak wrote:
 Brian V Bonini napisał(a):
  You are saying:
  From the CLI you can write to a file all day long, no prob.
 Yes, the shell command php test.php works fine when executed as root
 (any other user has the same problem as from the web)
  From the web, if the file does not exist it is created, however, no
  content is appended to it. Furthermore, IF there is content in the file
  it can be appended to via web, but if it's an empty file it will not get
  written too. Am I following correctly?
 
 Exactly, as strange as it sounds, it's just like it is.
 
 And another thing, the whole instalation was working perfectly for the 
 past month or two, and now (friday-saturday) suddenly the above symptom 
 have appeared.
 No config changes, no updates or anything else I could relate was 
 happening on the server, and there is no info in the log files on this 
 behaviour, the is_writable says it is writable. The safe mode is disabled.
 
 Hope this tells You something, and gives You an idea on how to solve this.

What does 'df -h' say on your system?


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] arrays question

2005-11-12 Thread Brian V Bonini
On Fri, 2005-11-11 at 15:25, cybermalandro cybermalandro wrote:
 I have this that looks like this
 
 array(3) {
   [0]=
   array(2) {
 [0]=
 string(1) 1
 [1]=
 string(1) 2
   }
   [1]=
   array(2) {
 [0]=
 string(3) 492
 [1]=
 string(3) 211
   }
   [2]=
   array(2) {
 [0]=
 string(2) 11
 [1]=
 string(2) 20
   }
 }
 
 I want to loop through so I can get and print 1,492,11 and
 2,211,20 What is the best way to do this? I suck with arrays and
 I can't get my looping right.

$a = array(array(1,2),
   array(492,211),
   array(11,20)
 );

for($i=0;$i2;$i++) {
foreach($a as $v) {
echo $v[$i] . \n;
}

echo ==\n;
}

Prints:

1
492
11
==
2
211
20
==


-Brian
-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] AJAX PHP

2005-07-23 Thread Brian V Bonini
On Thu, 2005-07-21 at 08:23, Marco Tabini wrote:
 We had a webcast on PHP and Ajax a while back--the recordings are still
 available for free at http://blogs.phparch.com/mt/index.php?p=49.

Nice, totally crashes Firefox in Linux.


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] PHP 5 Object Inheritance

2005-07-15 Thread Brian V Bonini
On Fri, 2005-07-15 at 17:53, Chris wrote:
 
 Yeah, I understand... Is multiple inheritance something that true OOP 
 languages can do?
 

Yes.



-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Dynamic Images and File Permissions

2005-07-14 Thread Brian V Bonini
On Thu, 2005-07-14 at 12:09, Adam Hubscher wrote:
 My questions are this:
 
 A) Is there any way to set the permissions on the file on creation of
 the image?

Set umask 002 on the user php is running as.

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] recompiling php

2005-07-06 Thread Brian V Bonini
On Wed, 6 Jul 2005, blackwater dev wrote:

 I have a linux box which I use periodically. I built php 5.0.3 on it
 and it runs fine.  I just came across a situation where I need to
 compile in the zlib extension so I got into my php folder and did
 ./configure with my options, then make and make install.  I then
 restarted Apache but when I look at phpinfo, it still shows the old
 command used to build php, not the command I just used to recompile.
 Are there other things needed in a recompile?


Which distro are you running. Adding libs with Linux *CAN* be a simple as
'$ urpmi php-zlib' depending on which flavor your running.

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



Re: [PHP] shell expansion (globbing) from inside php cli script

2005-07-01 Thread Brian V Bonini
On Thu, 2005-06-30 at 10:47, Bob Winter wrote:
 Brian,
 
 Is /www/files/services/ the correct relative path??  You could 
 try using the absolute path to see if it fixes the problem.
 
 Also, and maybe more significant, I use tcsh . . . if you use bash 
 this could be the conflict. I see that the echo of the $cmd string 
 from PHP is missing the '\}' that is in my test.

Nope, paths are definitely correct, I also use tcsh.. I that instance I
did not use the same syntax as yours but I had tried it in one of the
passes. This is a SunOs system and php 4.x so that might be the
difference there. Will keep digging.

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



Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-30 Thread Brian V Bonini
On Wed, 29 Jun 2005, Bob Winter wrote:
 Brian,

 The script works for me, I should have included the screen
 input/output, which now follows:


Hmmm, this simply does not work for me. Maybe something with my version of
php or ssh.. I'm at a loss..

$ php -v
PHP 4.3.5 (cli) (built: Apr 30 2004 14:27:11)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.6, Copyright (c) 2003-2004, by Zend
Technologies
with Zend Optimizer v2.5.7, Copyright (c) 1998-2004, by Zend
Technologies
with bDISABLED/b Zend Download Server v1.0.2, Copyright (c)
2003-2004, by Zend Technologies
with bDISABLED/b Zend Performance Suite v4.1.0-platform, Copyright
(c) 1999-2004, by The Accelerator presently supports only Apache, ISAPI
and FastCGI SAPIs
with Zend Debugger v3.5.2a, Copyright (c) 1999-2004, by Zend
Technologies
with sqlite wrapper v1.0, Copyright (c) 2004, by Zend Technologies
with java wrapper v1.0, Copyright (c) 2004, by Zend Technologies


Executing: program /usr/local/bin/ssh host xxx,
user xxx, command scp -v -f
/www/files/services/include/niche/paa/include/niche/atc_syc/{q,w,e,r}
OpenSSH_3.8p1, SSH protocols 1.5/2.0, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Connecting to stagingcws.traderonline.com [10.222.132.174] port
22.
debug1: Connection established.
debug1: identity file /home/bonini/.ssh/identity type -1
debug1: identity file /home/bonini/.ssh/id_rsa type -1
debug1: identity file /home/bonini/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version
OpenSSH_3.5p1
debug1: match: OpenSSH_3.5p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server-client aes128-cbc hmac-md5 none
debug1: kex: client-server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(102410248192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'xxx' is known and matches the RSA
host key.
debug1: Found key in /home/bonini/.ssh/known_hosts:10
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue:
publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/bonini/.ssh/identity
debug1: Trying private key: /home/bonini/.ssh/id_rsa
debug1: Offering public key: /home/bonini/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 435
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type unknown
Enter passphrase for key '/home/bonini/.ssh/id_dsa':
debug1: read PEM private key done: type DSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -v -f
/www/files/services/include/niche/paa/include/niche/atc_syc/{q,w,e,r}
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
scp:
/www/files/services/include/niche/paa/include/niche/atc_syc/{q,w,e,r}: No
such file or directory
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 1
string: scp -v
[EMAIL 
PROTECTED]:/www/files/services/include/niche/paa/include/niche/atc_syc/{q,w,e,r}
/www/files/services/include/niche/paa/include/niche/atc_syc/tmp/.
status: 1
Array
(
)

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



Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-29 Thread Brian V Bonini
On Tue, 28 Jun 2005, Bob Winter wrote:

 Brian,

 The format of your string that works for me is :

 $cmd = scp [EMAIL PROTECTED]:$directory/\{$files\}  $tmp_dir;

 $files must be a comma separated string with NO SPACES.

 Here is my complete test script for your review:
   START  =
 #!/usr/bin/php
 ?php

 $file1 = 'file_A';
 $file2 = 'file_B';
 $file3 = 'file_C';
 $files = $file1,$file2,$file3;
 $directory = '/tmp';
 $user = 'root';
 $tld = 'com';
 $tmp_dir = '/tmp/test';
 $cmd = scp [EMAIL PROTECTED]:$directory/\{$files\}  $tmp_dir;

 exec($cmd, $output, $err);

 echo string: $cmd \n;
 echo status:$err \n;
 print_r($output);
 ?
 === END 


I tried that too. I get '/{a,s,d,f\}' in the string if I use it that way.
Are you saying that you were able to do a succesful transfer using the
above? I can output a string that SHOULD work, e.g. scp
[EMAIL PROTECTED]:/dir/{file1,file2,file3} /dir/. but when run from within a
php script it does not expand the stuff inside the braces. Instead it's
looking for a file literally named '{file1,file2,file3}' rather than
/dir/file1, /dir/file2, /dir/file3, etc. If you just echo the string it
will appear well formed, but try to actually use it and it will not work,
at least not for me.

-Brian

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



Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-28 Thread Brian V Bonini
On Mon, 2005-06-27 at 20:51, Jasper Bryant-Greene wrote:
 Brian V Bonini wrote:
  I can echo out the command and get a well formed command, i.e.
  one that will execute from a command prompt, but when I try to
  exec() $cmd from within the script the globbing is taken
  literally.
 
 Try shell_exec(). I don't think exec() goes via the shell.

Tried that too.

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-28 Thread Brian V Bonini
On Mon, 2005-06-27 at 22:04, Bob Winter wrote:
 Brian,
 
 Can you post more of the script?

Sure. I also tried {{$files}} and tried calling a shell exclusively like:

sh -s 'scp [EMAIL PROTECTED]'

Anyway, here's more for the code surrounding the area in question, it's a 
little hacked up ATM
but your get the picture. I can send the whole file to you if you think it will 
help. I basically
just want to be able to do '$ command {file,file1,file2}' from within a php cli 
script but the {} are
not expanding.

} else {
if($argv[1] == $switches[0]) { 
print(Do you want to push live from dev[d] or staging[s]?: );
$confirm = read_input();
if(!$confirm) {
echo You did not select a choice, exiting program\n;
exit;
}
if ($confirm == s) {
if(!(mkdir($tmp_dir, 0777))) {
echo Error: can not make temp dir for files. 
Please log into staging and push manually;
exit;
}
}
$live_servers = array(a, b, c);
print(Which live servers (a=[all] b=[1-5] c=[6-13]): );
$which_servers = read_input();

if(!in_array($which_servers, $live_servers)) {
echo You must choose which live servers\n;
$err = true;
exit;
} else {
switch($which_servers) {
case $live_servers[0]:
$i = 1;
$j = 13;
break;
case $live_servers[1]:
$i = 1;
$j = 5;
break;
case $live_servers[2]:
$i = 6;
$j = 13;
break;
default:
echo An unrecoverable error has occured\n;
$err = true;
exit;
}

$ii = $i; // store this so we can reset $i on each 
outer foreach
foreach($files as $directory = $file_array) {
$files = implode(,, $file_array);
if($confirm == s) { //if staging suck the 
files down to temp local dir first
$cmd = scp [EMAIL 
PROTECTED]:$directory/{{$files}} $tmp_dir/.;
echo $cmd . \n\n;
exec($cmd, $output, $err);
//shell_exec($cmd);
}
while (!$err  $i = $j) {
($i  10) ? $cname = cwsweb0 : $cname 
= cwsweb;
$cmd = scp $tmp_dir/ . '{' . $files . 
'}' . [EMAIL PROTECTED]:$directory/.;
//echo $cmd . \n;
//exec($cmd, $output, $err);
$i++;
}
$i = $ii; // reset $i to original value so loop 
continues
}
if(file_exists($tmp_dir)) rmdir($tmp_dir); // remove 
the temp dir
$err= true;
}
}



 
 --Bob
 
 Brian V Bonini wrote:
  On Mon, 27 Jun 2005, [ISO-8859-1] Andr? Medeiros wrote:
  
  
 $cmd = 'scp ' . $user . '@stagingcws.' . $tld . ':' . $directory/{' .
 $files . '} ' . $tmp_dir . '/';
 
 That should work
 
 On 6/27/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 Can not make this work inside a php script.
 
 Have tried several variations:
 $cmd = scp [EMAIL PROTECTED]:$directory/\{$files} $tmp_dir/.;
 
 $cmd = scp [EMAIL PROTECTED]:$directory/ . '{' . $files . '} ' . 
 $tmp_dir/.;
 
 etc...
 
 I can echo out the command and get a well formed command, i.e. one that 
 will execute from a command prompt, but when I try to exec() $cmd from 
 within the script the globbing is taken literally.
 
  
  
  No, I already tried it that way too. I guess I should mention this is a
  cli script if that matters.
-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread Brian V Bonini
On Mon, 27 Jun 2005, [ISO-8859-1] Andr? Medeiros wrote:

 $cmd = 'scp ' . $user . '@stagingcws.' . $tld . ':' . $directory/{' .
 $files . '} ' . $tmp_dir . '/';

 That should work

 On 6/27/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Can not make this work inside a php script.
 
  Have tried several variations:
  $cmd = scp [EMAIL PROTECTED]:$directory/\{$files} $tmp_dir/.;
 
  $cmd = scp [EMAIL PROTECTED]:$directory/ . '{' . $files . '} ' . 
  $tmp_dir/.;
 
  etc...
 
  I can echo out the command and get a well formed command, i.e. one that 
  will execute from a command prompt, but when I try to exec() $cmd from 
  within the script the globbing is taken literally.
 

No, I already tried it that way too. I guess I should mention this is a
cli script if that matters.

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



Re: [PHP] including the result of one query in another query

2005-06-26 Thread Brian V Bonini
On Sun, 2005-06-26 at 06:38, Pedro Quaresma de Almeida wrote:
 Hi
 
 I have two databases, on for aeromodelistas (aeromodelling) and
 another for Códigos Postais (Postal Codes). I whant to do the
 following query
 
 SELECT CódigoPostal FROM Aeromodelistas 
 WHERE CódigoPostal IN 
   (SELECT distinct(CP4) FROM codigopostal.LOCART,codigopostal.DISTRITO
WHERE codigopostal.LOCART.DD=codigopostal.DISTRITO.DD 
AND   codigopostal.DISTRITO.DESIG='Coimbra'); 


I believer DISTINCT is not an SQL function, it's a statement.

SELECT DISTINCT column_name FROM table_name;

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



Re: [PHP] a basic array question!

2005-06-25 Thread Brian V Bonini
On Sat, 2005-06-25 at 17:01, bruce wrote:
 feel kind of foolish posting this.. but i can't seem to figure it out for
 now..
 
 i have an array, i can do a print_r($foo) and get the following:
 Array
 (
 [bookmark] = 1
 [facets] = Array
 (
 [0] = Array
 (
 [lastname] = form id=facet-lastname
 input type=hidden name=list value= /
 input type=hidden name=offset value=0 /
 input type=hidden name=orderBy value=username /
 input type=hidden name=sort value=asc /
 strongName:/strong
   input type=text name=_lastname value= style=width: 125px /
   input type=submit value=Search /
 /form
   }
 
 i simply need to know how to get the actual value of an element ('lastname')
 to do:
 $cat = $foo-facets[0]-['lastname'] (obviously, this doesn't work!!)
 

$lastname = $foo['facets'][0]['lastname'];

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



Re: [PHP] looping through an array problem

2005-06-05 Thread Brian V Bonini
On Sun, 2005-06-05 at 16:37, Jack Jackson wrote:
 This is something dumb I am doing but:
 
 Trying to pull all names of publishers in db. This sql:
 
 SELECT art.art_id,art.publisher_id,publisher.publisher_name,
 FROM art
 LEFT JOIN publisher
 ON publisher.publisher_id=art.publisher_id
 
 pulls (in phpmyadmin) four rows:
artID  pubID Publisher_name
17   The New York Times: Sunday Styles
23   The New York Sun
32   Metro NY
43   The New York Sun
 
 
 I'm trying to make a sidebar which will make links to each unique 
 publisher name:
 
 while ($cartoon = mysql_fetch_assoc($result)) {
   $pub_sidebar[] = ul class='sidebar-menu'a class='img-link' 
 href='{$_SERVER['PHP_SELF']}?p={$cartoon['publisher_id']}' 
 title=\{$cartoon['publisher_name']}\{$cartoon['publisher_name']}/a/ul;
}
 
 
 This prints:
The New York Times: Sunday Styles
 
The New York Sun
 
Metro NY
 
The New York Sun
 
 
 I'd like to stop the NY Sun from appearing twice! What have i missed here?


SELECT DISTINCT publisher.publisher_name etc... ??


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Re: stripping html tags

2005-06-05 Thread Brian V Bonini
On Sun, 2005-06-05 at 16:05, Dotan Cohen wrote:

 I don't want to strip out all the tags, just certain ones. But the
 problem turned out not to be in this peice of code- the script simply
 wasn't parsing. I started another thread with that problem after
 failing to fix it on my own.


The prototype says you cam specify exceptions to the function.
-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Re: stripping html tags

2005-06-05 Thread Brian V Bonini
On Sun, 2005-06-05 at 18:13, Dotan Cohen wrote:
 On 6/6/05, Brian V Bonini [EMAIL PROTECTED] wrote:
  On Sun, 2005-06-05 at 16:05, Dotan Cohen wrote:
  
   I don't want to strip out all the tags, just certain ones. But the
   problem turned out not to be in this peice of code- the script simply
   wasn't parsing. I started another thread with that problem after
   failing to fix it on my own.
  
  
  The prototype says you cam specify exceptions to the function.

 I was looking to remove certain tags, not leave certain tags, as does
 strip_tags(). But thank you, I do appreciate the input.

It's the same thing... Just think of it terms of what you don't want to
remove rather then what you do want to remove. The result is the same.


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



RE: [PHP] Replacing 2 strings

2005-05-30 Thread Brian V Bonini
On Mon, 2005-05-30 at 11:13, Murray @ PlanetThoughtful wrote:
  Someone much more clever that I can probably come up with something much
  cleaner and efficient but This works...
 
 Definitely not more clever and arguably not more efficient, but a different
 way of handling this might be:
 
 ?
 
 function replace($string){
   $string = preg_replace(/(|\^|)/, ,$string);
   $string = str_replace(_,  , $string);
   $string = ucwords(strtolower($string));
   $string = str_replace( , -, $string);
   return $string;
 }
 
 echo replace(^JIM_JONES);
 
 ?

AHHH! ucwords(); I probably looked right at it a million times.. I knew
there had to be something to do that


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



RE: [PHP] Replacing 2 strings

2005-05-30 Thread Brian V Bonini
On Mon, 2005-05-30 at 12:58, Murray @ PlanetThoughtful wrote:
 ?
   $string = this;
   $string{0} = strtoupper($string{0});
   echo $string; // should return value of This
 ?

I knew you could access but I didn't realize your could assign/replace
specific chars like that, i.e. $string{x} = 

I can usually work through the logic but am not familiar enough with PHP
to know what's available to work with

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



RE: [PHP] Replacing 2 strings

2005-05-30 Thread Brian V Bonini
On Mon, 2005-05-30 at 15:24, Murray @ PlanetThoughtful wrote:
  This is a great help, thanks to both.  One question I have though.
  How do I just leave the formatting as is?  In the loop you gave me,
  Brian...:
 
 [snippage]
  
  I can't see how I can disregard strtolower without disrupting the rest
  of the function!  My problem is $string contains a whole load of text,
  the formatting of which needs to be retained...
 
 Hmmm. Methinks your problem is a little more complex than originally
 presented.
 
 Can you give us a pseudo-example of what the string might actually contain?
 I think both Brian and I took your original message to mean that your string
 would ONLY contain a value like ^JIM_JONES, but from this message I get
 the sense that the value you're trying to target may be buried in a string
 with other text on either side?
 
 Again, an example that is as close to your real-world needs as possible
 would be very helpful.

The original request was: the text-to-replace is just in a var named
$text1.

I read that to mean you'd already extracted ^JIM_JONES into $text1


?php

function replace($string, $search)
{
$string = strstr($string, $search)
$string = preg_replace(/(|\^|)/, ,$string);
$string = str_replace(_,  , $string);
$string = ucwords(strtolower($string));
$string = str_replace( , -, $string);
return $string;

}

$text = 'My name is ^JIM_JONES and I like ice cream';
$search_string = '^JIM_JONES';
echo replace($text, $search_string);

?


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Replacing 2 strings

2005-05-30 Thread Brian V Bonini
On Mon, 2005-05-30 at 16:24, W Luke wrote:
 On 30/05/05, Brian V Bonini [EMAIL PROTECTED] wrote:
 
 [...]
 
   Again, an example that is as close to your real-world needs as possible
   would be very helpful.
  
  The original request was: the text-to-replace is just in a var named
  $text1.
  
  I read that to mean you'd already extracted ^JIM_JONES into $text1
 
 Sorry - my mistake/fault.  $text1 always begins with ^JIM_JONES by
 is followed by various other stuff:
 
 ^JIM_JONES Leicester, 1720.  Oxford, 1800 CONFIRMED: meeting at 19.10
 
 And I'd like it to read, simply, JIM JONES: (I think having the name
 in Caps would be best for now) and leave the rest of the text
 unaltered:

?php // this will produce Jim-Jones as in previous post

function replace($string, $search)
{
$string = strstr($string, $search)
$string = preg_replace(/(|\^|)/, ,$string);
$string = str_replace(_,  , $string);
$string = ucwords(strtolower($string));
$string = str_replace( , -, $string);
return $string;

}

$text = 'My name is ^JIM_JONES and I like ice cream';
$search_string = '^JIM_JONES';
echo replace($text, $search_string);

?

?php // this will produce JIM JONES

function replace($string, $search)
{
$string = strstr($string, $search)
$string = preg_replace(/(|\^|)/, ,$string);
$string = str_replace(_,  , $string);
return $string;

}

$text = 'My name is ^JIM_JONES and I like ice cream';
$search_string = '^JIM_JONES';
echo replace($text, $search_string);

?


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Replacing 2 strings

2005-05-29 Thread Brian V Bonini
On Sun, 2005-05-29 at 12:22, W Luke wrote:
 Hi,
 
 I have some text in a file which, when it's dumped to a var, needs to
 be replaced.  In its raw form, it looks like this: ^JIM_JONES and I
 need to remove the ^_ and  characters and have it read Jim-Jones
 
 It's nestled in amongst a load of other text - I'm fopen'ing a file
 and reading it line by line - the text-to-replace is just in a var
 named $text1
 
 Any ideas would be great
 
 Will

Someone much more clever that I can probably come up with something much
cleaner and efficient but This works...

?php

function replace($string)
{
$chars = array(, ^, );
$string = str_replace($chars, , $string);
$string = str_replace(_, -, $string);
$pieces = preg_split('/-/', $string);

foreach($pieces as $char) {
$first_letter[] = $char{0};
$remainder[] = strtolower(substr($char, 1));
}

$result = array_merge($first_letter, $remainder);
list($frstltr,$lstltr,$frstwrd,$lstwrd) = $result;
$string = $frstltr . $frstwrd . - . $lstltr . $lstwrd;

return $string;

}

$text1 = '^JIM_JONES';
echo replace($text1);

?





-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] include file and problems with headers

2005-05-27 Thread Brian V Bonini
On Sat, 2005-05-21 at 06:30, Ross wrote:
 I have the folowing code which checks whether the user has logged in.
 
 if (!isset ($_SESSION['new_session'] ) )
 {
 
 $login_status = div class=\standard_text\Your are not signed in 
 /div;
 
 }
 if (isset ($_SESSION['new_session'] ) )
 {
 $address = $_SESSION['new_session'];
 $login_status = div class=\standard_text\Your are signed in as span 
 class=\under\$address/span/div;
 }
 ?
 
 
 Now when I have this as a file to be included in each page, status.php (see 
 code)  gives the header error (already sent).
 
 ?php
 session_start();
 include('status.php');

How about putting session_start in status.php then just include it.

?php

session_start();

if (!isset ($_SESSION['new_session'] ) )
{

$login_status = div class=\standard_text\Your are not 
signed in 
/div;

}
if (isset ($_SESSION['new_session'] ) )
{
$address = $_SESSION['new_session'];
$login_status = div class=\standard_text\Your are signed 
in as span 
class=\under\$address/span/div;
}

echo $login_status;

?

Then in other files just:

?php include 'status.php'; ?

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] how to convert char into number

2005-05-27 Thread Brian V Bonini
On Wed, 2005-05-25 at 16:11, Jeremy Reynolds wrote:
 What function do I use to convert an ASCII character into it's 
 equivalent number?
 --
 Sorry, I think my spam filters got any responses.  If you replied, 
 could you please resend it to me?

ord()

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



Re: [PHP] how to convert char into number

2005-05-27 Thread Brian V Bonini
On Wed, 2005-05-25 at 16:01, Jeremy Reynolds wrote:
 What function do I use to convert an ASCII character into it's 
 equivalent number?

ord()

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] update blues

2005-05-21 Thread Brian V Bonini
On Fri, 2005-05-20 at 23:54, Jim  Sara Feldman wrote:
 Warning: session_start(): Cannot send session cookie - headers 
 already sent by (output started at 
 /Library/WebServer/Documents/testit/Logsafe_project/db_fns.php:212) 
 in /Library/WebServer/Documents/testit/Logsafe_project/member.php on 
 line 14
 
 Warning: session_start(): Cannot send session cache limiter - headers 
 already sent (output started at 
 /Library/WebServer/Documents/testit/Logsafe_project/db_fns.php:212) 
 in /Library/WebServer/Documents/testit/Logsafe_project/member.php on 
 line 14

What's the first 20 lines of member.php look like? And what's at line
212 +/- in db_fns.php




-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Getting parameters from a URL coming from outside the site

2005-05-20 Thread Brian V Bonini
On Fri, 2005-05-20 at 12:51, Mário Gamito wrote:

 Why is this wrong and how to make it right ?

I did this and sent myself a link to it via email, clicked it from
within my email client (Evolution) which launched a browser and called
the script successfully writing the vars to test.txt. Of course this is
not use-able in the real world but it works for testing...

http:/foobar.com/[EMAIL PROTECTED]code=vu782

?php

$filename=test.txt;

if(!file_exists($filename)) {
touch($filename);
}

$content = $_GET['email'] . :;
$content .= $_GET['code'] . \n;

$fp = fopen($filename, 'ab');
fwrite($fp, $content);
fclose($fp);

header(Location: http://foobar.com/test.txt;);

?


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] Help with using SPL to build a MySQL Iterator

2005-05-18 Thread V Kam
Hello all

I was trying to write an SPL Iterator for a MySQL
result set but not having any luck. Specifically I'm
not sure how to overload the key() and current/next()
methods. 

Does anyone here have a working code sample that does
this, or can offer some guidance on how to overload
the 5 Iterator methods? Any assistance much
appreciated!

Thanks!



__ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-18 Thread Brian V Bonini
On Mon, 2005-05-16 at 22:10, Richard Lynch wrote:
 Let him fight with phpIniDir some other day.

Something interesting maybe:
http://gfx.gfx-design.com/session_test.php
Hit your browsers refresh button.

I would think SID is NOT supposed to change with every page refresh..??

?php
 
session_start();
header(Cache-control: private);
 
$_SESSION['test'] = testing;
echo 'pre';
print_r($_SESSION);
echo \nSession Id: . session_id();
echo \n . strip_tags(SID);
echo '/pre';
 
?



-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Re: Sending a string with $_POST/$_GET

2005-05-18 Thread Brian V Bonini
On Wed, 2005-05-18 at 11:53, Luis wrote:
 Ross wrote:
  I want to write a string to a variable and use $_POST or $_GET to retrieve 
  it on another page.


$string = 'this is a string';
echo 'a href=another_page.php?val=' . $string . 'Next page/a';


another_page.php:

echo $_GET[val];


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Building array ?

2005-05-18 Thread Brian V Bonini
On Wed, 2005-05-18 at 12:00, Paul Nowosielski wrote:
 HI All,
 
 I'm trying to build an array of user id's. This is the code I've written
 that does not work.
 
  
 while($row=mysql_fetch_array($result)){
// put user ID's into an array;
$uidToAdmin .= array ($row[user_id]);
  
// for debugging
echo brUID $row[user_id]BR;
echo BRAUID $uidToAdmin[0];
 }
 
 So how can I continue adding to this array in the while loop?

$uidToAdmin[] = $row[user_id];

??

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-17 Thread Brian V Bonini
On Mon, 2005-05-16 at 22:10, Richard Lynch wrote:
 Does ?php phpinfo();? show the same /path/to/php.ini as the one you edit?
 

Yup

 To be 100% certain, use 'stop' to stop Apache and then do:
 ps aux | grep httpd
 
 You should see only the grep httpd output, or no output at all.

Did that...


 Then start Apache, and triple check ?php phpinfo();? shows the php.ini
 file being read from the same directory you edited php.ini
 

Yup

Still no go... Other changes in php.ini DO take effect, just not
this I'm at a loss


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] counting ocuring words in a string

2005-05-17 Thread Brian V Bonini
On Tue, 2005-05-17 at 06:00, Merlin wrote:
 Hi there,
 
 I am trying to find a way to count the number of times (if any) words are 
 inside 
 a string. So I played around with ereg, preg_match_all and so on, but could 
 not 
 put together a working code.

Maybe something like this?

?php

$words = array(php, language);
$str = 'One language which is great is php. PHP works great!';
$str = strtolower($str);

echo 'pre';

foreach($words as $word) {
echo 'word = ' .$word;
echo ' (' . substr_count($str, $word). )\n;
}

echo '/pre';

?

Although you'll run into a problem if your words array contains for
example 'air' which will match both 'air' and 'fair',

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-17 Thread Brian V Bonini
On Tue, 2005-05-17 at 09:53, Jason Barnett wrote:
 Brian V Bonini wrote:
 ...
  
  Still no go... Other changes in php.ini DO take effect, just not
  this I'm at a loss
  
  
 
 By any chance are you changing PHP values through Apache's conf file?

I am, in ANOTHER virtual hosts container block but not any values
related to sessions. What are you getting at?

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-17 Thread Brian V Bonini
On Tue, 2005-05-17 at 15:58, Richard Lynch wrote:
  On Tuesday 17 May 2005 21:01, Brian V Bonini wrote:
 
  Still no go... Other changes in php.ini DO take effect, just not
  this I'm at a loss
 
 Does phpinfo() show trans_sid as on or off?

Shows it as 0 or 1 depending on how I set it at that moment...
http://gfx.gfx-design.com/php_info.php


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-16 Thread Brian V Bonini
On Sat, 2005-05-14 at 22:44, Richard Lynch wrote:
 Using Cookies, or using URL, the session DATA will be stored on the server
 in /tmp files -- Unless you change php.ini to store them somewhere else,
 in which case, again, the Cookie and URL only holds the ID and all the
 data goes wherever you store it:  database, shared memory, or an army of
 elves for all PHP cares.
 
 If trans_sid is not working for you, let's narrow this down:
 
 If you do this:
 ?php
   session_start();
   echo a href=\yourdomainnamehere.com\click me/abr /\n;
 ?
 
 Do you see something like ?PHPSESSID=a847hjfu3734hgfjgurur tacked on to
 the end of the URL?
 
 If not, trans_sid is NOT enabled.

I don't see the session id string, BUT, I do have session.use_trans_sid
= 1 set in php.ini and I did restart Apache after setting it.. I can see
the session file being created in /tmp but the values are not being
incremented as they should per script below.

 
 Did you restart Apache?

Yes.

 
 Did you turn *OFF* Cookies?  If PHP *can* use Cookies, I think it's gonna
 use Cookies, and not bother with the trans_sid stuff, though maybe it
 always puts it there.  I never really dived into that.  To be certain,
 though, turn off Cookies in php.ini and/or in your browser.

I did turn them off in the browser. And tried in php.ini at some point.

 
 Re-start Apache for your php.ini changes to kick in.

Did that...

Is it something with my script?


$xsl = new DOMDocument;
$xsl-load('quotes.xsl');

// Configure the transformer
$proc = new XSLTProcessor;
$proc-importStyleSheet($xsl); // attach the xsl rules

// get elements to operate on
$quotes = $xml-getElementsByTagName('quote_text');
$authors = $xml-getElementsByTagName('quote_author');

// store element values into array
foreach ($authors as $author) {
$author_result[] = $author-nodeValue;
}
foreach ($quotes as $quote) {
$quote_result[] = $quote-nodeValue;
}

session_start(); 
header(Cache-control: private); // IE 6 Fix

if (!isset($_SESSION['user_quotes']) || $_SESSION['user_quotes'] =
count($quote
_result) - 1) {
   $_SESSION['user_quotes'] = 0;
} else {
   $_SESSION['user_quotes']++;
}

// convert to simple var
$user_quotes = $_SESSION['user_quotes'];

// session debug stuff
/*
echo pre;
echo $_SESSION['user_quotes'] . \n;
print_r($_SESSION);
echo Session Id: . session_id();
echo /pre;
*/

if(isset($user_quotes)) {
$quote = htmlentities($quote_result[$user_quotes]);
$name = $author_result[$user_quotes];
}

$proc-setParameter('', 'quote', $quote);
$proc-setParameter('', 'name', $name);
$output = $proc-transformToXML($xml);

?


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Special characters

2005-05-16 Thread Brian V Bonini
On Mon, 2005-05-16 at 12:23, Carlos Palomino wrote:
 Hi everyone,
 I have just begun writing PHP web-pages and I have come across an interesting 
 issue. 
 Whenever I use special characters within my code such as: a ©, the 
 character 
 displays as a ?.

Because that's not valid HTML... See:
http://www.w3.org/TR/html401/sgml/entities.html

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



Re: [PHP] DOMDocument and html doctype

2005-05-14 Thread Brian V Bonini
On Sat, 2005-05-14 at 06:00, Claudio wrote:
 Hi,
 I've used loadHTML() to read a HTML file to DOM. This file starts with a 
 string like
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 
 Do someone know how I can access this string? By reading the doctype back 
 from DOMDocument I only found the name (HTML) but nothing more...
 

?php

$html = EOS
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
htmlbodyTestbr/body/html
EOS;  

$pattern = '!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01
Transitional//EN';

$doc = new DOMDocument();
$doc-loadHTML($html);
preg_match($pattern, $doc-saveHTML(), $matches);
echo 'lt;' . $matches[0] . 'gt;';

?



-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-14 Thread Brian V Bonini
On Fri, 2005-05-13 at 23:31, Jason Wong wrote:
 On Saturday 14 May 2005 09:42, Brian V Bonini wrote:
 
  Yeah, I know session support is there and I DO NOT have it set to use
  ONLY cookies. But if I disable cookies in the browser stuff relying on
  sessions stops working. I'm using 5.0.3
 
  session.use_trans_sid
  0
  0
 
 Set that to 1. Sessions *are* cookies, they're cookies that have been set 
 to expire when the browsing session finishes (ie when the browser is 
 closed).

I thought the idea was; cookies if available otherwise the session data
gets serialized and propagated in the URL? The later of which appears to
not work, for me, if applicable

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



RE: [PHP] DOMDocument and html doctype

2005-05-14 Thread Brian V Bonini
On Sat, 2005-05-14 at 07:57, Jared Williams wrote:
   Hi,
  I've used loadHTML() to read a HTML file to DOM. This file 
  starts with a string like !DOCTYPE HTML PUBLIC -//W3C//DTD 
  HTML 4.01 Transitional//EN
  
  Do someone know how I can access this string? By reading the 
  doctype back from DOMDocument I only found the name (HTML) 
  but nothing more...
  
 
   Use $document-doctype, its DOMDocumentType object..
  

That's part of DOM XML isn't it? I think he's referring to the newer DOM
extension since 'loadHTML() is cited...???

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



Re: [PHP] DOMDocument and html doctype

2005-05-14 Thread Brian V Bonini
On Sat, 2005-05-14 at 16:08, Johannes Findeisen wrote:
 On Saturday 14 May 2005 16:25, Brian V Bonini wrote:
  ?php
 
  $html = EOS
  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  htmlbodyTestbr/body/html
  EOS;  
 
  $pattern = '!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01
  Transitional//EN';
 
  $doc = new DOMDocument();
  $doc-loadHTML($html);
  preg_match($pattern, $doc-saveHTML(), $matches);
  echo 'lt;' . $matches[0] . 'gt;';
 
  ?
 
 Well, that ist a very crazy idea...
 
 If Claudio knows the doctype allready, he not needs to access this doc type 
 string. A preg_match is the wrong function at this place or will you write a 
 switch/case block that knows every doctype definition?
 
 This only is usefull to see if the string exists or not.

I'm sorry, I missed your solution, what was it again?

He said Do someone know how I can access this string? There it is,
THAT string is now in $matches[0]; Do what you want with it from
there. Otherwise set pattern to a regex and search for similar strings
if the search pattern is not EXACTLY that.

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



RE: [PHP] DOMDocument and html doctype

2005-05-14 Thread Brian V Bonini
On Sat, 2005-05-14 at 13:03, Jared Williams wrote:
  
  On Sat, 2005-05-14 at 07:57, Jared Williams wrote:
 Hi,
I've used loadHTML() to read a HTML file to DOM. This file starts 
with a string like !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 
Transitional//EN

Do someone know how I can access this string? By reading 
  the doctype 
back from DOMDocument I only found the name (HTML) but nothing 
more...

   
 Use $document-doctype, its DOMDocumentType object..

  
  That's part of DOM XML isn't it? I think he's referring to 
  the newer DOM extension since 'loadHTML() is cited...???
  
 
 I was referring to the new PHP5 DOM extension.

OOppps, there it is, tabel 3 on the first page of the DOM section in the
manual... I swear it wasn't there earlier.. ;-)

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



Re: [PHP] Hello, I'm new...

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 07:10, [EMAIL PROTECTED] wrote:
 Hi all, 
 
 I have only recently started to look at php, I hope this list dose not
 mind 'noob' questions.
 
 I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and 'Web
 Database Applications with PHP and MySQL' Hugh E. Williams, David Lane.
  
 
 I would like to create a 'community' website and was wondering if there
 was a framework available to get me started?

Google for mambo or php nuke


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Re: Strange comparison behaviour

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 06:34, Erwin Kerk wrote:
 Bogdan Stancescu wrote:
  You probably mis-typed something:
  
  [EMAIL PROTECTED] ~]$ php
  ?
  if (info == 0) echo is 0\n; else echo not 0\n;
  ?
  Content-type: text/html
  X-Powered-By: PHP/4.3.11
  
  is 0
 Tried that, but notice the PHP Version, it is failing in PHP 4.1.2!
 
 Erwin Kerk

Same behavior on 5.x - I suspect something to do with the 'type' and
loose comparison operators. According to table 2:
http://us4.php.net/manual/en/types.comparisons.php is should evaluate as
true. Looking at the ordinal values revealed nothing to me...


?php

$string = info;
$len = strlen($string);
$lst = $string{strlen($string - 1)};
 
echo 'pre';
echo ($string == 0) ? is 0\n : not 0\n;
echo (rtrim($string, $lst) == 0) ? is 0\n : not 0\n;
echo ---\n;

for($i=0; $i$len; $i++) {
$ord_value =  ord($string[$i]);
echo chr($ord_value) . = . $ord_value . \n;
}

echo '/pre';

?

Anyway, I suspect using ($string === 0) will give you the expected
results.


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] session wierd in Konqueror

2005-05-13 Thread Brian V Bonini
session_start();
header(Cache-control: private); // IE 6 Fix

$user_quotes = $_SESSION['user_quotes'];

if (!isset($user_quotes) || $user_quotes = count($quote_result) - 1) {
   $user_quotes = 0;
} else {
   $user_quotes++;
}

echo pre;
echo $_SESSION['user_quotes'] . \n;
print_r($_SESSION);
echo Session Id: . session_id();
echo /pre;

Gives this in Konqueror:

Array
(
)
Session Id:bfe78a51438a2e4620092f4333c9389a

and in firefox:

2
Array
(
[count] = 10
[user_quotes] = 2
)
Session Id:e8f10e77b0cbb6dc8650e365ed7352f6

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



Re: [PHP] domxml problem

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 10:31, Georgi Ivanov wrote:
 But it gives me error on this line :
 $DomDocument = domxml_open_file($file);

What's the error?

Try:

$dom = dom_xml_file($file);


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] php works in IE not Firefox?

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 14:12, Dustin Wish wrote:
 Anyone run across an issue where a php script works in IE and not Firefox?
 Christianboards.org is a PHP nuke site running on a Enism linux box that is
 having this issue.

http://www.christianboards.org/ comes up fine for me; firefox/linux
however http://christianboards.org/ does not.. This is a DNS issue, not
PHP.  :) christianboards.org has no 'A' record. My guess is that IE
fills in the 'www' when you type in 'christianboards.org' whereas
firefox does not.

 snip 

$ dig christianboards.org

;  DiG 9.2.3rc2  christianboards.org
;; global options:  printcmd
;; Got answer:
;; -HEADER- opcode: QUERY, status: NOERROR, id: 53525
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;christianboards.org.   IN  A

;; AUTHORITY SECTION:
christianboards.org.10800   IN  SOA ns1.limedale.com.
indco.indco.net. 2005050601 3600 900 604800 86400

;; Query time: 237 msec
;; SERVER: 192.168.15.1#53(192.168.15.1)
;; WHEN: Fri May 13 16:34:35 2005
;; MSG SIZE  rcvd: 104

[EMAIL PROTECTED] ~/www]$ dig www.christianboards.org

;  DiG 9.2.3rc2  www.christianboards.org
;; global options:  printcmd
;; Got answer:
;; -HEADER- opcode: QUERY, status: NOERROR, id: 43722
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;www.christianboards.org.   IN  A

;; ANSWER SECTION:
www.christianboards.org. 86400  IN  A   66.139.178.33

;; AUTHORITY SECTION:
christianboards.org.86400   IN  NS  ns1.limedale.com.
christianboards.org.86400   IN  NS  ns2.limedale.com.

;; ADDITIONAL SECTION:
ns1.limedale.com.   160305  IN  A   64.216.172.1
ns2.limedale.com.   160305  IN  A   66.139.178.1

;; Query time: 139 msec
;; SERVER: 192.168.15.1#53(192.168.15.1)
;; WHEN: Fri May 13 16:34:42 2005
;; MSG SIZE  rcvd: 137

 /snip 


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] why are session only working with cookies?

2005-05-13 Thread Brian V Bonini
Everything in php.ini seems to be correct. Is there soem thign I'm
supposed to pass to 'configure' at compile time?

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



[PHP] solved::session wierd in Konqueror

2005-05-13 Thread Brian V Bonini
This is solved...

--original--

session_start();
header(Cache-control: private); // IE 6 Fix

$user_quotes = $_SESSION['user_quotes'];

if (!isset($user_quotes) || $user_quotes = count($quote_result) - 1) {
   $user_quotes = 0;
} else {
   $user_quotes++;
}

echo pre;
echo $_SESSION['user_quotes'] . \n;
print_r($_SESSION);
echo Session Id: . session_id();
echo /pre;

Gives this in Konqueror:

Array
(
)
Session Id:bfe78a51438a2e4620092f4333c9389a

and in firefox:

2
Array
(
[count] = 10
[user_quotes] = 2
)
Session Id:e8f10e77b0cbb6dc8650e365ed7352f6

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



  1   2   3   4   5   6   >