[PHP] PHP program running from shell ends silently

2003-03-17 Thread Ruben
Hi:

I'm running a 'batch' PHP program from the shell with "#!/usr/bin/php 
-q" as the first line. After some processing, it ends silently without 
any visible notice or error. It processes information from a PostgreSQL 
database and shows its progression (via echoes) until it suddenly stops. 
This behaviour occurs when it treats a high volume of information, with 
just a few records it works fine.

I guess it may be a problem of lack of memory but I have tried to look 
for any trace in /var/logs and I cannot find any sign of the program. 
How can I know what is happening? Where can I look for the error?

Thanks a lot!

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


Re: [PHP] PHP program running from shell ends silently [SOLVED]

2003-03-17 Thread Ruben
Thanks a lot Chris:

'memory_limit' is the responsible. I have done a couple of tests and 
AFAIK PHP shows no error at all when this limit is surpassed (I have 
error_reporting = E_ALL & ~E_NOTICE in php.ini).

Ruben.

Chris Hewitt wrote:
Ruben wrote:

I'm running a 'batch' PHP program from the shell with "#!/usr/bin/php 
-q" as the first line. After some processing, it ends silently without 
any visible notice or error. It processes information from a 
PostgreSQL database and shows its progression (via echoes) until it 
suddenly stops. This behaviour occurs when it treats a high volume of 
information, with just a few records it works fine.

I guess it may be a problem of lack of memory but I have tried to look 
for any trace in /var/logs and I cannot find any sign of the program. 
How can I know what is happening? Where can I look for the error?


Its not much to go on. I'd put some more debug code in an log it, e.g. 
append a file, so you can see what is happening. If it is only occuring 
when there is a lot of data, are you running into the max_execution_time 
(by default 30 seconds) in php.ini. If you feel it may be memory, maybe 
the memory_limit parameter is too low for your application.

HTH
Chris


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


[PHP] Unexpected result in floor function

2003-11-17 Thread ruben
Hi:

Why is the "floor" function returning 27564 instead of 27565 in this 
script? PHP version is 4.2.2.

Thanks!
Ruben.


#!/usr/bin/php -q



$b = 275.65 * 100;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b);// Incorrect. why 27564?
$b = 27565;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b)."\n\n";// Correct
?>

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


[PHP] Sending email through "mail" function to a bad address

2001-09-20 Thread Ruben


Hi!
When I send email through "mail" function to a bad address, I don't get an
error message back, as I used to when using perl and sendmail. I've triyed
using "Return-Path" and "Errors-To" headers with no results.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Detect file size BEFORE upload it

2005-10-05 Thread Ruben

Hi,

I have been trying _several_ ways to control the size of the files that 
can be uploaded in a form.


The problem is that I was able to detect file size after complete file 
is transfered.


I need to detect file size before all file is transfered, in order to 
cancel it and preserve server resources.


Any ideas?

Thanks in advance
Ruben Rubio Rey

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



[PHP] apache chroot + mail()

2003-12-23 Thread Ruben Vanhoutte
Hi,

I am having a problem using the mail() command inside a chrooted
apache/php installation on linux with qmail.
Nothing apears in the logs, nothing in apache error logs , neither in
php error logs..
And.. no mail gets send.. Nothing to see in my mailer daemon logs neither..
Exempt from php.ini:
===
[mail function]
SMTP = 127.0.0.1
===
Can anyone help pls ?

Tnx

--

Ruben Vanhoutte

Systems Admin
X-Treme Webhosting
Zakske 10
8000 Brugge
Belgium
Fortis 001-3688345-93
Btw: BE 518.853.394
HR: 95181
http://www.x-tremewebhosting.net


The information contained in this message or any of its attachments may 
be confidential and is intended for the exclusive use of the 
addressee(s). Any disclosure, reproduction, distribution or other 
dissemination or use of this communication is strictly prohibited 
without the express permission of the sender. Visibility email is for 
business use only.
*

-- Quote Of The Day --
Self Test for Paranoia: You know you have it when you can't think of 
anything that's your own fault.
-- Quote Of The Day --

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


[PHP] Crashing a webserver

2002-02-19 Thread Ruben Vermeersch

I have got the task to down our webserver, to see how stable she is, and how
easy/hard it is to get it on it's knees ;)

Does anyone have some ideas how to do it?

phpinfo() kan be found here:

http://devel.basm.be/phpinfo.php

Thanks Already,
Witch



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




[PHP] Re: Crashing a webserver

2002-02-20 Thread Ruben Vermeersch

Thank you all, let's see how good the machine will do...





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




[PHP] Send files before the php script executes

2004-10-07 Thread Ruben Duarte
Hi,

Anybody knows if is posible in Linux with PHP to do upload of several
files sending the data before that php script executes. Now in my
server you do the upload (with html,form, multipart ...) and first all
the files are upload and them the php script is executed.

The idea is the next: In the server in my php script I want to
proccess each file separated because if the conexion is lost the user
don't have to send all the files again , only have to send the files
that haven't been uploaded and proccessed.

It seems hard.

Thanks in advance. ;-)

Ruben Alutiz

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



Re: [PHP] Javascript detection , working version

2007-01-11 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

A good way to detect if javascript exists is (cross-browser,
cross-platform):

You try to load javascript_exists.htm.

- 
javascript_exists.htm:




 ...
Javascript is actived!!


- 
javascript_not_actived.htm:

 ...
Javascript is *NOT* actived!!


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFpzemIo1XmbAXRboRAirXAKCo8LlqI0gv/7+Kfs7L6EHJGRdN3QCgo530
1YwBznS0B8p3KSFVCVcyyfc=
=DjZ8
-END PGP SIGNATURE-

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



Re: [PHP] Paging script

2009-09-30 Thread Ruben Crespo
Hi all,

Maybe it is not just what you need but could be helpfull.

Here you have the code:

//---paginator.php
Page ".$current." of ".$total_pages."";
  $Goto = "Go to Page";
  $go = "Go";


  $texto = "
  ".$toFrom."
  ";

  if ($current > 1)
$texto .= "«";
  else
$texto .= "«";


//Se lista hasta llegar a la posición actual
if ($current > $limit) {
$start = ($current - $limit) + 1;
$texto .= "...";
} else {
$start = 1;
}

 for ($start; $start < $current; $start++) {
   $texto .= "$start";
   }

//mostramos posicion actual
  $texto .= "$current ";

