Re: [PHP] How to download a multi-part file at the server side?

2013-11-02 Thread Ajay Garg
Hi Aziz.
Thanks for the reply.

Unfortunately, making the change suggested by you does not make any
difference :(


Sorry, Thanks and Regards


On Sat, Nov 2, 2013 at 10:51 PM, Aziz Saleh azizsa...@gmail.com wrote:




 On Sat, Nov 2, 2013 at 1:03 PM, Ajay Garg ajaygargn...@gmail.com wrote:

 Hi all.

 1.
 I could have the proper $_FILES[userfile][name] been echoed back, by
 replacing
ContentBody cbFile = new
 FileBody(file, image/png);

 with
ContentBody cbFile = new
 FileBody(file);



 2.
 However, now I am stuck with the following server-side code.
 No matter what I do, I always get a no echoed back (specifying that the
 file is not copied to its target place).




 ###
 ?php

 $headers = apache_request_headers();

 foreach ($headers as $header = $value)
 {
 if($header == active_window_title)
 {
 $active_window_title = $value;
 break;
 }
 }


 $target_path = /home/ajay/success.png;

 move_uploaded_file($_FILES[userfile][tmp_name], $target_path);
 if(file_exists($target_path))
 {
 echo yes;
 }
 else
 {
 echo no;
 }

 echo \n . $_FILES[userfile][name]; # I always get the proper
 file-name echoed.

 ?

 





 Any ideas what stupidity am I making in the PHP code?


 On Sat, Nov 2, 2013 at 7:13 PM, Ajay Garg ajaygargn...@gmail.com wrote:

  Does not work :(
 
 
  As per the code-snippet I pasted,
   $_FILES[userfile][name]
 
  should be
 
 /path/to/png/file.png
 
 
  However, $_FILES[userfile][name] is empty.
 
 
  On Sat, Nov 2, 2013 at 6:59 PM, Shawn McKenzie sh...@mckenzies.net
 wrote:
 
  Fairly easy:
  http://www.php.net/manual/en/features.file-upload.post-method.php
 
 
  On Sat, Nov 2, 2013 at 7:36 AM, Ajay Garg ajaygargn...@gmail.com
 wrote:
 
  Hi all.
 
  I intend to implement a use-case, wherein the client uploads a file in
  multi-part format, and the server then stores the file in a mysql
  database
  (after downloading it at the server side).
 
  I have been unable to find any immediate answers through googling; I
 will
  be grateful if someone could start me in a direction to achieve the
  downloading at server via php requirement.
 
  (Don't think it should matter, but I use Java to upload a file in
  multi-part format).
 
  I will be grateful for some pointers.
 
  Thanks in advance
 
 
  Thanks and Regards,
  Ajay
 
 
 
 
 
  --
  Regards,
  Ajay
 



 --
 Regards,
 Ajay


 Ajay, try changing your mpEntity to:

 new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE)

 See if it makes a difference.



Ajay


Re: [PHP] How to download a multi-part file at the server side?

2013-11-02 Thread Aziz Saleh
On Sat, Nov 2, 2013 at 1:03 PM, Ajay Garg ajaygargn...@gmail.com wrote:

 Hi all.

 1.
 I could have the proper $_FILES[userfile][name] been echoed back, by
 replacing
ContentBody cbFile = new
 FileBody(file, image/png);

 with
ContentBody cbFile = new
 FileBody(file);



 2.
 However, now I am stuck with the following server-side code.
 No matter what I do, I always get a no echoed back (specifying that the
 file is not copied to its target place).



 ###
 ?php

 $headers = apache_request_headers();

 foreach ($headers as $header = $value)
 {
 if($header == active_window_title)
 {
 $active_window_title = $value;
 break;
 }
 }


 $target_path = /home/ajay/success.png;

 move_uploaded_file($_FILES[userfile][tmp_name], $target_path);
 if(file_exists($target_path))
 {
 echo yes;
 }
 else
 {
 echo no;
 }

 echo \n . $_FILES[userfile][name]; # I always get the proper
 file-name echoed.

 ?

 





 Any ideas what stupidity am I making in the PHP code?


 On Sat, Nov 2, 2013 at 7:13 PM, Ajay Garg ajaygargn...@gmail.com wrote:

  Does not work :(
 
 
  As per the code-snippet I pasted,
   $_FILES[userfile][name]
 
  should be
  /path/to/png/file.png
 
 
  However, $_FILES[userfile][name] is empty.
 
 
  On Sat, Nov 2, 2013 at 6:59 PM, Shawn McKenzie sh...@mckenzies.net
 wrote:
 
  Fairly easy:
  http://www.php.net/manual/en/features.file-upload.post-method.php
 
 
  On Sat, Nov 2, 2013 at 7:36 AM, Ajay Garg ajaygargn...@gmail.com
 wrote:
 
  Hi all.
 
  I intend to implement a use-case, wherein the client uploads a file in
  multi-part format, and the server then stores the file in a mysql
  database
  (after downloading it at the server side).
 
  I have been unable to find any immediate answers through googling; I
 will
  be grateful if someone could start me in a direction to achieve the
  downloading at server via php requirement.
 
  (Don't think it should matter, but I use Java to upload a file in
  multi-part format).
 
  I will be grateful for some pointers.
 
  Thanks in advance
 
 
  Thanks and Regards,
  Ajay
 
 
 
 
 
  --
  Regards,
  Ajay
 



 --
 Regards,
 Ajay


Ajay, try changing your mpEntity to:

new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE)

See if it makes a difference.


Re: [PHP] How to capture uploaded file data

2013-09-28 Thread Bastien


Thanks,

Bastien

 On Sep 27, 2013, at 12:56 AM, Mariusz Drozdowski scheme...@wp.pl wrote:
 
 Hi all php experts,
 
 I would like to ask you all a question, I hope this is the right place
 to ask it.
 
 I'm writing a PHP extension now in c/c++. User uploads a file (could be POST
 or PUT method, but I can limit it to POST only). I need to capture the
 file data while being
 uploaded, without writing it to disk on the server. I need to process
 the data and (maybe,
 depending on a situation) send it somewhere else or save it to disk.
 Of course I know, that I can process the file
 after it has been uploaded (saved on disk on the server), but I would
 like to avoid it.
 I also need to do something opposite: I need to generate a file on the
 fly and send it
 to the user. All metadata of the generated file is known beforehand
 (e.g. size, name).
 
 I've been searching around for some time now and I could not find
 anything even close to the solution.
 Is there any example(s) or existing PHP extension that do(es) something
 like this (at least something simmilar) ?
 If you could give me any pointers that would be awesome.
 
 Thanks for your help 

The question I have is why? Should your upload fail for any reason you've got a 
half processed file that is non-recoverable.  No do-overs. If you stick to the 
standard processes with out the extension,

Upload
Save somewhere (or leave in temp upload folder)
Process
Send result back to user 
Unlink file

Generating the file and sending it to the user is also pretty standard

Create your dataset
Send appropriate headers
Send data
Close connection

For this, there usually isn't a need to save the file. You may run into issues 
streaming the data to certain browsers. 

Also one of the main downsides to your upload is high load situations or large 
file situations (where file size exceeds php's upload limit). 

My personal preference is to save that file to disk so that if needed I can 
work with it later ( if say the server load is high) and email the results to 
the user. 



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



[PHP] How to capture uploaded file data

2013-09-26 Thread Mariusz Drozdowski
Hi all php experts,

I would like to ask you all a question, I hope this is the right place
to ask it.

I'm writing a PHP extension now in c/c++. User uploads a file (could be POST
or PUT method, but I can limit it to POST only). I need to capture the
file data while being
uploaded, without writing it to disk on the server. I need to process
the data and (maybe,
depending on a situation) send it somewhere else or save it to disk.
Of course I know, that I can process the file
after it has been uploaded (saved on disk on the server), but I would
like to avoid it.
I also need to do something opposite: I need to generate a file on the
fly and send it
to the user. All metadata of the generated file is known beforehand
(e.g. size, name).

I've been searching around for some time now and I could not find
anything even close to the solution.
Is there any example(s) or existing PHP extension that do(es) something
like this (at least something simmilar) ?
If you could give me any pointers that would be awesome.

Thanks for your help in advance.

Mariusz


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



[PHP] How to do PHP build test

2013-08-27 Thread Shahina Rabbani
Hi,


Can anybody help me answering my doubt.

I wanted to check if there are any errors with the php compilation and
build.
I have ran make, make test. make test didnt give any errors to me.
Is there any other method or command to run through which we can see if
there are any errors in building the php source code.


Thanks,
Shahina Rabbani


Re: [PHP] How to send post-variables in a Location header

2013-08-27 Thread Daniel Brown
On Mon, Aug 26, 2013 at 3:48 PM, Ajay Garg ajaygargn...@gmail.com wrote:
 Hi all.

 I have a scenario, wherein I need to do something like this ::

 ###
 $original_url = /autologin.php;
 $username = ajay;
 $password = garg;

 header('Location: ' . $original_url);
 ###

 As can be seen, I wish to redirect to the URL autologin.php.

 Additionally, I wish to pass two POST key-value pairs :: user=ajay and
 password=garg (I understand that passing GET key-value pairs is trivial).

 Is it  even possible?
 If yes, I will be grateful if someone could let me know how to redirect to
 a URL, passing the POST key-value pairs as necessary.

No.  Sending a 'Location:' header issues an HTTP 301 by default,
which means the browser will follow it using a GET request.  If you
can't pass the information from one location to another using sessions
or (less ideally) cookies, you might consider doing a cURL POST
request in the background and passing the session ID back to the
browser, and having it handle it appropriately (read: session
hijack).

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



[PHP] How to send post-variables in a Location header

2013-08-26 Thread Ajay Garg
Hi all.

I have a scenario, wherein I need to do something like this ::

###
$original_url = /autologin.php;
$username = ajay;
$password = garg;

header('Location: ' . $original_url);
###

As can be seen, I wish to redirect to the URL autologin.php.

Additionally, I wish to pass two POST key-value pairs :: user=ajay and
password=garg (I understand that passing GET key-value pairs is trivial).

Is it  even possible?
If yes, I will be grateful if someone could let me know how to redirect to
a URL, passing the POST key-value pairs as necessary.


Looking forward to a reply :)


-- 
Regards,
Ajay


Re: [PHP] How to send post-variables in a Location header

2013-08-26 Thread ma...@behnke.biz


 Ajay Garg ajaygargn...@gmail.com hat am 26. August 2013 um 21:48
 geschrieben:


 Hi all.

 I have a scenario, wherein I need to do something like this ::

 ###
         $original_url = /autologin.php;
         $username = ajay;
         $password = garg;

         header('Location: ' . $original_url);
 ###

 As can be seen, I wish to redirect to the URL autologin.php.

 Additionally, I wish to pass two POST key-value pairs :: user=ajay and
 password=garg (I understand that passing GET key-value pairs is trivial).

 Is it  even possible?
 If yes, I will be grateful if someone could let me know how to redirect to
 a URL, passing the POST key-value pairs as necessary.

Iirc it is not possible to pass post body content via location redirect.
What you can do: Set auth headers

http://forums.phpfreaks.com/topic/84480-solved-how-to-send-authorization-basic-header/



 Looking forward to a reply :)


 --
 Regards,
 Ajay

--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

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



Re: [PHP] How to send post-variables in a Location header

2013-08-26 Thread Matijn Woudt
On Mon, Aug 26, 2013 at 9:48 PM, Ajay Garg ajaygargn...@gmail.com wrote:

 Hi all.

 I have a scenario, wherein I need to do something like this ::

 ###
 $original_url = /autologin.php;
 $username = ajay;
 $password = garg;

 header('Location: ' . $original_url);
 ###

 As can be seen, I wish to redirect to the URL autologin.php.

 Additionally, I wish to pass two POST key-value pairs :: user=ajay and
 password=garg (I understand that passing GET key-value pairs is trivial).

 Is it  even possible?
 If yes, I will be grateful if someone could let me know how to redirect to
 a URL, passing the POST key-value pairs as necessary.


 Looking forward to a reply :)


Usually you would pass this around in sessions. If you must however use
post, you can only do so with using some javascript magic. Write a form
with hidden input and auto submit it.

- Matijn


Re: [PHP] How to send post-variables in a Location header

2013-08-26 Thread Tamara Temple

On Aug 26, 2013, at 2:48 PM, Ajay Garg ajaygargn...@gmail.com wrote:
 Hi all.
 
 I have a scenario, wherein I need to do something like this ::
 
 ###
$original_url = /autologin.php;
$username = ajay;
$password = garg;
 
header('Location: ' . $original_url);
 ###
 
 As can be seen, I wish to redirect to the URL autologin.php.
 
 Additionally, I wish to pass two POST key-value pairs :: user=ajay and
 password=garg (I understand that passing GET key-value pairs is trivial).
 
 Is it  even possible?
 If yes, I will be grateful if someone could let me know how to redirect to
 a URL, passing the POST key-value pairs as necessary.
 
 
 Looking forward to a reply :)

