Re: [PHP] NetBeans Question

2010-05-31 Thread Mario Lacunza

Hello,

what about the Netbeans ram eating?

Mario

On 31/05/10 02:03, Dušan Novaković wrote:

Hi, I've been using NetBeans for some time and I found that there are
some issues like for Web applications if you write html tag
incorrectlly, you wont be informed about that, for stand alone
applications in Java there were also some stupid errors, etc. So, I
strongly suggest to check out Eclipse(http://www.eclipse.org/)! You
can easily download Eclipse for PHP on Windows, Linux and MAC, and the
best part is that you can also easily find and add different plugins
like SVN, JS, etc. Just check it out... ;-)

Regards,
Dusan

On Mon, May 31, 2010 at 4:13 AM, Mark Kellyp...@wastedtimes.net  wrote:
   

Hi.

On Monday 31 May 2010 at 02:50 Ashley Sheridan wrote:
 

Yeah, like I mentioned earlier, Dreamweaver is known for having issues
with include files, can be slow when working on large projects with lots
of files, and is only available for Mac and Windows, which limits it
somewhat.
   

Indeed. I can't stand the thing myself - I was just being polite :)

I use netbeans on Linux and Windows, so its cross-platform nature is quite
important to me. I also appreciate the Subversion integration, which is very
nicely done.

Tedd: I'm no expert, but I'll chime in if I have any answers for you.

Cheers,

Mark

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


 



   


--

Saludos / Best regards

Mario Lacunza
Email:: mlacu...@gmail.com
Personal Website:: http://lacunza.biz/
Hosting:: http://mlv-host.com/
Google Talk: mlacunzav Skype: mlacunzav
MSN: mlacun...@hotmail.com Y! messenger: mlacunzav


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



Re: [PHP] MERRY XMAS

2008-12-24 Thread Kastner Mario
Merry XMas from Austria out to the world!

Love to everyone
Mario

http://unite-it.at

?php
function celebrateChristmas(array $people)
{
foreach ($people as $individuum)
{
printf(Wish you a merry Xmas, %s, $individuum);
}

singSomeChristmasCarols();
drinkSomeEggNog($dringToMuch = false);
// sendBillGatesAxMasEmail();

// ...  
}

?


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



Re: [PHP] PHP Form email w/attachment

2008-12-17 Thread Kastner Mario
use a mailer class, for example phpmailer, to handle this. man i say emailing 
could be a very crazy job for an coder. thank god that some guys make it 
simple for us ;)

http://sourceforge.net/projects/phpmailer


 I need to create a php form and mail it to a recipient (that I can do). My
 question is how do I create an area for a file (.doc, or .pdf) to be
 attached emailed along with other form data as well?

 -Jeff



Re: [PHP] Using DOM textContent Property

2008-09-09 Thread Mario Trojan

Hi Nathan,

if you're already speaking of iterating children, i'd like to ask you 
another question:


Basically i was trying to do the same thing as Tim, when i experienced 
some difficulties iterating over DOMElement-childNodes with foreach and 
manipulating strings inside the nodes or even replacing 
DOMElement/DOMNode/DOMText with another node. Instead, i am currently 
iterating like this:


$child = $element-firstChild;
while ($child != null) {
$next_sibling = $child-nextSibling;

// Do something with child (manipulate, replace, ...)

// Continue iteration
$child = $next_sibling
}

Is this correct, or is there any better way?

Thank you in advance!
Mario


Nathan Nobbe schrieb:

bouncing back to the list so that others may benefit from our work...

On Fri, Sep 5, 2008 at 3:09 PM, Tim Gustafson [EMAIL PROTECTED] wrote:


Nathan,

Thanks for the suggestion, but it's still not working for me.  Here's my
code:

===
$HTML = new DOMDocument();
@$HTML-loadHTML($text);
$Elements = $HTML-getElementsByTagName(*);

for ($X = 0; $X  $Elements-length; $X++) {
  $Element =  $Elements-item($X);

 if ($Element-tagName == a) {
   # SNIP - Do something with A tags here
 } else if ($Element instanceof DOMText) {
   echo $Element-nodeValue; exit;
 }
}
===

This loop never executes the instanceof part of the code.  If I add:

 } else if ($Element instanceof DOMNode) {
   echo foo!; exit;
 }

Then it echos foo! as expected.  It just seems that none of the nodes in
the tree are DOMText nodes.  In fact, get_class($Element) returns
DOMElement for every node in the tree.



Tim,

i got your code working with minimal effort by pulling in two of the methods
i posted and making some revisions.  scope it out,
(this will produce the same output as my last post (the part after OUT:))

?php
$text = 'htmlbodyTestbrh2[EMAIL PROTECTED]a name=barstuff
inside the link/aFoo/h2pcare/ppyoyser/p/body/html';
$HTML = new DOMDocument();
$HTML-loadHTML($text);
$Elements = $HTML-getElementsByTagName(*);

for ($X = 0; $X  $Elements-length; $X++) {
 $Element =  $Elements-item($X);
 if($Element-hasChildNodes())
foreach($Element-childNodes as $curChild)
 if ($curChild-nodeName == a) {
   # SNIP - Do something with A tags here
 } else if ($curChild instanceof DOMText) {
  convertToLinkIfNecc($Element, $curChild);
 }
}
echo $HTML-saveXML() . PHP_EOL;


function convertToLinkIfNecc(DomElement $textContainer, DOMText $textNode) {
if( (strtolower($textContainer-nodeName) != 'a') 
(filter_var($textNode-nodeValue, FILTER_VALIDATE_EMAIL) !== false)
) {
convertMailtoToAnchor($textContainer, $textNode);
}
}
function convertMailtoToAnchor(DomElement $textContainer, DOMText $textNode)
{
$newNode = new DomElement('a', $textNode-nodeValue);
$textContainer-replaceChild($newNode, $textNode);
$newNode-setAttribute('href', mailto:{$textNode-nodeValue});
}
?

so, the problem is iterating over a tree structure will only show you whats
at the first level of the tree.  this is why you need to call
hasChildNodes(), and if that is true, call childNodes() and iterate across
that (and really, the code should be doing the same thing there as well,
calling hasChildNodes() and iterating over the results of childNodes()).
the code i have shown will work for the html i posted, however it wont work
on (x)html where these text nodes we're searching for are deeper in the tree
than the second level.  im sure you can cook up something that will recurse
down to the leafs :)
anyway, im going to try and hook up a RecursiveDOMDocumentIterator that
implements RecursiveIterator so that it has the convenient foreach support.
also, ill probly try to hook up a Filter varient of this class so that
situations like this are trivial.

stay tuned :D

-nathan



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



Re: [PHP] PHP editor for linux

2008-08-15 Thread Mario Guenterberg
On Thu, Aug 14, 2008 at 07:32:13PM -0400, Eric Butera wrote:
 What sort of plugins do you use with vim?  For a while I was
 interested with it after seeing some presentations on it.  I never
 could figure out how to get it to do code completion based on methods
 of a class, it sort of jumbled all of them from a project together.  I
 also felt like it was a bit clunky jumping between files.  Using MVC
 means at least 3 files per uri so that got to be very tedious for me
 jumping between so many different files.  Any tips there?
 
 One of my favorite parts of pdt is the fact that I can code complete
 any class in my current project or anything that I specify in my
 include path.  Also you can jump to the exact class/method by control
 clicking on it too which is a huge time saver.  Is there anything like
 this?

Hi

I use vim + some plugins and a custom configuration. It works fine
in cli and as vim-gtk under debian/ubuntu.

The Plugins are NERDTree, PDV and debugger. This and a little own
vimrc makes we wonder how powerfull vim is.

The vim installation is a standard apt-get install way installation.

You can open mutliple files with NERDTree if you use the the tab-key. 
It is easy to handle more than 3 files recently, but a bigger 
resolution on your desktop is needed ;-)

So i can coding some lines or files, press CTRL-L for syntax
checking and have a wonderfull customizable syntax highlightning.

The autocomplete function works also very well. I have downloaded
the php5 funclist from rasmus and extend it if needed. Variables and
contants defined in the file that i edit are also autocompleted.

Happy coding
Mario

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

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



Re: [PHP] import XLS sheet into DB

2008-08-15 Thread Mario Guenterberg
On Fri, Aug 15, 2008 at 10:29:40AM +0200, Alain R. wrote:
 Hi,

 I would like to import content of an XLS sheet into a PostgreSQL DB (table).

 How can i do that ?

Your question is not php related ;-)

Maybe, export the sheet as comma separated csv file and import it to postgresql.

Happy coding
Mario

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


signature.asc
Description: Digital signature


Re: [PHP] What font/size do you use for programming?

2008-07-09 Thread Mario Guenterberg
On Tue, Jul 08, 2008 at 07:23:49PM -0400, tedd wrote:
 Hi gang:

 I'm running a Mac (so I know mine is a bit different size wise) but I'm 
 currently using Veranda at 14 point for coding.

 Just out of curiosity, what font and size do you ppls use for your 
 programming?


Monospace 9pt in Eclipse+PDT.

Greetings
Mario

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


signature.asc
Description: Digital signature


Re: [PHP] PHPExcel

2008-07-03 Thread Mario Guenterberg
On Thu, Jul 03, 2008 at 02:36:18PM -0400, Dan Shirah wrote:
 UGH!
 
 I am now constantly getting an error of PHP Fatal error: Allowed memory
 size of 16777216 bytes exhausted (tried to allocate 936 bytes) on line 689
 
 Is there a way to continuously write to the file and avoid getting this
 error?

Hi Dan...

change the value of memory_limit in your php.ini to a greater
value than 16M.

Greetings
Mario

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

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



[PHP] SimpleXML and registerXPathNamespace

2008-06-13 Thread Mario Caprino
Hi,

I am having problems with the below test case. I am using an extended
googlebase Atom format to store my data.  Included in the test case is
a simplified version of my XML-document.

PROBLEM:
Why do I need to re-register namespace 'a' when using xpath through
the result of a previous xpath()-statement?
As you may notice the same is not true for namespace 'g'.
I can't get this to make sense!

Any insight would be much appreciated.

Best regards,
Mario Caprino

?php
#Simpliefied sample data
$str= EOF
?xml version=1.0 encoding=iso-8859-1?
feed xmlns=http://www.w3.org/2005/Atom;
xmlns:g=http://base.google.com/ns/1.0;
xml:lang=en
entry
   g:mpn10100/g:mpn
   titleMy product/title
   title xml:lang=noMitt produkt/title
   g:price299/g:price
/entry
/feed
EOF;

#Load document
$xml= simplexml_load_string ($str);
$xml-registerXPathNamespace ('a', 'http://www.w3.org/2005/Atom');
$xml-registerXPathNamespace ('g', 'http://base.google.com/ns/1.0');

echo This is what I am trying to achieve...\n;
$lang= 'no';
$id= '10100';
$title= $xml-xpath (/a:feed/a:entry[g:mpn='$id']/a:title[lang('$lang')]);
echo utf8_decode ($title[0]) . \n;

#---

echo But I'd fist like to store the entity node, and then request
several data nodes relative to it\n;
$entry= $xml-xpath (/a:feed/a:entry[g:mpn='$id']);
$entry= $entry[0];


$price= $entry-xpath (g:price);
echo This works as expected: $price[0]\n;

#$entry-registerXPathNamespace ('a', 'http://www.w3.org/2005/Atom');
$title= $entry-xpath (a:title[lang('$lang')]);
echo '... but this will only work if I re-register the namespace a?
' . utf8_decode ($title[0]);
?

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



Re: [PHP] preg_match_all

2008-05-29 Thread Mario Guenterberg
On Thu, May 29, 2008 at 01:07:11PM -0500, Chris W wrote:
 What I want to do is find all links in an html file.  I have the pattern  
 below.  It works as long as there is only one link on a line and as long  
 as the whole link is one line.  It seems there should be a way to get  
 this to work with more than one link on a single line.  The work around  
 I have done for now is to read the whole file into a buffer and remove  
 all new lines and then add a new line after every closing a tag.  Then  
 process each line.  There has to be a better way.

 Any Ideas?  Also note I don't want to find any a tags that don't have an  
 href there probably aren't any but just in case.


 preg_match_all(/( *a[^]*href[^]+)(.*)\/a/, $Line, $matches,  
 PREG_PATTERN_ORDER);

Hi...

I have a little function to explode URLs with the following pattern:

$str = filename;

$pattern = '=^.*a .* href\=(.*[://]|[:])(\S+)[^]*(.*)/a.*$=ims';