//mostramos resto de registros
  for ($i=$current+1; $i<=$total_pages; $i++) {

  if ($i > $limit)
  {
  $texto .= "...";
  $i = $total_pages;
  }else{
  $texto .= "$i ";
  }
}

  if ($current < $total_pages)
  {
  $texto .= "»";
  }else{
$texto .= "»";
  }

 $texto .= "";


 //a form to go directly to the page you want
 $texto .= '



'.$Goto.' 



';



$texto .= '


';

return $texto;

}

?>
//---paginator.php

//---example.php
";
}


?>

//---example.php




2009/9/30 Angelo Zanetti 

>
> Hi All,
>
> I am looking for a paging script, not the normal type but slightly
> different. It must show as follows:
>
> 1 2 3 ... 12
>
> Then:
>
> 1 ... 678 ... 12
>
> And
>
> 1 ... 10 11 12
>
> I have googled and not really found much and don't really want to reinvent
> the wheel. I am sure I can write my own but due to time constraints ill
> like
> to get a script that will assist me.
>
> Thanks in advance
> http://www.wapit.co.za
> http://www.elemental.co.za
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
http://peachep.wordpress.com


Re: [PHP] Paging script

2009-09-30 Thread Ruben Crespo
O.K Angelo,

I wish you that you find the code useful for your projects.

Best Regards !!

Rubén Crespo

2009/9/30 Angelo Zanetti 

>
>
>
>
>  _
>
> From: Ruben Crespo [mailto:rumails...@gmail.com]
> Sent: 30 September 2009 01:23 PM
> To: Angelo Zanetti
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Paging script
>
>
>
> Hi all,
>
> Maybe it is not just what you need but could be helpfull.
>
> Here you have the code:
>
>
> //---paginator.php--
> --
>  function paginator ($current, $total, $per_page, $link, $limit) {
>
>if ($current == '')
>{
>$current = 1;
>}else{
>$current = $current;
>}
>
>  $total_pages = ceil($total/$per_page);
>  $previous = $current - 1;
>  $next = $current + 1;
>
>
> /*traduction*/
>  $toFrom = "Page ".$current." of ".$total_pages."";
>  $Goto = "Go to Page";
>  $go = "Go";
>
>
>  $texto = "
>  ".$toFrom."
>  ";
>
>  if ($current > 1)
>$texto .= "«";
>  else
>$texto .= "«";
>
>
> //Se lista hasta llegar a la posición actual
>if ($current > $limit) {
>$start = ($current - $limit) + 1;
>$texto .= "...";
>} else {
>$start = 1;
>}
>
> for ($start; $start < $current; $start++) {
>   $texto .= "$start";
>   }
>
> //mostramos posicion actual
>  $texto .= "$current ";
>
> //mostramos resto de registros
>  for ($i=$current+1; $i<=$total_pages; $i++) {
>
>  if ($i > $limit)
>  {
>  $texto .= "...";
>  $i = $total_pages;
>  }else{
>  $texto .= "$i ";
>  }
>}
>
>  if ($current < $total_pages)
>  {
>  $texto .= "»";
>  }else{
>$texto .= "»";
>  }
>
>  $texto .= "";
>
>
>  //a form to go directly to the page you want
>  $texto .= '
> 
>
>
>'.$Goto.' 
>
>
>
> ';
>
>
>
> $texto .= '
>
> 
> ';
>
> return $texto;
>
> }
>
> ?>
>
> //---paginator.php--
> --
>
>
> //---example.php
> 
>  include ("paginator.php");
>
> for ($n=0; $n<=100; $n++)
> {
> $myArray [$n] = $n;
> }
>
> $total = count ($myArray); //the total elements in the array
> $per_page = 5; //elements the script show
> $link = "example.php?page="; //link
> $limit = 3; //number of items you show in the paginator list
>
>
>
> if ($_GET["page"])
> {
> $current = $_GET["page"];
> }else{
> $current = $_POST["page"];
> }
>
> $start = ($current-1) * $per_page;
> $end = $start + $per_page;
>
> //call to the paginator function ...
> echo paginator ($current, $total, $per_page, $link, $limit);
>
>
> //Show the results in different pages
> for ($i = $start; $i<=$end ;$i++)
> {
> echo $myArray[$i]."";
> }
>
>
> ?>
>
>
> //---example.php
> 
>
>
> Thanks ruben very much :-)
>
>
>
> Regards
>
> Angelo
>
>
>
> http://www.wapit.co.za
> http://www.elemental.co.za
>
>


-- 
http://peachep.wordpress.com


[PHP] ViaFirma php Client

2010-04-21 Thread Ruben Crespo
Has someone  implemented the php client of viafirma [
http://www.viafirma.com/]?

Thanks !!!

-- 
http://peachep.wordpress.com


[PHP] Ruben Knol has invited you to open a Google mail account

2010-05-15 Thread Ruben Knol
I've been using Gmail and thought you might like to try it out. Here's
an invitation to create an account.

-------

Ruben Knol has invited you to open a free Gmail account.

To accept this invitation and register for your account, visit
http://mail.google.com/mail/a-aa11bd36fb-302f6744ca-s4UI_b6q4PMLn9Ns0oJf_P55xNo

Once you create your account, Ruben Knol will be notified with
your new email address so you can stay in touch with Gmail!

If you haven't already heard about Gmail, it's a new search-based webmail
service that offers:

- Over 2,700 megabytes (two gigabytes) of free storage
- Built-in Google search that instantly finds any message you want
- Automatic arrangement of messages and related replies into
  "conversations"
- Powerful spam protection using innovative Google technology
- No large, annoying ads--just small text ads and related pages that are
  relevant to the content of your messages

To learn more about Gmail before registering, visit:
http://mail.google.com/mail/help/benefits.html

And, to see how easy it can be to switch to a new email service, check
out our new switch guide: http://mail.google.com/mail/help/switch/

We're still working every day to improve Gmail, so we might ask for your
comments and suggestions periodically.  We hope you'll like Gmail.  We
do.  And, it's only going to get better.

Thanks,

The Gmail Team

(If clicking the URLs in this message does not work, copy and paste them
into the address bar of your browser).

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



Re: [PHP] How to add user to linux using php

2006-09-04 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



1) You can configure nobody (apache/php user) to log with ssh key
verification (You do not need to write a password) So you can execute
"ssh [EMAIL PROTECTED]" and you can login without write any password.

2) Configure a php that execute a perl script with  username/password as
parameter. (You should very carefully check that the parameters are only
characters with no estrange characters there)

3) Use Perl module Net::SSH to log as root in localhost and execute
adduser command.