Since this seems that it will not work, I'm wondering if you could take a step 
back for us and say what is it you're hoping to accomplish by this. Maybe 
there's a better way to get you what you need that is possible, and also will 
be good PHP. Describe your scenario in higher level terms, not how you'd 
implement it, but what the outcome you need is, and what the design goal is for 
the user.


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



Re: [PHP] how old is this version of PHP?

2013-08-19 Thread Larry Garfield

On 08/17/2013 06:26 PM, Camilo Sperberg wrote:

On 16 aug. 2013, at 19:17, Tamara Temple tamouse.li...@gmail.com wrote:


Looking into a problem for someone who is using Godaddy Shared Web Hosting (I 
know..), I noticed the version tag reported by phpinfo is:


PHP API 20041225
PHP Extension   20060613
Zend Extension  220060519

Just how old is this version of PHP??



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


According to my google search, it should be 5.2.9, so it isn't that old:


5.2.9 was released in February of 2009.  5.2 is completely retired and 
out of support.  5.3 is on security-only life-support.  5.4 is the 
legacy stable release.


Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into 
this decade.  (GoDaddy apparently doesn't meet that qualification.) 
You're doing clients a disservice by allowing them to run such an 
ancient and unsupported version.


--Larry Garfield

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



[PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread aesbovis
Hello there
I am making a little web-based-tool for our studio to progress a large
amount of data, more than 2000 items, but it seems there is a length limit
of 1000 to $_POST.

How can I submit all of the items in one time?

Thank you!
aesbovis

-- 
*Anywhere @aesbovis!*


Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Mihai Anghel
Check this http://www.php.net/manual/en/ini.core.php#ini.post-max-size


On Mon, Aug 19, 2013 at 9:55 AM, aesbovis aesbo...@gmail.com wrote:

 Hello there
 I am making a little web-based-tool for our studio to progress a large
 amount of data, more than 2000 items, but it seems there is a length limit
 of 1000 to $_POST.

 How can I submit all of the items in one time?

 Thank you!
 aesbovis

 --
 *Anywhere @aesbovis!*



Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Szopen Xiao
you can use JSON post

2013/8/19 aesbovis aesbo...@gmail.com:
 Hello there
 I am making a little web-based-tool for our studio to progress a large
 amount of data, more than 2000 items, but it seems there is a length limit
 of 1000 to $_POST.

 How can I submit all of the items in one time?

 Thank you!
 aesbovis

 --
 *Anywhere @aesbovis!*

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



Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Jan Ehrhardt
Mihai Anghel in php.general (Mon, 19 Aug 2013 11:30:01 +0300):
Check this http://www.php.net/manual/en/ini.core.php#ini.post-max-size

Keyword: max_input_vars.

Jan

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



RE: [PHP] how old is this version of PHP?

2013-08-19 Thread Thomas Punt
Godaddy enables you to upgrade to PHP 5.3 in the cPanel settings.

 Date: Mon, 19 Aug 2013 01:07:17 -0500
 From: la...@garfieldtech.com
 To: php-general@lists.php.net
 Subject: Re: [PHP] how old is this version of PHP?
 
 5.2.9 was released in February of 2009.  5.2 is completely retired and 
 out of support.  5.3 is on security-only life-support.  5.4 is the 
 legacy stable release.
 
 Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into 
 this decade.  (GoDaddy apparently doesn't meet that qualification.) 
 You're doing clients a disservice by allowing them to run such an 
 ancient and unsupported version.
 
 --Larry Garfield
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
  

Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread aesbovis
T
hank you, it works now.


On Mon, Aug 19, 2013 at 5:09 PM, Jan Ehrhardt php...@ehrhardt.nl wrote:

 Mihai Anghel in php.general (Mon, 19 Aug 2013 11:30:01 +0300):
 Check this http://www.php.net/manual/en/ini.core.php#ini.post-max-size

 Keyword: max_input_vars.

 Jan

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




-- 
*Anywhere @aesbovis!*


Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread aesbovis
I know Javascript can solve it, but I don't want to use Js.
Thank you all the same.


On Mon, Aug 19, 2013 at 4:32 PM, Szopen Xiao chopins.x...@gmail.com wrote:

 you can use JSON post

 2013/8/19 aesbovis aesbo...@gmail.com:
  Hello there
  I am making a little web-based-tool for our studio to progress a large
  amount of data, more than 2000 items, but it seems there is a length
 limit
  of 1000 to $_POST.
 
  How can I submit all of the items in one time?
 
  Thank you!
  aesbovis
 
  --
  *Anywhere @aesbovis!*




-- 
*Anywhere @aesbovis!*


Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Stuart Dallas
On 19 Aug 2013, at 10:49, aesbovis aesbo...@gmail.com wrote:

 I know Javascript can solve it, but I don't want to use Js.
 Thank you all the same.

I know you've had the right answer, but I think it's worth pointing out that 
use of JSON in no way requires Javascript, despite its name.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

 On Mon, Aug 19, 2013 at 4:32 PM, Szopen Xiao chopins.x...@gmail.com wrote:
 
 you can use JSON post
 
 2013/8/19 aesbovis aesbo...@gmail.com:
 Hello there
 I am making a little web-based-tool for our studio to progress a large
 amount of data, more than 2000 items, but it seems there is a length
 limit
 of 1000 to $_POST.
 
 How can I submit all of the items in one time?
 
 Thank you!
 aesbovis
 
 --
 *Anywhere @aesbovis!*
 
 
 
 
 -- 
 *Anywhere @aesbovis!*


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



Re: [PHP] how old is this version of PHP?

2013-08-19 Thread Lester Caine

Larry Garfield wrote:

5.2.9 was released in February of 2009.  5.2 is completely retired and out of
support.  5.3 is on security-only life-support.  5.4 is the legacy stable 
release.

Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into this
decade.  (GoDaddy apparently doesn't meet that qualification.) You're doing
clients a disservice by allowing them to run such an ancient and unsupported
version.


While the statements are correct, many users are not in a position to move from 
their currently working systems to even 5.3 let alone 5.4. There is still a lot 
of legacy code that unless a few more people step up and help bring it forward 
for the many - non programming - users who are stuck with legacy applications, 
they will remain requiring 5.2 to run. ISPs got caught out when they arbitrarily 
moved accounts forward, and GoDaddy have even been caught by that, so 
maintaining a LTS version of PHP5.2 is the lesser evil ... Windows 2000 is 
supposed to be dead, but *I* still have sites reliant on it because the code and 
hardware is unsupported in even XP. Saying something is dead only works if there 
is an affordable way of moving forward ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



RE: [PHP] how old is this version of PHP?

2013-08-19 Thread Jeff Burcher

I apologize if this is off topic, but this raises a question for me. Why
can't new versions be backwards compatible? Is it really that difficult to
accomplish? This has been a complaint of mine for years with Windows ever
since we went from 95 to 98. I am an AS400 programmer and I have legacy
programs written in RPG II, which died 20 years ago, and they still run fine
on the newest version of AS400 or iSeries or Power System or whatever the
heck it is called now. I also have PHP scripts that are many years old that
work just fine the way they are, if a new version doesn't come along and
make me have to reprogram for no reason just because it can't handle older
code. Really, have Do loops and data calls changed that much over the years?
I mean, all you do is set a condition, use a variable key field, and voila,
data is pulled and processed, no big deal. Yeah, you can get fancy with it,
but the core basics are still the same. I have been programming for over 35
years and like to think that once a program is built it should run forever.
Do we just accept that we have to rewrite every program we ever wrote every
time a new version comes out? A little extreme, but you get my point.
Comments? Suggestions?

(I am also the kind of guy who thinks quality made hand tools from the 1800s
are superior to many purchased today at Lowes or Home Depot.)

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping Works
Making Metal Parts since 1946.


 -Original Message-
 From: Lester Caine [mailto:les...@lsces.co.uk]
 Sent: Monday, August 19, 2013 6:24 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] how old is this version of PHP?
 
 Larry Garfield wrote:
  5.2.9 was released in February of 2009.  5.2 is completely retired and
  out of support.  5.3 is on security-only life-support.  5.4 is the
legacy stable
 release.
 
  Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into
  this decade.  (GoDaddy apparently doesn't meet that qualification.)
  You're doing clients a disservice by allowing them to run such an
  ancient and unsupported version.
 
 While the statements are correct, many users are not in a position to move
 from their currently working systems to even 5.3 let alone 5.4. There is
still a
 lot of legacy code that unless a few more people step up and help bring it
 forward for the many - non programming - users who are stuck with legacy
 applications, they will remain requiring 5.2 to run. ISPs got caught out
when
 they arbitrarily moved accounts forward, and GoDaddy have even been
 caught by that, so maintaining a LTS version of PHP5.2 is the lesser evil
...
 Windows 2000 is supposed to be dead, but *I* still have sites reliant on
it
 because the code and hardware is unsupported in even XP. Saying
 something is dead only works if there is an affordable way of moving
forward
 ;)
 
 --
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
 http://enquirysolve.com/ Model Engineers Digital Workshop -
 http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 



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



Re: [PHP] how old is this version of PHP?

2013-08-19 Thread Sebastian Krebs
2013/8/19 Jeff Burcher j...@allredmetal.com


 I apologize if this is off topic, but this raises a question for me. Why
 can't new versions be backwards compatible? Is it really that difficult to
 accomplish? This has been a complaint of mine for years with Windows ever
 since we went from 95 to 98. I am an AS400 programmer and I have legacy
 programs written in RPG II, which died 20 years ago, and they still run
 fine
 on the newest version of AS400 or iSeries or Power System or whatever the
 heck it is called now. I also have PHP scripts that are many years old that
 work just fine the way they are, if a new version doesn't come along and
 make me have to reprogram for no reason just because it can't handle older
 code. Really, have Do loops and data calls changed that much over the
 years?
 I mean, all you do is set a condition, use a variable key field, and voila,
 data is pulled and processed, no big deal. Yeah, you can get fancy with it,
 but the core basics are still the same. I have been programming for over 35
 years and like to think that once a program is built it should run forever.
 Do we just accept that we have to rewrite every program we ever wrote every
 time a new version comes out? A little extreme, but you get my point.
 Comments? Suggestions?


My 2 cent: I hadn't any major issues with BC since 5.3 and from 5.2 it
required a little bit to do, but was solveable (means: It wasn't
complicated, but only an afternoon time to invest). Caine complaints from
time to time his codebase here. That is nothing new and I am unsure how
representative his statements are.

Regards,
Sebastian



 (I am also the kind of guy who thinks quality made hand tools from the
 1800s
 are superior to many purchased today at Lowes or Home Depot.)

 Thanks,

 Jeff Burcher - IT Dept
 Allred Metal Stamping Works
 Making Metal Parts since 1946.


  -Original Message-
  From: Lester Caine [mailto:les...@lsces.co.uk]
  Sent: Monday, August 19, 2013 6:24 AM
  To: php-general@lists.php.net
  Subject: Re: [PHP] how old is this version of PHP?
 
  Larry Garfield wrote:
   5.2.9 was released in February of 2009.  5.2 is completely retired and
   out of support.  5.3 is on security-only life-support.  5.4 is the
 legacy stable
  release.
  
   Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into
   this decade.  (GoDaddy apparently doesn't meet that qualification.)
   You're doing clients a disservice by allowing them to run such an
   ancient and unsupported version.
 
  While the statements are correct, many users are not in a position to
 move
  from their currently working systems to even 5.3 let alone 5.4. There is
 still a
  lot of legacy code that unless a few more people step up and help bring
 it
  forward for the many - non programming - users who are stuck with legacy
  applications, they will remain requiring 5.2 to run. ISPs got caught out
 when
  they arbitrarily moved accounts forward, and GoDaddy have even been
  caught by that, so maintaining a LTS version of PHP5.2 is the lesser evil
 ...
  Windows 2000 is supposed to be dead, but *I* still have sites reliant on
 it
  because the code and hardware is unsupported in even XP. Saying
  something is dead only works if there is an affordable way of moving
 forward
  ;)
 
  --
  Lester Caine - G8HFL
  -
  Contact - http://lsces.co.uk/wiki/?page=contact
  L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
  http://enquirysolve.com/ Model Engineers Digital Workshop -
  http://medw.co.uk Rainbow Digital Media -
 http://rainbowdigitalmedia.co.uk
 
  --
  PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
  http://www.php.net/unsub.php
 



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




-- 
github.com/KingCrunch


Re: [PHP] how old is this version of PHP?

2013-08-19 Thread Lester Caine

Sebastian Krebs wrote:

Do we just accept that we have to rewrite every program we ever wrote every
time a new version comes out? A little extreme, but you get my point.
Comments? Suggestions?


My 2 cent: I hadn't any major issues with BC since 5.3 and from 5.2 it
required a little bit to do, but was solveable (means: It wasn't
complicated, but only an afternoon time to invest). Caine complaints from
time to time his codebase here. That is nothing new and I am unsure how
representative his statements are.


My 'problem' came about through taking over a couple of small hosting companies 
who had sites across several ISP's and various versions of PHP ( and ASP thrown 
in for good measure ). Every site required a day or so's work to tidy up, and 
little problems thrown in like the ?= cock-up which took down 5 sites when that 
ISP 'upgraded' PHP to the problem version. But the main problem still is making 
things E_STRICT compliant since PHP5.4 tends to be set up with it enabled and 
PHP5.3 will be fazed out on ISP's at some point.


I'm slowly moving sites to servers where I do have control of the framework, but 
'just an afternoons work' across a large number of sites and fire fighting when 
sites go down without prior warning all takes time ... I can't really complain, 
I've been picking up customers who's sites have been affected and earning money 
from them :) I have to say no to a lot though as there are only so many hours in 
a day.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Matijn Woudt
On Mon, Aug 19, 2013 at 11:54 AM, Stuart Dallas stu...@3ft9.com wrote:

 On 19 Aug 2013, at 10:49, aesbovis aesbo...@gmail.com wrote:

  I know Javascript can solve it, but I don't want to use Js.
  Thank you all the same.

 I know you've had the right answer, but I think it's worth pointing out
 that use of JSON in no way requires Javascript, despite its name.

 -Stuart


You might want to explain how you convert form data to JSON without
javascript?


Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Stuart Dallas
On 19 Aug 2013, at 15:56, Matijn Woudt tijn...@gmail.com wrote:

 
 On Mon, Aug 19, 2013 at 11:54 AM, Stuart Dallas stu...@3ft9.com wrote:
 On 19 Aug 2013, at 10:49, aesbovis aesbo...@gmail.com wrote:
 
  I know Javascript can solve it, but I don't want to use Js.
  Thank you all the same.
 
 I know you've had the right answer, but I think it's worth pointing out that 
 use of JSON in no way requires Javascript, despite its name.
 
 -Stuart
 
 
 You might want to explain how you convert form data to JSON without 
 javascript?

PHP can do it. Ruby can do it. .NET can do it. Just because you want to use 
JSON in a web browser where Javascript is the go-to method, doesn't mean JSON 
requires Javascript.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Matijn Woudt
On Mon, Aug 19, 2013 at 5:20 PM, Stuart Dallas stu...@3ft9.com wrote:

 On 19 Aug 2013, at 15:56, Matijn Woudt tijn...@gmail.com wrote:


 On Mon, Aug 19, 2013 at 11:54 AM, Stuart Dallas stu...@3ft9.com wrote:

 On 19 Aug 2013, at 10:49, aesbovis aesbo...@gmail.com wrote:

  I know Javascript can solve it, but I don't want to use Js.
  Thank you all the same.

 I know you've had the right answer, but I think it's worth pointing out
 that use of JSON in no way requires Javascript, despite its name.

 -Stuart


 You might want to explain how you convert form data to JSON without
 javascript?


 PHP can do it. Ruby can do it. .NET can do it. Just because you want to
 use JSON in a web browser where Javascript is the go-to method, doesn't
 mean JSON requires Javascript.

 -Stuart



Yes, of course they can do it, but then you first need to submit the POST
data (which he could not do because of the above). Javascript is more or
less the only way to do it (yes I know Flash)


Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Stuart Dallas
On 19 Aug 2013, at 16:24, Matijn Woudt tijn...@gmail.com wrote:

 On Mon, Aug 19, 2013 at 5:20 PM, Stuart Dallas stu...@3ft9.com wrote:
 On 19 Aug 2013, at 15:56, Matijn Woudt tijn...@gmail.com wrote:
 
 
 On Mon, Aug 19, 2013 at 11:54 AM, Stuart Dallas stu...@3ft9.com wrote:
 On 19 Aug 2013, at 10:49, aesbovis aesbo...@gmail.com wrote:
 
  I know Javascript can solve it, but I don't want to use Js.
  Thank you all the same.
 
 I know you've had the right answer, but I think it's worth pointing out that 
 use of JSON in no way requires Javascript, despite its name.
 
 -Stuart
 
 
 You might want to explain how you convert form data to JSON without 
 javascript?
 
 PHP can do it. Ruby can do it. .NET can do it. Just because you want to use 
 JSON in a web browser where Javascript is the go-to method, doesn't mean JSON 
 requires Javascript.
 
 -Stuart
 
 
 
 Yes, of course they can do it, but then you first need to submit the POST 
 data (which he could not do because of the above). Javascript is more or less 
 the only way to do it (yes I know Flash….)

I wasn't speaking to his specific issue as that was solved by an earlier 
response. I was just commenting that the implied intrinsic link between JSON 
and Javascript in what he had said does not exist.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Tedd Sperling
On Aug 19, 2013, at 11:32 AM, Stuart Dallas stu...@3ft9.com wrote:
 I wasn't speaking to his specific issue as that was solved by an earlier 
 response. I was just commenting that the implied intrinsic link between JSON 
 and Javascript in what he had said does not exist.
 
 -Stuart

This is similar JAVA and JavaScript confusion -- even the college where I teach 
didn't know the difference.

For example, several years ago, they asked me if I could teach Java-JavaScript 
and I answered Sure, which one? The administrator stood there like a dog who 
just heard a high note and replied Yes, we want you to teach Java-JavaScript.

After I explained the difference, her next comment was Which one are you 
certified in?

She went from not knowing the difference to knowing that certification was 
required to teach it (whatever it was).

It's a wonder that anyone receives an education these days.

Cheers,

tedd

___
tedd sperling
tedd.sperl...@gmail.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how old is this version of PHP?

2013-08-19 Thread Larry Garfield
Far too much is made of BC breaks between PHP versions.  Well-behaved 
code should still be working a decade later.


The catch is that well behaved gets tighter each release.  For example:

$foo = hello;
$bar = world;
print $foo[$bar];

In PHP 5.3 and earlier, $bar is a string which makes no sense as an 
index of a string.  It needs to be an int.  PHP therefore casts that to 
an int, gets 0, and you get h.


In PHP 5.4, that was acknowledged as a bug (which it always was), and 
now triggers a Warning.  Because, really, it always was a bug but just 
failed silently before.  Now it tells you so you can fix it.  It looks 
like a BC break, though, because I get an error I didn't used to.


Other things are, eg, removing register_globals and magic_quotes, which 
have been deprecated for about 12 years and if you were still using them 
now then your code should break. :-)  They're a security hole.  But 
those are very few and far between.