while (preg_match($pattern, $line, $exploded_url)) {
some usefull stuff
returns an array ($exploded_url)
}

$exploded_url[1] = protocoll;
$exploded_url[2] = URL;
$exploded_url[3] = name of the URL;

greetings
MG

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

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



Re: [PHP] Incorrect version shown in phpinfo() and phpversion() in 5.2.6

2008-05-06 Thread Mario Guenterberg
On Tue, May 06, 2008 at 02:00:33PM -0400, Scott Lerman wrote:
 Yup, I restarted Apache several times. The httpd.conf line I have is
 LoadModule php5_module C:/Program
 Files/PHP/php-5.2.6-Win32/php5apache2.dll. If nobody else has seen
 this problem, I'll just assume it's some oddity on my system. I just
 figured I'd mention it in case others were having the same problem.

It's better to use a path without whitespaces, eg. c:\php instead of
c:\program files\php.

Have you copied some php5X.dlls from prior installations of php to
windows's system folder?

Greetings
guenti

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

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



Re: [PHP] Apache child pid segfault + APD

2008-05-05 Thread Mario Guenterberg
On Mon, May 05, 2008 at 02:41:17AM -0700, Waynn Lue wrote:
 My main problem with using xdebug was that it seemed to require KDE to
 interpret the traces that it took, which I don't have installed on my
 server.  I only spent 15 minutes looking at it, though, so that could
 be completely unjustified...
 
 Would upgrading glibc help?
 
 On Sat, May 3, 2008 at 12:48 AM, Mario Guenterberg [EMAIL PROTECTED] wrote:
  On Fri, May 02, 2008 at 10:24:03PM -0700, Waynn Lue wrote:
 
*** glibc detected *** free(): invalid pointer: 0x002a9956d000 ***
 
   Hi Waynn,
 
   try to use xdebug instead of APD to profile you app. There is a problem 
  with your glibc
   version and your APD version.
 
   In my environment php 5.2.6 with suhosin/apc, apache 2.2.8 and xdebug 
  2.0.2 it works fine.

Upgrading the glibc on a server is not the best choice to solve a
problem with a extension for php ;-).

There's a webfrontend for xdebug.

Greetings
guenti

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

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



Re: [PHP] Apache child pid segfault + APD

2008-05-03 Thread Mario Guenterberg
On Fri, May 02, 2008 at 10:24:03PM -0700, Waynn Lue wrote:

 *** glibc detected *** free(): invalid pointer: 0x002a9956d000 ***

Hi Waynn,

try to use xdebug instead of APD to profile you app. There is a problem with 
your glibc
version and your APD version.

In my environment php 5.2.6 with suhosin/apc, apache 2.2.8 and xdebug 2.0.2 it 
works fine.

Greetings
Mario

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

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



Re: [PHP] php-5.2.5 glibc detected *** free()

2008-02-23 Thread Mario Guenterberg
On Sat, Feb 23, 2008 at 12:03:16PM +0100, [EMAIL PROTECTED] wrote:
 Hello all

 I got glibc detected errors about several php extensions on my debian  
 box both by executing php-cgi or php-cli.

 Config:
 # cat /proc/version
 Linux version 2.6.24-rc7-vs2.2.0.5.0.7 ([EMAIL PROTECTED]) (gcc version 4.1.2 
  
 20061115 (prerelease) (Debian 4.1.1-21)) #2 SMP

 # gcc --version
 gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

 # dpkg -l libc6
 libc6   2.3.6.ds1-13etch5

 I'm running on debian-etch stable/backports.

 I build php-5.2.5 with this configure line:

 ./configure  --enable-bcmath  --enable-calendar  --enable-exif  
 --enable-ftp  --enable-shmop  --enable-soap  --enable-sockets  
 --enable-sysvmsg  --enable-sysvsem  --enable-sysvshm  
 --enable-memory-limit  --enable-wddx  --enable-fastcgi  --enable-dio  
 --enable-dmalloc  --enable-force-cgi-redirect  --enable-discard-path  
 --with-gmp=shared,/usr  --with-gettext=shared,/usr  
 --with-mysql=shared,/usr  --with-pdo-mysql=shared,/usr  
 --with-mysqli=shared  --with-gd=shared  --with-jpeg-dir=/usr  
 --with-png-dir=/usr  --with-zlib  --with-zlib-dir=/usr  
 --with-xpm-dir=/usr  --with-freetype-dir=/usr  --with-libt1=/usr  
 --enable-gd-native-ttf  --with-pgsql=shared,/usr  
 --with-pdo-pgsql=shared,/usr  --with-curl=shared,/usr  
 --with-curlwrappers  --with-xsl  --with-xmlrpc  --enable-xslt  
 --with-xslt-sablot=/usr  --with-mhash=shared,/usr  
 --enable-dba=shared,/usr  --with-gdbm=/usr  --with-db4=/usr  --with-cdb  
 --with-mm=/usr  --with-bz2=shared,/usr  --with-imap=shared,/usr  
 --with-kerberos  --with-imap-ssl  --with-readline  --with-pcre-regex  
 --enable-pcntl  --enable-simplexml  --enable-ctype  
 --with-ming=shared,/usr  --with-ncurses=shared,/usr  --enable-mbstring  
 --with-inifile  --with-flatfile  --with-iconv  --with-ldap=shared,/usr  
 --enable-gd-native-ttf  --with-dom=/usr  --with-dom-xslt=/usr  
 --with-dom-exslt=/usr  --with-expat-dir=/usr  --with-zip=shared,/usr  
 --with-openssl=/usr  --with-snmp=shared,/usr  --with-ttf=shared,/usr  
 --with-libxml-dir=/usr  --enable-dbase  --enable-dbx  --enable-dio  
 --enable-filepro  --enable-sqlite-utf8  --with-mcrypt=shared,/usr  
 --with-pspell=shared,/usr  --with-unixODBC=shared,/usr

 The errors occurs when i want to activate several shared extensions:  
 pgsql, snmp, mcrypt.

 I'm really confused because if i build these extensions statically all  
 works fine ( ./configure ..blabla... --with-pgsql ... --with-mcrypt )

 I've a little script script to test pgsql connection :

 ?
 $dbconn = pg_connect(host=192.168.0.230 port=5432  user=demo  
 password=demo dbname=demo);
 $query = pg_exec ($dbconn, SELECT * FROM agenda);
 
 ?

 If i call this script via a web browser i got in apache log:

 [Fri Feb 22 21:40:30 2008] [error] [client 192.168.0.22] *** glibc  
 detected *** free(): invalid pointer: 0xb6b3f880 ***
 [Fri Feb 22 21:40:30 2008] [error] [client 192.168.0.22] Premature end  
 of script headers: listepg.php

 If i call this script on command line, same error:

 etch:/web/clients/client1/www# php -c ../php.ini listepg.php
 connexion*** glibc detected *** free(): invalid pointer: 0xb48b8280 ***
 Abandon

 I'm knocking my head on the walls since several months about this issue  
 which i didn't meet with previous versions of php (i compile myself  
 since php-5.0.0RC1). All was working fine until i upgrade to php-5.2.x.

 More strange: i've installed php-xxx.deb from dotdeb packages (added in  
 my sources.list) where these extensions are shared and in this case all  
 works fine. I've asked dotdeb developper what may cause this issue on my  
 box but he couldn't spent many time to debug my problem.

 In doubt, i've reinstalled all lib-dev invoked by configure script  
 but always same error. I've tried on 2 others machines with same distro  
 and i got same error, too.

 I think i make a mistake during php configuration but can't find where.

 Any help/idea please ...

 If you need more info, i can provide them

Hello

download the php-xxx.diff.gz from dotdeb source repo and see if there 
any differences in the debian/rules file from this diff to your 
configure options. The debian/control file has listed all the 
dependencies for build the php-xxx.deb packages. See also in this file
for mistakes in your environment.

Greetings
Mario

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


signature.asc
Description: Digital signature


Re: [PHP] PHP To an EXE Executable for Win32 ( Is it possible)

2008-02-21 Thread Mario Guenterberg
On Thu, Feb 21, 2008 at 02:16:55PM -0700, Dan wrote:
 I know that there's apparently some way to compile PHP to make it run  
 faster.  But has anyone come up with a system to turn PHP scripts into an 
 .exe?  What I mean is you would run the exe and see exactly the same 
 thing as if you were viewing the script through a webbrowser, but without 
 having to install php.

 What is the name of this?

Hi...

look at this:
http://www.php-editors.com/forums/other-php-tools/2374-php-compiler-embedder-php2exe.html

Greetings
Mario

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


signature.asc
Description: Digital signature


Re: [PHP] PHP ide?

2007-11-11 Thread Mario Guenterberg
On Fri, Nov 09, 2007 at 01:44:19PM +, Lester Caine wrote:
 Tiago Silva wrote:
 Lester Caine escreveu:
 Robert Cummings wrote:
 Ubuntu = Debian + New Life

 Mandriva has Eclipse and PHPEclipse 'out of the box' along with Apache 
 and PHP
 I can build a fully functional development machine from a pile of bits in 
 under an hour ;)
 And currently that includes downloading the latest updates :)

 I use an OS called Windows Vista :-P
 hahahha crap(I use openSuse... ;-) )
 Guys, talking about features of distributions is a looping question...it's 
 a vicious endless thing...
 let's talk about PHP ide's ok?
 I use eclipse, with PHPEclipse it's fullfeatured for PHP, look, FOR PHP!
 The good programmer don't need a full featured IDE, like Delphi for PHP 
 and anyothers that wrap you behind the scenes...

 Not had to bother with vista yet - in fact a lot of my hardware intensive 
 stuff simply will not run on it :(
 BUT the best thing about Eclipse is that it runs the same on windows as 
 Linux, so I don't have to have different environments on each. I just run a 
 local CSV server and sync things between the two environments. And now I 
 can move stuff that was originally developed on Windows over to Linux
 - or replace it with PHP powered stuff :)

Hi all...

in the past i'd worked for a web development company. We had some
Windows, some MacOSX and some Linux workstations and a central
Dedian development server. The best solution to work with an IDE 
was the use of Eclipse with the needed plugins. On every machine the
same environment for development and the individual stuff for
design/grafix and more. No problems with a central subversion/CVS
repo and a NFS/Samba share for the apache document root on the devel
server.

regards
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] Announcing Xaja, a PHP Reverse Ajax framework

2007-07-13 Thread Mario Guenterberg
On Fri, Jul 13, 2007 at 12:44:35PM +0200, David Négrier wrote:
  Hi Mario, hi Stuart,
 
  I fixed the SVN repository. You can try it now, it works better.
  Regarding the way Xaja is pronounced well  that's a good 
  question.
  Actually, I'm French and my pronunciation is... well... French ;), so I 
  won't give you any advice on how to pronounce it.
  However, I will present Xaja in San Francisco at the Ajax Experience (a 
  conference about Web 2.0 development). I will ask some people there if they 
  can give me a clue on the way to pronounce it in English ;).
 
  Best regards,
  David.

Now it works fine. :-) Thanks.
I will test it and give you some response, if you want it.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


pgpKtNDgyNqk7.pgp
Description: PGP signature


Re: [PHP] Announcing Xaja, a PHP Reverse Ajax framework

2007-07-13 Thread Mario Guenterberg
On Fri, Jul 13, 2007 at 10:10:15AM +0200, David Négrier wrote:

  Xaja is still in an early stage of development, but it is time for us to get 
  some feedback (or some help, since it is released in GPL). You can download 
  an alpha version of Xaja from http://www.thecodingmachine.com/projects/xaja
  You can view a screencast presenting Xaja at : 
  http://www.thecodingmachine.com/cmsDoc/xaja/trunk/screencast.html?group_id=29
 
  Thanks in advance to anyone sending me comments or problems regarding Xaja.
 

Hi...