Note: You can be a little bit secure if you create an user that has
enough privileges to execute adduser, and instead login as root with ssh
key verification log as that user.


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/RowIo1XmbAXRboRAiX8AKCQyviGYZQdGNw9Qgld+rhgD/9xqQCgkNa4
w9QLmo8b6VIIZtdMo0cI8tU=
=6YaW
-END PGP SIGNATURE-

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



Re: [PHP] Is this unsecure?

2006-09-05 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


> 
> $authstring = md5("asdf".$email."fdsa");
> 

md5 is unsecure.
Use sha1 ( http://www.php.net/sha1 ) instead
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/XjEIo1XmbAXRboRAh14AJ9eqyWj6bRCfCG3bGi9A94uQxJz4wCfbyeS
Wt9KKC7QrRCoJDCDRG5I/kY=
=JTiq
-END PGP SIGNATURE-

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



Re: [PHP] How to skip browser's Warning?

2006-09-14 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

This is php cconfiguration.
Add this to php.ini

session.cache_limiter=none


[EMAIL PROTECTED] wrote:
> Hi,
> Could somebody explain to me what to do to skip this message I'm getting
> after I search for some products on my page, got the list of products,
> selected a detailed view of the product and click on the Back button of
> the browser to see again list of found products (result page):
> "The Page you are trying to view contains POSTDATA that has expired from
> cache. If you resend the data, any action the form carried out such as a
> search or online purchase) will be repeated. To resend the data, click OK.
> Otherwise, click Cancel."
> 
> Thanks for any help.
> 
> -afan
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFCSZpIo1XmbAXRboRAhSoAKCozvcSHiOAOpsGBkwKY6VqIM8aSACfXiEm
rgJwGNM3qRL131lqt5rETJY=
=aPUv
-END PGP SIGNATURE-

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



[PHP] Send emails from PHP ... in a secure way

2006-12-05 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I have a question sending mails from PHP. Actually I am using phpmailer
(is good!!) but when this class sends an email and there is an error
(Mail server is not ready) It just reports error and email is lost.

Is out there any way to save failed emails, and resend if is it  possible?

Thanks in advance
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFdSs8Io1XmbAXRboRAozTAJ9OScgvOYrALnuFo+JQaSXL1KBRSwCeJ+So
/uiRgT6xPeKNV4mosGWQYRw=
=sD5W
-END PGP SIGNATURE-

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



Re: [PHP] Send emails from PHP ... in a secure way

2006-12-05 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

clive escribió:
> Ruben Rubio wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
> the MTA then something is very wrong
> 
> Why cant you save the email in a file or a database and then send it
> later your self?

Because if Mail server has a problem like server is down, or is busy, or
has too many concurrent connections ... it will reject temporary the
email. But that the email sent from php application _NEVER_ will try to
resend the email. Temporary problem, is an error for the log ... but the
email is lost.

In that case, It would be interesting save temporary the email in order
to be able to resend it later.

> 
> clive
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFdUImIo1XmbAXRboRAkajAJ92ziV90uB7A9SQwlq7HnCAq/eWBwCgqobh
ie72JNl+RNjKq9V1TfweAJY=
=XVCd
-END PGP SIGNATURE-

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



Re: [PHP] Send emails from PHP ... in a secure way

2006-12-05 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

T.Lensselink escribió:
> You can store the emails in a database or textfile when an error occurs.
> And use crontab to check the stored messages and send them to the mailserver.

Is out there something that actually do it?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFdU1QIo1XmbAXRboRAt3nAJ9i/4jeCc8txFEUtceXHASv8TindwCeJ4TK
WZUx6Fi1/kGOmxDmOttePNo=
=lV7r
-END PGP SIGNATURE-

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



[PHP] security

2001-05-21 Thread Ker Ruben Ramos

ey guys,

  what are the functions that's disabled if "safe_mode" is On?
also, what I just did now is disabling the functions exec() and system() just to 
prevent shell commands.
but, how do i disable something like `ls -l /` ? the backticks.

Thanks guys



[PHP] ereg questions

2001-05-23 Thread Ker Ruben Ramos

How do i change all '' to '' 
any help out there?



Re: [PHP] ereg questions

2001-05-23 Thread Ker Ruben Ramos

hmm, got a little question.
1. what's that \\1 and \\2? got any info on where u got that from?
2. what if it's just href="anything.html" ? i mean.. something like it got
lots of subdirectories or not.

Thanks
- Original Message -
From: "Mark Maggelet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 1:19 AM
Subject: Re: [PHP] ereg questions


> On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos
> ([EMAIL PROTECTED]) wrote:
> >How do i change all '' to ' >href="file.php?file=anythinghere.php">'
> >any help out there?
>
> I would go:
>
> $string = ereg_replace(
> "",
> "",
> $string);
>
> - Mark
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ereg questions

2001-05-24 Thread Ker Ruben Ramos

Thanks alot, now i know what are thos \\$NUM
but one more thing, where're those \\0 come from? just found it on some
scripts using \\0. seems to confuse me a bit.

Thanks
- Original Message -
From: "Dan Lowe" <[EMAIL PROTECTED]>
To: "Ker Ruben Ramos" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 5:18 PM
Subject: Re: [PHP] ereg questions


> Previously, Ker Ruben Ramos said:
> > hmm, got a little question.
> > 1. what's that \\1 and \\2? got any info on where u got that from?
>
> Expands to whatever the parentheses surrounded during the match.  So
> in this case you have:
>
> Match pattern:  ""
> Replace pattern: ""
>
> There are two places in the match pattern where there are ().  These are
> memorized (rather whatever they actually matched was memorized) and then
> you can spit it back out in the replacement pattern using \\1, \\2, etc.
>
>  -dan
>
> > 2. what if it's just href="anything.html" ? i mean.. something like it
got
> > lots of subdirectories or not.
> >
> > Thanks
> > - Original Message -
> > From: "Mark Maggelet" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, May 24, 2001 1:19 AM
> > Subject: Re: [PHP] ereg questions
> >
> >
> > > On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos
> > > ([EMAIL PROTECTED]) wrote:
> > > >How do i change all '' to ' > > >href="file.php?file=anythinghere.php">'
> > > >any help out there?
> > >
> > > I would go:
> > >
> > > $string = ereg_replace(
> > > "",
> > > "",
> > > $string);
> > >
> > > - Mark
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> If carpenters made buildings the way programmers make programs, the first
> woodpecker to come along would destroy all of civilization.
> -Weinberg's Second Law
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] safe_mode

2001-06-20 Thread Ker Ruben Ramos