--Larry Garfield

On 8/19/13 7:25 AM, Jeff Burcher wrote:


I apologize if this is off topic, but this raises a question for me. Why
can't new versions be backwards compatible? Is it really that difficult to
accomplish? This has been a complaint of mine for years with Windows ever
since we went from 95 to 98. I am an AS400 programmer and I have legacy
programs written in RPG II, which died 20 years ago, and they still run fine
on the newest version of AS400 or iSeries or Power System or whatever the
heck it is called now. I also have PHP scripts that are many years old that
work just fine the way they are, if a new version doesn't come along and
make me have to reprogram for no reason just because it can't handle older
code. Really, have Do loops and data calls changed that much over the years?
I mean, all you do is set a condition, use a variable key field, and voila,
data is pulled and processed, no big deal. Yeah, you can get fancy with it,
but the core basics are still the same. I have been programming for over 35
years and like to think that once a program is built it should run forever.
Do we just accept that we have to rewrite every program we ever wrote every
time a new version comes out? A little extreme, but you get my point.
Comments? Suggestions?

(I am also the kind of guy who thinks quality made hand tools from the 1800s
are superior to many purchased today at Lowes or Home Depot.)

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping Works
Making Metal Parts since 1946.



-Original Message-
From: Lester Caine [mailto:les...@lsces.co.uk]
Sent: Monday, August 19, 2013 6:24 AM
To: php-general@lists.php.net
Subject: Re: [PHP] how old is this version of PHP?

Larry Garfield wrote:

5.2.9 was released in February of 2009.  5.2 is completely retired and
out of support.  5.3 is on security-only life-support.  5.4 is the

legacy stable

release.


Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into
this decade.  (GoDaddy apparently doesn't meet that qualification.)
You're doing clients a disservice by allowing them to run such an
ancient and unsupported version.


While the statements are correct, many users are not in a position to move
from their currently working systems to even 5.3 let alone 5.4. There is

still a

lot of legacy code that unless a few more people step up and help bring it
forward for the many - non programming - users who are stuck with legacy
applications, they will remain requiring 5.2 to run. ISPs got caught out

when

they arbitrarily moved accounts forward, and GoDaddy have even been
caught by that, so maintaining a LTS version of PHP5.2 is the lesser evil

...

Windows 2000 is supposed to be dead, but *I* still have sites reliant on

it

because the code and hardware is unsupported in even XP. Saying
something is dead only works if there is an affordable way of moving

forward

;)

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
http://enquirysolve.com/ Model Engineers Digital Workshop -
http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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







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



Re: [PHP] How can I submit more than 2000 items of data?

2013-08-19 Thread Robert Cummings

On 13-08-19 11:32 AM, Stuart Dallas wrote:

On 19 Aug 2013, at 16:24, Matijn Woudt tijn...@gmail.com wrote:


You might want to explain how you convert form data to JSON without javascript?


PHP can do it. Ruby can do it. .NET can do it. Just because you want to use 
JSON in a web browser where Javascript is the go-to method, doesn't mean JSON 
requires Javascript.

-Stuart



Yes, of course they can do it, but then you first need to submit the POST data 
(which he could not do because of the above). Javascript is more or less the 
only way to do it (yes I know Flash….)


I wasn't speaking to his specific issue as that was solved by an earlier 
response. I was just commenting that the implied intrinsic link between JSON 
and Javascript in what he had said does not exist.


Your post didn't in anyway indicate that your response had nothing to do 
with his problem:


I know you've had the right answer, but I think it's worth
 pointing out that use of JSON in no way requires Javascript,
 despite its name.

As such, given the requirement of POSTing over HTTP(S) and that 
JavaScript is almost certainly more frequently used than ActionScript, I 
think a JSON based solution was at least 50% linked to JavaScript.


:)

Cheers,
Rob
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



[PHP] how old is this version of PHP?

2013-08-17 Thread Tamara Temple
Looking into a problem for someone who is using Godaddy Shared Web Hosting (I 
know..), I noticed the version tag reported by phpinfo is: 


PHP API 20041225
PHP Extension   20060613
Zend Extension  220060519

Just how old is this version of PHP??



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



Re: [PHP] how old is this version of PHP?

2013-08-17 Thread Camilo Sperberg
On 16 aug. 2013, at 19:17, Tamara Temple tamouse.li...@gmail.com wrote:

 Looking into a problem for someone who is using Godaddy Shared Web Hosting (I 
 know..), I noticed the version tag reported by phpinfo is: 
 
 
 PHP API   20041225
 PHP Extension 20060613
 Zend Extension220060519
 
 Just how old is this version of PHP??
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

According to my google search, it should be 5.2.9, so it isn't that old:


http://devzone.zend.com/1442/compiling-php-extensions-with-zend-server/

CD onto the extension's source dir (in our example, the PHP version is 5.2.9 as 
it is the current stable version Zend Server is shipped with):

$ cd /usr/local/zend/share/php-source/php-5.2.9/ext/pspell
Run phpize:

$ /usr/local/zend/bin/phpize
Output should be similar to this:

/Configuring for:
PHP Api Version: 20041225
Zend Module Api No:  20060613
Zend Extension Api No:   220060519/


Greetings.


Met vriendelijke groet,
Camilo Sperberg


W: http://unreal4u.com
T: http://twitter.com/unreal4u


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



Re: [PHP] how old is this version of PHP?

2013-08-17 Thread Tamara Temple

On Aug 17, 2013, at 6:26 PM, Camilo Sperberg unrea...@gmail.com wrote:

 On 16 aug. 2013, at 19:17, Tamara Temple tamouse.li...@gmail.com wrote:
 
 Looking into a problem for someone who is using Godaddy Shared Web Hosting 
 (I know..), I noticed the version tag reported by phpinfo is: 
 
 
 PHP API  20041225
 PHP Extension20060613
 Zend Extension   220060519
 
 Just how old is this version of PHP??
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 According to my google search, it should be 5.2.9, so it isn't that old:
 
 
 http://devzone.zend.com/1442/compiling-php-extensions-with-zend-server/
 
 CD onto the extension's source dir (in our example, the PHP version is 5.2.9 
 as it is the current stable version Zend Server is shipped with):
 
 $ cd /usr/local/zend/share/php-source/php-5.2.9/ext/pspell
 Run phpize:
 
 $ /usr/local/zend/bin/phpize
 Output should be similar to this:
 
 /Configuring for:
 PHP Api Version: 20041225
 Zend Module Api No:  20060613
 Zend Extension Api No:   220060519/

