php-general Digest 13 Jun 2003 05:38:05 -0000 Issue 2114

Topics (messages 151282 through 151330):

Re: mail() function & exchange
        151282 by: Diana
        151283 by: Mark
        151287 by: Diana

Re: How to find if a string is an integer?
        151284 by: Felipe Desiderati
        151288 by: Alex Earl
        151291 by: CPT John W. Holmes
        151292 by: Alex Earl
        151293 by: DvDmanDT
        151296 by: Jason Wong
        151297 by: Brent Baisley
        151298 by: Alex Earl
        151306 by: Brent Baisley

Re: How to format a strign with a generic mask??
        151285 by: Felipe Desiderati

w32api functions?
        151286 by: DvDmanDT
        151289 by: Roedel, Mark
        151290 by: DvDmanDT
        151295 by: DvDmanDT

4.3.2 -- does connection_status() actually work?
        151294 by: Per Jessen
        151316 by: Jeff Harris
        151318 by: Rasmus Lerdorf

Error display
        151299 by: John Nichel
        151300 by: Alex Earl
        151301 by: John Nichel
        151302 by: John Nichel

Vmailmgr Functions
        151303 by: John Nichel
        151305 by: Philip Olson
        151308 by: Jason Wong

Re: Headers in body - what am I doing wrong???
        151304 by: Jeff Harris

Url problem
        151307 by: Sparky Kopetzky
        151310 by: Jason Wong
        151320 by: DvDmanDT

POST detection
        151309 by: Johnny Martinez
        151311 by: Jason Wong
        151312 by: R'twick Niceorgaw
        151315 by: Johnny Martinez
        151322 by: Johnny Martinez

make a variable not exist?
        151313 by: Amanda McComb
        151314 by: Alex Earl
        151319 by: Leif K-Brooks

$_SESSION as $key=>$value
        151317 by: Daniel J. Rychlik

How do I capture a POST responce
        151321 by: Joaco
        151326 by: Jake Johnson

Zend Optimizer not active?
        151323 by: Steve Yates

Re: supplied argument is not a valid MySQL result resource
        151324 by: Ben Houlton
        151325 by: Philip Olson

LDAP problems
        151327 by: Praveen Kumar

Gettnig PHP code out of a DB?
        151328 by: Ben Houlton
        151330 by: Leif K-Brooks

Re: PHP Email....
        151329 by: David Robley

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 ---
I totally agree with your first sentence *grin*.
Anyways, I won`t be able to use your class because my
server is kind of "locked" in their network, meaning I
don`t have the possibility to connect outside, only to
their servers (NT servers). And as Exchange servers
don`t use SMTP (meaning the whole protocol is NOT
used, so your classes won`t help me), I`m not able to
send mails at all. Only like he offered me to put an
extra box in the network which will relay the mails
from my linux server. 
Does anyone know about the way exchange servers work,
mapi and mapisend? The only thing I found was how to
program that in VB (and being able to talk to Exchange
servers), but it seems like this is not possible for
my penguin :) (VB on Linux??? sounds stupid)
I found in old archives of this mailinglist that some
people asked this question before (how to implement a
mail function for exchange servers in php) but no one
knew it. One hint was to use ldap. anyone any idea
about this? ANY help is appreciated, I will follow the
threads started about ldap but right now it does not
look like it has a lot to do with the mail stuff. 

Another hint might be the COM interface (I saw VB code
they used this) but php offers only very few things on
this and as I have no idea of microsofts concepts that
doesn`t help :(

Please email me for suggestions!!! Wold be great to
implement something new in php ;). If anyone knows
documents about how outlook & exchange work I would
like to see them! Thanks :)
Diana 



 --- Manuel Lemos <[EMAIL PROTECTED]> schrieb: > Hello,
