Re: [PHP] Stop neurotic posting

2003-08-06 Thread Jason Wong
On Wednesday 06 August 2003 14:26, Curt Zirzow wrote:

 Now noisyness from the 'helpers'...  I have noticed at times that a
 question is answered the same way like 10 times by 10 different
 people; this I consider more noisy than a RTFM post.

And what I find really annoying is that some helpers being really 'helpful' 
copy and paste whole chunks from the manual.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
filibuster, n.:
Throwing your wait around.
*/


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



[PHP] Sum a column of values from a MySQL query

2003-08-06 Thread Ben C.
I am trying to sum a query of values from a MySQL table.  The code I am
using is:

---BEGIN CODE #1--
$sql_2 = SELECT SUM(partpaidamount) as partpaid
FROM $tb_name
WHERE invoiceid = \$invoiceid\
;

$result_2 = @mysql_query($sql_2,$connection) or die(mysql_error());

while ($row = mysql_fetch_array($result_2)) {
$invoicepartpaid = $row['partpaid'];
}
---END CODE #2

1) The code returns the sum of a partially paid invoice.  The individual
invoice is 'partpaid'. WORKS...NO PROBLEM
2) The while() then return a list of partially paid invoices which is
$invoicepartpaid.  WORKS..NO PROBLEM
3) I then want to add the list of partially paid invoices ($invoicepartpaid)
together.  I AM STUCK HERE ADDING THE INVOICES AMOUNTS TOGETHER.

If anyone can help I would greatly appreciate it.


--
The content of this email message and any attachments are confidential and
may be legally privileged, intended solely for the addressee.  If you are
not the intended recipient, be advised that any use, dissemination,
distribution, or copying of this e-mail is strictly prohibited.  If you
receive this message in error, please notify the sender immediately by reply
email and destroy the message and its attachments.


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



Re: [PHP] Running script produces no output

2003-08-06 Thread Jacob Vennervald Madsen
Does the script work when you run it by hand?

Try to insert an echo TESTER in the top the shell script to make sure
something is sent to stdout. And then check in your php script that you
receive the message.

Best regards,
Jacob Vennervald

On Wed, 2003-08-06 at 08:38, Chris Blake wrote:
 Greetings learned PHP(eople);
 
 I have a small script sitting in my web directory which I have called
 upon as follows :
 
 ?php
 shell_exec('./info.sh');
 ?
 
 The script is not being run, yet I can do things like
 
 ?php
 $info=shell_exec('ls -l');
 echo 'pre$info/pre';
 ?
 
 ..which produce output to the browser...
 
 I have tried 'chown apache:apache info.sh' but this doesn`t change
 anything
 I have also tried using './info.sh' with no result
 
 Any pointers much appreciated as to why this won`t work. The permissions
 are as follows for the script file :
 
 -rwxrwxrwx1 root root 2456 Aug  5 16:35 info.sh
 
 Regards
 
 -- 
 Chris Blake
 Office : (011) 782-0840
 Cell : 083 985 0379
 
 Join the army, see the world, meet interesting, exciting people, and
 kill them.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



RE: [PHP] dev style guide

2003-08-06 Thread Jay Blanchard
[snip]
They use the One True Brace Style,
which is encouraging:

function fooFunction($arg1, $arg2 = '')
{
if (condition) {
statement;
}
return $val;
}
[/snip]

At the risk of starting a flame/religious/holy war I find the One True
Brace style to have some inconsistency if it is as above. The 'function'
does not open the curly brace at the EOL, but the 'if' does. I also
mentioned me being and old-schooler earlier today but the rules that we
use in our (current) group always place the opening curly at the EOL.
Also, we do not allow ternary notation. We encourage Hungarian notation,
but do not require it if the documentation is clear.

HTH!

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



Re: [PHP] OO function overloading?

2003-08-06 Thread Jean-Christian IMbeault
Greg Beaver wrote:

 This statement isn't entirely correct, overloading is possible with the 
 overload extension.

True. Nice work. But still a hack in my mind :) (though a *very* clean
hack).

Jean-Christian Imbeault


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



Re: [PHP] Re: PHP Fusebox

2003-08-06 Thread Alexandru COSTIN
Hello Ralph,