That would be neat if there was any shell access.


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



Re: [PHP] How to upstream code changes to php community

2013-08-16 Thread Daniel Brown
On Tue, Aug 13, 2013 at 12:38 AM, Shahina Rabbani
shahinarabbani.sh...@gmail.com wrote:
 Hi,

 I have done some modifications to the php source code and i tested it with
 php bench and I observed  some improvement.

 I wanted to upstream these code changes to PHP community.
 I searched the wed but i didnt find proper guide to upstream the code to
 php.

 Please help me by  providing the information how to upstream my code
 changes to php  source code community.

Start by subscribing to intern...@lists.php.net and introducing
yourself on that list, which is intended for the discussion of the
ongoing development of the runtime and related things.  You may also
want to hop on EFNet and join #php.pecl, which - like internals@ - is
specifically for discussion of furthering the core development (not
for any time of support).

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



[PHP] How to upstream code changes to php community

2013-08-12 Thread Shahina Rabbani
Hi,

I have done some modifications to the php source code and i tested it with
php bench and I observed  some improvement.

I wanted to upstream these code changes to PHP community.
I searched the wed but i didnt find proper guide to upstream the code to
php.

Please help me by  providing the information how to upstream my code
changes to php  source code community.


Thanks,
Shahina Rabbani


[PHP] how to see all sessions sets in server

2013-08-04 Thread Farzan Dalaee
hi
i want to write online user module for my site and i want to check
$_SESSION['userID'] to find all users id who loged in
but when i echo this code its return only current user detail
how i can see all sessions?

foreach($_SESSION as $k = $v)
{
echo $k.--.$v;
}
 or how i handle online users?


Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Matijn Woudt
On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote:

 hi
 i want to write online user module for my site and i want to check
 $_SESSION['userID'] to find all users id who loged in
 but when i echo this code its return only current user detail
 how i can see all sessions?

 foreach($_SESSION as $k = $v)
 {
 echo $k.--.$v;
 }
  or how i handle online users?


You can only access sessions when you know the session id.
Most sites handle online users in their database, store a timestamp each
time a user loads a page. When you want to display the online users, check
where the timestamp is between now and a few minutes ago. Note that without
javascript (or flash/java/etc) there is no way to truly know if the user
left or not. The session will stay active for a long time, depending on
your php.ini settings.

- Matijn


Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Farzan Dalaee
You mean when user logged in i add new record to table and when logged out i 
delete the row? So if user close the browser without logout how can i find user 
is online or not?

Sent from my iPhone

On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:

 
 
 
 On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee farzan.dal...@gmail.com 
 wrote:
 hi
 i want to write online user module for my site and i want to check
 $_SESSION['userID'] to find all users id who loged in
 but when i echo this code its return only current user detail
 how i can see all sessions?
 
 foreach($_SESSION as $k = $v)
 {
 echo $k.--.$v;
 }
  or how i handle online users?
 
 You can only access sessions when you know the session id.
 Most sites handle online users in their database, store a timestamp each time 
 a user loads a page. When you want to display the online users, check where 
 the timestamp is between now and a few minutes ago. Note that without 
 javascript (or flash/java/etc) there is no way to truly know if the user left 
 or not. The session will stay active for a long time, depending on your 
 php.ini settings.
 
 - Matijn
 


Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Ashley Sheridan
On Sun, 2013-08-04 at 14:56 +0430, Farzan Dalaee wrote:

 You mean when user logged in i add new record to table and when logged out i 
 delete the row? So if user close the browser without logout how can i find 
 user is online or not?
 
 Sent from my iPhone
 
 On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:
 
  
  
  
  On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee farzan.dal...@gmail.com 
  wrote:
  hi
  i want to write online user module for my site and i want to check
  $_SESSION['userID'] to find all users id who loged in
  but when i echo this code its return only current user detail
  how i can see all sessions?
  
  foreach($_SESSION as $k = $v)
  {
  echo $k.--.$v;
  }
   or how i handle online users?
  
  You can only access sessions when you know the session id.
  Most sites handle online users in their database, store a timestamp each 
  time a user loads a page. When you want to display the online users, check 
  where the timestamp is between now and a few minutes ago. Note that without 
  javascript (or flash/java/etc) there is no way to truly know if the user 
  left or not. The session will stay active for a long time, depending on 
  your php.ini settings.
  
  - Matijn
  


Like Matijn said, unless you're using some kind of client-side method to
continually poll the server, you can't know if they've just closed their
browser. There are Javascript events for exiting a page, but they don't
work correctly on Safari and iOS Safari.

You don't have to actually save anything to the DB manually, just
instruct PHP to use the DB for its own sessions, rather than files.

Do you really need to inspect each visitors session in detail, or do you
just need a way to determine how many unique visitors are on the site at
any one time?

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




Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Farzan Dalaee


 On Sun, 2013-08-04 at 14:56 +0430, Farzan Dalaee wrote:
 
 You mean when user logged in i add new record to table and when logged out i 
 delete the row? So if user close the browser without logout how can i find 
 user is online or not?
 
 Sent from my iPhone
 
 On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:
 
  
  
  
  On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee farzan.dal...@gmail.com 
  wrote:
  hi
  i want to write online user module for my site and i want to check
  $_SESSION['userID'] to find all users id who loged in
  but when i echo this code its return only current user detail
  how i can see all sessions?
  
  foreach($_SESSION as $k = $v)
  {
  echo $k.--.$v;
  }
   or how i handle online users?
  
  You can only access sessions when you know the session id.
  Most sites handle online users in their database, store a timestamp each 
  time a user loads a page. When you want to display the online users, check 
  where the timestamp is between now and a few minutes ago. Note that 
  without javascript (or flash/java/etc) there is no way to truly know if 
  the user left or not. The session will stay active for a long time, 
  depending on your php.ini settings.
  
  - Matijn
  
 
 Like Matijn said, unless you're using some kind of client-side method to 
 continually poll the server, you can't know if they've just closed their 
 browser. There are Javascript events for exiting a page, but they don't work 
 correctly on Safari and iOS Safari.
 
 You don't have to actually save anything to the DB manually, just instruct 
 PHP to use the DB for its own sessions, rather than files.
 
 Do you really need to inspect each visitors session in detail, or do you just 
 need a way to determine how many unique visitors are on the site at any one 
 time?
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 
 
 


I need to inspect each visitor to show how online or who offline for chat
Like facebook chat
 


Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Stuart Dallas
On 4 Aug 2013, at 14:36, Farzan Dalaee farzan.dal...@gmail.com wrote:

 I need to inspect each visitor to show how online or who offline for chat
 Like facebook chat

PHP sessions is a really bad mechanism to use to accomplish this. In the past 
I've used memcached or redis for presence indicators. Both allow you to set 
keys that expire after a set period. The problem with this is that a user can 
appear to be online for up to set period seconds longer than they actually 
are.

In the system I'm currently building I've got a node.js daemon to which the 
browser connects. That daemon exposes an API that the rest of the system can 
call to get lists of online users, which is easily gathered since it's just the 
list of connected users. There is then no delay between the browser closing the 
connection and the daemon deciding that user is no longer online.

If you have a chat system I'm curious as to how it works, since presence is 
usually tied closely to how the client is detecting new messages.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Ashley Sheridan


Farzan Dalaee farzan.dal...@gmail.com wrote:


 On Sun, 2013-08-04 at 14:56 +0430, Farzan Dalaee wrote:
 
 You mean when user logged in i add new record to table and when
logged out i delete the row? So if user close the browser without
logout how can i find user is online or not?
 
 Sent from my iPhone
 
 On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:
 
  
  
  
  On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee
farzan.dal...@gmail.com wrote:
  hi
  i want to write online user module for my site and i want to
check
  $_SESSION['userID'] to find all users id who loged in
  but when i echo this code its return only current user detail
  how i can see all sessions?
  
  foreach($_SESSION as $k = $v)
  {
  echo $k.--.$v;
  }
   or how i handle online users?
  
  You can only access sessions when you know the session id.
  Most sites handle online users in their database, store a
timestamp each time a user loads a page. When you want to display the
online users, check where the timestamp is between now and a few
minutes ago. Note that without javascript (or flash/java/etc) there is
no way to truly know if the user left or not. The session will stay
active for a long time, depending on your php.ini settings.
  
  - Matijn
  
 
 Like Matijn said, unless you're using some kind of client-side method
to continually poll the server, you can't know if they've just closed
their browser. There are Javascript events for exiting a page, but they
don't work correctly on Safari and iOS Safari.
 
 You don't have to actually save anything to the DB manually, just
instruct PHP to use the DB for its own sessions, rather than files.
 
 Do you really need to inspect each visitors session in detail, or do
you just need a way to determine how many unique visitors are on the
site at any one time?
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 
 
 


I need to inspect each visitor to show how online or who offline for
chat
Like facebook chat
 

Ah, so you don't need to see the details of the sessions then. Facebook does 
this (badly) by using javascript on the client side which triggers an update of 
a timestamp on the server, which then allows you to determine who is online (or 
was within a given time limit)
Thanks,
Ash

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



Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Matijn Woudt
On Sun, Aug 4, 2013 at 4:00 PM, Ashley Sheridan 
a...@ashleysheridan.co.ukwrote:



 Farzan Dalaee farzan.dal...@gmail.com wrote:
 
 
  On Sun, 2013-08-04 at 14:56 +0430, Farzan Dalaee wrote:
 
  You mean when user logged in i add new record to table and when
 logged out i delete the row? So if user close the browser without
 logout how can i find user is online or not?
 
  Sent from my iPhone
 
  On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:
 
  
  
  
   On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee
 farzan.dal...@gmail.com wrote:
   hi
   i want to write online user module for my site and i want to
 check
   $_SESSION['userID'] to find all users id who loged in
   but when i echo this code its return only current user detail
   how i can see all sessions?
  
   foreach($_SESSION as $k = $v)
   {
   echo $k.--.$v;
   }
or how i handle online users?
  
   You can only access sessions when you know the session id.
   Most sites handle online users in their database, store a
 timestamp each time a user loads a page. When you want to display the
 online users, check where the timestamp is between now and a few
 minutes ago. Note that without javascript (or flash/java/etc) there is
 no way to truly know if the user left or not. The session will stay
 active for a long time, depending on your php.ini settings.
  
   - Matijn
  
 
  Like Matijn said, unless you're using some kind of client-side method
 to continually poll the server, you can't know if they've just closed
 their browser. There are Javascript events for exiting a page, but they
 don't work correctly on Safari and iOS Safari.
 
  You don't have to actually save anything to the DB manually, just
 instruct PHP to use the DB for its own sessions, rather than files.
 
  Do you really need to inspect each visitors session in detail, or do
 you just need a way to determine how many unique visitors are on the
 site at any one time?
 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 
 
 I need to inspect each visitor to show how online or who offline for
 chat
 Like facebook chat
 

 Ah, so you don't need to see the details of the sessions then. Facebook
 does this (badly) by using javascript on the client side which triggers an
 update of a timestamp on the server, which then allows you to determine who
 is online (or was within a given time limit)
 Thanks,
 Ash


Maybe it's bad, but there's no good alternative, except sending ping
requests to your server every second or so, but any site as large as
Facebook will DDOS itself when using things like that ;)

- Matijn


Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Farzan Dalaee


 
 
 
 On Sun, Aug 4, 2013 at 4:00 PM, Ashley Sheridan a...@ashleysheridan.co.uk 
 wrote:
 
 
 Farzan Dalaee farzan.dal...@gmail.com wrote:
 
 
  On Sun, 2013-08-04 at 14:56 +0430, Farzan Dalaee wrote:
 
  You mean when user logged in i add new record to table and when
 logged out i delete the row? So if user close the browser without
 logout how can i find user is online or not?
 
  Sent from my iPhone
 
  On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:
 
  
  
  
   On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee
 farzan.dal...@gmail.com wrote:
   hi
   i want to write online user module for my site and i want to
 check
   $_SESSION['userID'] to find all users id who loged in
   but when i echo this code its return only current user detail
   how i can see all sessions?
  
   foreach($_SESSION as $k = $v)
   {
   echo $k.--.$v;
   }
