php-general Digest 11 Oct 2003 18:26:23 -0000 Issue 2349

Topics (messages 165835 through 165857):

Re: XML / XLS application
        165835 by: Curt Zirzow
        165847 by: Raditha Dissanayake

Re: Oracle - Win32
        165836 by: John Nichel
        165837 by: imran

off-list topic: Debian vs. Redhat
        165838 by: Wang Feng
        165839 by: Curt Zirzow

Re: CSV file with PHP
        165840 by: Eugene Lee
        165850 by: Curt Zirzow

recompiling libphp4.so because of modssl??
        165841 by: Merlin
        165843 by: daniel.electroteque.org

Re: Sessions
        165842 by: Nelson Goforth
        165856 by: Curt Zirzow

Re: How to fire off a unix command WITHOUT waiting for it to return (I want to use &)
        165844 by: Marek Kilimajer

Detecting devices i.e. PDA, Mobile
        165845 by: Shaun
        165846 by: Raditha Dissanayake

Re: [xml] character data
        165848 by: Raditha Dissanayake

Re: Am I asking too much?
        165849 by: John Taylor-Johnston
        165852 by: Curt Zirzow
        165853 by: Curt Zirzow
        165855 by: John Taylor-Johnston

Re: Encryption question
        165851 by: Jason Sheets

Re: phpmyadmin <form onsubmit>
        165854 by: John Taylor-Johnston

Howto ? Local/Master Value
        165857 by: ada

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
* Thus wrote Ray Hunter ([EMAIL PROTECTED]):
> So what is your questions concerning php?

I think he's lost.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message --- Very true curt, since he the message seems to be about XSL and not about XLS (which i understand to be a ms excel file format)

Orlando, head off to w3schools where you will find a map :-)


Curt Zirzow wrote:


* Thus wrote Ray Hunter ([EMAIL PROTECTED]):


So what is your questions concerning php?



I think he's lost.



Curt




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

--- End Message ---
--- Begin Message --- [EMAIL PROTECTED] wrote:
Hello mailing list, I want to use Oracle function in PHP parser in Win32

OS,


but I don't know how to install it, in the official documentation tell

this:


Installation
You have to compile PHP with the option --with-oracle[=DIR], where DIR
defaults to your environmment variable ORACLE_HOME.



I think that this steps is by Linux user, any help, I will appreciate,
thanks.



http://www.php.net/manual/en/install.windows.php


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
-Edit the php.ini file

GET THE DLLs:

The Dlls for mssql and others (oracle, sybase, etc.) are NOT included in the
installation (Install Shield Wizard) in the root folder.

Get the other package for windows systems (NO Install shield!).  Just plain
files.  After unzipping the file, look for the subdirectory called
extensions.  NOT the dlls folder! You'll find a bunch of dlls with the name
format like such: php_xxx. For Oracle DD, you'll need php_oracle.dll.  Take
the oracle dll.

PLACE THE DLL(s):
Place the dll you want in the root folder where you installed php locally.

EDITING THE PHP.INI:
Your php.ini SHOULD be in the Windows System Root (commonly C:\WINNT).
Ok, in the php.ini file, look for the Paths and Directories section.
Your extension_dir path should look like a DOS path like this:
extension_dir = C:/php/   ; Point the directory where you installed php
; inside the root should be the dll you placed!
If the default value of extension_dir is = ./ REMOVE IT!  This path should
be identical to a DOS path!
Ok, this is just a side note:

If you find a comment section for Windows Extensions inside another section
called Dynamic Extensions that has a bunch of lines like this:
;extension=php_xxx1.dll
;extension=php_xxx2.dll

un-comment this line for oracle dll...

THAT's it!
Save the php.ini.

Now you can call Oracle functions

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 11, 2003 10:29 AM
Subject: [PHP] Oracle - Win32


>
> > > Hello mailing list, I want to use Oracle function in PHP parser in
Win32
> > OS,
> > > but I don't know how to install it, in the official documentation tell
> > this:
> > >
> > > Installation
> > > You have to compile PHP with the option --with-oracle[=DIR], where DIR
> > > defaults to your environmment variable ORACLE_HOME.
> > >
> > >
> > >
> > > I think that this steps is by Linux user, any help, I will appreciate,
> > > thanks.
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Greetings,

Have been working with Windows for many years, I'm planning to *migrate* to
Linux.

Googled Debian vs. Redhat. Found that more commercial software vendors
support Redhat rather than Debian. Why does this happen?