I will test your framework but the checkout for the svn repo don't
accept the username and password documented in the website. :-(

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


pgpiWaKUOc2F6.pgp
Description: PGP signature


Re: [PHP] About Eclipse JVM Termination

2007-07-10 Thread Mario Guenterberg
On Tue, Jul 10, 2007 at 02:25:49AM -0700, Kelvin Park wrote:
  Do you know the cause of this error?
  I'm trying to run it on 64bit Fedora 7. I have AMD64 and JRE 1.6.0_02 64bit
  is installed.
  Do you know how to fix the following error? if yes how?
 
  
 **
  JVM terminated. Exit code=13
  /usr/java/jre1.6.0_02/bin/java
  -Xms40m
  -Xmx256m
  -jar
  
 /home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070516.jar
  -os linux
  -ws gtk
  -arch x86
  -showsplash
  -launcher /home/kelvino/downloads/eclipse/eclipse
  -name Eclipse
  
 --launcher.library/home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.0.v20070516/eclipse_1017.so
  -startup
  
 /home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070516.jar
  -exitdata 158008
  -clean
  -data /tmp_workspace
  -vm /usr/java/jre1.6.0_02/bin/java
  -vmargs
  -Xms40m
  -Xmx256m
  -jar
  
 /home/kelvino/downloads/eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070516.jar
 
 
  
 **

Ehm, wrong list?
Try the eclipse mailing lists to solve your problem.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


pgpV2yMR6YWYT.pgp
Description: PGP signature


Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Mario Guenterberg
On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote:
  I've build my own Linux, so good to know how to change it :)
 
  Tijnema

Ahh, a linux from scratch user, eh? :-)
If you need it or want some usefull input, I have very usefull
build scripts for apache/php and mysql/postgresql. I use this scripts
for my own builds from scratch or vanilla source.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


pgpfL9WPzFBoe.pgp
Description: PGP signature


Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Mario Guenterberg
On Mon, Jul 09, 2007 at 10:38:24PM +0200, Tijnema wrote:
  On 7/9/07, Mario Guenterberg [EMAIL PROTECTED] wrote:
  On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote:
I've build my own Linux, so good to know how to change it :)
  
Tijnema
 
  Ahh, a linux from scratch user, eh? :-)
  If you need it or want some usefull input, I have very usefull
  build scripts for apache/php and mysql/postgresql. I use this scripts
  for my own builds from scratch or vanilla source.
 
  Greetings
  Mario
 
 
  It has an LFS base yes ;)
 
  When I had the base LFS system, I continued on my own, no BLFS or
  such, and a lot of unstable code fixes, which was more like making
  bugs in programs to fix compile errors ;), commenting out some mem
  calls or such :P

  Can't remember that I've changed anything in PHP/Apache/MySQL or
  PostgreSQL, but still interested in your scripts :)
 
  Tijnema

I don't change the sources even if security bugs or issues are known.
The only 3rd party patch I ever applied for php is hardened php/suhosin.

I attach the scripts to this mail.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


build-apache2.sh
Description: Bourne shell script


build-mysql5.sh
Description: Bourne shell script


build-pgsql8.sh
Description: Bourne shell script


build-php5.sh
Description: Bourne shell script


pgpXXBXUvZAVs.pgp
Description: PGP signature


Re: [PHP] Where does PHP look for php.ini??

2007-07-08 Thread Mario Guenterberg
On Sat, Jul 07, 2007 at 02:08:21AM +0200, Tijnema wrote:
  Hi,
 
  I just noted that my php (CLI and Apache2 SAPI) doesn't read my php.ini in 
  /etc
  I have compiled php with --prefix=/usr, and my /usr/etc is symlinked
  to /etc, but it doesn't read the php.ini file..
  when I use the CLI with -c /etc it works fine :)
 
Hi...

you can use the configure parameter --with-config-file-path.

Greetings
Mario
-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


pgpxq2gntGTLy.pgp
Description: PGP signature


Re: [PHP] Re: php security books

2007-07-04 Thread Mario Guenterberg
On Wed, Jul 04, 2007 at 11:36:06AM -0700, bruce wrote:
 andrew...
 
 are you sure about this... i would have thought that if you have an apache
 user 'apache' and allow php to be run as/by 'apache' than this would provide
 complete access to anything php needs to do as 'apache'.
 
 this should definitely work if you allow the 'group' for the apache err log
 files be accessed by this user...
 
 so.. i ask again.. are you sure about this..
 

Hi all...

the only owner with write permissions of the logs is root! I mean
the standard configuration for the apache webserver. Read
permissions for groups for the apache logs can be different per distribution. 
You can configure your environment for the PHP processes to log in seperate
files. 
If you allow write access for the 'group' you open the door
wide for hackers.

greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


pgpQLSOhWvwKR.pgp
Description: PGP signature


Re: [PHP] Cannot remove PHP Version 5.2.1-0.dotdeb.1

2007-04-04 Thread Mario Guenterberg
On Tue, Apr 03, 2007 at 08:56:12PM -0300, Miles Thompson wrote:
 Mario,
 
 Boy it's been a long day - it seems that every item I had in by configure
 batch had to be installed; then at the very end of the day it finally got to
 the --with-mysql. Had quite a scramble tryingto find the correct dev
 environment, then finally I was down to to two warning errors, one of  which
 was for sqlite.
 
 Tried a make, but it wouldn't go, so I ran configure again, explicitly
 stating with no sqlite.
 
 Tried make again and it completed.
 
 Ran checkinstall and it packaged the puppy, installed it and signed off with
 a pleasant note on how to uninstall if necessary.
 
 Tomorrow we'll see how it  works, and I hope I did not clobber mysql as part
 of this.
 
 There's an incompatibility between bzip2 and prefork-apache2-dev (or
 something like that). Running one clobbers the other, so since I needed
 apxs2 more than bzip2, that was dropped from the configuration.
 
 If you're interested I'll post another update tomorrow.
 

Hi Miles,

can you post your ./configure options.
apache2-prefork-dev is the right devel package and in my environment
that works fine with bzip2 and sqlite. Have you installed the
libsqlite0-dev and libsqlite3-dev packages and the libbz2-dev
package?

I've written a little install shellscript for my own use.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


build-php5.sh
Description: Bourne shell script
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Cannot remove PHP Version 5.2.1-0.dotdeb.1

2007-04-03 Thread Mario Guenterberg
On Tue, Apr 03, 2007 at 08:50:31AM -0300, Miles Thompson wrote:
 Mario,
 
 That did it - when I tried to reload the phpinof.php script Apache did not
 know what to do with the file.
 
 Now I'll drag the compiler from it's dusty corner and start from scratch.

Not the debian/ubuntu way but sometimes the best solution ;-)

 Thanks a million - Miles
:-)

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] Cannot remove PHP Version 5.2.1-0.dotdeb.1

2007-04-02 Thread Mario Guenterberg
On Mon, Apr 02, 2007 at 04:52:02PM -0300, Miles Thompson wrote:
 This probably belongs under php-install, but thought I would try here first,
 and it comes under the general header of Be careful what you wish for.
 
 On a new Ubuntu (Debian) server I installed this version of PHP because I
 wanted some 5.2 features. It's the hardened version, and not the one we
 want.
 
 I have done the conventional aptitude remove php5, and then went to all of
 the directories returned by whereis php5 and manually removed them.
 
 I've rebooted both the server and my own computer, and still a
 http://localhost/phpinfo.php returns the phpinfo() data AND shows
 configuration file paths: etc/php5/apache2 and /etc/php5/apache2/conf.d
 which have been deleted.

Try dpkg --purge php-5.2.1 or so.
You may have only the php binaries (CLI) removed.
This removes the config-scripts at all.
Apt-get remove libapache2-mod-php5 removes your apache2 modules and
the dpkt --purge libapache2-mod-php5 removes all the config scripts
of them.

I have build php 5.2.1 from source on Ubuntu 6.10 and it works
fine. Installad in /usr/local for some system reasons and of course
a easy way to upgrade.

Greetings
Mario
-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] FastCGI + PHP5

2007-03-31 Thread Mario Guenterberg
On Fri, Mar 30, 2007 at 07:00:07PM -0400, Stevie wrote:
 Hi all.

 anyone have any decent docs getting the config working? i guess not many 
 people using FastCGI w/PHP because it's seems so complicated to setup.
 btw i have already installed the fastcgi libs and mod_fastcgi. what 
 should an apache configure line look like when you complie php/fastcgi 
 with it.. am i suppose to install apache first? some people say you have 
 to install apache first but if you install apache first how will it 
 locate the php libs?

Hi..

Try this http://www.fastcgi.com/docs/faq.html#PHP

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] FastCGI + PHP5

2007-03-31 Thread Mario Guenterberg
On Fri, Mar 30, 2007 at 07:00:07PM -0400, Stevie wrote:

or this:
http://www.webhostingtalk.com/archive/index.php/t-509127-p-1.html

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] Ide help needed

2007-03-30 Thread Mario Guenterberg
On Fri, Mar 30, 2007 at 11:09:02PM +0530, [EMAIL PROTECTED] wrote:
 I am a beginer with php and i need to know which IDE is best suited
 under windows and linux both
 
 i have seen dreamweaver working and have heard about GoLive too but don't
 know whichone to go for
 
 can you please help me decide
 and also
 tell me some other IDE's if possible

Hi...

I use Eclipse with a PHP plugin on both Windows and Linux.
There are 2 good plugins available: PHP-IDE from eclipse.org and
PHPEclipse. I prefer PHP-IDE. You can use any usefull other plugins
(Tidy, Clay, Quantum) for work with any solution you need.
All of this is open source...

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't

2007-03-28 Thread Mario Guenterberg
On Wed, Mar 28, 2007 at 07:20:37AM -0500, Myron Turner wrote:
 It's hard to see how this could be a browser issue.  Firefox does not 
 parse the scripts.  The scripts are parsed on the server, under Apache.  
 The server outputs the result of the parsing and the browser displays 
 the result. 

I know that the browser does not parse the scripts. But what the
hell is the problem? I have changed the apache log settings to debug 
and nothing to see in the log files. The amusing of this is the
old mozilla works fine with the same script. Firefox pop up a download
window. The script is well formed, ?php ? tags are included. I
would not be surprised when I see the source of the script in
firefox. But a download window???

The problem is very irregularly. Sometimes the effect steps on new
scripts, sometimes on old scripts that worked before. 

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] Re: PHP 5.2.1: Some scripts are being parsed, but most aren't

2007-03-28 Thread Mario Guenterberg
On Wed, Mar 28, 2007 at 01:50:39PM +0100, Colin Guthrie wrote:

 Should get you some output... check the headers, check the content etc.

I've checked twice the big apache log files and found some
segmentation faults! Mhm, with a vanilla apache 2.2.4 the problem
did not emerge. I would change the default apache 2.0.55 from ubuntu
to vanilla apache 2.2.4.

Greetings and thanks
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


[PHP] Smarty Website down?

2007-03-27 Thread Mario Guenterberg
Hi...

I try to connect in the last hours and the results are timeouts.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -

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



Re: [PHP] Re: Smarty Website down?

2007-03-27 Thread Mario Guenterberg
On Tue, Mar 27, 2007 at 07:27:18AM -0500, itoctopus wrote:
 looks ok now
 
The site is ok now.

Thanks Mario
-- 
 --
| havelsoft.com - Ihr Service Partner fuer Open Source |
| Tel:  033876-21 966  |
| Notruf: 0173-277 33 60   |
| http://www.havelsoft.com |
|  |
| Inhaber: Mario Guenterberg   |
| Muetzlitzer Strasse 19   |
| 14715 Maerkisch Luch |
 --


signature.asc
Description: Digital signature


Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't

2007-03-27 Thread Mario Guenterberg
On Tue, Mar 27, 2007 at 10:22:40PM -0700, Eddie wrote:
 Hi all,
 
 Previously, I had installed Apache 1.3.37 with PHP 5.2.1 as
 a static module on Ubuntu 6.06. I am having a problem where,
 for some reason, some of my PHP scripts just show source
 code, while some are parsed.

Hi...

I have a problem something similar. Any scripts would be parsed, any
would be downloaded in fireofx 2.x. I use Ubuntu 6.10. My solution
is to start the ancient Mozilla browser, with this browser works
everything fine. I think it is a firefox problem?! My server is
apache 2.0.55 with php 5.2.1.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


signature.asc
Description: Digital signature


Re: [PHP] Performance: While or For loop

2007-03-22 Thread Mario Guenterberg
On Fri, Mar 23, 2007 at 12:24:45AM -0500, Travis Doherty wrote:
 After multiple runs I see that the for pre-increment loop is fastest. 
 Note that the while loop with a post-increment runs once more than with
 a pre-increment.
 
 Everytime I run, the results are *very* different, though still fall
 within similar comparitive domains.

Hi...

I used your script and my results are different from yours.
The post-while increment is generally the fastest result on my
machine (Core 2 Duo, php 5.2.1 and apache 2.2.4).

I ran the script multiple times:

[schnipp ]

For pre-increment (10): 0.066
For post-increment (10): 0.066
While pre-increment (10): 0.028
While post-increment (11): 0.025