If i had safe_mode = On; in php.ini, How do i set 
to have a certain directory that have safe_mode=Off ?


[PHP] Attachments in POP

2001-06-20 Thread Ker Ruben Ramos

Why are attachments in POP cannot be viewed in latest IMP? but if I use
IMAP, it works just fine.




Re: [PHP] Attachments in POP

2001-06-20 Thread Ker Ruben Ramos

oops :) sorry... used the wrong lists

- Original Message - 
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Ker Ruben Ramos" <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 10:59 PM
Subject: Re: [PHP] Attachments in POP


> > Why are attachments in POP cannot be viewed in latest IMP? but if I use
> > IMAP, it works just fine.
> 
> That would be a question for the IMP mailing list, not php-general.
> 
> -Rasmus
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Safe_mode in certain directories

2001-06-21 Thread Ker Ruben Ramos



Ey guys!
 
    How do set only safe_mode = On 
in certain directories while others are Off. And vice versa.
 
Thank You.


[PHP] command output

2001-07-09 Thread Ker Ruben Ramos

ey guys.. anyone know of doing something like with
net.yahoo.com/cgi-bin/trace.sh?ip_here .. something that prints out every
result of the traceroute command... not showing the result after command
exited


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] check if user exists

2001-08-01 Thread Ker Ruben Ramos

how do i check if user exist?
I tried...
$result = mysql_query("SELECT count(uname) FROM users WHERE
uname=\'$username@$domain\'");
if(isSet($result))
return("Username already exists.\n");
but still wont work.. :(


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] simple question...

2001-09-20 Thread Ker Ruben Ramos

ey guys.. how do i check if the postdata is a valid time format? something
like '2001-09-15'
I hate it when they'll be entering garbage in it...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] simple question...

2001-09-20 Thread Ker Ruben Ramos

One more thing... If I got '2001-09-01'
Is there a fast way of incrementing the month of it?
making it '2001-10-01' ?

- Original Message -
From: "* R&zE:" <[EMAIL PROTECTED]>
To: "Ker Ruben Ramos" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 20, 2001 6:04 AM
Subject: Re: [PHP] simple question...


> 
> From: Ker Ruben Ramos <[EMAIL PROTECTED]>
> Date: Thu, Sep 20, 2001 at 08:56:03PM -0700
> Message-ID: <00f801c14251$5aa288b0$bb05aacb@weblinqproxy>
> Subject: [PHP] simple question...
>
> > ey guys.. how do i check if the postdata is a valid time format?
something
> > like '2001-09-15'
> > I hate it when they'll be entering garbage in it...
>
> 
>
> 
>
> See the example below:
>
> --- PHP Example Code ---
> 
> 
> /* Valid date */
> $myDate = "2001-09-12";
>
> /* Invalid date */
> //$myDate = "2001-13-20";
>
> /* Another invalid date */
> //$myDate = "20o1-10-x9";
>
> if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $myDate,
> $matches)) {
>   if (checkdate ($matches[2], $matches[3], $matches[1])) {
> print ("Valid date!\n\n");
> print (date ("r", mktime (0,0,0,$matches[2], $matches[3],
> $matches[1])));
>   } else {
> print ("No valid date!");
>   }
> } else {
>   print ("No valid date!");
> }
>
> ?>
> 
> --- End of PHP Example Code ---
>
> 
>
> --
>
> * R&zE:
>
>
> -- 
> -- Renze Munnik
> -- DataLink BV
> --
> -- E: [EMAIL PROTECTED]
> -- W: +31 23 5326162
> -- F: +31 23 5322144
> -- M: +31 6 21811143
> --
> -- Stationsplein 82
> -- 2011 LM  HAARLEM
> -- Netherlands
> --
> -- http://www.datalink.nl
> -- 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] simple question...

2001-09-20 Thread Ker Ruben Ramos

again.. one more thing How do I know how many days date differ? let's
say '2001-09-01' and '2001-09-08'.
Just looking for the fastest way of code to run.

- Original Message -
From: "* R&zE:" <[EMAIL PROTECTED]>
To: "Ker Ruben Ramos" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 20, 2001 6:46 AM
Subject: Re: [PHP] simple question...


> > You should date() do the work here. So just take the month and then
> > +1. Date() will take care the result is a valid date.
> > Below is some example...
>
> Well... I meant: let mktime() do the work... not date(). Date() only
> shows the result of mktime() in a proper format. Mktime() makes sure
> it's a valid time(stamp) :)
>
> --
>
> * R&zE:
>
>
> -- 
> -- Renze Munnik
> -- DataLink BV
> --
> -- E: [EMAIL PROTECTED]
> -- W: +31 23 5326162
> -- F: +31 23 5322144
> -- M: +31 6 21811143
> --
> -- Stationsplein 82
> -- 2011 LM  HAARLEM
> -- Netherlands
> --
> -- http://www.datalink.nl
> -- 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem installing php

2006-07-11 Thread Ruben Rubio Rey
I have a problem when installing php. I have tried with different 
versions of apache (2.0.55 and 2.0.58) and php (5.1.4 and 5.1.2).


The problem still there (Same error in different versions)!!!

Note that I had installed apache 2.0.58 and php 5.1.4 before on this 
server. Problems began when tried to add -with-pspell --with-openssl at 
configure. ( I installed aspell). When I tried it, i was no able to 
install php again.


Any ideas or workarrounds will be appreciated.


Complete Information:
Configure:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-gettext 
--with-pgsql --enable-trac k-vars --enable-force-cgi-redirect 
--with-mime-magic -with-pspell --with-openssl


Server: CentOS release 4.3 (Final)
2.6.9-34.0.1.ELsmp

/usr/local/src/php-5.1.2$ make install
Installing PHP SAPI module:   apache2handler
/usr/local/apache2/build/instdso.sh 
SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la 
/usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libphp5.la 
/usr/local/apache2/modules/

cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
cp .libs/libphp5.a /usr/local/apache2/modules/libphp5.a
ranlib /usr/local/apache2/modules/libphp5.a
chmod 644 /usr/local/apache2/modules/libphp5.a
libtool: install: warning: remember to run `libtool --finish 
/usr/local/src/php-5.1.2/libs'

Warning!  dlname not found in /usr/local/apache2/modules/libphp5.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/libphp5.so
chmod: no se puede acceder a «/usr/local/apache2/modules/libphp5.so»: No 
existe el fichero o el directorio

apxs:Error: Command failed with rc=65536

Thanks in advance,
Ruben Rubio

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



[Fwd: [PHP] Problem installing php] - SOLVED

2006-07-11 Thread Ruben Rubio Rey

Solved installing csv version.
Is it officially stable?
Do anyone know when is it going to be stable?

 Original Message 
Subject:[PHP] Problem installing php
Date:   Tue, 11 Jul 2006 12:04:18 +0200
From:   Ruben Rubio Rey <[EMAIL PROTECTED]>
To: php-general@lists.php.net



I have a problem when installing php. I have tried with different 
versions of apache (2.0.55 and 2.0.58) and php (5.1.4 and 5.1.2).


The problem still there (Same error in different versions)!!!

Note that I had installed apache 2.0.58 and php 5.1.4 before on this 
server. Problems began when tried to add -with-pspell --with-openssl at 
configure. ( I installed aspell). When I tried it, i was no able to 
install php again.


Any ideas or workarrounds will be appreciated.


Complete Information:
Configure:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-gettext 
--with-pgsql --enable-trac k-vars --enable-force-cgi-redirect 
--with-mime-magic -with-pspell --with-openssl


Server: CentOS release 4.3 (Final)
   2.6.9-34.0.1.ELsmp

/usr/local/src/php-5.1.2$ make install
Installing PHP SAPI module:   apache2handler
/usr/local/apache2/build/instdso.sh 
SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la 
/usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libphp5.la 
/usr/local/apache2/modules/

cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
cp .libs/libphp5.a /usr/local/apache2/modules/libphp5.a
ranlib /usr/local/apache2/modules/libphp5.a
chmod 644 /usr/local/apache2/modules/libphp5.a
libtool: install: warning: remember to run `libtool --finish 
/usr/local/src/php-5.1.2/libs'

Warning!  dlname not found in /usr/local/apache2/modules/libphp5.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/libphp5.so
chmod: no se puede acceder a «/usr/local/apache2/modules/libphp5.so»: No 
existe el fichero o el directorio

apxs:Error: Command failed with rc=65536

Thanks in advance,
Ruben Rubio

--
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] Floored!

2006-02-23 Thread Ruben Rubio Rey

|What PHP versioan are u using? (Maybe a known bug?)
What options did u use to compile?

|Temporarily solutions ...|
- round($Bar, 2)  
Or

- intval($Bar*100)/100
|
Ben Miller wrote:


If anyone has an answer for this, I would be greatly appreciative.

I was trying to compare two values, the first is the total cost of products
to be refunded, and the second is the original order total.  To the naked
eye, they both were coming out as 102.85, yet an if($Refund_Amount >
$Order_Total) was coming back true, so.

I ran some tests, and did the following:

$Order_Total = sprintf("%01.20f",$Order_Total);
$Refund_Amount = sprintf("%01.20f",$Refund_Amount);

which produced:

$Order_Total = 102.84431566
and $Refund_Amount = 102.85852651

so, I figured I would try the following to make sure that the figures in the
database weren't weird:

$Bar = 102.85;
$Foo = sprintf("%01.20f",$Bar);

echo "\$Foo = $Foo";

which produced:

$Foo = 102.84431566;

I am completely lost.

 



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



[PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread Ruben Rubio Rey

Hi,

I have to create some maps from a latitude / longitude points.

Do anyone know how to convert it to plane coordenates? (In order to show 
it on a bitmat)


I have already found a function but does not work very well ...

Any help will be apreciated.
Thanks in advance

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



Re: [PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread Ruben Rubio Rey

Anas Mughal wrote:


Lat and long are all you need for rendering on an X,Y coordinate.

Keep in mind to adjust the ratio of lat and long depending on where 
you are on the globe.


Good luck!
--
Anas Mughal


any other details? I have tried to convert lat and long to x and y 
coordinate but it not worked very well.

Could give me any math form to apply, or function ...

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



Re: [PHP] Coordenates latitude / longitude on PHP - SOLVED

2006-03-03 Thread Ruben Rubio Rey

It wasn't so hard!
I ll post the solution, so everyone ll be able to do it

function getlocationcoords($lat, $lon, $width, $height)
{
  $lat=$lat*20;   
  $lon=$lon*28; 
  $x = (($lon + 180) * ($width / 360));  
  $y = ((($lat * -1) + 90) * ($height / 180));

  return array("x"=>round($x),"y"=>round($y+3500));
}

$lat -> Latitude
$lon -> Longitude
$width -> Image's width (Where u are going to represent the data)
$height -> Image's height (Where u are going to represent the data)


This is the zoom of the data
$lat=$lat*20;   
$lon=$lon*28; 
If the data is lo flat (for example), u can fix it writting bigger 
values on the data that is multiplying.


$x = (($lon + 180) * ($width / 360));  
$y = ((($lat * -1) + 90) * ($height / 180));

This translates lat / lon to cardinal data. I found it on the net.


return array("x"=>round($x+VALUEONE),"y"=>round($y+3500));
If u puts the rights values on VALUEONE or 3500, u will be able to 
center the coordenates on the image.


Done!
:)

By Tk421

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



[PHP] Charsets ?

2006-03-08 Thread Ruben Rubio Rey

Hi, I hace a functions that does a think, it cleans strange characters:

$trash_string='whateverwithstrangecharacterslikeñ';
$clean_string=strtr(trim($trash_string)," 'ç/-àáãèéìíòóõùúüñ()äëïö,", 
"__c__aaaeeiiooouuun__aeio_");


Its strange, but if I work with php's charset iso8859-15 it works fine, but i I 
set php to utf-8 it does not work.
Any ideas?

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



[PHP] PHP HOSTNAME environment variable poltergeist

2006-03-15 Thread Ruben Rubio Rey

Im having again a problem with hostname environment varible.

Hostname is set OK and it is now shown in phpinfo().
But if I run "php -i" hostname is set!

Any ideas?
Php version: 5.1.2
Configure './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' 
'--with-gettext' '--with-pgsql' '--enable-track-vars' 
'--enable-force-cgi-redirect' '--with-mime-magic'


Thanks in advance, Im completely lost.
Any ideas will be appreciated.

Note 1:  I have another server (shold be exactly the same in 
configuracion, at least in apache and php _IS_ exactly the same) and 
hostname variable is shown in phpinfo.


Note 2:  hostname command and echo $HOSTNAME shows correctly hosname.

Note 3:  Php bug?

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



Re: [PHP] Re: PHP AJAX Framework - Suggestions Please

2006-04-03 Thread Ruben Rubio Rey

The best and simplest for me is prototype.js

Is much more than ajax ! 100% cross browser! ang GPL!

http://www.sergiopereira.com/articles/prototype.js.html

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



[PHP] Pear DB and memcached

2006-06-06 Thread Ruben Rubio Rey

Hi,

Im having a trouble using memcached with pear db.

When im using memcache to store and retrieve an string, all works fine.
When Im using memcache to store a pear db resulset, it does not work!!

This retrieves data but pear::db does not understand it.
I really dont know

Any ideas?
Thanks in advance

Code:

$sql = "SELECT * FROM anytable";
$myownqry= cachedSQL($sql);

while ($rs_qryPhoto =& $myownqry->fetchRow()) {
   echo "OK";//When variable is taken from cache, nothink is 
shown!!!

}


$MEMCACHE_CONNECTED=0;
$MEMCACHE_STR="";
function memcachedConnect(){

   global $MEMCACHE_CONNECTED,$MEMCACHE_STR;
  
   if(!($MEMCACHE_CONNECTED)){

   $MEMCACHE_CONNECTED=1;
   $MEMCACHE_STR = memcache_connect('192.168.2.8', 11211);
   }

}

function cachedSQL($sSQL)  {
   global $db,$MEMCACHE_CONNECTED,$MEMCACHE_STR;
   memcachedConnect();
  
   if($tmp=memcache_get($MEMCACHE_STR,MD5($sSQL))){

   echo "Cached";
   //echo var_dump($tmp);
   }else{
   $tmp = $db->query($sSQL);
   //echo var_dump($tmp);
   echo "NOT Cached";
   memcache_set($MEMCACHE_STR, MD5($sSQL), $tmp, 0, 10);
  
   }

   echo "";
   return $tmp;

 }


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



Re: [PHP] Re: Pear DB and memcached

2006-06-06 Thread Ruben Rubio Rey

Ben Ramsey wrote:


On 6/6/06 9:55 AM, Ruben Rubio Rey wrote:


Im having a trouble using memcached with pear db.

When im using memcache to store and retrieve an string, all works fine.
When Im using memcache to store a pear db resulset, it does not work!!

This retrieves data but pear::db does not understand it.
I really dont know



This is because $db->query returns a resource, which is a reference to 
the data and not the data itself.


For example, let's say you're using the MySQL driver for PEAR::DB, 
then when you call $db->query(), it uses mysql_query(). This function 
will return a resource. When you store the resource to the memcache 
server and then later retrieve it, it no longer maintains its 
reference to the data.


If you want to store the data to the cache, I suggest you use getAll() 
to retrieve an array of data and then store that to the memcache server:


$db->setFetchMode(DB_FETCHMODE_ASSOC);
$data =& $db->getAll($sSQL);
memcache_set($MEMCACHE_STR, MD5($sSQL), $data, 0, 10);

Now, your result set is stored properly on the memcache server.

Yes, it has sense. I have been working arround it but I didn't found the 
solution. I ll try it tomorrow I ll tell what has happen!!!


Thanks a lot men!

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



Re: [PHP] Re: Pear DB and memcached

2006-06-07 Thread Ruben Rubio Rey

Ben Ramsey wrote:


On 6/6/06 9:55 AM, Ruben Rubio Rey wrote:


Im having a trouble using memcached with pear db.

When im using memcache to store and retrieve an string, all works fine.
When Im using memcache to store a pear db resulset, it does not work!!

This retrieves data but pear::db does not understand it.
I really dont know



This is because $db->query returns a resource, which is a reference to 
the data and not the data itself.


For example, let's say you're using the MySQL driver for PEAR::DB, 
then when you call $db->query(), it uses mysql_query(). This function 
will return a resource. When you store the resource to the memcache 
server and then later retrieve it, it no longer maintains its 
reference to the data.


If you want to store the data to the cache, I suggest you use getAll() 
to retrieve an array of data and then store that to the memcache server:


$db->setFetchMode(DB_FETCHMODE_ASSOC);
$data =& $db->getAll($sSQL);
memcache_set($MEMCACHE_STR, MD5($sSQL), $data, 0, 10);

Now, your result set is stored properly on the memcache server.


Seems its working. Thaks a lot!

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



[PHP] GetText string not found

2006-06-13 Thread Ruben Rubio Rey

Hi,

I am using gettext to get a web page in several languages.

When gettext does not found an string, it shows the string.

Is it possible to detect when a string is not found, in order to advis me ?

Thanks in advance,
Ruben Rubio Rey

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



Re: [PHP] GetText string not found

2006-06-13 Thread Ruben Rubio Rey
Is strange that there is not a really good solution for this problem, i 
think its not very strange. Maybe i ll request this feature, I think is 
interesting, useful and not so hard to add.


Anyway, I cannot use "ob_ " functions, i ll have problems with some 
functions.


So, the solution seems to extend "_" function, that provides me the 
posibility to report "strings" not found.


The bad think is that I ll have to make thousands of modifications in 
order to implement this feature in the webpage :(


Thanks to everybody!




Richard Lynch wrote:


On Tue, June 13, 2006 6:30 am, Ruben Rubio Rey wrote:
 


I am using gettext to get a web page in several languages.

When gettext does not found an string, it shows the string.

Is it possible to detect when a string is not found, in order to advis
me ?
   



My experience, if you call it that, with gettext consists of reading
the manual and saying "Neat!", so take this with a HUGE grain of
salt...

One option that MIGHT work would be:

function ___ ($string) {
 //check for existince of the language file/string by hand :-(
}

Another option, perhaps, would be to have your "default" language be
something really... weird, and then the output itself would be icky...

I suppose you could do something hacky like:


All code/html here.


Ugh.



Maybe a Feature Request at GetText and/or bugs.php.net would be in
order...

 



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



Re: [PHP] progress monitor in php

2006-06-15 Thread Ruben Rubio Rey

weetat wrote:


Hi all ,

  I was using PEAR:HTTP_Upload to upload file in php 4.3.2.
  Is ok , however i need to display some sort of progress monitor to 
the user because some file is very large and took some times to upload.

I need to inform the users to uploading is in progress.

I have search google ,and found megaupload , however the problem of 
megaupload is the filename is rubbish, i need the filename of uploaded 
file because the file is xml , need to convert data from xml to database.


Anybody have any ideas ? Or have any another php upload progress 
monitor ?


Thanks

- weetat

PHP cannot do it. Other languajes, like jsp, is able to report that 
information.

I did it with Perl (CGI) and playing with some iframes.
Its a little complex and dirty.

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



[PHP] Re: Detect file size BEFORE upload it

2005-10-06 Thread Ruben Rubio Rey

Saswat Praharaj wrote:


I guess checking the content-length field in HTTP header will help you.
 

I have already tried it.  PHP can read content-length after complete 
file is transferred.



Regds,
-Saswat

On 10/6/05, Ruben <[EMAIL PROTECTED]> wrote:
 


Hi,

I have been trying _several_ ways to control the size of the files that
can be uploaded in a form.

The problem is that I was able to detect file size after complete file
is transfered.

I need to detect file size before all file is transfered, in order to
cancel it and preserve server resources.

Any ideas?

Thanks in advance
Ruben Rubio Rey

--
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] Detect file size BEFORE upload it

2005-10-06 Thread Ruben Rubio Rey

:) U have it. Its perferct. Im gonna check it, but seems to be the solution.