Also, Debian contains more than 8000 packages, which is much more than the
number of packages Redhat has, buy why the Redhat needs more than 600MBs
harddisk space while Debian needs less than 200?


Which one are you using or prefer? Why? Which one should I use? Suggestions?



Thanks for your time.


cheers,

feng

--- End Message ---
--- Begin Message ---
* Thus wrote Wang Feng ([EMAIL PROTECTED]):
> Greetings,
> 
> Have been working with Windows for many years, I'm planning to *migrate* to
> Linux.
> 
> Googled Debian vs. Redhat. Found that more commercial software vendors
> support Redhat rather than Debian. Why does this happen?

$$$ and marketing.

> 
> Also, Debian contains more than 8000 packages, which is much more than the
> number of packages Redhat has, buy why the Redhat needs more than 600MBs
> harddisk space while Debian needs less than 200?

Quantity doesn't give something more Quality. How many of
those 8000 packages are you going to use? Probably the ~30
packages available on red hat.

The 600mb is probably reserved for their nice but unflexible rpm
system.

> 
> Which one are you using or prefer? Why? Which one should I use? Suggestions?

Neither.. FreeBSD is the answer.


You might consider finding some more appropriate place to ask this
(besides being enitirely OT). What flavor of Linux to be used can be
discussed for hours at end. Some research and googling would
benefit also.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message ---
On Fri, Oct 10, 2003 at 03:06:53PM -0700, Curt Zirzow wrote:
: 
: On Fri, 10 Oct 2003 18:38:04 -0300, Cesar Aracena <[EMAIL PROTECTED]> 
: wrote:
: >
: >Does anybody knows how to make a CSV (comma separated values) file
: >with PHP based on results fetched from MySQL? I need it to import it
: >with Microsoft Outlook Express.
: 
: csv file format as follows:
: 
:  value,"value\" with quotes",value with space,value<CR>

What about values with commas?

--- End Message ---
--- Begin Message ---
* Thus wrote Eugene Lee ([EMAIL PROTECTED]):
> On Fri, Oct 10, 2003 at 03:06:53PM -0700, Curt Zirzow wrote:
> : 
> : On Fri, 10 Oct 2003 18:38:04 -0300, Cesar Aracena <[EMAIL PROTECTED]> 
> : wrote:
> : >
> : >Does anybody knows how to make a CSV (comma separated values) file
> : >with PHP based on results fetched from MySQL? I need it to import it
> : >with Microsoft Outlook Express.
> : 
> : csv file format as follows:
> : 
> :  value,"value\" with quotes",value with space,value<CR>
> 
> What about values with commas?

doh!

"value, with comma"


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message --- Hi there,

I have just installed modssl and recompiled apache. When I start apachessl, I do get following warnings:

Loaded DSO libexec/libphp4.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)
[Sat Oct 11 13:21:23 2003] [warn] Loaded DSO /usr/local/lib/mod_gzip.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)


Can anybody give me hint on how to solve this, I am lost. How do I recompile libphp4.so?

Thanx for any help,

Merlin
--- End Message ---
--- Begin Message ---
lol from the php source, it compiles the so module into the destination apx
(apache) directory, try ./configure --help in the source of php for more
> Hi there,
>
> I have just installed modssl and recompiled apache. When I start
> apachessl, I do get following warnings:
>
> Loaded DSO libexec/libphp4.so uses plain Apache 1.3 API, this module
> might crash under EAPI! (please recompile it with -DEAPI)
> [Sat Oct 11 13:21:23 2003] [warn] Loaded DSO /usr/local/lib/mod_gzip.so
>  uses plain Apache 1.3 API, this module might crash under EAPI! (please
>  recompile it with -DEAPI)
>
> Can anybody give me hint on how to solve this, I am lost. How do I
> recompile libphp4.so?
>
> Thanx for any help,
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message --- The "Session" documentation IS difficult to understand. I wrestled with it for some time (and still am).

There's just no clear "cookie_lifetime" variable! All of Lowell Allen's instructions are the same that I've discovered, save that I set the 'session.gc_maxlifetime' to a large number - I was having trouble with the system forgetting me while I was testing. Your typical user might not sit around for an hour between actions, but I did, and while the session might have still been registered it lost the $USERID variable.

You can set the session settings in PHP code using 'ini_set' or 'ini_alter' (see the documentation), or (and I like this better) in your .htaccess file - assuming you're using Apache:

  php_flag session.use_trans_sid off
  php_flag session.cookie_lifetime 0
  php_flag session.gc_maxlifetime 3600