[schnipp ]

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -

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



Re: [PHP] Espanol en esto lista

2006-08-16 Thread Mario de Frutos
Hi everyone!

I'm spanish and i don't have any problem to answer his questions.

Cheers

Peter Lauri escribió:
 I have no clue what he is saying, but I believe he is asking if there is any
 list in Spanish he can join. But I might be wrong :)
 
 -Original Message-
 From: Dave Goodchild [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, August 16, 2006 5:20 PM
 To: Rory Browne
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Espanol en esto lista
 
 Hablo espanol, pero lo que Rory dice es verdad, hay otra lista en espanol.
 Pero, si quieres, you tratare entender tu palabra.


 In short, speaking a language other than English on this list( especially
 considering that there is a php.general.es -
 http://news.php.net/php.general.es ), is similar to whispering in company.
 Most of us don't understand what you're saying.

 Rory


 
 


-- 
**
FUNDACIÓN CARTIF

  MARIO DE FRUTOS DIEGUEZ - Email: [EMAIL PROTECTED]
 División de Ingeniería del Software y Comunicaciones

   Parque Tecnológico de Boecillo, Parcela 205
   47151 - Boecillo (Valladolid) España
  Tel.   (34) 983.54.88.21 Fax(34) 983.54.65.21
**
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información CONFIDENCIAL sometida a secreto profesional o cuya
divulgación esté prohibida en virtud de la legislación vigente. Si ha
recibido este mensaje por error, le rogamos que nos lo comunique
inmediatamente por esta misma vía y proceda a su destrucción.

Nótese que el correo electrónico via Internet no permite asegurar ni la
confidencialidad de los mensajes que se transmiten ni la correcta
recepción de los mismos. En el caso de que el destinatario de este
mensaje no consintiera la utilización del correo electrónico vía
Internet, rogamos lo ponga en nuestro conocimiento de manera inmediata.
***
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by a professional
privilege or whose disclosure is prohibited by law. If this message has
been received in error, please immediately notify us via e-mail and
delete it.

Please note that Internet e-mail neither guarantees the confidentiality
nor the proper receipt of the messages sent. If the addressee of this
message does not consent to the use of Internet e-mail, please
communicate it to us immediately.


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



Re: Re: [PHP] transform RDF to HTML via XSL and PHP

2006-06-12 Thread Mario Pavlov
 xsl:template match=rdf:RDF
 html
 body
 table border=1
 xsl:for-each select=item
 tr
 tdxsl:value-of select=title//td
 tdxsl:value-of select=link//td
 /tr
 /xsl:for-each
 /table
 /body
 /html
 /xsl:template
 /xsl:stylesheet



I'ts been awhile, but try the above.

--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html


nope
it doesn't work like this
still the same result
I think the problem is in the way that I'm accessing the elements
how exactly this should be done ?... 

-
http://www.sportni.bg/worldcup/ - Германия 2006 - Световното първенство по 
футбол наближава!

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



Re: Re: [PHP] transform RDF to HTML via XSL and PHP

2006-06-12 Thread Mario Pavlov
 Mario Pavlov wrote:
 
  nope
  it doesn't work like this
  still the same result
  I think the problem is in the way that I'm accessing the elements
  how exactly this should be done ?... 
 
 Its due to default namespaces in the feed. The item elements and its 
 child elements are in the default namespace: 
 http://my.netscape.com/rdf/simple/0.9/
 
 You need to declare this namespace with a prefix in order to access the 
 elements within the stylesheet (same as using XPath).
 
 i.e. the following stylesheet uses the prefix rdf9 for that namespace.
 
 ?xml version=1.0 encoding=ISO-8859-1?
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#;
 xmlns:rdf9=http://my.netscape.com/rdf/simple/0.9/;
 xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/
 
 xsl:template match=/
   html
body
  table border=1
xsl:for-each select=//rdf:RDF/rdf9:item
tr
  tdxsl:value-of select=rdf9:title//td
  tdxsl:value-of select=rdf9:link//td
/tr
/xsl:for-each
  /table
/body
/html
 /xsl:template
 /xsl:stylesheet
 
 Rob
 
 -- 
 [EMAIL PROTECTED]
 author of Pro PHP XML and Web Services from Apress
 

thank you man!! :)
I can't believe it, it just WORKS :)
thank you very much!
it took me about a week ...
thank you again! :)
god bless you :)

-
http://www.sportni.bg/worldcup/ - Германия 2006 - Световното първенство по 
футбол наближава!

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



[PHP] Re: fread problem

2006-01-03 Thread Mario de Frutos Dieguez
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yes, sorry i forget send some example code. Here is:


$xml_parser = xml_parser_create();
// usa case-folding para que estemos seguros de encontrar la etiqueta
// en $map_array
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($xml_parser, startElement, endElement);
xml_set_character_data_handler($xml_parser, characterData);
if (!($fp = fopen($file, rb))) {
   die(could not open XML input);
}

while ($data = fread($fp, 12288)) {
   if (!xml_parse($xml_parser, $data, feof($fp))) {
   die(sprintf(XML error: %s at line %d,
   xml_error_string(xml_get_error_code($xml_parser)),
   xml_get_current_line_number($xml_parser)));
   }
}   

If i put fread($fp, 8192) i obtain the same text and if a put 4096 it
cut before.
- --
**
FUNDACIÓN CARTIF

  MARIO DE FRUTOS DIEGUEZ - Email: [EMAIL PROTECTED]
 División de Ingeniería del Software y Comunicaciones

   Parque Tecnológico de Boecillo, Parcela 205
   47151 - Boecillo (Valladolid) España
  Tel.   (34) 983.54.88.21 Fax(34) 983.54.65.21
**
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información CONFIDENCIAL sometida a secreto profesional o cuya
divulgación esté prohibida en virtud de la legislación vigente. Si ha
recibido este mensaje por error, le rogamos que nos lo comunique
inmediatamente por esta misma vía y proceda a su destrucción.

Nótese que el correo electrónico via Internet no permite asegurar ni la
confidencialidad de los mensajes que se transmiten ni la correcta
recepción de los mismos. En el caso de que el destinatario de este
mensaje no consintiera la utilización del correo electrónico vía
Internet, rogamos lo ponga en nuestro conocimiento de manera inmediata.
***
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by a professional
privilege or whose disclosure is prohibited by law. If this message has
been received in error, please immediately notify us via e-mail and
delete it.

Please note that Internet e-mail neither guarantees the confidentiality
nor the proper receipt of the messages sent. If the addressee of this
message does not consent to the use of Internet e-mail, please
communicate it to us immediately.

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

iD8DBQFDunbvbPPtxT8v/3wRAjBwAJ4kHE0cdyrvruFE3LlSGXMKFri5fwCfU7ii
machwamViid/Hr8lXPrv8e8=
=xyJI
-END PGP SIGNATURE-

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



[PHP] fread problem

2006-01-02 Thread Mario de Frutos Dieguez
Hi!

I have a problem using fread with a XML document. When i read some nodes
with a great amount of text it cuts in the same place of the text. There
are any limitation of text or something? I have in the php.ini the amount
of memory in 256M.

Thanks in advance

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



[PHP] PHP/MySQL offline

2005-09-04 Thread Mario netMines

Hi all

I have a project where I'm using PHP/Mysql. The client wants to run that 
project to a cd.
Does anyone know of a trick either by using javascript, XML or an automated 
script that creates a static site that will allow me to do that?


Many Thanks

M 


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