or how i handle online users?
  
   You can only access sessions when you know the session id.
   Most sites handle online users in their database, store a
 timestamp each time a user loads a page. When you want to display the
 online users, check where the timestamp is between now and a few
 minutes ago. Note that without javascript (or flash/java/etc) there is
 no way to truly know if the user left or not. The session will stay
 active for a long time, depending on your php.ini settings.
  
   - Matijn
  
 
  Like Matijn said, unless you're using some kind of client-side method
 to continually poll the server, you can't know if they've just closed
 their browser. There are Javascript events for exiting a page, but they
 don't work correctly on Safari and iOS Safari.
 
  You don't have to actually save anything to the DB manually, just
 instruct PHP to use the DB for its own sessions, rather than files.
 
  Do you really need to inspect each visitors session in detail, or do
 you just need a way to determine how many unique visitors are on the
 site at any one time?
 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 
 
 I need to inspect each visitor to show how online or who offline for
 chat
 Like facebook chat
 
 
 Ah, so you don't need to see the details of the sessions then. Facebook does 
 this (badly) by using javascript on the client side which triggers an update 
 of a timestamp on the server, which then allows you to determine who is 
 online (or was within a given time limit)
 Thanks,
 Ash
 
 Maybe it's bad, but there's no good alternative, except sending ping requests 
 to your server every second or so, but any site as large as Facebook will 
 DDOS itself when using things like that ;)
 
 - Matijn 

So best way is use a script(javascript) to send ajax to server every 5 second 
to check users is logged in or not? Is that okey?
I want to write chat module like facebook and i need a solution to find online 
users and way to send messages when users chat together, does any one write 
similar module like that?



Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Ashley Sheridan


Matijn Woudt tijn...@gmail.com wrote:
On Sun, Aug 4, 2013 at 4:00 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:



 Farzan Dalaee farzan.dal...@gmail.com wrote:
 
 
  On Sun, 2013-08-04 at 14:56 +0430, Farzan Dalaee wrote:
 
  You mean when user logged in i add new record to table and when
 logged out i delete the row? So if user close the browser without
 logout how can i find user is online or not?
 
  Sent from my iPhone
 
  On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:
 
  
  
  
   On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee
 farzan.dal...@gmail.com wrote:
   hi
   i want to write online user module for my site and i want to
 check
   $_SESSION['userID'] to find all users id who loged in
   but when i echo this code its return only current user detail
   how i can see all sessions?
  
   foreach($_SESSION as $k = $v)
   {
   echo $k.--.$v;
   }
or how i handle online users?
  
   You can only access sessions when you know the session id.
   Most sites handle online users in their database, store a
 timestamp each time a user loads a page. When you want to display
the
 online users, check where the timestamp is between now and a few
 minutes ago. Note that without javascript (or flash/java/etc) there
is
 no way to truly know if the user left or not. The session will stay
 active for a long time, depending on your php.ini settings.
  
   - Matijn
  
 
  Like Matijn said, unless you're using some kind of client-side
method
 to continually poll the server, you can't know if they've just
closed
 their browser. There are Javascript events for exiting a page, but
they
 don't work correctly on Safari and iOS Safari.
 
  You don't have to actually save anything to the DB manually, just
 instruct PHP to use the DB for its own sessions, rather than files.
 
  Do you really need to inspect each visitors session in detail, or
do
 you just need a way to determine how many unique visitors are on the
 site at any one time?
 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 
 
 I need to inspect each visitor to show how online or who offline for
 chat
 Like facebook chat
 

 Ah, so you don't need to see the details of the sessions then.
Facebook
 does this (badly) by using javascript on the client side which
triggers an
 update of a timestamp on the server, which then allows you to
determine who
 is online (or was within a given time limit)
 Thanks,
 Ash


Maybe it's bad, but there's no good alternative, except sending ping
requests to your server every second or so, but any site as large as
Facebook will DDOS itself when using things like that ;)

- Matijn

I'm not saying the method is bad, but the way Facebook does it isn't great, I'm 
constantly seeing people online who sign out when I open up a message box. 
Now that might be genuine, but I'm not *that* unpopular! 

Thanks,
Ash

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



Re: [PHP] how to see all sessions sets in server

2013-08-04 Thread Paul M Foster
On Sun, Aug 04, 2013 at 05:58:53PM +0100, Ashley Sheridan wrote:

[snip]

 
 I'm not saying the method is bad, but the way Facebook does it isn't
 great, I'm constantly seeing people online who sign out when I open
 up a message box. Now that might be genuine, but I'm not *that*
 unpopular! 

I'm sorry. Were you saying something? As soon as I saw Ashley Sheridan
in my email client, it closed and my computer rebooted for some strange
reason. ;-}

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

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



[PHP] How to delete 3 months old records in my database?

2013-08-02 Thread Karl-Arne Gjersøyen
Hello again, folks!
I wish to delete records in my database that is older than 3 months.

$todays_date = date('Y-m-d');
$old_records_to_delete =  ???

if($old_records_to_delete){
include(connect.php);
$sql = DELETE FROM table WHERE date = '$old_records_to_delete';
mysql_query($sql, $connect_db) or die(mysql_error());
}

Thank you very much for your help to understand also this question :)

Karl


Re: [PHP] How to delete 3 months old records in my database?

2013-08-02 Thread Dušan Novaković
$query = DELECT FROM `__table_name__` WHERE `__date__` BETWEEN NOW() -
INTERVAL 3 MONTH AND NOW()


On Fri, Aug 2, 2013 at 12:58 PM, Karl-Arne Gjersøyen karlar...@gmail.comwrote:

 Hello again, folks!
 I wish to delete records in my database that is older than 3 months.

 $todays_date = date('Y-m-d');
 $old_records_to_delete =  ???

 if($old_records_to_delete){
 include(connect.php);
 $sql = DELETE FROM table WHERE date = '$old_records_to_delete';
 mysql_query($sql, $connect_db) or die(mysql_error());
 }

 Thank you very much for your help to understand also this question :)

 Karl




-- 
mob:   + 46 7 230 230 19
web:   http://novakovicdusan.com

Please consider the environment before printing this email.


Re: [PHP] How to delete 3 months old records in my database?

2013-08-02 Thread Simon Griffiths
Hello,

Try something like:

$oldDate = new DateTime();
$oldDate-sub(new DateInterval('P3M'));
$old_records_to_delete = $oldDate-format('Y-m-d');


Hope this helps,

Si

Sent from my iPhone

On 2 Aug 2013, at 11:58, Karl-Arne Gjersøyen karlar...@gmail.com wrote:

 Hello again, folks!
 I wish to delete records in my database that is older than 3 months.
 
 $todays_date = date('Y-m-d');
 $old_records_to_delete =  ???
 
 if($old_records_to_delete){
 include(connect.php);
 $sql = DELETE FROM table WHERE date = '$old_records_to_delete';
 mysql_query($sql, $connect_db) or die(mysql_error());
 }
 
 Thank you very much for your help to understand also this question :)
 
 Karl

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



Re: [PHP] How to delete 3 months old records in my database?

2013-08-02 Thread Karl-Arne Gjersøyen
2013/8/2 Dušan Novaković ndu...@gmail.com

 $query = DELECT FROM `__table_name__` WHERE `__date__` BETWEEN NOW() -
 INTERVAL 3 MONTH AND NOW()


This delete everything from now and 3months backwards. I want to store 3
months from now and delete OLDER than 3 months old records.

Karl


Re: [PHP] How to delete 3 months old records in my database?

2013-08-02 Thread Simon Schick
On Fri, Aug 2, 2013 at 2:02 PM, Karl-Arne Gjersøyen karlar...@gmail.com wrote:

 2013/8/2 Dušan Novaković ndu...@gmail.com

  $query = DELECT FROM `__table_name__` WHERE `__date__` BETWEEN NOW() -
  INTERVAL 3 MONTH AND NOW()
 

 This delete everything from now and 3months backwards. I want to store 3
 months from now and delete OLDER than 3 months old records.

 Karl

Hi, Karl

You're right, but restructuring, to get it the way you want, isn't be
that hard, is it? :)

$query = DELETE FROM `__table_name__` WHERE `__date__`  NOW() -
INTERVAL 3 MONTH

@Dusan,
Btw: What is DELECT? I assume it should've been DELETE, right?

Bye
Simon

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



Re: [PHP] How to delete 3 months old records in my database?

2013-08-02 Thread Dušan Novaković
Yeah, just spelling mistake :-)
And yes, it should be:

$query = DELETE FROM `__table_name__` WHERE `__date__` = NOW() - INTERVAL
3 MONTH


Cheers ;-)


On Fri, Aug 2, 2013 at 2:35 PM, Simon Schick simonsimc...@gmail.com wrote:

 On Fri, Aug 2, 2013 at 2:02 PM, Karl-Arne Gjersøyen karlar...@gmail.com
 wrote:
 
  2013/8/2 Dušan Novaković ndu...@gmail.com
 
   $query = DELECT FROM `__table_name__` WHERE `__date__` BETWEEN NOW() -
   INTERVAL 3 MONTH AND NOW()
  
 
  This delete everything from now and 3months backwards. I want to store 3
  months from now and delete OLDER than 3 months old records.
 
  Karl

 Hi, Karl

 You're right, but restructuring, to get it the way you want, isn't be
 that hard, is it? :)

 $query = DELETE FROM `__table_name__` WHERE `__date__`  NOW() -
 INTERVAL 3 MONTH

 @Dusan,
 Btw: What is DELECT? I assume it should've been DELETE, right?

 Bye
 Simon

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




-- 
mob:   + 46 7 230 230 19
web:   http://novakovicdusan.com

Please consider the environment before printing this email.


Re: [PHP] How to extract php source code from joomla

2013-07-23 Thread Yoinier Hernandez Nieves

El 22/07/13 15:49, elk dolk escribió:

Thank you for the quick response ! What I am trying to do : I have to complete 
two university projects for

  my professor !

project One  : Make an online shop and must use the following components in it


Shopping cart, Catalog of products, payment gateway , user login and user 
activity log .

You can use Prestashop, Magento, Oscommerce, etc, and modify at you're 
needed.


project Two : Implementing of a B2B sell-side portal with negotiation mechanism.


You can modify above softwares to this purpose.

Thanks

As I am familiar with php and My.SQL and I have only 20 days to complete those 
projects !  I thought it's
(...)

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




--
_.___.  .__
\__  |   |  |__| ___  __    __
 /   |   |/\|  |/ __ \  \/ // __ \ /  ___/
 \   |   |  \  \  ___/\   /\  ___/ \___ \
 / __|___|  /__|\___  \_/  \___    
 \/   \/\/  \/ \/
.___  __   ___  __
  __| _/_/  |_ \  \   _/  |_
 / __ |/  _ \   __\/   |   \_/ __ \   __\
/ /_/ (  _ )  | /|\  ___/|  |
\ |\/|__| \|__  /\___  __|
 \/   \/ \/

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



Re: [PHP] How to extract php source code from joomla

2013-07-23 Thread richard gray

On 23/07/2013 16:54, Yoinier Hernandez Nieves wrote:

El 22/07/13 15:49, elk dolk escribió:
Thank you for the quick response ! What I am trying to do : I have to 
complete two university projects for


  my professor !

project One  : Make an online shop and must use the following 
components in it



Shopping cart, Catalog of products, payment gateway , user login and 
user activity log .


You can use Prestashop, Magento, Oscommerce, etc, and modify at you're 
needed.
IMO do NOT use Oscommerce (or the ZenCart fork for that matter) ... 
unless you want a lesson in how not to write an application in PHP... 
the code and architecture is (well it was the last time I had the 
dubious pleasure of working with it...) truly awful


Rich

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



[PHP] How to extract php source code from joomla

2013-07-22 Thread elk dolk
Hi all,
I want to build a website using Joomla 2.5 . It should have 5 pages:

index.php
pageOne.php
pageTwo.php
...

How can I get the php source code for those pages?

I installed joomla 2.5 on my windows box and use XAMPP's appache web server 
thanks


Re: [PHP] How to extract php source code from joomla

2013-07-22 Thread Ashley Sheridan
On Mon, 2013-07-22 at 12:18 -0700, elk dolk wrote:

 Hi all,
 I want to build a website using Joomla 2.5 . It should have 5 pages:
 
 index.php
 pageOne.php
 pageTwo.php
 ...
 
 How can I get the php source code for those pages?
 
 I installed joomla 2.5 on my windows box and use XAMPP's appache web server 
 thanks


Erm, Joomla is a CMS, which means that you don't have source code for
individual pages like that. If you want, you don't have to get involved
with the PHP at all in Joomla. What is it that you're actually trying to
achieve?

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




[PHP] How to extract php source code from joomla

2013-07-22 Thread elk dolk
Thank you for the quick response ! What I am trying to do : I have to complete 
two university projects for

 my professor !

project One  : Make an online shop and must use the following components in it 


Shopping cart, Catalog of products, payment gateway , user login and user 
activity log .


project Two : Implementing of a B2B sell-side portal with negotiation mechanism.

As I am familiar with php and My.SQL and I have only 20 days to complete those 
projects !  I thought it's 

better to use Joomla I'll be grateful if you can give me an advice 


thank you


- Forwarded Message -
From: Ashley Sheridan a...@ashleysheridan.co.uk
To: elk dolk elkd...@yahoo.com 
Cc: php-general@lists.php.net php-general@lists.php.net 
Sent: Monday, July 22, 2013 11:45 PM
Subject: Re: [PHP] How to extract php source code from joomla
 