Raditha Dissanayake wrote:


While you are at SF checkout Mega Upload.


Ruben Rubio Rey wrote:



Anyway, if I would use any applet I ll use one of sourceforge.net. 
Its free and I can modify source, so I can personalize it...


But thanks by the idea! :)


Raditha Dissanayake wrote:


Hello Ruben,
Ruben Rubio Rey wrote:


Raditha Dissanayake wrote:


Shameless plug:
you need  a java upload applet such as Rad Upload 
(http://www.radinks.com/upload/)

Ruben wrote:

Thats actually good idea, but I would not want to use Flash or Java 
applets.





I respect your opinion. If you ever change your mind please do 
consider Rad Upload it's being used by quite a few image hosting 
companies.

thanks and best regards
raditha




Hi,

I have been trying _several_ ways to control the size of the 
files that can be uploaded in a form.


The problem is that I was able to detect file size after complete 
file is transfered.









I need to detect file size before all file is transfered, in 
order to cancel it and preserve server resources.


Any ideas?

Thanks in advance
Ruben Rubio Rey



















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



[PHP] OPTIMIZING - The fastest way to open and show a file

2005-10-14 Thread Ruben Rubio Rey


Hi,

I m creating a cache system, and i have a problem: PHP takes a lot of 
time opening the file. (Im using 2.6.9-1.667smp and XFS)


* For files less or equal 6 Kb, takes arround 0.02-0.03 miliseconds - its ok
* For files arround 35 Kb takes arround 0.2-0.4 miliseconds - too much.

What can I do to make faster opening files?

**
Source code:
  if(file_exists($filename)){
$modified_date=filemtime($filename);
if(time()<($modified_date+1 * 24 * 60 * 60)){
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents;
}
 }
**

Thinks that I have tried:
* fopen is *much* faster than include
* filemtime is faster than filectime
* Pear Cache its too much slower (0.5-0.7 milsecond per file)

Thanks in advance
Tk421

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



[PHP] Re: OPTIMIZING - The fastest way to open and show a file

2005-10-16 Thread Ruben Rubio Rey

In a "almost idle desktop machine" always takes arround 0.04.

The measured is on a server when it was with low traffic (average load 
arround 0.7)


ac wrote:


where did these time measured?
on a heavily loaded server or on your own almost idle desktop machine ?


On 10/14/05, Ruben Rubio Rey <[EMAIL PROTECTED]> wrote:
 


Hi,

I m creating a cache system, and i have a problem: PHP takes a lot of
time opening the file. (Im using 2.6.9-1.667smp and XFS)

* For files less or equal 6 Kb, takes arround 0.02-0.03 miliseconds - its
ok
* For files arround 35 Kb takes arround 0.2-0.4 miliseconds - too much.

What can I do to make faster opening files?

**
Source code:
  if(file_exists($filename)){
$modified_date=filemtime($filename);
if(time()<($modified_date+1 * 24 * 60 * 60)){
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents;
}
 }
**

Thinks that I have tried:
* fopen is *much* faster than include
* filemtime is faster than filectime
* Pear Cache its too much slower (0.5-0.7 milsecond per file)

Thanks in advance
Tk421

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


   




--
all born, to be dying


 



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



Re: [PHP] OPTIMIZING - The fastest way to open and show a file

2005-10-16 Thread Ruben Rubio Rey

Richard Lynch wrote:


On Fri, October 14, 2005 6:29 am, Ruben Rubio Rey wrote:
 


  if(file_exists($filename)){
$modified_date=filemtime($filename);
if(time()<($modified_date+1 * 24 * 60 * 60)){
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents;
}
 }
   



Checking both file_exists and then doing fopen seems a bit silly.

Trap the error from fopen, and just use that as your file_exists test.

I suspect http://php.net/file_get_contents will be SLIGHTLY faster
than doing all of this code, though:

if (filemtime($filename) > time()) $contents =
@file_get_contents($filename);
if ($contents === false){
 //error-handling code
}
else{
 echo $contents;
}

Then, of course, we have to wonder if you NEED $contents for later use
in the script.

If not, something like this will clock in better:

$bytes = @readfile($filename);
if ($bytes === false){
 //error-handling code
}

 

This seems to be the best solution. I do not need $content anymore. I ll 
post results. :)



The difference here is that you don't even stuff the file into the PHP
string.  It's all read and passed out to stdout in low-level internal
PHP C code, and the data never needs to hit "PHP" variables which are
"more expensive" to setup and maintain.

Note that which is REALLY fastest will probably depend on the size of
the files, your OS system cache, your hardware, and maybe which
version of PHP you are using, if the underlying functions changed.

Must be nice to be worried about 0.0x milliseconds -- I'm fighting a
mystery 3.0 seconds in a data feed for a search engine myself :-)
 


Search engine ... thats the most complicated!

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



Re: [PHP] OPTIMIZING - The fastest way to open and show a file

2005-10-19 Thread Ruben Rubio Rey

:(

Its not working

$bytes = @readfile($filename);
if ($bytes === false){
 //error-handling code
}

There is not any output ?




Richard Lynch wrote:


On Fri, October 14, 2005 6:29 am, Ruben Rubio Rey wrote:
 


  if(file_exists($filename)){
$modified_date=filemtime($filename);
if(time()<($modified_date+1 * 24 * 60 * 60)){
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents;
}
 }
   



Checking both file_exists and then doing fopen seems a bit silly.

Trap the error from fopen, and just use that as your file_exists test.

I suspect http://php.net/file_get_contents will be SLIGHTLY faster
than doing all of this code, though:

if (filemtime($filename) > time()) $contents =
@file_get_contents($filename);
if ($contents === false){
 //error-handling code
}
else{
 echo $contents;
}

Then, of course, we have to wonder if you NEED $contents for later use
in the script.

If not, something like this will clock in better:

$bytes = @readfile($filename);
if ($bytes === false){
 //error-handling code
}

The difference here is that you don't even stuff the file into the PHP
string.  It's all read and passed out to stdout in low-level internal
PHP C code, and the data never needs to hit "PHP" variables which are
"more expensive" to setup and maintain.

Note that which is REALLY fastest will probably depend on the size of
the files, your OS system cache, your hardware, and maybe which
version of PHP you are using, if the underlying functions changed.

Must be nice to be worried about 0.0x milliseconds -- I'm fighting a
mystery 3.0 seconds in a data feed for a search engine myself :-)

 



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