[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Install PHP in Linux

2005-08-18 Thread Mario Lacunza
Hello,

Im newbie in Linux and I need your help for install PHP5 in my Ubuntu
5.04 Linux distro, any links, manuals, etc

Thansk in advance!!

-- 
Saludos / Best regards

Mario Lacunza
Desarrollador de Sistemas - Webmaster
Email: [EMAIL PROTECTED]
Email: [EMAIL PROTECTED]
Messenger MSN: [EMAIL PROTECTED]
Website: http://www.lacunza.tk
Lima - Peru

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



[PHP] URL decode

2005-07-10 Thread Mario netMines

Hi all

I have a value like: %u0394%u0397%u03A4%u039C%u039B

Is there a way to decode to normal characters (like javascript's unescape() 
function)


Thanks in advance

Mario 


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



Re: [PHP] Re: date problem

2005-06-29 Thread Mario netMines
Isn't DATEDIFF() a MySQL 4.x function? The server I'm using has 3.x and I 
can't upgrade...


- Original Message - 
From: Jasper Bryant-Greene [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Wednesday, June 29, 2005 7:49 AM
Subject: Re: [PHP] Re: date problem



Mario netMines wrote:

Hi Jasper and thanks for the quick reply.

something tells me it's not a straightforward SQL query that I have to
use here but a logic using PHP and SQL.


Please don't top-post.

It can be done in SQL quite easily, as can many things people use PHP
for. Go to the MySQL manual at http://dev.mysql.com/ and read up on
Date/Time functions, specifically the DATEDIFF() function. IIRC, it
returns the difference between two dates.

You can perform many types of arithmetic on the return value of the
function which should help to get the result you want. Try the MySQL
mailing lists if you can't figure it out, or if you're completely stuck
and are *convinced* it's a PHP problem (which I doubt, but I could be
wrong) then by all means come back!

Cheers

Jasper

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




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



[PHP] date problem

2005-06-28 Thread Mario netMines

Hi all

I have a database that holds car rental info
DB:
carrental_from (datetime field)
carrental_to (datetime field)
carrental_price (datetime field) [rates are per hour]
The values I have are like:
-00-00 00:00:00,-00-00 07:00:00,10 (all year around 00:00-07:00)
-00-00 07:00:00,-00-00 00:00:00,20 (all year around 07:00-00:00)
2005-12-22 07:00:00,2006-01-02 00:00:00,15 (christmas period 00:00-07:00)
2005-12-22 00:00:00,2006-01-02 07:00:00,25 (christmas period 07:00-00:00)

The user selects dates ($from - $to) to rent a car and he gets the price 
accordingly.
I can do a (($to-$from)/60/60) and get the total number of hours but 
depending on the date and time you get a different result. Can anyone help 
with the SQL?


Thanks in advance

Mario 


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



Re: [PHP] Re: date problem

2005-06-28 Thread Mario netMines

Hi Jasper and thanks for the quick reply.

something tells me it's not a straightforward SQL query that I have to use 
here but a logic using PHP and SQL.


Mario
- Original Message - 
From: Jasper Bryant-Greene [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Wednesday, June 29, 2005 4:28 AM
Subject: [PHP] Re: date problem



Firstly, this shouldn't be in the PHP list, as you're asking for help
with SQL.

Mario netMines wrote:

carrental_from (datetime field)
carrental_to (datetime field)
carrental_price (datetime field) [rates are per hour]


carrental_price shouldn't be a datetime field, as it isn't a datetime 
value.



The values I have are like:
-00-00 00:00:00,-00-00 07:00:00,10 (all year around 00:00-07:00)
-00-00 07:00:00,-00-00 00:00:00,20 (all year around 07:00-00:00)
2005-12-22 07:00:00,2006-01-02 00:00:00,15 (christmas period 00:00-07:00)
2005-12-22 00:00:00,2006-01-02 07:00:00,25 (christmas period 07:00-00:00)

The user selects dates ($from - $to) to rent a car and he gets the price
accordingly.
I can do a (($to-$from)/60/60) and get the total number of hours but
depending on the date and time you get a different result. Can anyone
help with the SQL?


Read up on the MySQL DATEDIFF() function, if you are using MySQL. Other
DBMSs should have an equiv. function.

Jasper

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




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



[PHP] PHP on XP SP2 IIS Security?

2005-05-29 Thread Mario netMines

Hi all

a while ago I bought a new computer and set it up to run PHP on IIS using 
MySQL db. I did all the usual setup step as I used to for the last 5 yrs.
The first problem was with image uploading. The move_uploaded_file() was not 
working but only if the path was in the Inetpub directory. If I wanted to 
upload an image on the c: drive it was fine.
I use Win XP Proffesional and I'm not on a network, so I don't get the 
security tab on the folder properties. I decided to make the user 
IUSR_computername an Administrator (stupid I know, but it worked).


So now I'm trying to do an fopen($filename, w+) but it fails. If the file 
is outside the Inetpub directory, it works!!!


Can anyone help PLEASE

Thanks in advance

Mario 


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



[PHP] Mindbuster - uploading works in some directories

2005-05-18 Thread Mario netMines
Hi all
this is so weird but here it goes:
PHP version: 4.3.11
Operating system: win XP SP2
I have been using the same uploading script for a while. I just got a new 
Athlon 64bit and I installed PHP and the rest as always.

The only problem is that now my images are not getting to the directory I 
tell them to go.

Here is the script:
$thepathwithoutslash = c:/Inetpub/wwwroot/mario/cms-front;
$subpath = images/uploaded;
$unique_id = time();
$num = 0;
$unique_id = time() + $num;
$picture = fileup$num._name;
$picture1 = $$picture;
$picture2 = fileup$num;
$picture3 = $$picture2;
$picture1 = $unique_id .-. $picture1;
$picture1 = str_replace( , _, $picture1);
if($picture3 != none) {
move_uploaded_file($picture3, $thepathwithoutslash/$subpath/$picture1);
}
When I do error checking I get no errors.
on the form side I have:
form action=photos_a_s.php method=post name=theform 
enctype=multipart/form-data accept-charset=iso-8859-1,iso8859-7

and input type='file' name='fileup0' size='24' border='0' class='input'
Now the funny bit is that if I change the path to c:\Inetpub it works but if 
I change it to c:\Inetpub\wwwroot it doesn't.

There is no security on the dirs, the php.ini is as it was in all the other 
machines I worked on...

Can enyone help?

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


[PHP] how to test paralelly?

2005-05-11 Thread Mario Lopez
Hi,

I would like to measure how much users per minute
can handle my php script, mysql db and apache server

also, would like to determine how much users can be
served at the same time and how script execution time
changes in this case

if i run a script like:

$id = rand(1,70);
$file = http://mydomain/gallery.php?galpage=$id;
if (!($fp = @fopen ($file, r))){
return ;
}


$intext=;
while(!feof($fp)){
$intext .= fgetc($fp);
}

@fclose($fp);

it does not execute the script paralelly and gives apache

any ideas how can i simulate paralel script execution?

Thanks

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



[PHP] Dates problem

2005-04-27 Thread Mario de Frutos Dieguez
Hi!
I have a problem with dates. I have a function that sum a duration in 
laboral days to an initial date. The problem come when the function 
reaches the last sunday of October, the data remains in the last sunday 
of October and make an infinite loop. The functions works fine i have 
test in all the cases and only fails in the last sunday of October.

Can anyone help me?
Thanks in advance.
PD: Jochem home english is bad english :P
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Dates problem

2005-04-27 Thread Mario de Frutos Dieguez
Petar Nedyalkov escribió:
On Wednesday 27 April 2005 09:17, Mario de Frutos Dieguez wrote:
 

Hi!
I have a problem with dates. I have a function that sum a duration in
laboral days to an initial date. The problem come when the function
reaches the last sunday of October, the data remains in the last sunday
of October and make an infinite loop. The functions works fine i have
test in all the cases and only fails in the last sunday of October.
   

So, let's see the function.
 

Can anyone help me?
Thanks in advance.
PD: Jochem home english is bad english :P
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones
CARTIF -Parque Tecnológico Boecillo
   

 

function aCalculaFechas($oSqlBDGestion,$fecFechaIniProyecto,$iDuracion)
   {
   $iCont=0;
  
   //Descomponemos los argumentos y pasamos las fechas a 
formato Y/m/d
   $aFecIniTemp=split(/,$fecFechaIniProyecto);
   
$fecFechaInicio=date(Y/m/d,mktime(0,0,0,$aFecIniTemp[1],$aFecIniTemp[0],$aFecIniTemp[2]));
  
   if ($iDuracion0)
   {
   //Generamos una fecha temporal sobre la que haremos los 
cálculos
   $fecFechaFinTemp=$fecFechaInicio;
  
   //Sumamos uno a la fecha para iniciar la cuenta de la 
duración un día despues de la fecha de inicio
   $fecFechaFinTemp=$this-SumarFechas($fecFechaFinTemp,1);
  
   //Ejecutamos un bucle que irá calculando la duración 
total (incluyendo sabados y domingos) a partir de la duración
   //laboral
   while ($iCont($iDuracion))
   {
   //Obtenemos el día de la semana del día que estamos 
mirando  
   $aFecTempCalculo=split('/',$fecFechaFinTemp);
   
$iDiaSemanaTemp=date(w,mktime(0,0,0,$aFecTempCalculo[1],$aFecTempCalculo[2],$aFecTempCalculo[0]));
   //Si el día es distinto de domingo o sabado 
aumentamos el contador de duración laboral
   if ($iDiaSemanaTemp!=6  $iDiaSemanaTemp!=0)
   {
   $iCont++;
   }
   //Se añade uno más a la fecha
   $fecFechaFinTemp=$this-SumarFechas($fecFechaFinTemp,1);
   //Siempre se añade uno al número de días totales.
   $iNumDiasTotales++;
   //echo $iNumDiasTotales.'br';
   }
  
   //Sumamos al a fecha temporal el número de dias totales 
(solo incluidos sabados y domingos)
   
$fecFechaFinTemp=$this-SumarFechas($fecFechaInicio,$iNumDiasTotales);
  
   //Hacemos un bucle obteniendo los días festivos usando 
la fecha final temporal y hasta que no se obtengan dias
   //festivos sigue sumandolos.
   do
   {
   //echo SELECT * FROM festivos WHERE dia_festivo 
BETWEEN '.$fecFechaInicio.' AND '.$fecFechaFinTemp.';
   //Obtenemos los dias festivos entre el rango de fechas
   
$iObtenDiasFest=$oSqlBDGestion-iEjecutarConsulta(SELECT * FROM 
festivos WHERE dia_festivo BETWEEN '.$fecFechaInicio.' AND 
'.$fecFechaFinTemp.');
  
   
$iNumDiasFestivos=$oSqlBDGestion-iNumeroFilasResultadoConsulta($iObtenDiasFest);
  
   $fecFechaInicio=$this-SumarFechas($fecFechaFinTemp,1);
   
$fecFechaFinTemp=$this-SumarFechas($fecFechaFinTemp,$iNumDiasFestivos);
  
   }while ($iNumDiasFestivos0);
  
   $aFecTempCalculo=split('/',$fecFechaFinTemp);
   
$iDiaSemanaTemp=date(w,mktime(0,0,0,$aFecTempCalculo[1],$aFecTempCalculo[2],$aFecTempCalculo[0]));
   if ($iDiaSemanaTemp==6)
   $fecFechaFin=$this-SumarFechas($fecFechaFinTemp,3);
   else if ($iDiaSemanaTemp==0)
   $fecFechaFin=$this-SumarFechas($fecFechaFinTemp,2);
   else
   $fecFechaFin=$fecFechaFinTemp;
   $aFecFin=split(/,$fecFechaFin);
   
$fecFechaFin=date(d/m/Y,mktime(0,0,0,$aFecFin[1],$aFecFin[2],$aFecFin[0]));
   }
   else
   $fecFechaFin=$fecFechaIniProyecto;

  
   return $fecFechaFin;
   }

--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Line feed in a echo

2005-04-26 Thread Mario de Frutos Dieguez
How can i make a line feed in a echo instruction? like printf(foo\n);
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Line feed in a echo

2005-04-26 Thread Mario de Frutos Dieguez
Andri Heryandi escribió:
Use echo something br;
is that what you mean?
Mario de Frutos Dieguez wrote:
How can i make a line feed in a echo instruction? like printf(foo\n);

yes that's it thx
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] strtotime() lost precision?

2005-04-26 Thread Mario de Frutos Dieguez
Hi!
I'm back hahaha :D
I'm making functions to calculate the duration (only laboral days) 
between 2 dates and the initial and final date between a duration give 
me in laboral days.

I use the following function to make the diference between 2 dates:
function fecDiferenciaFechas($fecFechaInicio,$fecFechaFin)
   {
   $fecFechaInicio=strtotime($fecFechaInicio);
   $fecFechaFin=strtotime($fecFechaFin);
  
   if ($fecFechaFin == -1 || $fecFechaInicio == -1)
   {
   return false;
   }
  
   $iDiferencia = $fecFechaFin - $fecFechaInicio;
  
   //Inicializamos la variable
   $iDias = 0;
  
   //Devolvemos la diferencia en dias
   return ($iDiferencia/86400);
   }

The problem is that with a duration of 220 the return is 219.958333, 
where im losing precision?

(Sorry for my home english :P)
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] .htaccess

2005-04-19 Thread Mario de Frutos Dieguez
pete M escribió:
I'm trying to figure out out to put a directive in .htaccess to make 
the session timeout in 4 hours ..

tried
php_flag session.cookie_lifetime 240
and a few others
can someone help !
tia
Try ini_set(session.gc_maxlifetime,2400);
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to unset a post variable (SOLVED)

2005-04-18 Thread Mario de Frutos Dieguez
Richard Lynch escribió:
On Mon, April 18, 2005 9:42 pm, Chris Kay said:
 

unset($_POST['buttonNew']);
wont work?
   

Sure it works
It's just not useful in the context of this thread :-)
How do you know to unset it the second time when they hit refresh (aka
reload) though?
I should have said won't solved that specific problem
You can change $_POST all you want, but it doesn't change that fact that
that's what the browser *sent* to you.
To reliable detect a reload of a page, you need to somehow change
something in between load and reload and you have to tie it to that
user, filling in that form, at that time.
There's no easy way to do that unless *YOU* somehow notate each FORM you
send out, and then mark it as used when it comes back.
 

On Mon, Apr 18, 2005 at 08:25:04PM -0700, Richard Lynch wrote:
   

On Fri, April 15, 2005 5:08 am, Mario de Frutos Dieguez said:
 

I have another little question hehe :D, i have a page with a form
   

where
 

the user insert data and can click in a new,edit or delete button.
   

I've
 

make that when a button is clicked the page refresh and in the head of
the page i have conditions like this: if ($_POSt[buttonNew]!=) {
insert commands.. } , etc
My question is, how can i unset $_POST[buttonNew] or leave it empty
because when the user refresh the page make insert commans again
   

because
 

the $_POST[buttonNew] arent empty.
   

The POST data is sent by the browser, so you can't really alter that...
But you can bury an http://php.net/md5 or other random token in the
FORM,
and put that token in a table in your database, and then on the first
POST, you mark that token as used
On the second POST, a re-load, you can detect that the token was used
and do whatever you want.  Re-direct the user, ignore them completely,
give them an error message, blow up their computer.  Well, okay, you can
do almost whatever you want.
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 

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


 

Thx for all, i do it and works perfectly :D
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How to unset a post variable

2005-04-15 Thread Mario de Frutos Dieguez
Hi!
I have another little question hehe :D, i have a page with a form where 
the user insert data and can click in a new,edit or delete button. I've 
make that when a button is clicked the page refresh and in the head of 
the page i have conditions like this: if ($_POSt[buttonNew]!=) { 
insert commands.. } , etc

My question is, how can i unset $_POST[buttonNew] or leave it empty 
because when the user refresh the page make insert commans again because 
the $_POST[buttonNew] arent empty.

Thx in advance for all *^_^*
--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Image and PHP

2005-04-14 Thread Mario de Frutos Dieguez
I have a page where i place an image but i want when i show the image 
delete it. How can i do this?

--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Image and PHP

2005-04-14 Thread Mario de Frutos Dieguez
Petar Nedyalkov escribió:
On Thursday 14 April 2005 10:06, Mario de Frutos Dieguez wrote:
 

I have a page where i place an image but i want when i show the image
delete it. How can i do this?
   

You want to delete it from the clients machine or what? 

 

--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones
CARTIF -Parque Tecnológico Boecillo
   

 

Sorry, i want delete it from the server side. I put the images in a 
directory in the server.

--
Mario de Frutos Dieguez
División de Ingeniería del Software
y Comunicaciones  

CARTIF -Parque Tecnológico Boecillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] getting filenames from dir

2005-04-01 Thread Mario St-Gelais
That should get you started :
$dirname='/var';
$dh=opendir($dirname) or die('could not open directory');
while (!(($file=readdir($dh))===false)){
   if (is_dir('$dirname/$file')){
   $myarray[]=$file;
   }
   echo $filebr;
   $myarray[]=$file;
}
Mario
Merlin wrote:
Hi there,
does anybody know how to get all file names from a specified directory 
into an array?

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


AW: [PHP] php 4 php 5

2005-03-04 Thread Mario Micklisch
 [snip]
 Is there a way to install two version of php on the same machine, and
 use them for two different users?
 [/snip]
 
 No.

Yes!