> 
> On 06/11/2003 05:38 PM, Diana wrote:
> > Hi, 
> > just today I stumbled into the same problem. It is
> > true, I got this answer from an expert:
> 
> > "Unfortunately this will not work.  SMTP relaying
> is
> > disabled on all the
> > Exchange connector servers and a standard Exchange
> > mailbox server does 
> > not
> > support SMTP.  The only way that you can send SMTP
> > email from within 
> > our company is to use the Internal MailSweeper. 
> And
> > to allow this we need 
> > the IP
> > Address of the box that will be sending the
> messages
> > so that we can 
> > include
> > it in the authenticated list.  We have to have
> things
> > set up this way 
> > for
> > Security reasons.
> > 
> > One other thing I should have mentioned.  Outlook
> uses
> > mapi to send on 
> > the
> > Exchange servers.  So we can use the mapisend
> command
> > but I do not know 
> > if
> > your application would support this.  I think that
> > this may also need a
> > valid Outlook profile to work."
> > 
> > 
> > I don`t understand that either, because I am
> trying to
> > use my Linux server (inside my companys network)
> to
> > deliver mails to the exchange server via sendmail.
> 
> > If anyone knows more about this topic, let me
> > know.....sorry that this obviously does not belong
> to
> > a php list, but I deleted the original email &
> could
> > not find the email address of the author of this
> topic
> > :(
> 
> I wonder about his expertise. Authentication was
> meant for security reasons.
> 
> Anyway, you do no not need to relay in the company
> SMTP server unless 
> outside access is blocked in some firewall.
> 
> If you are using Linux, you just need to use the
> mail() function because 
> it just uses sendmail by default.
> 
> If you still have problems, just use the classes
> that I mentioned 
> enabling direct delivery mode in the SMTP sending
> attributes. That does 
> the same as sendmail but at least if it fails you
> can enable debugging 
> to see what the SMTP protocol dialog reveals.
> 
> 
> 
> >  --- Manuel Lemos <[EMAIL PROTECTED]> schrieb: >
> Hello,
> > 
> >>On 06/10/2003 04:44 PM, Matthias Wulkow wrote:
> >>
> >>>a friend of mine is trying to set up an automated
> >>
> >>mailing function.
> >>
> >>>The platform is Windows & he's using the last PHP
> >>
> >>release at this
> >>
> >>>time.
> >>>He asks me how to do it with Exchange, because it
> >>
> >>doesn't speak SMTP
> >>
> >>>or not correctly? What is the matter? Is that
> >>
> >>true? But that's not
> >>
> >>>really the question... could somebody point me to
> >>
> >>some documents where
> >>
> >>>I could find out, what has to be done to make it
> >>
> >>work?
> >>
> >>I do not see what he means by not speaking SMTP
> >>correctly. Anyway, if it 
> >>receives e-mail that you get, it also can relay
> >>messages that you send. 
> >>I think in the worst case you need to
> authenticate.
> >>
> >>In that case you may want to try this class for
> >>composing and sending 
> >>messages. It comes with a sub class for sending
> >>messages via SMTP that 
> >>supports authentication.
> >>
> >>http://www.phpclasses.org/mimemessage
> >>
> >>You also need this class for the actual message
> >>delivery:
> >>
> >>http://www.phpclasses.org/smtpclass


__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de

--- End Message ---
--- Begin Message ---
--- Diana <[EMAIL PROTECTED]> wrote:
> I totally agree with your first sentence *grin*.
> Anyways, I won`t be able to use your class because my
> server is kind of "locked" in their network, meaning I
> don`t have the possibility to connect outside, only to
> their servers (NT servers). And as Exchange servers
> don`t use SMTP (meaning the whole protocol is NOT
> used, so your classes won`t help me), I`m not able to
> send mails at all. Only like he offered me to put an
> extra box in the network which will relay the mails
> from my linux server. 
> Does anyone know about the way exchange servers work,
> mapi and mapisend? The only thing I found was how to
> program that in VB (and being able to talk to Exchange
> servers), but it seems like this is not possible for
> my penguin :) (VB on Linux??? sounds stupid)
> I found in old archives of this mailinglist that some
> people asked this question before (how to implement a
> mail function for exchange servers in php) but no one
> knew it. One hint was to use ldap. anyone any idea
> about this? ANY help is appreciated, I will follow the
> threads started about ldap but right now it does not
> look like it has a lot to do with the mail stuff. 
> 
> Another hint might be the COM interface (I saw VB code
> they used this) but php offers only very few things on
> this and as I have no idea of microsofts concepts that
> doesn`t help :(
> 
> Please email me for suggestions!!! Wold be great to
> implement something new in php ;). If anyone knows
> documents about how outlook & exchange work I would
> like to see them! Thanks :)
> Diana 

I can't comment on how your company's Exchange servers are
configured, but they absolutely *can* talk SMTP. We are using a
web-based application that sends email notifications through our
internal Exchange servers.

Now, they can be set up with SMTP turned off, or so that only certain
other hosts can relay through them (send mail), and that might be
what he's talking about when he says the "authenticated list". I
believe it's simply a list of hosts that are allowed to relay through
the Exchange SMTP server.

You'd be fine using SMTP on a connector server. It will relay the
mail to the appropriate mailbox server (assuming they've separate the
functions). 

Out of curiosity, why not give them the IP address and let them add
the host to the authenticated sender list, as he offered? Or did I
miss a part of the converation (very possible).


> 
> 
> 
>  --- Manuel Lemos <[EMAIL PROTECTED]> schrieb: > Hello,
> > 
> > On 06/11/2003 05:38 PM, Diana wrote:
> > > Hi, 
> > > just today I stumbled into the same problem. It is
> > > true, I got this answer from an expert:
> > 
> > > "Unfortunately this will not work.  SMTP relaying
> > is
> > > disabled on all the
> > > Exchange connector servers and a standard Exchange
> > > mailbox server does 
> > > not
> > > support SMTP.  The only way that you can send SMTP
> > > email from within 
> > > our company is to use the Internal MailSweeper. 
> > And
> > > to allow this we need 
> > > the IP
> > > Address of the box that will be sending the
> > messages
> > > so that we can 
> > > include
> > > it in the authenticated list.  We have to have
> > things
> > > set up this way 
> > > for
> > > Security reasons.
> > > 
> > > One other thing I should have mentioned.  Outlook
> > uses
> > > mapi to send on 
> > > the
> > > Exchange servers.  So we can use the mapisend
> > command
> > > but I do not know 
> > > if
> > > your application would support this.  I think that
> > > this may also need a
> > > valid Outlook profile to work."
> > > 
> > > 
> > > I don`t understand that either, because I am
> > trying to
> > > use my Linux server (inside my companys network)
> > to
> > > deliver mails to the exchange server via sendmail.
> > 
> > > If anyone knows more about this topic, let me
> > > know.....sorry that this obviously does not belong
> > to
> > > a php list, but I deleted the original email &
> > could
> > > not find the email address of the author of this
> > topic
> > > :(
> > 
> > I wonder about his expertise. Authentication was
> > meant for security reasons.
> > 
> > Anyway, you do no not need to relay in the company
> > SMTP server unless 
> > outside access is blocked in some firewall.
> > 
> > If you are using Linux, you just need to use the
> > mail() function because 
> > it just uses sendmail by default.
> > 
> > If you still have problems, just use the classes
> > that I mentioned 
> > enabling direct delivery mode in the SMTP sending
> > attributes. That does 
> > the same as sendmail but at least if it fails you
> > can enable debugging 
> > to see what the SMTP protocol dialog reveals.
> > 
> > 
> > 
> > >  --- Manuel Lemos <[EMAIL PROTECTED]> schrieb: >
> > Hello,
> > > 
> > >>On 06/10/2003 04:44 PM, Matthias Wulkow wrote:
> > >>
> > >>>a friend of mine is trying to set up an automated
> > >>
> > >>mailing function.
> > >>
> > >>>The platform is Windows & he's using the last PHP
> > >>
> > >>release at this
> > >>
> > >>>time.
> > >>>He asks me how to do it with Exchange, because it
> > >>
> > >>doesn't speak SMTP
> > >>
> > >>>or not correctly? What is the matter? Is that
> > >>
> > >>true? But that's not
> > >>
> > >>>really the question... could somebody point me to
> > >>
> > >>some documents where
> > >>
> > >>>I could find out, what has to be done to make it
> > >>
> > >>work?
> > >>
> > >>I do not see what he means by not speaking SMTP
> > >>correctly. Anyway, if it 
> > >>receives e-mail that you get, it also can relay
> > >>messages that you send. 
> > >>I think in the worst case you need to
> > authenticate.
> > >>
> > >>In that case you may want to try this class for
> > >>composing and sending 
> > >>messages. It comes with a sub class for sending
> > >>messages via SMTP that 
> > >>supports authentication.
> > >>
> > >>http://www.phpclasses.org/mimemessage
> > >>
> > >>You also need this class for the actual message
> > >>delivery:
> > >>
> > >>http://www.phpclasses.org/smtpclass
> 
> 
> __________________________________________________________________
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=====
Mark Weinstock
[EMAIL PROTECTED]
***************************************
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***************************************

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

--- End Message ---
--- Begin Message ---
Hi,
my company set their server up not to talk SMTP
(disabled all --> that guy told me), and my tries to
connect or talk to any of their Exchange servers
failed :( so he must be true. Got onto their NT
servers though ;)
All the company uses Outlook & Exchange, & they use
mapi to talk to each other. If a manager can`t be in
the network, he`s connected via VPN & uses Outlook as
well. They`ve got a trust relationship between their
NT servers & the Exchange ones, & lots of domains
joined. 
As I said, I don`t have a clue of Exchange so correct
me if something sounds strange. 
To your suggestions: of course that would be easy for
me to tell them to set up a new box for me. They`ll do
that. But who likes the easy way ;)?
No, just my curiosity, maybe someone knows how the
protocol or whatever these M$ servers use is working &
I could try to implement that. Would make my project
more portable inside the company (They plan to use it
on other sites as well), so they wouldn`t have
problems with setting up separate Internal
Mailsweepers everytime :).