Anyway, as a sample of a very powerful and open Krysalis application, we
have an already open CMS built upon Krysalis - the Komplete Lite CMS (I am
proposing the lite for now as it's open source). Komplete Lite was designed
for Krysalis and I can also say that Krysalis advanced because of Komplete
requirements.

We have tried to make Komplete a very adaptive CMS, that allows us to
use most of the nice Krysalis features - I think all of them

- it uses taglibs everywhere for code completion
- it's pages are designed as aggregated pipelines with cache support for
performance and for site section independence
- it is based completely on the separation of application logic from the
presentation layer - so changing the presentation layer can be made with a
simple click
- it already includes a very powerful structure manager
- has various page types (to be rendered in the central site section)
and can easily include new page types
- it can import RSS streams from other sites
- has support for various types of nuggets (not as many as nuke, but we
are welcoming contributions)
- includes a visual HTML editor (KTML lite)
- and many other features.

 Komplete can be found at
http://www.interakt.ro/products/KompleteLite/index.php

Alexandru


-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
Ralph Guzman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am not set on Fusebox, but the reason I've been considering it is
 because I came across ezPublish 3, that uses this framework.

 I am looking for a CMS with a framework that I can use to develop my
 future projects.

 Are there any PHP/MySQL based XML/XSLT CMS that I can look at?

 I am just doing my research now, and I will decide on a standard once I
 have looked at all my options.


 -Original Message-
 From: Nicolas Frisby [mailto:[EMAIL PROTECTED]
 Sent: Monday, August 04, 2003 10:38 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: PHP Fusebox

 I just recently did a bit of research into standardized development
 processes and such and the most robust system I have found is XML and
 XSLT.

 I realize that the whole idea of the 'fusebox' page is lost, but XSL
 allows
 you to generate just about anything and XML's standard formats (DocBook
 and
 Apache's Cocoon to name a couple) guarantee some degree of easy sharing
 or
 even an easy switch to a different system in the future.

 Come to think of it, if you are really set on this Fusebox idea, you
 could
 (theoretically) use XSL to generate your php files that conatin your
 fusebox
 templates from XML...

 Hope this offers even the tiniest bit of illumination
 -Nick

 





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



Re: [PHP] problem using unlink()

2003-08-06 Thread Pascal Miquet
Hello,

I'd suggest to have a look at your php.ini and see the value of some
execute external commands. Don't remember exactly the name of this flag.
HTH
Regards
Pascal Miquet

Le mar 05/08/2003 à 13:53, James Brash a écrit :
 
 Hi,
 I have a problem using unlink(); on a system using FreeBSD and Apache...
 where my local system using Windows and Apache experiences no problems.
 
 ?
 unlink(test1.php);
 ?
 
 On the windows system is deletes the file, but on the FBSD system the file
 does not delete and returns no error. I have tried using the full path, and
 CHMODing the files but no luck. Thanks for any help/advice you can give me.
 
   James Brash
 
 
 -- 
 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] Re: PHP Fusebox

2003-08-06 Thread Ralph Guzman
I am not set on Fusebox, but the reason I've been considering it is
because I came across ezPublish 3, that uses this framework.

I am looking for a CMS with a framework that I can use to develop my
future projects.

Are there any PHP/MySQL based XML/XSLT CMS that I can look at?

I am just doing my research now, and I will decide on a standard once I
have looked at all my options.


-Original Message-
From: Nicolas Frisby [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 04, 2003 10:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: PHP Fusebox

I just recently did a bit of research into standardized development
processes and such and the most robust system I have found is XML and
XSLT.

I realize that the whole idea of the 'fusebox' page is lost, but XSL
allows
you to generate just about anything and XML's standard formats (DocBook
and
Apache's Cocoon to name a couple) guarantee some degree of easy sharing
or
even an easy switch to a different system in the future.

Come to think of it, if you are really set on this Fusebox idea, you
could
(theoretically) use XSL to generate your php files that conatin your
fusebox
templates from XML...

Hope this offers even the tiniest bit of illumination
-Nick

 



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



[PHP] Running script produces no output

2003-08-06 Thread Chris Blake
Greetings learned PHP(eople);

I have a small script sitting in my web directory which I have called
upon as follows :

?php
shell_exec('./info.sh');
?

The script is not being run, yet I can do things like

?php
$info=shell_exec('ls -l');
echo 'pre$info/pre';
?

..which produce output to the browser...

I have tried 'chown apache:apache info.sh' but this doesn`t change
anything
I have also tried using './info.sh' with no result

Any pointers much appreciated as to why this won`t work. The permissions
are as follows for the script file :

-rwxrwxrwx1 root root 2456 Aug  5 16:35 info.sh

Regards

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Join the army, see the world, meet interesting, exciting people, and
kill them.


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



[PHP] Stop Neurotic Posting

2003-08-06 Thread Sancar Saran
Why ?

So many people always asking same questions. Many of them so lazy. They aren't 
search lists archieve or google, they just ask or wait for the somebody do 
his/her job.

It just classic, if people doesn't ask same stupid questions, there is no RTFM 
or similar things. 

This is about human nature and this is a php technical list. Please post about 
list topics. We just try to write php programs, programming human brain is 
different thing.


Good Day

Sancar Delifisek Saran


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



Re: [PHP] why doesn't default values for this function work - resending because of bad formatting

2003-08-06 Thread anders thoresson
What is this mess that you have here :-)
I don't have a clue! :) It looks allright here, when I press send.

How exactly are you calling the function when no $max_length is passed? 
If you're doing something like:

secure_string($string, '', 'error msg');
Just secure_string($string);. In that case, $max_length should be set to 
-1 (since the function is defined function secure_string($unsafe_string, 
$max_length = -1, $errormessage = Too many characters. ).

Or is this where I'm mistaken.

The thing is that I've tried with zero, null and 0 as signals to the 
function that a max_length isn't applied. Nothing works.

But I've several functions with the same syntax, all working...

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


Re: [PHP] Help with Mod mathematical function

2003-08-06 Thread desa15


if you turn on --enable-bcmath, you can use de bcmod function equivalen to
Mod operator from visual basic


Un saludo, Danny


   

  Dean Baldwin 

  [EMAIL PROTECTED]  Para: [EMAIL PROTECTED]   

   cc: 

  06/08/2003 12:19 Asunto:   [PHP] Help with Mod 
mathematical function 
   

   





Hi,

I am porting a vb application across to php but have come up against a
small
problem. The code uses the Mod calculation however I cannot find any Mod in
php. The line of code that uses it looks like:

Data = (index Mod 16)

Anybody have any ideas how I recreate this in php? Both data and index are
integers.

Regards,
Dean


--
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] Re: Password storage system

2003-08-06 Thread Sek-Mun Wong
(This is a bit off topic, but I though might be helpful to some developers,
it deals more with security concepts than PHP per se)

I may be going out on a limb here, but  I doubt you'll find something in the
GPL/open source domain.

we've built our own and pretty much does what you've described (used to work
for a bank I did)

If I could help to put you on the right track in terms of design, what
you'll need is not just a password system, sounds like you want a authority
system, with groups  roles. You really want to design a system that relies
on resource objects for authentication and authorisation. Also to complete
the security jargon, encryption and non-repudiation (mostly means logging 
auditing)

If you want to look at something that W3C is working on, try SAML, the
security assertion markup lang... but it's in draft last time I looked, and
that deals with authority and authentication. and it's all markup-ish and
xml-ish of course ;-) There should be some tools based on SAML out there, I
haven't looked, possibly not in PHP though.