Having that in my LiteSpeed-Servers configuration with 3 different PHP
Versions. No problem if you use CGI or fastCgi's. On Apache also possible
via the VHost-Settings to assign a version to any selected VirtualHosts.

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



AW: [PHP] pulling content from a URL

2005-03-04 Thread Mario Micklisch
[..]
 into a variable.  I need to include some sort of error checking that 
 will kill this request if for some reason the URL request hangs for 
 more then 15 seconds.  In researching this, I think the correct 
 function to use is fsockopen, but I can't seem to get it to work.  Can 
 someone verify if fsockopen is the best way to grab an external URL, 
 but kill the request if it hangs for a certain amount of time ... and 
 if so, show me some sample code on how to place this URL's contents 
 into a variable that I can then parse.  The URL will be hard coded into 
[..]

stream_set_timeout should be what you're looking for.

might look like this:

?php
$fp = fsockopen(www.example.com, 80);
if (!$fp) {
   echo Unable to open\n;
} else {

   fwrite($fp, GET / HTTP/1.0\r\n\r\n);
   stream_set_timeout($fp, 2);
   $res = fread($fp, 2000);

   $info = stream_get_meta_data($fp);
   fclose($fp);

   if ($info['timed_out']) {
   echo 'Connection timed out!';
   } else {
   echo $res;
   }

}
?
-- from the manual:
http://us4.php.net/manual/en/function.stream-set-timeout.php

$res will hold the first 2,000 bytes of the result. 

socket blocking would be another way, but the above one looks like exactly
what you're looking for

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



[PHP] problems with several JPEGs in GD2

2005-02-28 Thread Mario Lopez
Hi,

PHP 4.3.10, GD2

I've noticed that there is a group of JPEG files
that cannot be operated with GD2 functions.

For example, if you try to imagecreatefromjpeg(my.jpg) it
replies:

Warning: imagecreatefromjpeg(): 'my.jpg' is not a valid JPEG file
in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 20

(this is not a scripting error, it works with lots of other jpegs)

Meanwhile the same my.jpg file can be shown in web browser by
HTML tag img src=my.jpg, can be opened in PhotoShop.. and other
programs..

But GD2 thinks that it is not a valid JPEG..

Any suggestions how to deal with these types of JPEGs in GD2?
Any workaround?

Thanks,
Mario

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



[PHP] Accents! Pls help. Still very confused.

2005-02-23 Thread mario
Hello,

I am still very puzzled.
If you a couple of minutes of spare time, pls give a look at
http://www.chiari.org/help/
and suggest a way out.

Thanks a lot.
mario

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



[PHP] TO Bret Hughes ---- Accents! Pls help. Still very confused.

2005-02-23 Thread mario
Bret,

i have just seen your reply to me.
Please, check link below. Thanks
mario
--
Hello,

I am still very puzzled.
If you a couple of minutes of spare time, pls give a look at
http://www.chiari.org/help/
and suggest a way out.

Thanks a lot.
mario

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



[PHP] issue with accents and mysql

2005-02-15 Thread mario
Hello,

please help me on the following issue.
please reply to [EMAIL PROTECTED] too.
(I asked for help on the php-db ml, but nobody replied)

I have hacked the following function:
function accents($text) {
   global $export;
   $search  = array ( 'à', 'è', 'ì', 'ò' , 'ù');
   $replace = array ( '\\`{a}', '\\`{e}', '\\`{i}', '\\`{o}', '\\`{u}');
   $export= str_replace($search, $replace, $text);
   return $export;
}

It works fine, as long as I feed it with a string: 
accents('à') -- \`{a} 

The issue is when I get 'à' from a mysql table. 
I.e., for some record of a mysql table Table, let à the value of the
field Field, and say
$result =  mysql_fetch_array($answer, MYSQL_BOTH), 
where $answer= mysql_query(SELECT * FROM Table).


Now accents($result['Field']) returns à (instead of \`{a}).
Why? I have no idea. 

Any hint is welcome.
Thanks a lot
mario

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



Re: [PHP] issue with accents and mysql

2005-02-15 Thread mario
Hi,

thanks, but that seems to be ok:
SQL result
Host: 127.0.0.1
Database : 
Generation Time: Feb 15, 2005 at 11:36 PM
Generated by: phpMyAdmin 2.5.7-pl1 / MySQL 3.23.58
SQL-query: SHOW VARIABLES LIKE 'character_set%'; 
Rows: 2 

   Variable_name 
   Value 
character_set
latin1
character_sets
latin1 big5 cp1251 cp1257 croat
czech danish dec8 ...

any further idea?
thanks
mario

ps of course, I could 
On Tue, 2005-02-15 at 21:42, Guillermo Rauch wrote:
 Try
 SHOW VARIABLES LIKE 'character_set%'
 
 and verify your character set is latin1.
 
 If not, see http://dev.mysql.com/doc/mysql/en/charset-database.html
 
 On Tue, 15 Feb 2005 22:04:30 +, mario [EMAIL PROTECTED] wrote:
  Hello,
  
  please help me on the following issue.
  please reply to [EMAIL PROTECTED] too.
  (I asked for help on the php-db ml, but nobody replied)
  
  I have hacked the following function:
  function accents($text) {
global $export;
$search  = array ( 'à', 'è', 'ì', 'ò' , 'ù');
$replace = array ( '\\`{a}', '\\`{e}', '\\`{i}', '\\`{o}', '\\`{u}');
$export= str_replace($search, $replace, $text);
return $export;
  }
  
  It works fine, as long as I feed it with a string:
  accents('à') -- \`{a}
  
  The issue is when I get 'à' from a mysql table.
  I.e., for some record of a mysql table Table, let à the value of the
  field Field, and say
  $result =  mysql_fetch_array($answer, MYSQL_BOTH),
  where $answer= mysql_query(SELECT * FROM Table).
  
  Now accents($result['Field']) returns à (instead of \`{a}).
  Why? I have no idea.
  
  Any hint is welcome.
  Thanks a lot
  mario
  
  --
  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] Shared variable

2005-02-09 Thread Mario Stiffel
Hello.

Is there any oppertunity to create varaibles that can accessed by more
than one instances? I need a way to communicate between many
php-instances. It can be, that they are not active to the same time. Is
there any way without using a file or a database?

Mario

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



[PHP] variable hell

2005-01-04 Thread mario
Hi all

I have few variables in this format:

$isproductssorttext = 150;
$isofferssorttext = 250;
$isnewproductssorttext = 350;

$isproductscount = 50;
$isofferscount = 30;
$isnewproductscount = 20;
etc


What I want to do is have a variable
e.g. $x = products;

and create from that, the variable $is'products'sorttext
(--$isproductssorttext) and use its value

so if $x was offers on echo I would have (250) -- $isofferssorttext
if $x was newproducts on echo I would have (350) -- 
$isnewproductssorttext

Thanks in advance

Mario

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



[PHP] Problems compiling mnogosearch

2004-11-25 Thread Mario Bittencourt
Hi,

I can't compile php 5 (or 4) with mnogosearch and mysql support.  I
saw a couple of posts but I was wondering what do I have to do in
order to make it compile.

mnogosearch is already installed and working.

Thanks.

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



Re: [PHP] Problems compiling mnogosearch

2004-11-25 Thread Mario Bittencourt
Hi,

I've tried this but keep getting


Stopping httpd:[FAILED]
Starting httpd: Syntax error on line 190 of /etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/modules/libphp5.so into server:
libmnogosearch-3.2.so: failed to map segment from shared object:
Permission denied

On Thu, 25 Nov 2004 10:06:47 -0500, John Nichel [EMAIL PROTECTED] wrote:
 Mario Bittencourt wrote:
 
 
  Hi,
 
  I can't compile php 5 (or 4) with mnogosearch and mysql support.  I
  saw a couple of posts but I was wondering what do I have to do in
  order to make it compile.
 
  mnogosearch is already installed and working.
 
  Thanks.
 
 
 The way I was able to get it working was to configure/compile
 mnogosearch *without* MySQL support, and build php against that.  Then
 once php was configured/compiled/installed, re-configure/compile
 mnogosearch *with* MySQL support.
 
 --
 By-Tor.com
 ...it's all about the Rush
 http://www.by-tor.com
 
 --
 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] Validating XML Schema

2004-11-20 Thread Mario Bittencourt
Hi,

I am trying to use php to validate a document using it's schema.

I keep getting Warning: Element 'Invoices': No matching global
declaration available.

My xsd has

?xml version=1.0 ?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
targetNamespace=http://www.mysite.com;
xmlns=http://www.mysite.com; elementFormDefault=qualified
xs:element name=Invoices type=InvoicesType/
xs:complexType name=InvoicesType
xs:element name=Invoice type=xs:string/
/xs:complexType
/xs:schema

The xml test

?xml version=1.0 ?
Invoices
Invoice10/Invoice
/Invoices

The php

$xml = new DOMDocument();
$xml-load( 'invoice.xml' );
if ($xml-schemaValidate(invoice.xsd))
{
 echo Validated OK ;
} else 
{
 echo Validate FAILED;
}

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



[PHP] free php live support script ?

2004-11-16 Thread Mario Bittencourt
Hi,

I was wondering if there is any free php live support script ?

I'd like to add a chat room in my web site so users could chat with
a human operator in a 1-1 mode.

thanks.

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



Re: [PHP] Re: Which PHP for MySQL 4.1

2004-11-12 Thread Mario Bittencourt
I could not compile php 5.0.2 with the latest mysql 4.1.7.

I've installed the rpms (server,max,client,devel,shared) from mysql.com.

./configure --with-mnogosearch --with-xml  --with-mysql=/usr
--with-mysqli=/usr/bin/mysql_config --with-apxs2 --enable-soap

When I compile I get tons of messages like this

/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x250): first defined here
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x330): In function
`net_write_command':

I have even tried only with mysqli or mysql and got the same result.

Any ideias ?

Fedora Core 3 Machine

On Fri, 12 Nov 2004 11:03:23 +0100, Sebastian Mendel
[EMAIL PROTECTED] wrote:
 
 
 C.F. Scheidecker Antunes wrote:
  Hello,
 
  I would like to migrate my MySQL servers from 4.0 to 4.1.
 
  As I use PHP as well as Java with these servers I wonder what PHP 4
  version would be compatible with MySQL 4.1.
 
  Has anyone used MySQL 4.1 with PHP yet?
 
  I appreciate your thoughts.
 
  Thanks.
 
 i run 4.1.x for a while, without problems,
 
 after upgrading you have to rebuild you php to use the new mysql_librarys
 
 and you have to run mysql_fix_privilege_tables on the linux/unix shell
 
 4.1. uses a new display-format for timestamps!
 4.1. uses a new encryption method for password(), with this function are
 all mysql_passwords stored in the db, thats why you have to run
 mysql_fix_privilege_tables
 
 read carefully through all 4.1. changelogs!
 
 --
 Sebastian Mendel
 
 www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
 www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
 
 
 
 --
 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] Replace or regex?

2004-09-30 Thread mario
Hi all

I have a string: ##CODE## and I want to replace that with a
href=somewhere.php?id=CODECODE/a

can u help?

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



AW: [PHP] checking multiple URL parameters

2004-09-16 Thread Mario Micklisch
 I know you could write a short script that would do it, but I 
 think I saw a built-in function that did it as well.

I think parse_str is what you're looking for:

http://www.php.net/manual/en/function.parse-str.php

i.e. parse_str(getenv('QUERY_STRING'))