Can you tellme more about :
> You'd be fine using SMTP on a connector server. It
> will relay the
> mail to the appropriate mailbox server 
is that working even if SMTP is not enabled? The guy
told me that SMTP is not enabled by default on
Exchange servers and they didn`t change that! (that`s
the reason for me to ask how that system works in the
whole....how does outlook send the mail to the
exchange server? Could it be that all the users just
access something like a directory on the exchange
server when starting their outlook (not a local
program! & not working when the exchange server
crashed ;)). Maybe that`s the LDAP part? 
Anyone enlighten me please......

by the way, a lot of people ask these questions....
see here

http://www.phpbuilder.com/mail/php3-list/199908/0344.php

http://www.linuxsa.org.au/mailing-list/2000-07/954.html

http://www.faqts.com/knowledge_base/view.phtml/aid/13043/fid/21


> 
> I can't comment on how your company's Exchange
> servers are
> configured, but they absolutely *can* talk SMTP. We
> are using a
> web-based application that sends email notifications
> through our
> internal Exchange servers.
> 
> Now, they can be set up with SMTP turned off, or so
> that only certain
> other hosts can relay through them (send mail), and
> that might be
> what he's talking about when he says the
> "authenticated list". I
> believe it's simply a list of hosts that are allowed
> to relay through
> the Exchange SMTP server.
> 
> You'd be fine using SMTP on a connector server. It
> will relay the
> mail to the appropriate mailbox server (assuming
> they've separate the
> functions). 
> 
> Out of curiosity, why not give them the IP address
> and let them add
> the host to the authenticated sender list, as he
> offered? Or did I
> miss a part of the converation (very possible).
> 
> 
> > 


__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de

--- End Message ---
--- Begin Message ---
> Felipe Desiderati wrote:
> > try this:
> >
> > if (ereg("^[0-9]+$", $_POST["var_int"))
> >     echo "is int";
>
> That's not the best regexp. It doesn' take into account negative
> integers and isn't there a [[:numeric:]] or something like regexp that
> would work better.
>
> I'm looking for the simplest method and the one that takes the less
> processing power :)
>
> Calling up the regular expression engine dounds pretty processing
> intensive ...

Sorry, I don´t know that you needed an effective snipet. And you are right,
I only writed for positive integers. Try something like apply 2 type cast
simunltaneous.

if ( (string) ((int) $_POST["var_int"]) == $_POST["var_int"])
    echo "is int";

And sorry for my english,

[]´s Felipe


--- End Message ---
--- Begin Message ---
<snip>
> Sorry, I don´t know that you needed an effective snipet. And you are
> right,
> I only writed for positive integers. Try something like apply 2 type cast
> simunltaneous.
>
> if ( (string) ((int) $_POST["var_int"]) == $_POST["var_int"])
>     echo "is int";
>


Why not just use the is_int() function?

www.php.net/is_int


Alex

--- End Message ---
--- Begin Message ---
> <snip>
> > Sorry, I don´t know that you needed an effective snipet. And you are
> > right,
> > I only writed for positive integers. Try something like apply 2 type
cast
> > simunltaneous.
> >
> > if ( (string) ((int) $_POST["var_int"]) == $_POST["var_int"])
> >     echo "is int";
> >
>
>
> Why not just use the is_int() function?
>
> www.php.net/is_int

Please try to use is_int() on a value passed from a form and see why.

Also, in the beginning of this thread, the OP already said that is_int() had
been tried.

---John Holmes...


--- End Message ---
--- Begin Message ---
>> <snip>
>> > Sorry, I don´t know that you needed an effective snipet. And you are
>> > right,
>> > I only writed for positive integers. Try something like apply 2 type
> cast
>> > simunltaneous.
>> >
>> > if ( (string) ((int) $_POST["var_int"]) == $_POST["var_int"])
>> >     echo "is int";
>> >
>>
>>
>> Why not just use the is_int() function?
>>
>> www.php.net/is_int
>
> Please try to use is_int() on a value passed from a form and see why.
>
> Also, in the beginning of this thread, the OP already said that is_int()
> had
> been tried.
>
> ---John Holmes...
>

I guess I missed the first part of the thread then.

Thanks for the info.

Alex



--- End Message ---
--- Begin Message ---
To be honest, I haven't really understood what three of them does... Is it
the same value without type casting?
"Jean-Christian Imbeault" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Dvdmandt wrote:
> > It's not that killing... :p
> > preg_match("#^-?[0-9]+$#",$_POST["var_int"]);
>
> Not *that's* a mouthful ...
>
> > I was also thinking about that === operator.. And this:
> > if(((string)((int)$_POST["var_int"]))==$_POST["var_int"])
>
> Cute. Might actually work too! Wonder if there would be any difference
> in using == or === in your suggestion?
>
> Jc
>



--- End Message ---
--- Begin Message ---
On Friday 13 June 2003 03:49, DvDmanDT wrote:
> To be honest, I haven't really understood what three of them does... Is it
> the same value without type casting?

It takes into account the variable type as well:

  (1 == '1')  // true
  (1 === '1') // false

-- 
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
------------------------------------------
/*
All is well that ends well.
                -- John Heywood
*/


--- End Message ---
--- Begin Message --- Jumping in a little late here, but what about is_numeric()?
Haven't tried it, but the php manual for is_int says:
Note: To test if a variable is a number or a numeric string (such as form input, which is always a string), you must use is_numeric().


On Thursday, June 12, 2003, at 03:31 PM, CPT John W. Holmes wrote:

Please try to use is_int() on a value passed from a form and see why.

Also, in the beginning of this thread, the OP already said that is_int() had
been tried.


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


--- End Message ---
--- Begin Message ---
> Jumping in a little late here, but what about is_numeric()?
> Haven't tried it, but the php manual for is_int says:
> Note:  To test if a variable is a number or a numeric string (such as
> form input, which is always a string), you must use is_numeric().
>

The problem with is_numeric() is that something like "4e4" comes up as
true, because it could be construed as a HEX value.

Alex

--- End Message ---
--- Begin Message --- Hmmm, didn't think about that. Here's something simple that seems to work in a couple of tests.
if(strlen($testValue-0) == strlen($testValue)) {
echo "Is a number";
} else {
echo "Is not a number";
}


Or, in one line:
(strlen($testValue-0) == strlen($testValue) ? 1 : 0)

Kind of a kludge, but it seems to work for positive, negative and decimals.

On Thursday, June 12, 2003, at 04:13 PM, Alex Earl wrote:

Jumping in a little late here, but what about is_numeric()?
Haven't tried it, but the php manual for is_int says:
Note:  To test if a variable is a number or a numeric string (such as
form input, which is always a string), you must use is_numeric().


The problem with is_numeric() is that something like "4e4" comes up as true, because it could be construed as a HEX value.

Alex

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


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


--- End Message ---
--- Begin Message ---
Thanks, helps a lot!!

[]´s Felipe

> "Felipe Desiderati" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >I need a simple function that takes a string and formats
> > with a generic mask. Like this example above:
> >
> >$string1 = "12345678"
> >$string2 = "11062003"
> >
> >echo format_string ("#.###.###-#", $string1);  // --> Returns 1.234.567-8
> >echo format_string ("##/##/####", $string1);  // --> Returns 11/06/2003
> >
> >Does anybody here have an idea to how to do this?
>
>
> Here is a function that does what you want, with
> a test stand.  HTH!
>
>
> <?php
>
> function format_string($mask, $contents, $ch = '#') {
>
>     $c = 0;
>     $str = "";
>
>     for($m = 0; $m < strlen($mask); $m++)
>         if ($mask[$m] == $ch) {
>             $str .= $contents[$c];
>             $c++;
>         }
>         else
>             $str .= $mask[$m];
>
>     return($str);
> }
>
> ?>
> <html>
> <body>
>     <form action="mask.php" method="get">
>         Mask: <input type="text" name="mask" value="<?php echo
> $_GET['mask']; ?>"/><br/>
>         Content: <input type="text" name="cont" value="<?php echo
> $_GET['cont']; ?>"/><br/>
>         Maskchar: <input type="text" name="ch" value="<?php echo
> $_GET['ch']; ?>"/><br/>
>         <input type="submit">
>     </form>
>
>
>     <b>Result:</b> <?php echo format_string($_GET['mask'], $_GET['cont'],
> $_GET['ch']); ?><br/>
> </body>
> </html>
>
> --
> Hugh Bothwell     [EMAIL PROTECTED]     Kingston ON Canada
> v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+
> PE++ Y+ PGP+ t-- 5++ !X R+ tv b++++ DI+++ D-(++) G+ e(++) h-- r- y+
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Hello everyone... I was wondering why the w32api functions were removed? And
will they come back? Else, will the 4.2.3 version work with 4.3.2? I really
want those functions for educational purposes you see...

Thanks in advance // DvDmanDT



--- End Message ---
--- Begin Message ---
Removed?

$PHPDIR/ext/w32api still seems to exist in the 4.3.2 I just installed.
Did you compile your own, or download a prebuilt binary?


---
Mark Roedel           | "Blessed is he who has learned to laugh
Systems Programmer    |  at himself, for he shall never cease
LeTourneau University |  to be entertained."
Longview, Texas, USA  |                          -- John Powell


> -----Original Message-----
> From: DvDmanDT [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 12, 2003 1:31 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] w32api functions?
> 
> 
> Hello everyone... I was wondering why the w32api functions 
> were removed? And will they come back? Else, will the 4.2.3
> version work with 4.3.2? I really want those functions for
> educational purposes you see...
> 
> Thanks in advance // DvDmanDT

--- End Message ---
--- Begin Message ---
Prebuilt.. Compiling myself is to complicated... But check the manual...
4.2.0-4.2.3 is the only versions suporting it it says...
"Mark Roedel" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]

Removed?

$PHPDIR/ext/w32api still seems to exist in the 4.3.2 I just installed.
Did you compile your own, or download a prebuilt binary?


---
Mark Roedel           | "Blessed is he who has learned to laugh
Systems Programmer    |  at himself, for he shall never cease
LeTourneau University |  to be entertained."
Longview, Texas, USA  |                          -- John Powell


> -----Original Message-----
> From: DvDmanDT [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 12, 2003 1:31 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] w32api functions?
>
>
> Hello everyone... I was wondering why the w32api functions
> were removed? And will they come back? Else, will the 4.2.3
> version work with 4.3.2? I really want those functions for
> educational purposes you see...
>
> Thanks in advance // DvDmanDT



--- End Message ---
--- Begin Message ---
Just wanted to download sources... But that's kinda impossible... 404 on
every single mirror, both bz and gz...

Hmm... I guess I'll go for snaps then... :p Someone, please fix this...
"Dvdmandt" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Prebuilt.. Compiling myself is to complicated... But check the manual...
> 4.2.0-4.2.3 is the only versions suporting it it says...
> "Mark Roedel" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
>
> Removed?
>
> $PHPDIR/ext/w32api still seems to exist in the 4.3.2 I just installed.
> Did you compile your own, or download a prebuilt binary?
>
>
> ---
> Mark Roedel           | "Blessed is he who has learned to laugh
> Systems Programmer    |  at himself, for he shall never cease
> LeTourneau University |  to be entertained."
> Longview, Texas, USA  |                          -- John Powell
>
>
> > -----Original Message-----
> > From: DvDmanDT [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 12, 2003 1:31 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] w32api functions?
> >
> >
> > Hello everyone... I was wondering why the w32api functions
> > were removed? And will they come back? Else, will the 4.2.3
> > version work with 4.3.2? I really want those functions for
> > educational purposes you see...
> >
> > Thanks in advance // DvDmanDT
>
>



--- End Message ---
--- Begin Message ---
Shouldn't the following work - or rather why doesn't it :


        ignore_user_abort(0);
 
        for( $i=100; $i; $i-- )
        {
                if ( connection_status() ) exit(0);
                print " blurp.<br/>"; flush();
                sleep(1);
        }
        print "Done.<br/>";

This is php4.3.2 on apache 2.0.45. 


/Per

-- 
Per Jessen, Zurich
http://timian.jessen.ch - an analog report formatter using XSLT.
http://www.dansk.org - for alle danskere i udlandet!


--- End Message ---
--- Begin Message ---
On Jun 12, 2003, "news" claimed that:

|Shouldn't the following work - or rather why doesn't it :
|
|
|        ignore_user_abort(0);
|
|        for( $i=100; $i; $i-- )
|        {
|                if ( connection_status() ) exit(0);
|                print " blurp.<br/>"; flush();
|                sleep(1);
|        }
|        print "Done.<br/>";
|
|This is php4.3.2 on apache 2.0.45.
|/Per

I'm just guessing here, because you didn't give us the desired result,
but how about:
    if (connection_status() ) break;

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



--- End Message ---
--- Begin Message ---
On Thu, 12 Jun 2003, Per Jessen wrote:
> Shouldn't the following work - or rather why doesn't it :
>
>
>         ignore_user_abort(0);
>
>         for( $i=100; $i; $i-- )
>         {
>                 if ( connection_status() ) exit(0);
>                 print " blurp.<br/>"; flush();
>                 sleep(1);
>         }
>         print "Done.<br/>";
>
> This is php4.3.2 on apache 2.0.45.

What does it do?  Using connection_status() in a script that doesn't
ignore user aborts is pretty useless.  The script will abort on the print
and never get to the connection_status() line so your code doesn't
actually make any sense.  And, beyond that, all bets are off for
Apache-2.0.x.  No real extensive testing has been done on that platform
which is why we don't suggest running it in production because stuff like
this is likely to be broken even if you got your code right.

-Rasmus

--- End Message ---
--- Begin Message --- I have error reporting set to E_ALL, but no matter what I do, no errors display. Is there somewhere else in the .ini that I have to set something?


--- End Message ---
--- Begin Message ---
> I have error reporting set to E_ALL, but no matter what I do, no errors
> display.  Is there somewhere else in the .ini that I have to set
> something?
>

I believe there is a print_errors or show_errors directive in the php.ini
file. Check on php.net for sure.

Alex

--- End Message ---
--- Begin Message --- Belay this question. Found it.

display_errors = On

John Nichel wrote:
I have error reporting set to E_ALL, but no matter what I do, no errors display. Is there somewhere else in the .ini that I have to set something?




--- End Message ---
--- Begin Message --- Alex Earl wrote:
I have error reporting set to E_ALL, but no matter what I do, no errors
display.  Is there somewhere else in the .ini that I have to set
something?



I believe there is a print_errors or show_errors directive in the php.ini
file. Check on php.net for sure.

Alex


Thanks guys.



--- End Message ---
--- Begin Message --- On PHPBuilder.com, they have functions listed for Vmailmgr in their manual, whereas on PHP.net, no such functions exist. Do these functions exist but not documented on PHP.net?


--- End Message ---
--- Begin Message ---
On Thu, 12 Jun 2003, John Nichel wrote:

> On PHPBuilder.com, they have functions listed for Vmailmgr in their 
> manual, whereas on PHP.net, no such functions exist.  Do these functions 
> exist but not documented on PHP.net?

The manual over at phpbuilder is useless, and very old.  Do
not use that manual, use php.net/manual

Anyway, this extension was removed from the manual 2.5 years
ago, this extension is specific to PHP 3.

Regards,
Philip


--- End Message ---
--- Begin Message ---
On Friday 13 June 2003 04:43, Philip Olson wrote:

> The manual over at phpbuilder is useless, and very old.  Do
> not use that manual, use php.net/manual

Talking of manuals, what happened to the extremely useful index of functions 
that used to be in the appendix?

-- 
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
------------------------------------------
/*
If elected, Zippy pledges to each and every American a 55-year-old houseboy 
...
*/


--- End Message ---
--- Begin Message ---
On Jun 12, 2003, "-{ Rene Brehmer }-" claimed that:

|>You have an extra \r\n.  There is one contained in the variable $from so the
|>line $headers .= "From: ".$from."\r\n"; is putting \r\n\r\n which signifies
|>the end of the headers and the begining of the message body.
|
|Stupid me ... so simple, of course ... thanks ... first thing to go is the
|eyes...
|
|Rene

Eyes are the THIRD thing to go. Second is memory. I can't remember the
first thing to go, though.

Jeff
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



--- End Message ---
--- Begin Message ---
OK. I'm suffering from brain gas...

I'm trying this, it doesn't work and I can't figure out why:

    include_once $SYSTEM_URL . "/classes/category.php"; where $SYSTEM_URL = 
"http://www.example.com"; is the url to the web site. and I get this error:

Fatal error: Cannot instantiate non-existent class: category in c:\program 
files\apache group\apache\htdocs\index.php on line 19

So, obviously, it's not pointing to the right place. I can load the opening page from 
the url, so I know Apache is trying to load from the htdocs folder.

Help... :o((

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net


--- End Message ---
--- Begin Message ---
On Friday 13 June 2003 04:55, Sparky Kopetzky wrote:

> I'm trying this, it doesn't work and I can't figure out why:
>
>     include_once $SYSTEM_URL . "/classes/category.php"; where $SYSTEM_URL =
> "http://www.example.com"; is the url to the web site. and I get this error:
>
> Fatal error: Cannot instantiate non-existent class: category in c:\program
> files\apache group\apache\htdocs\index.php on line 19
>
> So, obviously, it's not pointing to the right place. I can load the opening
> page from the url, so I know Apache is trying to load from the htdocs
> folder.

Short answer: you can't include files like that through a URL
Shorter answer: RTFM, study the examples

-- 
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
------------------------------------------
/*
The only winner in the War of 1812 was Tchaikovsky.
                -- David Gerrold
*/


--- End Message ---
--- Begin Message ---
The file get's parsed server side I guess... You would need to name it .txt
or something for that to work... :p
"Sparky Kopetzky" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
OK. I'm suffering from brain gas...

I'm trying this, it doesn't work and I can't figure out why:

    include_once $SYSTEM_URL . "/classes/category.php"; where $SYSTEM_URL =
"http://www.example.com"; is the url to the web site. and I get this error:

Fatal error: Cannot instantiate non-existent class: category in c:\program
files\apache group\apache\htdocs\index.php on line 19

So, obviously, it's not pointing to the right place. I can load the opening
page from the url, so I know Apache is trying to load from the htdocs
folder.

Help... :o((

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net




--- End Message ---
--- Begin Message ---
Hi all,
I have a self referring script that $_POST's two times at the beginning. The
problem is that the first time the script comes up those two $_POST vars
aren't being submitted and the webserver complains.

If I could detect if the vars were passed and if not then skip that would be
great. What's a good trick to detect for the first time?

Johnny

--- End Message ---
--- Begin Message ---
On Friday 13 June 2003 05:08, Johnny Martinez wrote:

> I have a self referring script that $_POST's two times at the beginning.
> The problem is that the first time the script comes up those two $_POST
> vars aren't being submitted and the webserver complains.
>
> If I could detect if the vars were passed and if not then skip that would
> be great. What's a good trick to detect for the first time?

  if ($_POST) { do_something_with_post(); }

or

  if (!empty($_POST)) { do_something_with_post(); }

should do.

-- 
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
------------------------------------------
/*
"Thank heaven for startups; without them we'd never have any advances."
-- Seymour Cray
*/


--- End Message ---
--- Begin Message ---
if ( isset($_POST['var_1']) and isset($_POST['var_2']) ) {
your code
}


----- Original Message ----- 
From: "Johnny Martinez" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, June 12, 2003 5:08 PM
Subject: [PHP] POST detection


> Hi all,
> I have a self referring script that $_POST's two times at the beginning.
The
> problem is that the first time the script comes up those two $_POST vars
> aren't being submitted and the webserver complains.
>
> If I could detect if the vars were passed and if not then skip that would
be
> great. What's a good trick to detect for the first time?
>
> Johnny
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--- End Message ---
--- Begin Message ---
Woot! That worked! Thanks Jason and R'twick!

Johnny

-----Original Message-----
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 2:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] POST detection


On Friday 13 June 2003 05:08, Johnny Martinez wrote:

> I have a self referring script that $_POST's two times at the beginning.
> The problem is that the first time the script comes up those two $_POST
> vars aren't being submitted and the webserver complains.
>
> If I could detect if the vars were passed and if not then skip that would
> be great. What's a good trick to detect for the first time?

  if ($_POST) { do_something_with_post(); }

or

  if (!empty($_POST)) { do_something_with_post(); }

should do.

-- 
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
------------------------------------------
/*
"Thank heaven for startups; without them we'd never have any advances."
-- Seymour Cray
*/


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

--- End Message ---
--- Begin Message ---
Will this work for $_GET as well?

J

-----Original Message-----
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 2:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] POST detection


On Friday 13 June 2003 05:08, Johnny Martinez wrote:

> I have a self referring script that $_POST's two times at the beginning.
> The problem is that the first time the script comes up those two $_POST
> vars aren't being submitted and the webserver complains.
>
> If I could detect if the vars were passed and if not then skip that would
> be great. What's a good trick to detect for the first time?

  if ($_POST) { do_something_with_post(); }

or

  if (!empty($_POST)) { do_something_with_post(); }

should do.

-- 
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
------------------------------------------
/*
"Thank heaven for startups; without them we'd never have any advances."
-- Seymour Cray
*/


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

--- End Message ---
--- Begin Message ---
Is there a way to make a variable not exist?  There are several places
where I test (!$variable), and I want to be able to change the
variable to pass that test, even though it exists, under certain
circumstances.

Thanks.


--- End Message ---
--- Begin Message ---
>
> Is there a way to make a variable not exist?  There are several places
> where I test (!$variable), and I want to be able to change the
> variable to pass that test, even though it exists, under certain
> circumstances.
>
> Thanks.
>


You can unset the variable www.php.net/unset but also I would recommend
using if(!isset($variable)) instead of just if(!$variable) its a little
more clear as to what you are really trying to see I think.

Alex

--- End Message ---
--- Begin Message --- And won't generate a notice.

Alex Earl wrote:

You can unset the variable www.php.net/unset but also I would recommend
using if(!isset($variable)) instead of just if(!$variable) its a little
more clear as to what you are really trying to see I think.

Alex




-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



--- End Message ---
--- Begin Message ---
Is this valid to iterate over a form variables.?

foreach ($_SESSION as $key=>$value) 

and another question,  do I need this <form action="scripts/process.php" 
method="post">  in my form?  

Im really struggling with $_SESSION.  Im trying to program smarter and make friendlier 
applications.  

Ive submitted several emails dealing with this function and I apologize for beating a 
dead horse, so to speak.  

I have a form with a few form fields.  Im working on an error function that will take 
the data that was entered and pass it back to the form so that the user will not have 
to input the data again.  If an error is found I use the header function to go back to 
the form.  Im having trouble with passing back the data.  Do I in my form setup a 
$_GET or should I use the $_SESSION to call it.  I am also going to setup a few css 
styles that highlight which field was found in error.  

Again, I apologize for my lack of vision and maybe a spark of light will go off, and I 
will be able to make some connections to get this done.  

Dan

--- End Message ---
--- Begin Message ---
I am writing a module that will allow a customer to process a credit card
refund thru a web interface that I am designing. The problem I am having is
that once the information is posted to the gateway, it returns a url encoded
string with the responce from the transaction. How can I capture that
responce on my page rather than having to open or save the returned file?



--- End Message ---
--- Begin Message ---
Try using this....

$_POST['var_name']

Jake Johnson
http://www.plutoid.com


On Thu, 12 Jun 2003, Joaco wrote:

> I am writing a module that will allow a customer to process a credit card
> refund thru a web interface that I am designing. The problem I am having is
> that once the information is posted to the gateway, it returns a url encoded
> string with the responce from the transaction. How can I capture that
> responce on my page rather than having to open or save the returned file?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Starting with a working site (FreeBSD 4.7, Apache 1.3.27) using PHP 4.3.0 
and the latest Zend Optimizer, I upraded to PHP 4.3.2.  Afterwards, phpinfo
() did not show the Optimizer as loaded.  Reinstalling Optimizer did not 
change this, nor did uninstalling and reinstalling Optimizer.  There were 
no errors during the Optimizer install, and everything looks like it's 
correct to me...the two lines are in php.ini, and they point to the right 
ZendOptimizer.so file.  There is only one php.ini on the system.  Any 
hints?

Thanks,

 - Steve Yates
 - Termite in pub: "Is the bar tender here?"

~ Taglines by Taglinator - www.srtware.com ~

--- End Message ---
--- Begin Message ---
I'm trying to make a PHP script that automaticly makes a link on the side
menu to the id page that was just made, under certain catagories. But I
edited my code to cleen up soem errors and all of a sudden 3 errors came up,
and I haven't been able to fix them! They are:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in C:\Inetpub\wwwroot\main\menu.php on line 29
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in C:\Inetpub\wwwroot\main\menu.php on line 41
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in C:\Inetpub\wwwroot\main\cat.php on line 39

The code for the menu and cat *.php files are below:

menu.php:
<HTML>

<HEAD>

  <link href="/css/base.css" rel="STYLESHEET" type="text/css">

</HEAD>

<BODY>

  <TABLE width=100% cellPadding=0 cellSpacing=0>

    <TR>

      <TD width=150 vAlign=top>

        <?php

          $register_globals;

          $db = mysql_connect("localhost","root");

          mysql_select_db("common",$db);

          $result = mysql_query("SELECT * FROM main",$db);

          echo "<center>Main</center><br>";

          while ($row1 = mysql_fetch_array($result)) {

            if ($row1["cat"] == 1) {

              printf("<a href=\"pages.php?cat=1&id=%s\">%s</a><br>",
$row1["id"], $row1["title"]);

            }

          }

          echo "<center>Misc.</center><br>";

          while ($row1 = mysql_fetch_array($result)) {

            if ($row1["cat"] == 2) {

              printf("<a href=\"pages.php?cat=2&id=%s\">%s</a><br>",
$row1["id"], $row1["title"]);

            }

          }

        ?>

      </TD>

      <TD>

cat.php:

<?php

  if ($submit) {

    if ($id) {

      $sql = "UPDATE main SET content='$content', title='$title' cat='$cat'
WHERE id=$id";

    } else {

      $sql = "INSERT INTO main (content,title,cat) VALUES
('$content','$title','$cat')";

    }

    $result = mysql_query($sql);

    echo "Record updated/edited!<p>Return to <A
href=\"pages.php?cat=$cat&id=$id\">Index</a>.";

  } elseif ($delete == areyousure) {

    $sql = "SELECT * FROM main WHERE id=$id";

    $result = mysql_query($sql);

    echo "Are you sure you want to delete $title?<p><a
href=\"$PHP_SELF?cat=$cat&id=$id&delete=true\">Yes</a> | <a
href=\"$PHP_SELF\">No</a>";

  } elseif ($delete == true) {

    $sql = "DELETE FROM main WHERE id=$id";

    $result = mysql_query($sql);

    echo "$title Record deleted!<p><a
href=\"$PHP_SELF?cat=$cat&id=$cat\">Return</a>";

  } else {

    $result = mysql_query("SELECT * FROM main",$db);

    while ($row = mysql_fetch_array($result)) {

      if ($id == $row["id"] && $cat == $row["cat"]) {

        printf("<center><font size=5>%s</font></center><br><br>",
$row["title"]);

        printf("%s<br><br>", $row["content"]);

        printf("<a
href=\"$PHP_SELF?cat=$cat&id=%s&delete=areyousure\">(DELETE)</a><br>",
$row["id"]);

        printf("<a
href=\"$PHP_SELF?cat=$cat&id=%s&edit_add=$cat\">(EDIT)</a><br>",
$row["id"]);

      }

    }

    echo "<P><a href=\"$PHP_SELF?cat=$cat&edit_add=$cat\">ADD A
RECORD</a><P>";

  }

?>

<?php

  if ($edit_add) {

?>

  <form method="post" action="pages.php?cat=<?php echo $cat ?>">

  <?php

    if ($id) {

      $sql = "SELECT * FROM main WHERE id=$id";

      $result = mysql_query($sql);

      $row = mysql_fetch_array($result);

      $id = $row["id"];

      $title = $row["title"];

      $cat = $row["cat"];

      $content = $row["content"];

    ?>

    <input type=hidden name="id" value="<?php echo $id ?>">

  <?php

    }

  ?>

  <TABLE cellPadding="0" cellSpacing="0" border="0">

    <TR>

      <TD>Title:</TD>

      <TD><input type="Text" name="title" value="<?php echo $title ?>"></TD>

      <TD rowSpan="2" vAlign="Top">

        <TABLE border="0" cellPadding="0" cellSpacing="0">
          <?php

            $result = mysql_query("SELECT * FROM cat",$db);

            while ($cat = mysql_fetch_array($result)) {

              printf("<TR><TD>%s</TD><TD><input type=\"radio\" name=\"cat\"
value=\"%s\"></TD></TR>", $cat["name"], $cat["id"]);

            }

          ?></TD></TR></TABLE></TD></TR>

    <TR>

      <TD>Message:</TD>

      <TD rowSpan="3"><textarea name="content" rows="7" cols="40"
wrap="virtual"><?php echo $content ?></TEXTAREA></TD></TR></TABLE>

  <input type="Submit" name="submit" value="Enter information">

  </form>

<?php

  }

?>


Anny help would be highly appreciated!
Thank You for your time.

-Ben


--- End Message ---
--- Begin Message ---
It has to do with you assuming everything will work 100% 
of the time.  It won't.  mysql_query() returns false on 
failure, check for that.  Read this recent thread:

 http://marc.theaimsgroup.com/?l=php-general&m=105517588819420

Also, this faq explains it:

 http://www.php.net/manual/en/faq.databases.php#faq.databases.mysqlresource

Btw, what do you expect: $register_globals; to do in your
code?  It won't do anything useful.

Regards,
Philip





--- End Message ---
--- Begin Message ---
Dear Walker,
After connecting to the LDAP using ldap_connect('localhost'); you should
use ldap_bind like the code given below.

<?php
$conn = ldap_connect("localhost") or die("Could not connect to server.
Error is " . ldap_error($conn)); 
// bind to the LDAP server 
$r = ldap_bind($conn, $root_dn, $root_pw) or die("Could not bind to
server. Error is " . ldap_error($conn));

    $dn = "dc=softprosys,dc=com";
    $filter = "cn=".$dname."*";
    $sr=ldap_search($conn,$dn,$filter,$justthese);  

?>

Hope this should help.
Regards
Praveen

-----------------------SOFTPRO DISCLAIMER------------------------------

Information contained in this E-MAIL and any attachments are
confidential being  proprietary to SOFTPRO SYSTEMS  is 'privileged'
and 'confidential'.

If you are not an intended or authorised recipient of this E-MAIL or
have received it in error, You are notified that any use, copyiny or
dissemination  of the information contained in this E-MAIL in any
manner whatsoever is strictly prohibited. Please delete it immediately
and notify the sender by E-MAIL.

In such a case reading, reproducing, printing or further dissemination
of this E-MAIL is strictly prohibited and may be unlawful.

SOFTPRO SYSYTEMS does not REPRESENT or WARRANT that an attachment
hereto is free from computer viruses or other defects. 

The opinions expressed in this E-MAIL and any ATTACHEMENTS may be
those of the author and are not necessarily those of SOFTPRO SYSTEMS.
------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Is there a way to get PHP script/code out of a DB? Becasue, when I enter PHP
code into the textbox and hit submit, and go check the page it has nothing
there with <?php xxxxxxx ?> and just shows the code, e.g.
include("menu.php"); without the <? ?> tags, the code I'm using to import
the DB text is below:

      } elseif ($id == $row["id"] && $cat == $row["cat"] && $row["xtra"] ==
php) {

        $msg = $row["msg"];

        $msg;

      }

Thank you for your time!
-Ben

(Note: My post didn't come up before, if it does, sorry for double posting)

--- End Message ---
--- Begin Message --- www.php.net/eval

Ben Houlton wrote:

Is there a way to get PHP script/code out of a DB? Becasue, when I enter PHP
code into the textbox and hit submit, and go check the page it has nothing
there with <?php xxxxxxx ?> and just shows the code, e.g.
include("menu.php"); without the <? ?> tags, the code I'm using to import
the DB text is below:

     } elseif ($id == $row["id"] && $cat == $row["cat"] && $row["xtra"] ==
php) {

$msg = $row["msg"];

$msg;

}

Thank you for your time!
-Ben

(Note: My post didn't come up before, if it does, sorry for double posting)




-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> > Working kind of :)
> >
> > Get one line from it....
> 
> Kinda... I get it to return one line...
> 
> The code:
> 
> <?php
> define('STDIN',fopen("php://stdin","r"));
> $str = fgets(STDIN);
> mail("[EMAIL PROTECTED]","Test","Test Test...\n\nOriginal
> Email:\n\n$str");
> ?>
> 
> Emails me:
> 
> Test Test...
> 
> Original Email:
> 
> >From [EMAIL PROTECTED] Thu Jun 12 11:41:39 2003

>From the docs (fgets):

"Returns a string of up to length - 1 bytes read from the file pointed to 
by fp. Reading ends when length - 1 bytes have been read, on a newline 
(which is included in the return value), or on EOF (whichever comes 
first). If no length is specified, the length defaults to 1k, or 1024 
bytes." 

So it's reading up to the first newline, as expected :-) Modify the 
example from the manual to suit your needs:

$fd = fopen ("/tmp/inputfile.txt", "r"); 
while (!feof ($fd)) { 
   $buffer = fgets($fd, 4096); 
   echo $buffer; 
} 
fclose ($fd); 

Cheers
-- 
Quod subigo farinam

--- End Message ---

Reply via email to