Back to building it: Think of authentication not only as a passwords,
there's PIN authentication, there's token authentication, (one use tokens or
multi-use tokens) and also digital certs, smart cards, RPGs (random
password/pin gens ala SafeWord), etc (ie, password types)

Then you need to ask, can a user with the right password access this
resource? Does he need a password AND a cert? Does this bank account need
two authorisers to sign off before you allow the money transfer?

Of course one way crypt passwords are a must, but that's so simple it's a
given.

The above are just some things to think about before you embark on you quest
to find the solution :) And it really depends what you want to do and how
robust your solution needs to be.

I can give you a few pointers if you want to take the discussion offline and
email me.

Daevid Vincent [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm in search of an 'enterprise level' password storage system.

I have looked at phpMyPass and it looks promising, but the demo doesn't seem
to have everything I want.
http://freshmeat.net/releases/127316/
While this one says v2.0
http://www.phpmypass.paniris.com/
Says 1.0 ??

I need it to be multiuser, have different security levels/access, encrypt
and decrypt on the fly (phpmypass has all the passwords in the rendered HTML
page :-( ), grouping of passwords (i.e. 'internal servers', websites, banks,
clients sites, personal, etc).

Ideally it should use mod_auth_mysql for security. The storage should be
encrypted so that even root can't see the passwords in the database without
the decryption key. Perhaps use a strong crypto algorithm for the important
fields, not just the pw.

I'd like to store: common name, url, username, pw, notes, incept date, last
mod date at least.

I could build this myself, or I could take phpMyPass and run with it, but I
thought I'd see if there were anything else out there before I build this.

http://daevid.com


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



[PHP] Class extension problem

2003-08-06 Thread Joshua Groboski
Ok, I have a parent class (CMS) and a child class (WebSite extends CMS).
There is some important stuff going on in the constructor for CMS that I
think should be happening when I instantiate a new WebSite.  Look at the
following example:

?php
class CMS {
  var $prop1 = a;
  function CMS(){
$this-prop1 = A;
  }
}

class WebSite extends CMS{
  var $prop2 = b;
  function WebSite(){ }
  function setProp2(){
$this-prop2 = $this-prop1;
  }
}

$ws = new WebSite();
echo Before:  . $ws-prop2 .  :  . $ws-prop1 . \n;
$ws-setProp2();
echo After:  . $ws-prop2 .  :  . $ws-prop1 . \n;
?

If you run this, you'll notice the constructor for CMS is never called.  Is
this a by-design functionality, am I wrong about what I think should happen,
or am I just totally off my rocker?


-- 
Joshua Groboski
Programmer Analyst
SAVVIS Communications Inc.
http://www.savvis.net



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



RE: [PHP] Stop neurotic posting

2003-08-06 Thread Ford, Mike [LSS]
On 06 August 2003 08:25, Daryl Meese mailto:[EMAIL PROTECTED] wrote:

 
 For my part on at least one occassion I posted a question to
 the list after
 reading the manual (which in that case was clear as mud) and
 got the RTFM.
 I was tempted to respond with IDRTFM  -  GFY.

Well, easy way to avoid that is to say I have RTFM, but ... at the start of your 
mail.  Then if you get an RTFM response, at least you can RTFM back (M=message!).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


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



Re: [PHP] Re: Parse error not understood

2003-08-06 Thread Miles Thompson
Yes, I'm top posting, pls forgive.

This is a situation where an editor which has built-in brace matching 
really helps - if in the midst of looking one remembers to use it.

Another tip, although it probably wouldn't help here: Save the code with a 
.phps extension and look at it in the browser.

Cheers - Miles

At 02:59 PM 8/6/2003 +0200, Chris Blake wrote:
Holy schmoley...something so small.I must get off this green tea,
all this good health stuff is causing havoc in my brain...
Thanks Fokkema, and Johnfor pointing out an obvious error...

Regards

On Wed, 2003-08-06 at 14:48, Fokkema, I.F.A.C. (HKG) wrote:
  //If Delete User is selected--
  if ( $_REQUEST['useroption'] == 'delete')
 snip -- liked the Ford quote  

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


Re: [PHP] How can I change ? to %3F

2003-08-06 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Tue, 5 Aug 2003 at
23:16, lines prefixed by '' were originally written by you.

 Is it possible to change the ?, :,  and / characters to their
 respective
 hex(?) values automatically?  That is without having to use
 str_replace for
 each one?  Anyone know how?
 Chris

http://uk2.php.net/urlencode

If you want *only* the ?:/ characters changed then it can be done
with a regular rexpression, the e modifier, and the ord(), hex() and
strtoupper() functions, post back if you would like an example.

HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Free PHP error handling script: www.phpmachine.com/error-handler/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/

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



php-general Digest 5 Aug 2003 13:40:00 -0000 Issue 2218

2003-08-06 Thread php-general-digest-help

php-general Digest 5 Aug 2003 13:40:00 - Issue 2218

Topics (messages 158230 through 158279):

Re: Display Records in Multiple Pages help please !
158230 by: daniel.electroteque.org
158277 by: Justin French

Re: Regular Expression
158231 by: Curt Zirzow

Extracting Compressed Files
158232 by: Matt Palermo
158233 by: Matt Palermo
158234 by: Curt Zirzow

Handling DELETE requests
158235 by: Seairth Jacobs
158237 by: Curt Zirzow
158273 by: Seairth Jacobs

Re: Addin a column of numbers not using MySQL
158236 by: Jason Wong

PHP Fusebox
158238 by: Ralph Guzman
158239 by: daniel.electroteque.org
158240 by: Tariq Murtaza
158243 by: daniel.electroteque.org
158245 by: Alexandru COSTIN
158246 by: daniel.electroteque.org
158250 by: Joona Kulmala

checking how many records are returned?
158241 by: Amanda McComb
158242 by: Nadim Attari

Sum a column of values from a MySQL query
158244 by: Ben C.
158247 by: Giz
158249 by: Ben C.
158251 by: Jason Wong
158255 by: Ford, Mike   [LSS]
158264 by: Ben C.
158266 by: Adam Alkins
158267 by: Jay Blanchard
158268 by: Jay Blanchard
158269 by: CPT John W. Holmes
158270 by: Jay Blanchard

Re: easier than switch
158248 by: Nicholas Robinson

Some SOAP samples
158252 by: Pascal Miquet
158261 by: Marek Kilimajer

Ezmlm Hash
158253 by: Eyles, Richard

Re: Values from forms
158254 by: Ford, Mike   [LSS]

snippet
158256 by: Harry Wiens
158257 by: David Nicholson
158258 by: Jon Haworth
158259 by: David Nicholson
158260 by: imran

problem using unlink()
158262 by: James Brash
158278 by: Pascal Miquet
158279 by: Pascal Miquet

strange foreach behaviour
158263 by: Martin Peck
158265 by: Martin Peck

PHP/JavaScript/HTML
158271 by: Mauricio
158272 by: CPT John W. Holmes

Formatted text from mySQL DB
158274 by: PHPSpooky
158275 by: CPT John W. Holmes
158276 by: David Nicholson

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]


--
---BeginMessage---
100k = 100k records = 200 meg hehe
 a sample from my db class, i had to store the total in a session as
 calling the total on every page on a large database was painful doing
 count(*) or even SQL_CALC_FOUND_ROWS, on a small database u just cant
 tell but on a database of 100k + it was painful to load each page ;)

 function page_query($per_page, $query, $page, $session_var, $debug =
 null, $start_session = null) {
   if ($start_session) session_start();
   if(!$page) {
$this-page = 1;
   $this-start = 0;
} else {
   $this-page = $page;
   $this-start = ($this-page - 1) * $per_page;
   }

   if ((!$page  !$_SESSION[''.$session_var.'']) || (!
 $_SESSION[''.$session_var.''])) {
   $query = preg_replace(/SELECT|select/,\\0
 SQL_CALC_FOUND_ROWS,$query);
   $query = $query LIMIT $this-start, $per_page;
   $result = $this-query($query);
   if ($debug) $this-debug();
   $row = $this-getOne(SELECT FOUND_ROWS() as
 total_rows);
   $_SESSION[''.$session_var.''] = $row['total_rows'];
   $this-total = $_SESSION[''.$session_var.''];
   } else {
   $query = $query LIMIT $this-start, $per_page;
   $result = $this-query($query);
   if ($debug) $this-debug();
   $this-total = $_SESSION[''.$session_var.''];
   }
   $this-pages = ceil($this-total / $per_page);
   return $result;
}




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