... as appropriate, of course. Unfortunately this approach isn't very well documented (hmmm, maybe _I_ should...) - I think I stumbled across it a couple years ago. I set the 'use_trans_sid' to off to see why the SESSIONID kept showing up in the URL at odd times.

Test using phpinfo() to see if the Local settings change from the global.
--- End Message ---
--- Begin Message ---
* Thus wrote Nelson Goforth ([EMAIL PROTECTED]):
> The "Session" documentation IS difficult to understand.  I wrestled 
> with it for some time (and still am).

agreed!  I am currently trying to come up with a re-write of the
session documentation, to resolve issues like this.  The problem is
there are many different options and gotchas that it is hard to
cover them all with out the documentation becoming bloated with
information overload.

Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message ---
Try
exec("/bin/scan & > /dev/null 2>/dev/null");

Daevid Vincent wrote:
How can I cause PHP to fire off a unix program and NOT wait for a reply.
Basically I want to use the "&" love the unix provides, but it seems that
exec, passthrough, system and even ` ` all wait for a return despite my
putting something like exec("/bin/scan &"); or `/bin/scan &`

*sigh*

The sitch is that I'm scanning/pinging/nmap a HUGE amount of IP addresses.
Perhaps 254 - 65000 or more individual iP addresses. We have a multithreaded
scanner that we wrote in C that can to this quickly, but it's still a wait.
It pulls from a db the ips to scan and sets their up/down flags. My php
scheduler page queries to get the ones that are up.


So as you see, I don't want to wait for a return code, I know the status via
the db and how many rows are done/need to be done.


Daevid Vincent.
http://daevid.com


--- End Message ---
--- Begin Message ---
Hi,

I have created an online system, and have created a WAP version, and am
currently crreating a PDA version. What I wuold like to to do is give out
the same URL instead of domain.com for normal use, domain.com/wap/ or
domain.com/pda/. Is there a way of detecting what device is loading the site
and redirect them accordingly?

Thanks for your help

--- End Message ---
--- Begin Message --- The easiest is to detect the browser because this is what really matters. Then the dimensions of the display come into the picture.
There is a db of these browser capabilities and detecting and using them etc in a sourceforge project call wurlf


all the best


Shaun wrote:


Hi,

I have created an online system, and have created a WAP version, and am
currently crreating a PDA version. What I wuold like to to do is give out
the same URL instead of domain.com for normal use, domain.com/wap/ or
domain.com/pda/. Is there a way of detecting what device is loading the site
and redirect them accordingly?

Thanks for your help





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

--- End Message ---
--- Begin Message --- What Tom has to say + you should note that character data may be called more than once for each call to startElement.

Tom Rogers wrote:

Hi,

Saturday, October 11, 2003, 6:26:01 AM, you wrote:
DA> I do not understand why this line does not work :
DA> $info[$element] = $content;

DA> but yet this works: echo $content;

DA> why? what is the trick?

DA> --

DA> $xml_comment_file = basename($svg_file, '.svg.xml') .'.info.xml';

DA> if (file_exists($xml_comment_file)) {
DA>     $file = $xml_comment_file;

DA>     $info = array();
DA>     $element = null;

DA>     function startElement($parser, $name, $attrs) {
DA>         global $element;
DA>         $element = $name;
DA>     }
DA>     function endElement($parser, $name) {
DA>         print "";
DA>     }
DA>     function characterData($parser, $content) {
DA>         global $info;
DA>         global $element;
DA>         $info[$element] = $content;
DA>         //$info[$element] = sprintf("%s", $content);
DA>     }

DA>     $xml_parser = xml_parser_create();
DA>     xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, FALSE);
DA>     xml_set_element_handler($xml_parser, "startElement", "endElement");
DA>     xml_set_character_data_handler($xml_parser, "characterData");

DA>     if (!($fp = fopen($file, 'r')))
DA>         die("could not open XML input\n");

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

DA> xml_parser_free($xml_parser);

DA>     print_r($info);
DA> }
DA> /*
DA> # the output is without $content :
DA> Array
DA> (
DA>     [info] =>
DA>     [file] =>
DA>     [orig-file] =>
DA>     [orig-author] =>
DA>     [bitmap-src] =>
DA>     [orig-date] =>
DA>     [svg-date] =>

DA> )
DA> */


the function characterData can be called with whitespace which is probably overwriting your content try this

$content = trim($content);
if(!empty($content)) $info[$element] = $content;





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

--- End Message ---
--- Begin Message ---
Any ideas? I want to avoid having two "mysql_query($sql)". I'm basically looking for 
better functionality and wanting to learn how to clean up my code.