--
Mario



 -Ursprüngliche Nachricht-
 Von: Gryffyn, Trevor [mailto:[EMAIL PROTECTED] 
 Gesendet: Thursday, September 16, 2004 20:47 PM
 An: PHP
 Cc: [EMAIL PROTECTED]; Andrew Kreps
 Betreff: RE: [PHP] checking multiple URL parameters
 
 
 You're right though, $_GET and $_POST and such are already an 
 associative array.  I actually think I was thinking of a 
 function that parsed a URL itself, regardless of whether it 
 was submitted or not.  I'm all kinds of mixed up today, so I 
 apologize for being kind of scrambled in the brain.
 
 Is there a function that'll take 
 http://www.server.com/scriptname.php?someparam=somedatasomep
 aram2=some
 data2 and produce:
 
 $someparam == somedata
 $someparam2 == somedata2
 
 ??
 
 You understand I'm talking about parsing the URL, not 
 juggling $_GET data, right?
 
 I know you could write a short script that would do it, but I 
 think I saw a built-in function that did it as well.
 
 -TG
 
  -Original Message-
  From: Chris Shiflett [mailto:[EMAIL PROTECTED]
  Sent: Thursday, September 16, 2004 2:19 PM
  To: Andrew Kreps; PHP
  Subject: Re: [PHP] checking multiple URL parameters
  
  
  --- Andrew Kreps [EMAIL PROTECTED] wrote:
   --- Trevor Gryffyn [EMAIL PROTECTED] wrote:
I could have sworn that there was a function that 
 dropped ALL GET 
values into an associative array. Kind of the inverse of 
http_build_query.
   
   I believe you're thinking of import_request_variables
  
  That imports variables into the global scope individually.
  He's probably
  just thinking about $_GET, which is already an associative 
 array that
  contains all GET data. No function is necessary.
  
  Chris
  
  =
  Chris Shiflett - http://shiflett.org/
  
  PHP Security - O'Reilly
   Coming December 2004
  HTTP Developer's Handbook - Sams
   http://httphandbook.org/
  PHP Community Site
   http://phpcommunity.org/
  
  --
  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] dynamical class variable definition

2004-09-13 Thread Mario Lopez
Hi,

I have a class, but the problem is that
its variables need to be defined dynamically.

example:

class class_myclass{
 var $variable1;
 var $variable2;
 var $variable3;
...
 var $variableN


how to initialize these $variableN class variables from a global array which 
contains
the variable names and custom count of them?

if that's not possible.. maybe there's a possibility to initialize class 
variables on the fly
from constructor class

but the whole point is that the names and number of variables each php 
script run is
different

any suggestions?
thanks a lot! 

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



Re: [PHP] dynamical class variable definition

2004-09-13 Thread Mario Lopez
Oh Thanks,
I thought that only those variables that are defined with VAR
will be accessible and trieted as class variables

Mario 

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



Re: [PHP] downloading files

2004-08-19 Thread Mario Micklisch
Hi Aaron,
[..]
The download files are in a directory protected by htaccess which it  
is my understanding that PHP can go underneath htaccess to get access  
to the files.  My problem is where do I put this directory?  I was  
already told to put it outside the web root directory,
[..]
Both are good methods to protect your files. And yes, you can access
your files because PHP is working on the servers side and doesnt need
to obey the .htaccess restrictions you defined for user/clients.
With .htaccess protection you can access them by yourself later using  
login/password combination.

Outside your DocumentRoot you won't have the possibility and without  
any help of serverside processes you will not be able to access them.
That way you also dont need to worry about any .htaccess settings :-)

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


[PHP] keeping the last zero

2004-05-17 Thread Mario
Hi all

I have a list of products with prices
e.g.

$100
$100.50
(those are examples, they can be anything, not all prices have decimal)

when I add those I get $200.5.

Is there a way to get $200.50.

Thanks

Mario


-
Marios Adamantopoulos
Web Developer
[EMAIL PROTECTED]

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



[PHP] Uploading and directory permissions

2004-05-10 Thread Mario
Hi all

For few years now I've been creating custom CMSs and I've been having an
images folder with permissions 777 so the PHP script can upload images
through the CMS.

You can imagine what the problem is... although I never had someone deleting
images (low profile sites usually), couple of days ago someone deleted all
images from one of the websites (gg!!!).

Anyways I was wondering if there is a way to upload through PHP without
having write permission to all. Is there a way maybe, for the script, to
change permission to write before the upload and then take it off? or
anything else I can do to protect the dir?

Thank you

Mario


-
Marios Adamantopoulos
Web Developer
[EMAIL PROTECTED]

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



Re: [PHP] Uploading and directory permissions

2004-05-10 Thread Mario
The problem there is that PHP doesn't have enough permissions to make that
change
I basically tried to change a 0775 dir to 0777, upload and then put it back
to 0775.

The chmod doesn't even work on a file. When I upload a file I'm trying to
put 0775 to a file but it only gives it a red and write for the owner
(another problem there since I can't download (through FTP) the images I
uploaded through PHP.

Mario
- Original Message - 
From: James E Hicks III [EMAIL PROTECTED]
To: Mario [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, May 10, 2004 3:56 PM
Subject: Re: [PHP] Uploading and directory permissions


 On Monday 10 May 2004 05:20 am, Mario wrote:
  Anyways I was wondering if there is a way to upload through PHP without
  having write permission to all. Is there a way maybe, for the
script,
  to change permission to write before the upload and then take it off?
or
  anything else I can do to protect the dir?

 You could keep your upload directory with 777, but after uploading move
files
 to safer directory with stricter file permissions. You could probably even
 get away with just changing the permission of the file after it was
uploaded.

 http://php.net/filesystem

 http://php.net/manual/en/function.chmod.php

 // Read and write for owner, read for everybody else
  chmod(/somedir/somefile, 0644);


 James Hicks

 -- 
 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] PHP ftp web client

2004-03-15 Thread Mario Ohnewald
Hello!
Can someone recommend me a good/stable PHP-FTP Web client?
I wasnt quite happy with the google search results :P

Thanks a lot!
  Mario

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



Re: [PHP] PHP timeout

2004-02-03 Thread Mario
Hi all

just a note that the problem was with the php 4.3.2 version finally and
nothing to do with permissions.

So if anyonwe has a similar problem, install a different version (the 4.3.4
is working fine here)

Mario
- Original Message - 
From: Mario [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 30, 2004 3:28 PM
Subject: Re: [PHP] PHP timeout


 it looks like it has nothing to do with MySQL and just with php

 I'm running a simple script like
 $x=23;

 echo $x;

 and it displays the number 23 properly, but the page keeps loading like
 there is something else to load too.

 - Original Message - 
 From: Raditha Dissanayake [EMAIL PROTECTED]
 To: Mario [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Friday, January 30, 2004 1:33 PM
 Subject: Re: [PHP] PHP timeout


  Hi,
 
  Make sure the mysql service is started and make sure that there isn't
  anything else competing for the same port (3306) beyond that i am afraid
  i cannot help as i am not  a windows expert.
 
 
  Mario wrote:
 
  both php and mysql is on the same machine.
  
  even running the following timesout:
  ?php
  
  if (!($mylink = @mysql_pconnect(localhost,*,**)))
  
  print h3Problem connecting to the database server/h3\n;
  
  exit();
  
  }
  
  mysql_select_db(xxx) or die (h3Problem connecting to the
  database/h3brDescription: . mysql_error());
  
  ?
  
  
  
  
  
  --
  Raditha Dissanayake.
  
  http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
  Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
  Graphical User Inteface. Just 150 KB | with progress bar.
 
  -- 
  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] PHP timeout

2004-01-30 Thread Mario
Hi all

I have a winXP machine on a network running IIS (PHP and MySQL is installed)

I have recently moved from one machine to another and after setting up IIS
and the rest and try to run few PHP scripts they just run forever or
timeout. I believe the problem is with the security permission on ...
somewhere, since I've been doing the same setup in several machines and it
works fine (not in this network).

Now, the funny thing is that most simple php script run fast after playing
with the permissions but more complicating scripts or the phpMyAdmin just
timesout.

Does anyone know what the hell is going on?

Mario

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



Re: [PHP] PHP timeout

2004-01-30 Thread Mario
thanks for the reply Raditha.

I don't have a firewall setup on this PC

Is there a chance it's a permissions problem?
And why do few simple scripts run fine though?

Thanks

Mario
- Original Message - 
From: Raditha Dissanayake [EMAIL PROTECTED]
To: Mario [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 30, 2004 12:14 PM
Subject: Re: [PHP] PHP timeout


 Mario,

 Please don't reply to a message when you want to ask a question compose
 a new thread instead.

 Anyway from what you have described it sounds like you have a firewall
 that's blocking the mysql port. Somefirewalls just drop the packets
 instead of denying the connection. That way the script just hangs an
 eternit waiting for a packet that never arrives. Try stopping your
 firewall completely .




 Mario wrote:

 Hi all
 
 I have a winXP machine on a network running IIS (PHP and MySQL is
installed)
 
 I have recently moved from one machine to another and after setting up
IIS
 and the rest and try to run few PHP scripts they just run forever or
 timeout. I believe the problem is with the security permission on ...
 somewhere, since I've been doing the same setup in several machines and
it
 works fine (not in this network).
 
 Now, the funny thing is that most simple php script run fast after
playing
 with the permissions but more complicating scripts or the phpMyAdmin just
 timesout.
 
 Does anyone know what the hell is going on?
 
 Mario
 
 
 


 -- 
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 150 KB | with progress bar.

 -- 
 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 timeout

2004-01-30 Thread Mario
both php and mysql is on the same machine.

even running the following timesout:
?php

if (!($mylink = @mysql_pconnect(localhost,*,**)))

print h3Problem connecting to the database server/h3\n;

exit();

}

mysql_select_db(xxx) or die (h3Problem connecting to the
database/h3brDescription: . mysql_error());

?



- Original Message - 
From: Raditha Dissanayake [EMAIL PROTECTED]
To: Mario [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 30, 2004 1:01 PM
Subject: Re: [PHP] PHP timeout



 Well the situation you have described are the typical symptoms of a
 firewall eating up packets.  (Simple scripts running fine and those that
 connect to networking timing out) How about installing both the php
 engine and mysql on the same machine for testing?


 Mario wrote:

 thanks for the reply Raditha.
 
 I don't have a firewall setup on this PC
 
 Is there a chance it's a permissions problem?
 And why do few simple scripts run fine though?
 
 Thanks
 
 Mario
 - Original Message - 
 From: Raditha Dissanayake [EMAIL PROTECTED]
 To: Mario [EMAIL PROTECTED]
 
 

 -- 
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 150 KB | with progress bar.

 -- 
 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 timeout

2004-01-30 Thread Mario
it looks like it has nothing to do with MySQL and just with php

I'm running a simple script like
$x=23;

echo $x;

and it displays the number 23 properly, but the page keeps loading like
there is something else to load too.

- Original Message - 
From: Raditha Dissanayake [EMAIL PROTECTED]
To: Mario [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, January 30, 2004 1:33 PM
Subject: Re: [PHP] PHP timeout


 Hi,

 Make sure the mysql service is started and make sure that there isn't
 anything else competing for the same port (3306) beyond that i am afraid
 i cannot help as i am not  a windows expert.


 Mario wrote:

 both php and mysql is on the same machine.
 
 even running the following timesout:
 ?php
 
 if (!($mylink = @mysql_pconnect(localhost,*,**)))
 
 print h3Problem connecting to the database server/h3\n;
 
 exit();
 
 }
 
 mysql_select_db(xxx) or die (h3Problem connecting to the
 database/h3brDescription: . mysql_error());
 
 ?
 
 
 
 
 
 --
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 150 KB | with progress bar.

 -- 
 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 prevent duplicated values?

2004-01-26 Thread Mario
Run a select first to check whether you have that value stored and by using
an if statement add the new value or show an error.
- Original Message - 
From: BAO RuiXian [EMAIL PROTECTED]
To: Radwan Aladdin [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, January 26, 2004 11:35 AM
Subject: Re: [PHP] How to prevent duplicated values?




 Radwan Aladdin wrote:

 Hello..
 
 I want to prevent mySQL from storing the same value in a specified field
(Username).. so how can I do it?
 
 Regards..
 
 
 Make it field UNIQUE.

 Best

 Bao

 -- 
 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] cron problem

2004-01-26 Thread Mario
Hi all

there is a bit of a problem with running cron scripts on our server and i
would appreciate any help from the unix gurus.
The story: I have created a script in the cron dir that runs a php file that
sends auto emails. (The script is working fine when we run it through the
command line, so it's working fine).

The problem is that when the time comes and the cron should do its thing and
run the script automatically, it doesn't.
We have tried the cron.d dir and the cron.daily and nothing. The funny thing
is that there are couple of scripts in there that run properly (I've been
told anyways).

So the question is: Is there some file somewhere that lists the names of the
files that should run in the cron directory?
If not, can someone tell me what the h*ll is going on?

Thanks in advanced

Mario


-
Marios Adamantopoulos
Web Developer
[EMAIL PROTECTED]

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



Re: [PHP] Please help me as fast as possible.. very important!!

2004-01-20 Thread Mario
The only thing you need to know is that you enter a file in the cron dir (in
/etc I think) and you have the following line in that file:
52 10 * * * /usr/bin/php /home/mainwebsite_html/file.php

this line runs the file.php every day at 10.52

(min hour week month year) (php dir) (file location) - the star means any
day-month-year [i'm not sure if it's week month year or year month week]

If there is a cron.daily or monthly ...etc... you don't need to specify the
first part (date time stuff)

e.g.  /usr/bin/php /home/mainwebsite_html/file.php





- Original Message - 
From: Radwan Aladdin [EMAIL PROTECTED]
To: Nick JORDAN [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 12:05 PM
Subject: Re: [PHP] Please help me as fast as possible.. very important!!


 Where can I fin tutorials about it? (CRON Tab)?

 Regards..
 - Original Message -
 From: Nick JORDAN [EMAIL PROTECTED]
 To: Radwan Aladdin raladin [EMAIL PROTECTED]
 Sent: Tuesday, January 20, 2004 1:56 PM
 Subject: Re: [PHP] Please help me as fast as possible.. very important!!


   Is it possible in mySQL to put a timer that changes a value inside a
   row in a table every while?
 
   For example : Add 1 to the value very 10 minutes for example..
   Field number = 5 after ten minutes = 6 after another 10 minuste =
  7..Etc..
 
 
  As far as I'm aware, that's not possible in MySQL, however you could
write
  a small script in PHP (or, indeed, some other language) which would
  increment the counter, and which would be run at intervals via cron (for
  instance).
 
  A better solution, however, would be to include a timestamp in your
  database, then, when data is requested, calculate how many units of ten
  minutes have passed and adjust your counter accordingly.
 
  Nick
 

 -- 
 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] shell_exec with pipes

2003-11-13 Thread Mario Ohnewald
Hello!
I think we are almost there yet :)

 On Wednesday 12 November 2003 21:48, Mario Ohnewald wrote:
 
  ok, i am running the script like this now:
 
 [snip]
 
 This seems to suggest that shell_exec() does not like your command and is
 not 
 executing it, so:
 
 Try tackling it logically, step-by-step:
 
   Have you:
  
   1) Turned on full error reporting?
 
  How do i turn that on?
 
 In php.ini, once you've enabled it, restart webserver and see what errors,
 if 
 any, you get.
ok, i have enabled that with error_reporting(E_ALL); 

 
   2) Checked that (i) you're not running in safe_mode, or (ii) if you
 are,
   that
   you are allowed to access those executables?
 
  i am running in safe mode.
 
 What is the answer to (ii)?
Yes, i do have acces to those files and the permissions are correct.

 
 Are you able to execute any shell programs/commands at all? Hint try
 something 
 simple like shell_exec('touch /tmp/testfile') and see whether
 /tmp/testfile 
 is being created.
Yes, i am. 

I think the key is here somewhere:
PHP Output from shell_exec(/usr/local/bin/mplayer -identify -frames 0
/tmp/pitstop.mpeg);


MPlayer 1.0pre2-3.3.2 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 1466 MHz (Family: 6,
Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Reading config file /usr/local/etc/mplayer/mplayer.conffont: can't open
file: (null)
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using usleep() timing

Playing /tmp/pitstop.mpeg
MPEG-PS file format detected.
VIDEO:  MPEG1  320x240  (aspect 1)  29.970 fps  1151.2 kbps (143.9 kbyte/s)



PHP Output from normal shell /usr/local/bin/mplayer -identify -frames 0
/tmp/pitstop.mpeg

MPlayer 1.0pre2-3.3.2 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 1466 MHz (Family: 6,
Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or
directory
Reading config file /home/lansinplayer/.mplayer/config
Reading /home/lansinplayer/.mplayer/codecs.conf: Can't open
'/home/lansinplayer/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open
'/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf
font: can't open file: /home/lansinplayer/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Failed to open /dev/rtc: Permission denied (mplayer should be setuid root or
/dev/rtc should be readable by the user.)
Using usleep() timing
Can't open input config file /home/lansinplayer/.mplayer/input.conf: No such
file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file
or directory
Falling back on default (hardcoded) input config

Playing /tmp/pitstop.mpeg
MPEG-PS file format detected.
VIDEO:  MPEG1  320x240  (aspect 1)  29.970 fps  1151.2 kbps (143.9 kbyte/s)
==
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer23 finished, tables done
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 16000-176400 (128.0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==
ID_FILENAME=/tmp/pitstop.mpeg
ID_VIDEO_FORMAT=0x1001
ID_VIDEO_BITRATE=1151200
ID_VIDEO_WIDTH=320
ID_VIDEO_HEIGHT=240
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=0.
ID_AUDIO_CODEC=mp3
ID_AUDIO_FORMAT=80
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_LENGTH=16
vo: couldn't open the X11 display ()!
vo: couldn't open the X11 display ()!
VO XOverlay need a subdriver
vo: couldn't open the X11 display ()!
Can't open /dev/fb0: Permission denied
[fbdev2] Can't open /dev/fb0: Permission denied
==
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 320 x 240 (preferred csp: Mpeg PES)
VDec: using Mpeg PES as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [null] 320x240 = 320x240 Mpeg PES
Selected video codec: [mpegpes] vfm:mpegpes (Mpeg PES output (.mpg or
Dxr3/DVB card))
==
Checking audio filter chain for 44100Hz/2ch/16bit - 44100Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
audio_setup

RE: [PHP] shell_exec with pipes

2003-11-12 Thread Mario Ohnewald
Hi,

 $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0
 /tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2);

$var=shell_exec(/usr/local/bin/mplayer -identify -frames 0
/tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2);
echo Output: $var;

Still gives nothing back :/
Told you, its not that easy :P


Thank you very much, Mario

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



Re: [PHP] shell_exec with pipes

2003-11-12 Thread Mario Ohnewald
ok, i am running the script like this now:
 START -

$var=shell_exec(/home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh 
/tmp/pitstop.mpeg);
echo --$var--;
 STOP -
Where echo returns nothing. I did a chmod 777 on the getfilelength.sh file.


When i run the file in shell i get this:
$ /home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh
/tmp/pitstop.mpeg
16


The Shell file looks like that:
if [ $1 ];then
length=`mplayer -identify -frames 0 $1 2/dev/null| grep ID_LENGTH
| cut -d \=\ -f 2`
echo $length





 On Wednesday 12 November 2003 17:21, Mario Ohnewald wrote:
 
   $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0
   /tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2);
 
  $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0
  /tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2);
  echo Output: $var;
 
  Still gives nothing back :/
  Told you, its not that easy :P
 
 Have you:
 
 1) Turned on full error reporting?