On Mon, 2013-07-22 at 12:18 -0700, elk dolk wrote:

 Hi all,
 I want to build a website using Joomla 2.5 . It should have 5 pages:
 
 index.php
 pageOne.php
 pageTwo.php
 ...
 
 How can I get the php source code for those pages?
 
 I installed joomla 2.5 on my windows box and use XAMPP's appache web server 
 thanks


Erm, Joomla is a CMS, which means that you don't have source code for
individual pages like that. If you want, you don't have to get involved
with the PHP at all in Joomla. What is it that you're actually trying to
achieve?

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

Re: [PHP] How to extract php source code from joomla

2013-07-22 Thread Ashley Sheridan
On Mon, 2013-07-22 at 12:49 -0700, elk dolk wrote:

 Thank you for the quick response ! What I am trying to do : I have to 
 complete two university projects for
 
  my professor !
 
 project One  : Make an online shop and must use the following components in 
 it 
 
 
 Shopping cart, Catalog of products, payment gateway , user login and user 
 activity log .
 
 
 project Two : Implementing of a B2B sell-side portal with negotiation 
 mechanism.
 
 As I am familiar with php and My.SQL and I have only 20 days to complete 
 those projects !  I thought it's 
 
 better to use Joomla I'll be grateful if you can give me an advice 
 
 
 thank you
 
 
 - Forwarded Message -
 From: Ashley Sheridan a...@ashleysheridan.co.uk
 To: elk dolk elkd...@yahoo.com 
 Cc: php-general@lists.php.net php-general@lists.php.net 
 Sent: Monday, July 22, 2013 11:45 PM
 Subject: Re: [PHP] How to extract php source code from joomla
  
 
 On Mon, 2013-07-22 at 12:18 -0700, elk dolk wrote:
 
  Hi all,
  I want to build a website using Joomla 2.5 . It should have 5 pages:
  
  index.php
  pageOne.php
  pageTwo.php
  ...
  
  How can I get the php source code for those pages?
  
  I installed joomla 2.5 on my windows box and use XAMPP's appache web server 
  thanks
 
 
 Erm, Joomla is a CMS, which means that you don't have source code for
 individual pages like that. If you want, you don't have to get involved
 with the PHP at all in Joomla. What is it that you're actually trying to
 achieve?
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk


20 days seems awfully ambitious, does your professor expect you to code
these by hand or are you allowed to use an existing CMS, I ask because
your original question seemed a bit odd.

For e-commerce you're better off choosing a CMS which does that out of
the box. Joomla has plugins that allow you to do these things, but it
can be a hefty CMS, and it's not particularly suited for shops, plus it
has a bit of a learning curve and some large security holes (which I
know first hand having had to just get a Joomla site to pass a rigorous
security test)

Lastly, please try not to top post :)

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




[PHP] How to extract php source code from joomla

2013-07-22 Thread elk dolk
I am allowed to use tools or code by hand , it does not matter ,the professor 
wants to have the source code.





Re: [PHP] How to extract php source code from joomla

2013-07-22 Thread Ashley Sheridan
On Mon, 2013-07-22 at 13:10 -0700, elk dolk wrote:

 I am allowed to use tools or code by hand , it does not matter ,the professor 
 wants to have the source code.
 
 
 
 


You say tools, but would he consider a full-blown complex CMS as merely
a tool, or not? At this point, I agree, your best option is probably a
CMS with plugins, because 20 days is not much time to build that sort of
thing, and that's coming from someone who develops in PHP for a living.

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




Re: [PHP] How to extract php source code from joomla

2013-07-22 Thread Tedd Sperling
On Jul 22, 2013, at 3:49 PM, elk dolk elkd...@yahoo.com wrote:
 Thank you for the quick response ! What I am trying to do : I have to 
 complete two university projects for
 
  my professor !
 
 project One  : Make an online shop and must use the following components in 
 it 
 
 
 Shopping cart, Catalog of products, payment gateway , user login and user 
 activity log .
 
 
 project Two : Implementing of a B2B sell-side portal with negotiation 
 mechanism.
 
 As I am familiar with php and My.SQL and I have only 20 days to complete 
 those projects !  I thought it's 
 
 better to use Joomla I'll be grateful if you can give me an advice 
 
 
 thank you
 

Sounds more like a client than someone who teaches php.

I couldn't do that from scratch in 20 days and I teach php at college level. 
That's more than my entire 16 weeks course of introductory php. Are you in an 
advanced class?

tedd

_
tedd.sperl...@gmail.com
http://sperling.com

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



[PHP] How to extract php source code from joomla

2013-07-22 Thread elk dolk


I study for MSc degree at university.




 Are you in an advanced class?

[PHP] How to read PHP-FPM config values using phpinfo

2013-07-16 Thread Amiya Maji

Hi all,

I am using PHP-FPM with Apache 2.4. I periodically change my 
php-fpm.conf and reload it by sending USR2 signal to the FPM process. Is 
there a way to print the updated parameters in FPM using phpinfo().
At present I am not seeing any FPM specific parameters in phpinfo. Any 
suggestion is appreciated.


Thanks!
Amiya.

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



Re: [PHP] How to read PHP-FPM config values using phpinfo

2013-07-16 Thread Daniel
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

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


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



Re: [PHP] How to read PHP-FPM config values using phpinfo

2013-07-16 Thread Amiya Maji
Daniel, thanks for asking. 
I do have Apache correctly configured to use fpm, in fact, phpinfo shows 
php-fpm as the cgi module. Only problem is to read (or dump) the Fpm configs 
from phpinfo.

Regards,
Amiya.




 Original message 
From: Daniel danielx...@gmail.com 
Date: 07/16/2013  9:48 PM  (GMT-05:00) 
To: Amiya Maji am...@purdue.edu 
Cc: php-general@lists.php.net 
Subject: Re: [PHP] How to read PHP-FPM config values using phpinfo 
 
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

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



[PHP] How to enable cURL php extension on Debian Wheezy?

2013-06-01 Thread Csanyi Pal
Hi,

I just upgraded Squeeze to Wheezy, and have difficulties with cURL PHP
extension: I can't enable it.

I have installed following packages related to this issue:
curl, libcurl3, libcurl3-gnutls, php5-curl.

I have in
/etc/php5/mods-available/curl.ini
; configuration for php CURL module
; priority=20
extension=curl.so

I know that cURL extension is not enabled because I want to install
Moodle and it complains about cURL extension.

How can I solve this problem?

-- 
Regards from Pal


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



Re: [PHP] How to enable cURL php extension on Debian Wheezy?

2013-06-01 Thread Adam Szewczyk
On Sat, Jun 01, 2013 at 09:41:33PM +0200, Csanyi Pal wrote:
 Hi,
 
 I just upgraded Squeeze to Wheezy, and have difficulties with cURL PHP
 extension: I can't enable it.
 
 I have installed following packages related to this issue:
 curl, libcurl3, libcurl3-gnutls, php5-curl.
 
 I have in
 /etc/php5/mods-available/curl.ini
 ; configuration for php CURL module
 ; priority=20
 extension=curl.so
 
 I know that cURL extension is not enabled because I want to install
 Moodle and it complains about cURL extension.
 
 How can I solve this problem?

Hi,

what error message do you get?

Also, have you restarted apache after installing the extension?

Regards,
A.

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



Re: [PHP] How to enable cURL php extension on Debian Wheezy?

2013-06-01 Thread Adam Szewczyk
On Sat, Jun 01, 2013 at 09:41:33PM +0200, Csanyi Pal wrote:
 Hi,
 
 I just upgraded Squeeze to Wheezy, and have difficulties with cURL PHP
 extension: I can't enable it.
 
 I have installed following packages related to this issue:
 curl, libcurl3, libcurl3-gnutls, php5-curl.
 
 I have in
 /etc/php5/mods-available/curl.ini
 ; configuration for php CURL module
 ; priority=20
 extension=curl.so
 
 I know that cURL extension is not enabled because I want to install
 Moodle and it complains about cURL extension.
 
 How can I solve this problem?

Hi,

what error message do you get?

Also, have you restarted apache after installing the extension?

Regards,
A.

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



Re: [PHP] How to enable cURL php extension on Debian Wheezy?

2013-06-01 Thread Tamara Temple
Csanyi Pal csanyi...@gmail.com wrote:
 I have installed following packages related to this issue:
 curl, libcurl3, libcurl3-gnutls, php5-curl.

All good.

 I have in
 /etc/php5/mods-available/curl.ini
 ; configuration for php CURL module
 ; priority=20
 extension=curl.so

Have you enabled the extension as well? That looks like the standard
set-up, which means that curl.ini is available, but you still have to
enable it. Check in /etc/php5/conf.d to see if there's a symlink in
there, otherwise look through the various bits to see if it's included
somewhere in one of the stock php.ini files.

Here's an example from one of my servers:

tamara@gandimouse /etc/php5$ ll mods-available/
total 4.0K
-rw-r--r-- 1 root root 66 Sep 15  2012 pdo.ini

tamara@gandimouse /etc/php5$ ll conf.d/
total 0
lrwxrwxrwx 1 root root 25 Sep 24  2012 10-pdo.ini - ../mods-available/pdo.ini

If you make changes here, ensure you restart your sever.


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



Re: [PHP] How do I remove a string from another string in a fuzzy way?

2013-05-21 Thread Tedd Sperling
On May 20, 2013, at 10:17 PM, Daevid Vincent dae...@daevid.com wrote:
Initially I was thinking that somehow I could use a simple regex on the
 needle and haystacks to strip out all white space and str_ireplace() them
 that way, but then I don't have a way to put the whitespace back that I can
 see.

Daevid:

Go ahead and strip out the whitespace, but replace it with a delimiter string 
that is unique and then don't consider that delimiter when comparing strings to 
strings.

Afterwards, if you want to keep the string (instead of deleting it), then 
reverse the process adding back in the whitespace and removing the delimiter.

Also, you may want to look into using array_unique() for comparing groupings of 
several strings (i.e., paragraphs) to other groupings. It works pretty slick 
for me.

Cheers,

tedd

_
tedd.sperl...@gmail.com
http://sperling.com


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



[PHP] How do I remove a string from another string in a fuzzy way?

2013-05-20 Thread Daevid Vincent
We have a support ticket system we built and customers can reply via email
which then posts their reply into our database. The problem is that when you
read a ticket, you see each ticket entry (row in DB) but they tend to
accumulate the previous entries text since the customer replied to an email.
A thread if you will.

I'm trying to strip out the duplicate parts (cosmetically on the front end
via a checkbox, in case the support person needs to see the actual unaltered
version such as in cases where the algorithm may be too aggressive and rip
out important pieces inadvertently).

One challenge I'm running into are situations like this, where the text is
embedded but has been slightly altered.

ENTRY 1:

For security and confidentiality reasons, we request that all subscribers
who are requesting cancellation do so via the website of the company billing
their account. You can easily cancel your membership on our billing agent
website

(just in case THIS PHP list software mangles the above, it is just one long
string with no CR breaks as the ones below have)

ENTRY 2: (which was mangled by the customer's email client most likely and
formatted for 72 chars)

For security and confidentiality reasons, we request that all
subscribers who are requesting cancellation do so via the website of
the company billing their account. You can easily cancel your 
membership on our billing agent website

This is a simple example, but the solution logic might extend to other
things such as perhaps a prefix like so:

ENTRY 3: (again mangled by email client to prefix with  marks)

 For security and confidentiality reasons, we request that all
 subscribers who are requesting cancellation do so via the website of
 the company billing their account. You can easily cancel your 
 membership on our billing agent website

Keep in mind those blobs of text are often embedded inside other text which
I *do* want to display.

Initially I was thinking that somehow I could use a simple regex on the
needle and haystacks to strip out all white space and str_ireplace() them
that way, but then I don't have a way to put the whitespace back that I can
see.

Currently I'm just sort of brute forcing it and comparing the current
message to previous ones and if the previous message is found in this
message, then blank it out. But this only works of course if they are
identical.

?php
$i = 0;

//the initial ticket message is in a different table than the replies
hereafter
$entry_message[$i] = $my_ticket-get_message(false); 

foreach($my_ticket-get_entries() as $eid = $entry) 
{ 
$i++;
$output_message = $entry_message[$i] = trim($entry['message']);
//var_dump('OUTPUT MESSAGE:', $output_message);

for ($j = ($i - 1); $j = 0; --$j)
{
//echo \nbrfont color='green'bsearching for
entry_message[$j] in [i = $i]:/bbr\n$output_message/fontbr\n;
$output_message = str_replace($entry_message[$j], '',
$output_message);
//var_dump('NEW OUTPUT MESSAGE:', $output_message);
}

( ^ you have to start from the bottom up like that or else you have altered
your $output_message so subsequent matches fail ^ )

Would these be helpful? 

http://us2.php.net/manual/en/function.similar-text.php
http://us2.php.net/manual/en/function.levenshtein.php
http://us2.php.net/manual/en/function.soundex.php
http://us2.php.net/manual/en/function.metaphone.php

It seems like similar_text() could be, and if it's a high percentage,
consider it a match, but then how do I extract that part from the source
string, since str_replace() requires an exact match, not fuzzy.

I am also thinking maybe something with preg_replace() where I break up the
source string and take the first word(s) and last word(s) and use .*? in
between, but that has its' own challenges for example...

  /For .*? website/

On this text doesn't do the match I really want (it stops on the second
line)...

  For security and confidentiality reasons, we request that all
  subscribers who are requesting cancellation do so via the website of
  the company billing their account. You can easily cancel your 
  membership on our billing agent website
  More stuff goes here website