John Taylor-Johnston wrote:

> So I should break it up my two queries?
>
> $sql = 'insert into '.$db2.'.'.$table2.'(KW,AUS,GEO,AN,RB,CO,RR)
> select KW,AUS,GEO,AN,RB,CO,RR FROM '.$db.'.'.$table.'
> WHERE id='.$id.';';
>
>  mysql_query($sql);
>
> $sql = 'DELETE FROM '.$db.'.'.$table.' WHERE id='.$id.' LIMIT 1;';
> mysql_query($sql);
>
> Any suggestions how I could prompt in between to ask yes or no? PhpMyAdmin does it 
> with a javascript alert(). An easy answer? Maybe I'm being lazy?
>
> > For security reasons mysql_query does not support ; to separate queries.
> > phpmyadmin splits multiple query strings up (PMA_splitSqlFile())

--- End Message ---
--- Begin Message ---
* Thus wrote John Taylor-Johnston ([EMAIL PROTECTED]):
> Any ideas? I want to avoid having two "mysql_query($sql)". I'm basically looking for 
> better functionality and wanting to learn how to clean up my code.
> 

there are a couple options, the insert has a extra option, 'ON
DUPLICATE KEY':
  http://www.mysql.com/doc/en/INSERT.html

Or use the REPLACE syntax:
  http://www.mysql.com/doc/en/REPLACE.html

Be forewarned about the REPLACE, that there may be side effects
because it not only replaces on the primary key value but any
UNIQUE index.

For example (ingore syntax errors),

create table (
 id   Primary Key
 name UNIQUE
)

Data:
1, 'Name1'
2, 'Name2'

replace into table (id, name) values (2, 'Name1');

I havn't tested this situation, but to me that, seems like an
awkward position to be in.

Curt.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message ---
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
> * Thus wrote John Taylor-Johnston ([EMAIL PROTECTED]):
> > Any ideas? I want to avoid having two "mysql_query($sql)". I'm basically looking 
> > for better functionality and wanting to learn how to clean up my code.
> > 

Oh, and IMO, there isn't anything unclean about having two sql
query() statements. It keeps the code more readable  as to
what you're trying to doing.

Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message ---
Curt

> Oh, and IMO, there isn't anything unclean about having two sql
> query() statements. It keeps the code more readable  as to
> what you're trying to doing.

I agree. I also think I should just try to emulate what phpmyadmin does. KISS 
principle.
Thanks!!!
John

--- End Message ---
--- Begin Message --- I wouldn't use crypt, instead use one of the proven more secure hashes like md5 or sha1.

For password hashing I'd use md5 (PHP 3 and 4) if you want broad support or sha1 for a little more security (sha1 hasn't been in PHP as long (only since 4.3.0) so you will lose some compatability,

Ryan Thompson wrote:

I know this is an opinion thing but what's the best functions or function set for password encryption?

Currently my project uses md5 but I thinks it's more for checksums isn't it?
Also, is mcrypt used for passwords? I looks like it's a two-way encryption.




--- End Message ---
--- Begin Message ---
What about some javascript to alert() and decide if the form executes like phpmyadmin 
does:

http://ccl.flsh.usherbrooke.ca/example.jpg

This would save me time coding PHP.
How can I accomplish this? What does the onsubmit look like?

John

> * Thus wrote John Taylor-Johnston ([EMAIL PROTECTED]):
> > Any ideas? I want to avoid having two "mysql_query($sql)". I'm basically looking 
> > for better functionality and wanting to learn how to clean up my code.
> there are a couple options, the insert has a extra option, 'ON
> DUPLICATE KEY':
>   http://www.mysql.com/doc/en/INSERT.html
> Or use the REPLACE syntax:
>   http://www.mysql.com/doc/en/REPLACE.html

--- End Message ---
--- Begin Message ---
Hi all,

I m note a great php config hacker.
But I notice thing that i doesnt have to notice before :)
In my phpinfo i notice 2 column ;
Local Value & Master Value

http://www.dealgates.com/phpinfo.php

So you can make several config judging from the current account ?
I dont found anything about that ...

How several configs are maintained in a mutual web server ?
Surely one php.ini for all and some little hacks on vhosts config ?
like here :
http://www.php.net/features.safe-mode
You can a vhost.conf file.

<Directory /vhosts/domain.com/httpdocs/>
php_admin_value safe_mode 0
php_admin_value open_basedir "/"
</Directory>

Explain me ?

Thanks.

--- End Message ---

Reply via email to