---End Message---
---BeginMessage---
If you're using CGI/Perl, WHY WHY WHY are you asking questions on a PHP 
list?

I've given you a hint, so perhaps take that hint and ask a question on 
an Oracle list, or search the Oracle documentation for similar 
functions.

Justin French

On Tuesday, August 5, 2003, at 10:37  PM, Coello, David wrote:

thank you for replying, good morning.
im using oracle 8. with cgi/perl
thank you david
-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]
Well, you haven't told us what database you're using at all, but I'll
assume MySQL.  In which case you should look at the LIMIT part of your
query.

[PHP] Re: manipulate mail header

2003-08-06 Thread Ivo Fokkema
Klaus Linzner [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi! Its me again. Sorry for the last post - it was quite clumsy.

 In fact, it wasn't really what I need. I have a mail and I want to fake
the
 attachment. Its always the same String in the header that I need, but I
need
 to set
 X-MS-Has-Attach: yes

 and I have to add some values to the header until this will work
correctly.
 Because if I send a mail the value for Content-Type: text/plain . And I
have
 to manipulate the header in that way, that I can set the Content-Type:
 multipart/mixed. Same with content-class.

 If you have any idea how to manipulate the header, please mail me. Thanks
 Klausi
All you need @ http://www.php.net/mail

HTH

--
Ivo



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



[PHP] Is fwrite atomic or not?

2003-08-06 Thread Herouth Maoz
I've seen answers both ways in the archive of this list, and I wonder 
what is true.

Suppose I open a file in append mode - like a log file. Two different 
HTTP connections fire up two different PHP processes which both open 
the same file. Then they both do an fwrite( $fp, some string ).

Is the result serializable? That is, is one write guaranteed to be 
appended after the the other? Or is there a chance that one will 
overwrite the other and truncate the file - in which case, I'll need 
an flock() even for the simplest log file.

What if I opened the file in some other mode, like w or r+?

Herouth

(If you answer, please make sure you cc to my e-mail, as I read this 
list in digest mode).




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



[PHP] Piping and the CLI parser

2003-08-06 Thread Nicolas Frisby
Greets everybody.

My question regards psuedo-DOS (XP cmd.exe) piping and the CLI php parser.
If you could help please continue reading.

The documention specifies that the CLI php parser sets up STDIN and its
kin.

It does in fact work fine assuming the STDIN is the console, but while I was
just toying around with my File Type default command (setting it up WinXP so
that 'foobar.php arg1 arg2' entered at the command line actually executes
the script with arguments), I attempted some piping; which, through very
shallow research, I've come to think uses STDIN.

It fails; no piping whatsoever. Even the simplest 'dir | echo.php', where
echo just implodes() $argv and echoes, gives no output.

Is my suspicion that the CLI php parser does not set up STDIN to receive
from a pipe correct, or am I missing something here?

Thank you very much for your time,
Nick

ps - the type of File Type work I used to make the command line work is
described here:
http://www.php.net/manual/en/features.commandline.php - do an in-page
search for phpNOSPAM to find the comment quickly

pps - if someone could try similar piping on a *nix box, I'd be interested
to know how that goes



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



[PHP] How to run PHP from a MySQL DB

2003-08-06 Thread Jeremy Darling
I have a database of code pages and was wondering if their is a way to
actually run the code from the Database as if it was part of a page.

Thanks,
Jeremy



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



Re: [PHP] Stop neurotic posting

2003-08-06 Thread Mike Mannakee
Hey - it doesn't actually seem to matter whether one does research or not.
Almost every single post I make, someone just HAS to tell me to search
google, which is maddening.  The whole idea behind a forum like this is to
be able to communicate with others who may be able to help, and who you may
be able to help.  So someone replying with a pissy RTFM is trying to get you
not to communicate with your friends.  That pretty much tells me where
they're at as individuals.  I don't need in-depth discussions with them to
figure out they don't have many friends and are rather lonely in life, which
is a bit pathetic as they have a whole community of people here that are
very friendly and also like-minded, as well as other people in their lives
that they incessantly work to alienate.  But, hey, there's always gotta be a
few in any bunch.

Mike


Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
This is a very busy list, over 100 message in a quiet day and most
people
are helpful and decent, don't mind reading and learning. Unfortunately
there are some who mostly post stuff like 'read the manual' and other
shit
like that. Stuffing e-mailboxes with such garbage day after day doesn't
do
anybody any good even if the manual is  not being read as much as it
should
be. Is it too difficult to not answer the post at all if you disagree
with
the content?
[/snip]

I know that this has circulated, but RTFA (toungue-firmly-in-cheeck)
http://catb.org/~esr/faqs/smart-questions.html

My suggestion, quit posting shit like this when it has been covered
dozens of times. Talk about noise. Look how many replies this thread
generated. Looks very much to me like you are
http://www.winternet.com/~mikelr/flame29.html I know I use RTFM, STFW,
and STFA a lot, but when the poster makes it apparent that they have
done no research it is an expected and acceptable answer.

HTH!



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



RE: [PHP] PHP Name of Script -0-T-

2003-08-06 Thread Chris W. Parker
Ryan A mailto:[EMAIL PROTECTED]
on Wednesday, August 06, 2003 6:33 AM said:

 I want to have an index of services available on my site..
[snip]

I have no idea what you're talking about. Well, actually, I have a
/guess/ but I'm not sure if it's correct.

Are you saying you want to have a list of people that fall into the
categories you listed earlier? It's definitely not an index of
services. And index of services would be a list of services, not having
anything to do with the people available with each service.



c.

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



[PHP] RE: Downloding files once

2003-08-06 Thread Boaz Yahav
This may work but i can't help thinking that this is the wrong way to
go.
Downloading 1GB or 2GB files via fpassthru doesn't feel right...

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com


-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 7:41 PM
To: Boaz Yahav
Cc: [EMAIL PROTECTED]; Igal Rubinstein; Matt Wade
Subject: Re: Downloding files once


Hello,

On 08/06/2003 12:43 PM, Boaz Yahav wrote:
 I'm trying to allow users to download files from my servers. Files can

 be hundreds of MB in size and sometimes even a few GB. This is a 
 closed section of the site and i would like to allow only
 members to be able to DL the files.
 
 I thought of using a download function that uses headers and 
 readfile() or fread(). This way i can check who is the user and send /

 not send the file. However, this does not seem to work with
 such big files.

I think you are exceeding your PHP memory limit. I suggest that you use 
fpassthru or maybe fread in many chunks of 100K and use flush() after 
each chunk echo so you pass the data back to Apache instead of keeping 
it in your PHP memory space.

-- 

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

 


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



Re: [PHP] Downloding files once

2003-08-06 Thread Curt Zirzow
* Thus wrote Boaz Yahav ([EMAIL PROTECTED]):
 
 I thought of using a download function that uses headers and readfile()
 or fread(). This way i can
 check who is the user and send / not send the file. However, this does
 not seem to work with 
 such big files.

you most likely are running into the script timeout when people
are downloading the  file.  I would in this case, use fread so you
can do some checking in between sends and if bandwidth becomes a
problem you can do some bandwidth throttling:

set_timelimit(0);
while (! feof() {
  if (connection_aborted() ) {
break; // no need to send the data now.
  }
  fread();
  print $data;
}
  

 
 Another idea is to use Apache Mod Rewrite and check that the user has
 the referrer of the
 download server. I'm assuming that he will only have this if he had
 access to a link to the 
 file from the server it's self and such a link will only be provided to
 members. As far as i can
 think, you can only fake a referrer by writing your own client.

I would discourage this for the fact that the referer can easily be
faked.  If you downloads are important to the general public and
word gets out that the referer is your security.. say good bye to
your bandwidth :)

 
 If anyone has any ideas or comments I'll be very happy to get them.

HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: How to run PHP from a MySQL DB

2003-08-06 Thread Alexandru COSTIN
php accelerator : http://www.google.com/search?q=php+accelerator

As for the tmp solution - this is indeed the approach

Alexandru

-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
Jeremy Darling [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 This is actually for a personal web portal, so very little will be eval'd
 out of the database most of the time.

 I'm not sure what a PHP accelerator is, but I'm guessing that if I wanted
to
 use it I could get away with doing something like:

 Export the php file from the db to an actual tmp file.  require it and
call
 it from inside of my dbpage.php file.


 Alexandru Costin [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Oopps, sorry for my previous reply.
  Actually I've missunderstood your question - I've understood it
better
  now.
 
  The eval is indeed the key - but there is one major performance
  issue - when eval-ing code from the database, you won't be able to use a
 PHP
  accelerator - as they can't optimize dynamically eval-ed code.
  What we regularily use is to cache the PHP code in some PHP files
that
  are actually required when you need to execute them
 
  Alexandru
 
  --
  Alexandru COSTIN
  Chief Operating Officer
  http://www.interakt.ro/
  +4021 312 5312
  Jeremy Darling [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   I have a database of code pages and was wondering if their is a way to
   actually run the code from the Database as if it was part of a page.
  
   Thanks,
   Jeremy
  
  
 
 





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



RE: [PHP] dev style guide

2003-08-06 Thread Jay Blanchard
[snip]
Just a remark but isn't it pointless to use Hungariannotation in a 
language that is by default typeless???
[/snip]

We use it becuase we have a group of programmers, so the notation makes
it easier for one in the group to understand the intention of another in
the group. The notation also helps to clear up any casting issues that
may arise. http://us2.php.net/language.types.type-juggling


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



RE: [PHP] Stop neurotic posting

2003-08-06 Thread Jay Blanchard
[snip]
Andu's right. I've left several lists in the past, not because of people

listing questions where they should have read the manual first, but
because I 
couldn't stand the sad b**ds who get their kicks by belittling
people 
with less knowledge but more manners than themselves.
[/snip]

neurotic

\Neu*rotic\, a. [Gr. ? nerve.] 1. Of or pertaining to the nerves;
seated in the nerves; nervous; as, a neurotic disease. 2. Uself in
disorders of, or affecting, the nerves.

I am being a smart-arse now, but I believe that dictionaries and Xanax
are in order for some of you. Get over it! RTFM, STFW, and STFA are NOT
PERSONAL ATTACKS! Those are reserved for off-list replies unless the
flame is warranted on list. Here we go ...

You are such whiney babies. Most of the STFM posts have a link directly
to the relevant portion of the manual or a link to the archived
materials. What would happen if those who posted such messages quit
doing it? I don't know the manual backwards and forwards, many have told
me to RTFM (with a relevant link) and I have gone on to learning
something that I didn't know.

Get over it.

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



Re: [PHP] Handling DELETE requests

2003-08-06 Thread Curt Zirzow
* Thus wrote Seairth Jacobs ([EMAIL PROTECTED]):
 Under Apache 1.3, how can I respond to DELETE request with a PHP script?  I
 have no problem with GET, POST, or PUT.  The only thing I found was the
 Scripts directive, but that requires a specic script to be named.  I am
 looking for something more generic, possibly where I can just say that php
 scripts can accept DELETE requests.

hmm.. I've never seen the DELETE method used anywhere, and probably
for good reason.  By default you cant use this method with apache
and I'm not sure if you can enable it without recompiling it or
getting a patch that enables it.

Now if you do enable the method, it is rather undefined on how it
would be handled by php.  According to some documentation I found
(w3c) is:

quote
DELETE 
Requests that the server delete the information corresponding to
the given URL. After a successfull DELETE method, the URL becomes
invalid for any future methods. 
/quote

If the client issues a 'DELETE /file.php' will the server delete
the php file and make it unusable. Or will it pass the Request to
php.  If the latter happens then my assumption is that it will be like
a GET request but the $REQUEST_METHOD variable will be 'DELETE'
instead of 'GET'.  And you program can act accordingly.

Now with that said, the common way to simulate a DELETE method is
by using GET with query paramaters telling you that this request want
to really delete something.


HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



RE: [PHP] preventing output dump of passthru()

2003-08-06 Thread Chris W. Parker
David Nicholson mailto:[EMAIL PROTECTED]
on Tuesday, August 05, 2003 5:12 PM said:

 $output = array();
 exec(command,$output);
 $output = implode(,$output);

That's a good idea!

Well how about this? (posted in another message)

$output = explode(\n,chop(`$command`));

That is working great and it's only one line. The problem is that I have
no idea WHY it works and what the ` characters do.

Can you fill me in?


Thanks,
chris.

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



Re: [PHP] Stop neurotic posting

2003-08-06 Thread Chris Sherwood
well I have been watching this post all morning and now into the afternoon..

personally I think there is differences in responses and well there are
definite persons with an elitist attitude, some of these people are
newbies... under immense amounts of pressure to pull something off... what
does it cost to type strpos()?

or what does it take to actually give a reasonable answer... if I am gonna
be rude I  wont say anything... doesnt any one remember their mother telling
them if you dont have anything nice to say dont say anything at all?

anyways lets let this topic drop and get back to what we all do best and
thats coding..


Chris


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



Re: [PHP] greedy preg

2003-08-06 Thread skate


 Yeah, it should be. What kind on content can be around $file and also
 within the item tag?


here's a snip of the xml file...

it's finding the $file correctly, but deletes all records from the beginning
of the file onwards. it leaves the xml file with valid xml ... news at the
start... so for the most part the preg is working... it's just being too
greedy at the start for whatever reason...

news
 item
  titlefhh/title
  date1060205191/date
  texthhh/text
  filexml/news/1060205191.xml/file
 /item
 item
  titlefgjghjh/title
  date1060205186/date
  textfgjh/text
  filexml/news/1060205186.xml/file
 /item
 item
  titlefgjhh/title
  date1060205182/date
  textfghh/text
  filexml/news/1060205182.xml/file
 /item
/news



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



RE: [PHP] Stop neurotic posting

2003-08-06 Thread andu
--On Wednesday, August 06, 2003 13:11:52 -0700 Chris W. Parker 
[EMAIL PROTECTED] wrote:

Aside from the fact that $example1 != $example2, they are different in
ATTITUDE.
Which was the original issue of this thread. Seems like few (with a 
temporary advantage of knowledge) would consider not to have an attitude 
(don't like to answer, don't do it) and if there is a choice, the nasty one 
seems to prevail. I guess it's a reflection of the times/place we are 
living or a huge lack of imagination.
My last word on this...

Andu

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


[PHP] RE: Downloding files once

2003-08-06 Thread Boaz Yahav
What about using mod_auth_mysql to add/remove usernames and passwords
from 
the download server in real time?

-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 7:52 PM
To: Boaz Yahav
Cc: [EMAIL PROTECTED]; Igal Rubinstein; Matt Wade
Subject: Re: Downloding files once


Hello,

On 08/06/2003 03:48 PM, Boaz Yahav wrote:
 This may work but i can't help thinking that this is the wrong way to 
 go. Downloading 1GB or 2GB files via fpassthru doesn't feel right...

Why not? As long as it works without blowing your server memory that is 
fine.

The only problem you may have is when the users resort to download 
managers, as this way they won't be able to stop and resume later. If 
you play with the HTTP headers and fseek, that can be solved too.


-- 

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

 


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



Re: [PHP] 4.3.3RC download mirror sites?

2003-08-06 Thread Jason Wong
On Wednesday 06 August 2003 14:28, Jean-Christian IMbeault wrote:

 I guess that is what I am saying since when I click on the download link
 I get:

 The operation timed out when trying to connect to downloads.php.net

If the main php site is slow/down then google  php mirror sites

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Biology grows on you.
*/


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



Re: [PHP] shell_exec

2003-08-06 Thread Christophe Chisogne
Rodney Green wrote:
 My web server runs as the user 'apache.' (...)
the script successfully from the command line as root but when I run it in
the browser the shell script executes but fails.
 (...)
I've set the permissions of the script to be executable for anyone.
Shell side:
- must be readable and executable by user (apache or perhaps everyone)
- suid bit work only for programs, not scripts I think
- shell can only execute cmds for which it's effective user has 
sufficient permissions

Try this (as root on webserver), if you can login as apache.
If you can't login as apache, log as a normal user (not root)
# su - apache
$ cd /path/to/script
$ ./myscript.sh
You will probably see errors here.
If not, it probably is a safemode restriction. See
http://www.php.net/manual/en/features.safe-mode.php#ini.safe-mode
and set the safe_mode_* variables in php.ini or in a .htaccess,
in particular safe_mode_exec_dir ...
Hope it helps

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


RE: [PHP] Stop neurotic posting

2003-08-06 Thread Chris W. Parker
Gabriel Guzman mailto:[EMAIL PROTECTED]
on Wednesday, August 06, 2003 1:10 PM said:

 On Wed, 2003-08-06 at 11:44, Chris W. Parker wrote:
 
 A bad answer would be:
 
 RTFM http://php.net/preg_match;
 
 A good answer would be:
 
 That can be done with a regular expression. The function you're
 looking for is called preg_match. http://php.net/preg_match;
 
 I fail to see the difference.

Aside from the fact that $example1 != $example2, they are different in
ATTITUDE.

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



Re: [PHP] why doesn't default values for this function work - resending because of bad formatting

2003-08-06 Thread Jason Wong
On Wednesday 06 August 2003 01:06, anders thoresson wrote:

  I'm having problem with a function that I'll use to validate user input
 before passing it to MySQL. For strings, I want to make sure that they
 aren't to long, so I have written this function:

What is this mess that you have here :-)

  function secure_string($unsafe_string, $max_length = -1, $errormessage =
 Too many characters. ) { // verify that string isn't longer then
 $max_length, if $max_length is set if ($max_length  -1) { if
 (!is_int($max_length)) { error(Variable max_length is not an integer. );
 } if (strlen($unsafe_string)  $max_length) { error($errormessage); } }
 [... and the validation will continue here.]


  When I want to use the max length check I pass a value to the function
 like this:
  $a_header = secure_string($_POST['a_header'], 60, Header must not be more
 then 60 characters. );
  But I having to problems:
 1) If no max length is passed, and $max_length gets the value -1, the if-
 loop if ($max_length  -1) is still run.

How exactly are you calling the function when no $max_length is passed? If 
you're doing something like:

  secure_string($string, '', 'error msg');

Then inside your function $max_length will be equivalent to 0 (zero) and hence 
your comparison:

  if ($max_length  -1)

will be true.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
When one burns one's bridges, what a very nice fire it makes.
-- Dylan Thomas
*/


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



[PHP] PHP P2P File sharing

2003-08-06 Thread Joe Harman
Hello, 
 
I curious if anyone knows of a PHP based Peer-to-Peer file sharing
program out there! I have a friend that wants to implement this with his
web server.. 
 
Joe Harman


 


[PHP] Re: checking how many records are returned?

2003-08-06 Thread Nadim Attari
 Is there a way to check how many records are returned from a query to the
 database?

Which database? MsSQL? mySQL? mSQL? PostgreSQL?  ?
If it's mySQL then try mysql_num_rows



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



Re: [PHP] Installer Software

2003-08-06 Thread Rodney Green

 I am making an application in PHP, but I want it to run on a user's
 local computer... but I need to find someway to bundle this so that when
 it is distributed, the installer installs PHP for windows... then copys
 the PHP files to the correct directory, then puts a short cut on the
 desktop... can anyone recommend anything out there.. preferably that is
 free

Check out the Nullsoft Install System. It's free..

http://www.nullsoft.com/free/nsis/



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



[PHP] Re: Downloding files once

2003-08-06 Thread Manuel Lemos
Hello,

On 08/06/2003 03:56 PM, Boaz Yahav wrote:
What about using mod_auth_mysql to add/remove usernames and passwords
from 
the download server in real time?
Never tried but it could work. The only problem is that for basic auth 
you need to keep passwords in plain text in the database.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Formatted text from mySQL DB [nl2br]

2003-08-06 Thread PHPSpooky
Astrum!

$wow = nl2br($myrow[data]);
echo $wow;

works excellect for me!!

Thanks!!

Dominor. .
PHPSpooky


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



Re: [PHP] Stop neurotic posting

2003-08-06 Thread Juan Nin
and please don't answer saying that you aggree or don't agree with me
I don't care

just cut off with this thread please  :)

Juan



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



[PHP] Re: How to run PHP from a MySQL DB

2003-08-06 Thread Alexandru COSTIN
Hi,
Please take a look at http://php.weblogs.com/ their first article is
exactly about this (both PostgreSQL and something about MySQL - see the
comment)

Alexandru

-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
Jeremy Darling [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have a database of code pages and was wondering if their is a way to
 actually run the code from the Database as if it was part of a page.

 Thanks,
 Jeremy





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



Re: [PHP] greedy preg

2003-08-06 Thread skate

 What are the possible values of $file? Are you looking to replace just a
 specific occurance of a $file between item tags? Maybe this will help:

 $contents = preg_replace(|item[^]*$file[^]*/item|si,,$contents);

 or just use the 'U' modifier for ungreedy...


i'm looking to replace the entire item/item for that respective
file.

the file will have a value of whichever file that record points to, and will
be unique (xml/news/12312312.xml)

should .*? not be ungreedy tho?



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



[PHP] Problem execucting nusoap.php

2003-08-06 Thread Daniel Ke
Hi,

I am new to php and tried to test googlesearch.php file (as attachment) from 
Chris Petersen. Which invokes nusoap.php file. I have all the necessary 
class files that nusoap.php included and put in the same directory with 
googlesearch.php and nusoap.php file. Also I have Google's licence key as 
well. But when executed googlesearch.php. It only displays the documentation 
of class.soapclinet.php and nothing else. Could anybody tell me what is the 
problem? Please help. Thanks,

Daniel

_
Get 10Mb extra storage for MSN Hotmail. Subscribe Now! 
http://join.msn.com/?pgmarket=en-hk
?
/*
Google API

*/
require_once(nusoap.php);
class GoogleSearchResults {
   var $estimatedTotalCount;
   var $searchTime;
   var $startIndex;
   var $endIndex;
   var $results;
   var $directories;
}
class GoogleSearchResult {
   var $cachedSize;
   var $hostName;
   var $snippet;
   var $summary;
   var $title;
   var $url;
}
function googleSearch($query, $startIndex) {
   $soapclient = new soapclient(GoogleSearch.wsdl, wsdl);
   $proxy = $soapclient-getProxy();
   $result = $proxy-doGoogleSearch(wzMXCPhQFHIoNdE1l1x/hsudArv9AceZ,
   $query,
   $startIndex,
   10,
   false,
   ,
   false,
   ,
   latin1,
   latin1);
   $returnVal = new GoogleSearchResults();
   $returnVal-estimatedTotalCount = $result[estimatedTotalResultsCount];
   $returnVal-searchTime = $result[searchTime];
   $returnVal-startIndex = $result[startIndex];
   $returnVal-endIndex = $result[endIndex];
   $rerurnVal-results = array();
   $resultElements = $result[resultElements];
   for($i=0; $icount($resultElements); $i++) {
   $entry = new GoogleSearchResult();
   $entry-cachedSize = $resultElements[$i][cachedSize];
   $entry-hostName = $resultElements[$i][hostName];
   $entry-snippet = $resultElements[$i][snippet];
   $entry-summary = $resultElements[$i][summary];
   $entry-title = $resultElements[$i][title];
   $entry-url = $resultElements[$i][URL];
   $returnVal-results[$i] = $entry;
   }
   return $returnVal;
}
?

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

RE: [PHP] PHP P2P File sharing

2003-08-06 Thread Joe Harman
Hey Chris.. Thanks for the insite... I was basically trying to provide a
way for a community of graphic/3D artist to share their files... Like
clothes and hair for poser... It would be great to take advantage of a
network like the Gnuetella one... I will look into the overnet site... I
may just make a file locker type app for them

Joe

 -Original Message-
 From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, August 06, 2003 11:28 PM
 To: Joe Harman; [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP  P2P File sharing
 
 
 --- Joe Harman [EMAIL PROTECTED] wrote:
  I curious if anyone knows of a PHP based Peer-to-Peer file sharing 
  program out there! I have a friend that wants to implement 
 this with 
  his web server..
 
 P2P isn't exactly something you do with PHP anymore than you 
 would write a Web server with PHP (which has been done, 
 however, but I hope you can still see my point). A better 
 approach, in my opinion, is to think of ways to allow your 
 users to interact with a P2P network while using your Web 
 application. There is a command-line client for Overnet 
(http://www.overnet.com/), for example, and PHP can interact with this
to perform whatever tasks you want to expose to your Web users. Most
every P2P protocol I am familiar with does not fit well within the Web
paradigm (HTTP transactions, etc.). So, you have to be creative and make
your Web application provide the layer that interprets your users'
desires, executes the appropriate tasks using a P2P client, and displays
the results in a way that can fit into the Web paradigm (downloads will
probably take longer than you want to wait before responding to users,
for example).

That's my perspective anyway (and I've been faced with this same task).
Hope it helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/



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



Re: [PHP] Convert GIF to JPG with or without GD

2003-08-06 Thread Daniel Ward
The following code works on Win2K, Apache 1.3.27, PHP 4.3.2

$gif = imagecreatefromgif('image.gif');
$w = imagesx($gif);
$h = imagesy($gif);
$jpg = imagecreate($w, $h);
// or $jpg = imagecreatetruecolor($w, $h); but colors are off
imagecopy($pic, $im, 0, 0, 0, 0, $w, $h);
// or imagecopyresampled($jpg, $gif, 0, 0, 0, 0, $w, $h, $w, $h);
imagejpeg($jpg); // also works with imagepng()
imagedestroy($gif);
imagedestroy($jpg);
exit;

don't have 4.3 on my linux box yet so I haven't tested it there

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