By putting more words before and after the .*? I could get better accuracy,
but that is starting to feel hacky or fragile somehow.



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



Re: [PHP] How do I remove a string from another string in a fuzzy way?

2013-05-20 Thread shiplu
Is your ticketing system written from scratch? Because such type of logic
is already implemented in existing help desk softwares.

I think you can also use a specific string in your email to define which
part goes in ticket and which part not. For example, you can include
PLEASE REPLY ABOVE THIS LINE\r\n in each of the email. When reply comes
you can split the whole email with this string and get the first part as
original reply.


-- 
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader


RE: [PHP] How do I remove a string from another string in a fuzzy way?

2013-05-20 Thread Daevid Vincent


 -Original Message-
 From: muquad...@gmail.com [mailto:muquad...@gmail.com] On Behalf Of shiplu
 Sent: Monday, May 20, 2013 9:03 PM
 To: Daevid Vincent
 Cc: php-general General List
 Subject: Re: [PHP] How do I remove a string from another string in a fuzzy
 way?
 
 Is your ticketing system written from scratch? Because such type of logic
 is already implemented in existing help desk softwares.

Yes written from scratch years ago.

 I think you can also use a specific string in your email to define which
 part goes in ticket and which part not. For example, you can include
 PLEASE REPLY ABOVE THIS LINE\r\n in each of the email. When reply comes
 you can split the whole email with this string and get the first part as
 original reply.

We have like 20,000 tickets in there already. Asking the users (who are not the 
brightest people on the planet to begin with given the vast majority of tickets 
I've encountered. Most don't read simple instructions as it is and many don't 
even speak Engrish) to follow some instructions is probably not going to work. 
And even if it did, that doesn't solve the problem for previous tickets.


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



[PHP] how to insert html code with PHP

2013-04-11 Thread Rafnews

Hi,

I would like to insert a piece of HTML code inside several pages.
all pages are differently named.

i need in each page to find a particular tag, let's say div 
id=#submenu.../div (so based on its ID and tagname) and inside it 
to insert my PHP/HTML code.


how can i do that ?

thx.

A.

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



Re: [PHP] how to insert html code with PHP

2013-04-11 Thread tamouse mailing lists
On Apr 11, 2013 6:35 AM, Rafnews raf.n...@gmail.com wrote:

 Hi,

 I would like to insert a piece of HTML code inside several pages.
 all pages are differently named.

 i need in each page to find a particular tag, let's say div
id=#submenu.../div (so based on its ID and tagname) and inside it to
insert my PHP/HTML code.

 how can i do that ?

I am a little confused. If you want to insert the same bit of code in a php
file, use the include function.

If you need to do same thing across a number of pages, you probably have
found a spot to refactor your code.

If your talking about inserting it in real time in the client's browser,
you want jQuery/AJAX for that, not php.

(php can serve up the HTML in response to an AJAX request, though)


 thx.

 A.

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



[PHP] How can I make PHP CodeSniffer Fixer ignore the namespace declaration?