[PHP] Write a FIFO file

2005-12-19 Thread Ruben Rubio Rey

Hi,

I have  a problem. I have created a fifo file (under linux) and I m not 
able to append some line from a php script.  There is not output error, 
php just is executing for ever ...


How can I write a fifo file?

Thanks in advance

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



Re: [PHP] Write a FIFO file

2005-12-20 Thread Ruben Rubio Rey

Ok, I tried it before, it didn't work:

For example,


fifo file created as root:
mkfifo fifo
chmod 777 fifo

Try to execute it and execution never ends... browser is waiting for 
ever ...

No errors in error php error log.

Any ideas?

Jay Blanchard wrote:


[snip]
I have  a problem. I have created a fifo file (under linux) and I m not 
able to append some line from a php script.  There is not output error, 
php just is executing for ever ...


How can I write a fifo file?
[/snip]

Please have a look here; http://www.php.net/file as a starting point for
file operations. You can append to a file with the fopen() function...
http://www.php.net/fopen


 



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



[PHP] High load Forum?

2005-12-22 Thread Ruben Rubio Rey

Hi,

Im looking for a good forum thats supports high load. (Now between 
300-2.000 active sessions, much more in next 2 years)


I have heard about vBulletin and PhpBB. At the moment I think vBulletin 
is the best choice, because I know some very big places that uses it.


What do u think about this?

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Ruben Rubio Rey

Nanu Kalmanovitz wrote:


Hi

The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE but
not in Netscape 7.0.

How can I fix it?

TIA

Nanu

 

Forget Netscape 7.0. Its not supported anymore. You should be worried 
with mozilla / firefox.
Anyway, im almost sure that is not a php problem. Have u check web 
server (apache, i think) configuration?

Is the data in source code that netscape have download?

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-23 Thread Ruben Rubio Rey

Mike Rondeau wrote:


I am still a newbie, but I am suprised that it effects browers at all, since it 
returns
pure HTML to the browser, right? Something so simple as echoing a "hello world" 
shouldn't cause trouble in so popular a browser as Netscape I would think...


 


* Netscape is not suported anymore.
* Get firefox and make sure its working on it 
http://www.mozilla.com/firefox/

* You can also try it with opera http://www.opera.com/

If code is working there, your web will be 99.9% cross browser compatible.


Mike
PHP Newbie
 - Original Message - 
 From: David Grant 
 To: Nanu Kalmanovitz 
 Cc: php-general@lists.php.net 
 Sent: Thursday, December 22, 2005 2:54 AM

 Subject: Re: [PHP] PHP is OK in IE but not in Netscape


 Nanu,

 Nanu Kalmanovitz wrote:
 > Ok, I will forget Netscape, what other popular browsers beside M$-IE
 > works with M$-Windows?

 I wouldn't "forget" Netscape, because people still use it.  Just make
 sure your code validates to W3C standards and so long as it isn't too
 cutting edge, must browsers should display it fine.

 To answer your question, Opera is probably the third most popular
 browser on Windows.

 Cheers,

 David
 -- 
 David Grant

 http://www.grant.org.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] PHP Frameworks

2005-12-28 Thread Ruben Rubio Rey

Script Head wrote:


Nobody has mentioned Fusebox (www.fusebox.org). I have been using it to
develop PHP applications for about 2 years. It has proven to be extremely
flexible when a large number of developers collaborate on one project.

 


jedit :)
Love macros and plugins!
http://www.jedit.org/

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



Re: [PHP] PHP Cache (was PHP load to high on server)

2006-01-18 Thread Ruben Rubio Rey

Did u tried memcached? http://www.danga.com/memcached/


Albert wrote:


I wrote:
 


I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP
4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine 
is used for testing. We have made some changes to our PHP application and 
now the machine is having trouble serving the pages. Apache is occupying 
almost 90% CPU usage.
   



I have resolved this issue by removing a piece of code which reads a set of
parameters from a database. It seems that the hard disk on the machine is
quite slow, slowing down all database access with it...

I now check if the parameters are set in the session, if it is I use them
otherwise I read them from the database and save it as session variables.
When it changes I simply remove it from the session so it forces an update.
So far it is working quite well.

I now want to go and take all the static stuff that the user will configure
once in a life time and put it in the session and only update it when it
changes instead of reading it from the database every five seconds or so.

For this I don't want to use a disk based session handler. I want the
session variables to remain in memory (about 20KB per user) as to speed up
the whole process. 


I also want an opcode cache to cache the compiled pages on the server in an
attempt to speed up the HTTP server.

For this I wanted to use mmCache (actually I want to use Zend Performance
Suite but first I need to prove that it is worth $ 1000 per CPU and from the
stats on the mmCache site mmCache is faster...) but it seems that the
mmCache project has been abandoned as there have been no work done on it
since 2003.

Can someone confirm this or recommend an alternate cache (doesn't have to be
free but should break the bank) which will do what I want? 


Albert

 



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



[PHP] HOSTNAME Environment variable

2006-02-20 Thread Ruben Rubio Rey

Hi,

How to set "Hostname" environment variable? (It contains the servers 
name, not the servers domain)

Its a Linux server.

Thanks in advance.

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



Re: [PHP] HOSTNAME Environment variable

2006-02-21 Thread Ruben Rubio Rey

Kim Christensen wrote:


On 2/21/06, Ruben Rubio Rey <[EMAIL PROTECTED]> wrote:
 


How to set "Hostname" environment variable? (It contains the servers
name, not the servers domain)
Its a Linux server.
   



Try the "hostname" command. Depending on your linux distro, you might
want to edit /etc/hostname manually afterwards to double-check.

--
Kim Christensen
[EMAIL PROTECTED]

 

Strange. Its already set (in hostname and "echo $HOSTNAME"). I have 
realized that is working on version (in my servers) 5.0.5 and its not 
working in 5.0.4 version. Is it an old bug? Im updating, we ll see 


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