How do i turn that on?

 2) Checked that (i) you're not running in safe_mode, or (ii) if you are,
 that 
 you are allowed to access those executables?
i am running in safe mode.

 3) Confirmed that the left side of the pipe is working and giving the
 expected 
 output?
$var2=shell_exec(mplayer -identify -frames 0 /tmp/pitstop.mpeg | /bin/grep
ID_LENGTH);
gives nothing back.

Thats what i get in Shell:
-
$ mplayer -identify -frames 0 /tmp/pitstop.mpeg | grep ID_LENGTH
: No such file or directory
Can't open '/home/lansinplayer/.mplayer/codecs.conf': No such file or
directory
Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Failed to open /dev/rtc: Permission denied (mplayer should be setuid root or
/dev/rtc should be readable by the user.)
Can't open input config file /home/lansinplayer/.mplayer/input.conf: No such
file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file
or directory
Falling back on default (hardcoded) input config
vo: couldn't open the X11 display ()!
vo: couldn't open the X11 display ()!
VO XOverlay need a subdriver
vo: couldn't open the X11 display ()!
Can't open /dev/fb0: Permission denied
[fbdev2] Can't open /dev/fb0: Permission denied
audio_setup: Can't open audio device /dev/dsp: Permission denied
ID_LENGTH=16



 4) Tried giving the full path to grep?
yes i did
 
 If you're still having trouble with it you can try sticking the above into
 a 
 little shell script and shell_exec() the shell script instead.
See above.


Any further ideas?

Thank you, Mario

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



[PHP] shell_exec with pipes

2003-11-11 Thread Mario Ohnewald
Hello List!
I have tried to get this command working with php for about 2Weeks now, and
i would like you to try to get this thing working.

This shell command:
/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null|
grep ID_LENGTH | cut -d = -f 2

gives me the result 16 back, the LENGHT of the filename.

$var=shell_exec(/usr/local/bin/mplayer -identify -frames 0
/tmp/pitstop.mpeg 2/dev/null| grep ID_LENGTH | cut -d = -f 2);

just wont for some reason! $var ist just empty.
I was playing around with stderr and stdout and stuff, but i dont know why
php wont deal with it as shell does.

$var=shell_exec(ls -al); 
for examle works just fine!

Could someone please give it a try, cause i have spent hours in irc channels
and googeling around to get this solved :/



Thanks a LOT!!

Mario

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



Re: [PHP] shell_exec with pipes

2003-11-11 Thread Mario Ohnewald
 Have you tried escaping the pipes and quotes?  Try this:
 
 $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 
 /tmp/pitstop.mpeg 2/dev/null\| grep ID_LENGTH \| cut -d \=\ -f 2);

nope, still get nothing back.

 
 Mario Ohnewald wrote:
 
  $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0
  /tmp/pitstop.mpeg 2/dev/null| grep ID_LENGTH | cut -d = -f 2);
 

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



[PHP] Mathematical differences?!

2003-09-18 Thread Mario Werner

Hello all,

I ported a algorithm from JavaScript to PHP and noticed that PHP outputs a
different result than JS. For example:


t   = 0.6255264658909423
f   = 20.5
ln  = -6.983
d2r = 0.017453292519943295

$ra = (((6.6460656 + 2400.0513 * $t + 2.58e-5 * $t * $t + $f) * 15 - $ln) %
360) * $d2r;

PHP outputs 4.4156830075456535
JS outputs 4.42304792511156


I found out that ((...) % 360) returns in PHP 253.... whereas JS and a
Calculator return 253.6085
I also tried to use the bc...-functions but the result was the same.

This formular is only a part of a bigger calculation and I also noticed
further differences because when
I manually set $ra to 4.4230... (the JS result) then I still get a different
end-result than in JS but it is
100% EXACTLY the same algorithm, I checked it many times.

How could that be?! 1:1 the same code but different outputs? Is this a
PHP-bug?  :-?

Kindly regards,

Mario

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



Re: [PHP] output compression and MSIE

2003-07-09 Thread Mario Oberrauch

 Hi,
 
 I'm shocked. It seems it works! However.. My pages without forcing ISO
 8559-2 don't look good. What to use instead so?

Hi,

You could try leaving the line an and add content-encoding headers like this

meta http-equiv=content-encoding content=gzip
(or an equiv. header() statement)

Haven't tried that, but i see a chance that it works properly.
Question is, if you let mod_gzip zip your pages, how to know when to send
this header-directive. I'm quite sure about that IE is up to making
troubles getting unzipped content with that header.

regards
mario


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



Re: [PHP] output compression and MSIE

2003-07-08 Thread Mario Oberrauch
 Hello,
 
 I've found problem with MSIE showing sometimes blank page when
 compression is turned on (no matter using zlib.output_compression or
 gzip handler). I've found that happens when page is =4096 bytes long
 (output in HTML). And this suggested me to try to change buffer size
 for compression (for zlib, that I was using) cause it was set to
 exactly 4KB. But that didn't help at all :-( If I add space characters
 at the end of output to let page grow ower 4096 bytes - everything
 works fine, else MSIE shows blank page and user has to hit Refresh
 button to see correct page. With other browsers that problem doesn't
 happen.
 
 Do you have any idea how to solve that? BTW - changing browser or
 doing anything with user system is not good idea for me, cause I can't
 force users of my application to do anything - they use (and will use)
 windows+IE and so that's my problem to find solution. And output
 compression is a MUST for me cause I have to cut network traffic to
 lower users costs of using internet (GPRS transmission using mobile
 phones).
 
 Big thanks in advance for any help
 
 Sebastian Baran

heyho lucky one

thought not anyone else would have that bug. it's a very nasty one (at
least it was in my case) to figure out. i'd suggest looking for the
content-type you are sending with. may it be it's a text/html or
somewhat thislike?

regards
mario



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



Re: [PHP] output compression and MSIE

2003-07-08 Thread Mario Oberrauch
[snip]
 My head looks like that - nothing special..
 
 head
 LINK href=/css/main.css rel=stylesheet type=text/css
 TITLESome title/TITLE
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-2
 script language=JavaScript src=/javascripts/date_picker/date_picker.js/script
 /head
[/snip]

sorry list for the mess in this thread. got somewhat wrong.

try to take the following line out:
meta http-equiv=Content-Type content=text/html; charset=iso-8859-2
(modifing to output correct type would be even better)

regards
mario



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



  1   2   >