2013-03-12 Thread Norah Jones
I am using the sublime text 2 plugin for PHP Coding Standards Fixer. It is 
working fine, except for the fact that it considers the namespace invalid (it 
is in fact invalid and I'm okay with it). this errors halts the script from 
correcting the rest of the file. I get the following error:


The namespace Application\Controllers\Admin in  does not match the file 
path according to PSR-0 rules.

How can I tell the the script to ignore the namespace constraint. Both command 
line arguments and Sublime text 2 user settings can be changed.



Re: [PHP] How can I make PHP CodeSniffer Fixer ignore the namespace declaration?

2013-03-12 Thread ma...@behnke.biz
 Norah Jones nh.jone...@gmail.com hat am 12. März 2013 um 15:18 geschrieben:

 I am using the sublime text 2 plugin for PHP Coding Standards Fixer. It is
 working fine, except for the fact that it considers the namespace invalid (it
 is in fact invalid and I'm okay with it). this errors halts the script from
 correcting the rest of the file. I get the following error:

 The namespace Application\Controllers\Admin in  does not match the file
 path according to PSR-0 rules.

 How can I tell the the script to ignore the namespace constraint. Both command
 line arguments and Sublime text 2 user settings can be changed.

Have you looked at the configuration options? Do they help?

https://github.com/fabpot/PHP-CS-Fixer



--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

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



Re: [PHP] how to calculate how much data does each ip address use ?

2013-02-06 Thread Aaron Holmes

No one has mentioned Cacti yet? It does exactly what Bulent is looking for.

http://cacti.net/

On 2/5/13 6:46 PM, Sean Greenslade wrote:

On Tue, Feb 5, 2013 at 10:13 AM, Bulent  Malik bma...@ihlas.net.tr wrote:



This task is not really suited for php. I would suggest looking into

Ntop.

It does exactly what you described.

Hello

I have  a freebsdbox firewall . also I have some internet customers.
I want to save how much data they used in a table ( such as mysql
table ) for each ip address.
Apache2, php5 and mysql5.5 work on the box.

How can I do it ?  any script or tool.

Thanks

How can i save in table using ntop ?  is there any document ?


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

Read the man pages. There are sql export options that you can specify on run.

I could not see any sql options on  the man file of ntop.
Where is it?




Whoops, my mistake. I was reading the NetFlow documentation and going
off vague memories of older versions of Ntop.

Ntop saves data in RRD files. There are PHP libraries to parse this
data [1]. You could theoretically scrape the RRDs and put them in a
SQL DB, but they may be useful enough on their own if you can parse
them correctly. (Note: I have never personally parsed RRDs manually.
This info was pulled from a simple Google search. YMMV.)

[1] http://www.ioncannon.net/system-administration/59/php-rrdtool-tutorial/




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



Re: [PHP] how to calculate how much data does each ip address use ?

2013-02-06 Thread Sean Greenslade
On Wed, Feb 6, 2013 at 11:15 AM, Aaron Holmes aa...@aaronholmes.net wrote:
 No one has mentioned Cacti yet? It does exactly what Bulent is looking for.

 http://cacti.net/


 On 2/5/13 6:46 PM, Sean Greenslade wrote:

 On Tue, Feb 5, 2013 at 10:13 AM, Bulent  Malik bma...@ihlas.net.tr
 wrote:


 This task is not really suited for php. I would suggest looking into

 Ntop.

 It does exactly what you described.

 Hello

 I have  a freebsdbox firewall . also I have some internet customers.
 I want to save how much data they used in a table ( such as mysql
 table ) for each ip address.
 Apache2, php5 and mysql5.5 work on the box.

 How can I do it ?  any script or tool.

 Thanks

 How can i save in table using ntop ?  is there any document ?


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

 Read the man pages. There are sql export options that you can specify on
 run.

 I could not see any sql options on  the man file of ntop.
 Where is it?



 Whoops, my mistake. I was reading the NetFlow documentation and going
 off vague memories of older versions of Ntop.

 Ntop saves data in RRD files. There are PHP libraries to parse this
 data [1]. You could theoretically scrape the RRDs and put them in a
 SQL DB, but they may be useful enough on their own if you can parse
 them correctly. (Note: I have never personally parsed RRDs manually.
 This info was pulled from a simple Google search. YMMV.)

 [1]
 http://www.ioncannon.net/system-administration/59/php-rrdtool-tutorial/



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


Neat, I'd never heard of that package before.

-- 
--Zootboy

Sent from some sort of computing device.

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



RE: [PHP] how to calculate how much data does each ip address use ?

2013-02-05 Thread Bulent Malik


 This task is not really suited for php. I would suggest looking into
Ntop.
 It does exactly what you described.

  Hello
 
  I have  a freebsdbox firewall . also I have some internet customers.
  I want to save how much data they used in a table ( such as mysql  
 table ) for each ip address.
 Apache2, php5 and mysql5.5 work on the box.
 
  How can I do it ?  any script or tool.
 
  Thanks

 How can i save in table using ntop ?  is there any document ?


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


Read the man pages. There are sql export options that you can specify on run.

I could not see any sql options on  the man file of ntop.
Where is it? 




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



Re: [PHP] how to calculate how much data does each ip address use ?

2013-02-05 Thread Peet Grobler
On 2013/02/01 4:58 PM, Sean Greenslade wrote:
 This task is not really suited for php. I would suggest looking into Ntop.
 It does exactly what you described.

That's one option.

I use a custom system, with perl and bash scripts collecting data and
saving to rrd databases. php script displaying the images.

Using this on a box with 5 interfaces (3 ethernet, 1 openvpn tunnel, 1
ppp session).


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



Re: [PHP] how to calculate how much data does each ip address use ?

2013-02-05 Thread Sean Greenslade
On Tue, Feb 5, 2013 at 10:13 AM, Bulent  Malik bma...@ihlas.net.tr wrote:


 This task is not really suited for php. I would suggest looking into
 Ntop.
 It does exactly what you described.

  Hello
 
  I have  a freebsdbox firewall . also I have some internet customers.
  I want to save how much data they used in a table ( such as mysql
 table ) for each ip address.
 Apache2, php5 and mysql5.5 work on the box.
 
  How can I do it ?  any script or tool.
 
  Thanks

 How can i save in table using ntop ?  is there any document ?


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


Read the man pages. There are sql export options that you can specify on run.

 I could not see any sql options on  the man file of ntop.
 Where is it?




Whoops, my mistake. I was reading the NetFlow documentation and going
off vague memories of older versions of Ntop.

Ntop saves data in RRD files. There are PHP libraries to parse this
data [1]. You could theoretically scrape the RRDs and put them in a
SQL DB, but they may be useful enough on their own if you can parse
them correctly. (Note: I have never personally parsed RRDs manually.
This info was pulled from a simple Google search. YMMV.)

[1] http://www.ioncannon.net/system-administration/59/php-rrdtool-tutorial/

-- 
--Zootboy

Sent from some sort of computing device.

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



[PHP] how to calculate how much data does each ip address use ?

2013-02-01 Thread Bulent Malik
Hello

I have  a freebsdbox firewall . also I have some internet customers.  I want
to save how much data they used in a table ( such as mysql table ) for each
ip address.
Apache2, php5 and mysql5.5 work on the box.

How can I do it ?  any script or tool.

Thanks


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



Re: [PHP] how to calculate how much data does each ip address use ?

2013-02-01 Thread Sean Greenslade
This task is not really suited for php. I would suggest looking into Ntop.
It does exactly what you described.
On Feb 1, 2013 9:40 AM, Bulent Malik bma...@ihlas.net.tr wrote:

 Hello

 I have  a freebsdbox firewall . also I have some internet customers.  I
 want
 to save how much data they used in a table ( such as mysql table ) for each
 ip address.
 Apache2, php5 and mysql5.5 work on the box.

 How can I do it ?  any script or tool.

 Thanks


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




RE: [PHP] how to calculate how much data does each ip address use ?

2013-02-01 Thread Bulent Malik


This task is not really suited for php. I would suggest looking into Ntop.
It does exactly what you described.

 Hello

 I have  a freebsdbox firewall . also I have some internet customers.  
 I want to save how much data they used in a table ( such as mysql 
 table ) for each ip address.
Apache2, php5 and mysql5.5 work on the box.

 How can I do it ?  any script or tool.

 Thanks

How can i save in table using ntop ?  is there any document ? 


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



RE: [PHP] how to calculate how much data does each ip address use ?

2013-02-01 Thread Sean Greenslade
On Feb 1, 2013 10:25 AM, Bulent Malik bma...@ihlas.net.tr wrote:



 This task is not really suited for php. I would suggest looking into
Ntop.
 It does exactly what you described.

  Hello
 
  I have  a freebsdbox firewall . also I have some internet customers.
  I want to save how much data they used in a table ( such as mysql
  table ) for each ip address.
 Apache2, php5 and mysql5.5 work on the box.
 
  How can I do it ?  any script or tool.
 
  Thanks

 How can i save in table using ntop ?  is there any document ?


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


Read the man pages. There are sql export options that you can specify on
run.


RE: [PHP] how to calculate how much data does each ip address use ?

2013-02-01 Thread Mike Mackintosh


 Original message 
From: Sean Greenslade zootboys...@gmail.com 
Date:  
To: Bulent Malik bma...@ihlas.net.tr 
Cc: php-general@lists.php.net 
Subject: RE: [PHP] how to calculate how much data does each ip address use ? 
 
On Feb 1, 2013 10:25 AM, Bulent Malik bma...@ihlas.net.tr wrote:



 This task is not really suited for php. I would suggest looking into
Ntop.
 It does exactly what you described.

  Hello
 
  I have  a freebsdbox firewall . also I have some internet customers.
  I want to save how much data they used in a table ( such as mysql
  table ) for each ip address.
 Apache2, php5 and mysql5.5 work on the box.
 
  How can I do it ?  any script or tool.
 
  Thanks

 How can i save in table using ntop ?  is there any document ?


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



Look at www.highonphp.com/regex-pattern-parsing-ifconfig

You can use exec to run ifconfig and parse the output using the above.

Re: [PHP] how to build multilingual e-commerce website

2012-12-29 Thread Sachin Raut
Thanks all for your suggestions. I have decided to go through these 2 books
 i will also talk to Magento developers.

Once again thanks for your input

regards
Sachin Raut

On Sat, Dec 29, 2012 at 9:20 AM, tamouse mailing lists 
tamouse.li...@gmail.com wrote:

  On Fri, Dec 28, 2012 at 5:19 AM, Sachin Raut imsachinr...@gmail.com
 wrote:
  Dear Friends,
 
  I have to develop multilingual e-commerce (clothing) website. Could
 anyone
  who has developed these kind of sites before guide me on how to start the
  development or recommend any tutorial / book for developing these kind of
  sites?
 
  Would really appreciate any inut regarding this.
 
  regards
  Sachin Raut


 There's this at O'Reilly: Building eCommerce Applications
 http://shop.oreilly.com/product/0636920023098.do

 And this at Amazon: Effortless E-Commerce with PHP and MySQL by
 Larry Ullman http://amzn.com/0321656229

 Also, not really knowing how much you need to do yourself, you could
 probably get a leg up using existing frameworks and such.

 The multilingual aspects will certainly be tricky. Gettext is sort of
 the standard for doing multilingual things, but in and of itself
 doesn't really provide much help in understanding *how* to do
 multilingual right, and can be problematic. Some frameworks do support
 multilingual sites; I know drupal does, for example, and includes
 quite a lot of other things that can help you build an e-commerce site
 rather quickly, but drupal itself has a rather steep learning curve.

 Passages of just plain text aren't that difficult; it's when you start
 constructing displayed text dynamically that it will be trickier, for
 certain.

 Just thinking off the top of my head; you will likely need something
 other than just gettext with it's separate language files for things
 like product descriptions. I think it gets rather difficult, and
 probably bad form, to have your separate strings in files in your code
 base linked to data base entries; simpler just to store the various
 multilingual data base bits in the data base itself. But you can see
 how complex it gets.

 At any rate, I hope you have a fair bit of experience in building
 dynamic internet sites already, this is not going to be easy.



[PHP] how to build multilingual e-commerce website

2012-12-28 Thread Sachin Raut
Dear Friends,

I have to develop multilingual e-commerce (clothing) website. Could anyone
who has developed these kind of sites before guide me on how to start the
development or recommend any tutorial / book for developing these kind of
sites?

Would really appreciate any inut regarding this.

regards
Sachin Raut


Re: [PHP] how to build multilingual e-commerce website

2012-12-28 Thread Bastien


Bastien Koert

On 2012-12-28, at 6:19 AM, Sachin Raut imsachinr...@gmail.com wrote:

 Dear Friends,
 
 I have to develop multilingual e-commerce (clothing) website. Could anyone
 who has developed these kind of sites before guide me on how to start the
 development or recommend any tutorial / book for developing these kind of
 sites?
 
 Would really appreciate any inut regarding this.
 
 regards
 Sachin Raut

Start by looking at magento. It's a great ecom shop software 

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



Re: [PHP] how to build multilingual e-commerce website

2012-12-28 Thread Matijn Woudt
Op 28 dec. 2012 12:20 schreef Sachin Raut imsachinr...@gmail.com het
volgende:

 Dear Friends,

 I have to develop multilingual e-commerce (clothing) website. Could anyone
 who has developed these kind of sites before guide me on how to start the
 development or recommend any tutorial / book for developing these kind of
 sites?

 Would really appreciate any inut regarding this.

 regards
 Sachin Raut

How about you just take an open source ecommerce o package, and
modify/extend that if you need more functions? I would not recommend
reinventing the wheel. Also I doubt there is a tutorial/book on this. As
always, source code is probably the best documentation you can get.

- Matijn


Re: [PHP] how to build multilingual e-commerce website

2012-12-28 Thread tamouse mailing lists
On Fri, Dec 28, 2012 at 5:19 AM, Sachin Raut imsachinr...@gmail.com wrote:
 Dear Friends,

 I have to develop multilingual e-commerce (clothing) website. Could anyone
 who has developed these kind of sites before guide me on how to start the
 development or recommend any tutorial / book for developing these kind of
 sites?

 Would really appreciate any inut regarding this.

 regards
 Sachin Raut


There's this at O'Reilly: Building eCommerce Applications
http://shop.oreilly.com/product/0636920023098.do

And this at Amazon: Effortless E-Commerce with PHP and MySQL by
Larry Ullman http://amzn.com/0321656229

Also, not really knowing how much you need to do yourself, you could
probably get a leg up using existing frameworks and such.

The multilingual aspects will certainly be tricky. Gettext is sort of
the standard for doing multilingual things, but in and of itself
doesn't really provide much help in understanding *how* to do
multilingual right, and can be problematic. Some frameworks do support
multilingual sites; I know drupal does, for example, and includes
quite a lot of other things that can help you build an e-commerce site
rather quickly, but drupal itself has a rather steep learning curve.

Passages of just plain text aren't that difficult; it's when you start
constructing displayed text dynamically that it will be trickier, for
certain.

Just thinking off the top of my head; you will likely need something
other than just gettext with it's separate language files for things
like product descriptions. I think it gets rather difficult, and
probably bad form, to have your separate strings in files in your code
base linked to data base entries; simpler just to store the various
multilingual data base bits in the data base itself. But you can see
how complex it gets.

At any rate, I hope you have a fair bit of experience in building
dynamic internet sites already, this is not going to be easy.

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



Re: [PHP] how to read emails with php

2012-12-09 Thread Michael Wallner
On 4 December 2012 19:24, Farzan Dalaee farzan.dal...@gmail.com wrote:
 Warning: imap_open() [function.imap-open]: Couldn't open stream
 mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6

 this is my code

 $host = 'mail.mydomain.net:143/pop3';
 $user = 'x...@mydomain.net';
 $password = 'myPassword';
 $mailbox = {$host}INBOX;
  ^^^

PHP interprets that as insert $host in string and removes the curly braces.

Try

$mailbox = {mail.mydomain.net:143/pop3}INBOX;

Cheers,
Mike

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



Re: [PHP] how to read emails with php

2012-12-05 Thread tamouse mailing lists
On Tue, Dec 4, 2012 at 12:24 PM, Farzan Dalaee farzan.dal...@gmail.com wrote:
 Warning: imap_open() [function.imap-open]: Couldn't open stream
 mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6

 Warning: imap_check() expects parameter 1 to be resource, boolean
 given in C:\xampp\htdocs\mail.php on line 10

 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX:
 no such mailbox (errflg=2) in Unknown on line 0


 this is my code

 $host = 'mail.mydomain.net:143/pop3';



I'm not hugely familiar with PHP's imap -- but are you trying to
connect using the IMAP port (143) but with the POP3 protocol? POP3 is
port 110...


 $user = 'x...@mydomain.net';
 $password = 'myPassword';
 $mailbox = {$host}INBOX;
 $mbx = imap_open($mailbox , $user , $password);

You might consider checking if $mbx === false here, since if
imap_open, it will return false. Then check
imap_last_errors/imap_errors to see what the error(s) is(are).

  if (false === $mbx) exit (can't connect to $mailbox: .
imap_last_error() . PHP_EOL);




 $check = imap_check($mbx);


 On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote:
 What does it say when you call imap_errors or imap_last_error?


 On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee
 farzan.dal...@gmail.comwrote:

 i dont have access to log files on server

 On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote:

  On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com
 wrote:
  hi guys
  i want to open an email content ( subject ,body , attachment ) with
  php
  i use imap_php but its wont connect to host
  what should i do?
  thanx

 
 Start by finding out why it won't connect.  Check the logs on the
  server if you can, that's always the best place to look first.
 
  --
  /Daniel P. Brown
  Network Infrastructure Manager
  http://www.php.net/


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




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


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



[PHP] how to read emails with php

2012-12-04 Thread Farzan Dalaee
hi guys 
i want to open an email content ( subject ,body , attachment ) with php
i use imap_php but its wont connect to host
what should i do?
thanx

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



Re: [PHP] how to read emails with php

2012-12-04 Thread Daniel Brown
On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote:
 hi guys
 i want to open an email content ( subject ,body , attachment ) with php
 i use imap_php but its wont connect to host
 what should i do?
 thanx

Start by finding out why it won't connect.  Check the logs on the
server if you can, that's always the best place to look first.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] how to read emails with php

2012-12-04 Thread Farzan Dalaee
i dont have access to log files on server

On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote:

 On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote:
 hi guys
 i want to open an email content ( subject ,body , attachment ) with php
 i use imap_php but its wont connect to host
 what should i do?
 thanx

 
Start by finding out why it won't connect.  Check the logs on the
 server if you can, that's always the best place to look first.
 
 -- 
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/


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



Re: [PHP] how to read emails with php

2012-12-04 Thread Jonathan Sundquist
What does it say when you call imap_errors or imap_last_error?


On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote:

 i dont have access to log files on server

 On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote:

  On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com
 wrote:
  hi guys
  i want to open an email content ( subject ,body , attachment ) with php
  i use imap_php but its wont connect to host
  what should i do?
  thanx

 
 Start by finding out why it won't connect.  Check the logs on the
  server if you can, that's always the best place to look first.
 
  --
  /Daniel P. Brown
  Network Infrastructure Manager
  http://www.php.net/


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




Re: [PHP] how to read emails with php

2012-12-04 Thread Farzan Dalaee
Warning: imap_open() [function.imap-open]: Couldn't open stream
mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6

Warning: imap_check() expects parameter 1 to be resource, boolean
given in C:\xampp\htdocs\mail.php on line 10

Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX:
no such mailbox (errflg=2) in Unknown on line 0


this is my code

$host = 'mail.mydomain.net:143/pop3';
$user = 'x...@mydomain.net';
$password = 'myPassword';
$mailbox = {$host}INBOX;
$mbx = imap_open($mailbox , $user , $password);

$check = imap_check($mbx);


On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote:
 What does it say when you call imap_errors or imap_last_error?


 On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee
 farzan.dal...@gmail.comwrote:

 i dont have access to log files on server

 On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote:

  On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com
 wrote:
  hi guys
  i want to open an email content ( subject ,body , attachment ) with
  php
  i use imap_php but its wont connect to host
  what should i do?
  thanx

 
 Start by finding out why it won't connect.  Check the logs on the
  server if you can, that's always the best place to look first.
 
  --
  /Daniel P. Brown
  Network Infrastructure Manager
  http://www.php.net/


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




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



Re: [PHP] how to read emails with php

2012-12-04 Thread Jonathan Sundquist
Try removing the call to the inbox and try getting a list of all the
folders using imap_listmailbox($host, *);


On Tue, Dec 4, 2012 at 12:24 PM, Farzan Dalaee farzan.dal...@gmail.comwrote:

 Warning: imap_open() [function.imap-open]: Couldn't open stream
 mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6

 Warning: imap_check() expects parameter 1 to be resource, boolean
 given in C:\xampp\htdocs\mail.php on line 10

 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX:
 no such mailbox (errflg=2) in Unknown on line 0


 this is my code

 $host = 'mail.mydomain.net:143/pop3';
 $user = 'x...@mydomain.net';
 $password = 'myPassword';
 $mailbox = {$host}INBOX;
 $mbx = imap_open($mailbox , $user , $password);

 $check = imap_check($mbx);


 On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote:
  What does it say when you call imap_errors or imap_last_error?
 
 
  On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee
  farzan.dal...@gmail.comwrote:
 
  i dont have access to log files on server
 
  On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote:
 
   On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee 
 farzan.dal...@gmail.com
  wrote:
   hi guys
   i want to open an email content ( subject ,body , attachment ) with
   php
   i use imap_php but its wont connect to host
   what should i do?
   thanx
 
  
  Start by finding out why it won't connect.  Check the logs on the
   server if you can, that's always the best place to look first.
  
   --
   /Daniel P. Brown
   Network Infrastructure Manager
   http://www.php.net/
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 



  1   2   3   4   5   6   7   8   9   10   >