php-general Digest 12 Sep 2002 04:13:05 -0000 Issue 1580
Topics (messages 116010 through 116077):
Re: IPlanet Webserver
116010 by: Henrik Hudson
116066 by: Justin French
PHP And Apache
116011 by: Glenn
116012 by: Rasmus Lerdorf
116015 by: Glenn
Need PHP programmer ASAP..
116013 by: Michael Plasse
PHP help needed
116014 by: Michael Plasse
116041 by: nicos.php.net
Re: Sending Attachements through php email form
116016 by: Manuel Lemos
PHP and Special Characters
116017 by: Rick King
116018 by: Adam Williams
is php-4.2.3 a stable version?
116019 by: Anil Garg
116021 by: MET
116040 by: nicos.php.net
help with making an xslt class
116020 by: Geoff
116022 by: Brian V Bonini
116025 by: Geoff
How do I upgrade my version of PHP?
116023 by: Monty
116033 by: nicos.php.net
Re: Mail system with folders?
116024 by: Leonid Mamtchenkov
Query result to an array
116026 by: Christian Ista
116027 by: Zak Greant
116031 by: Christian Ista
116034 by: Zak Greant
116036 by: Christian Ista
116044 by: Zak Greant
Re: Displaying value different from actual value
116028 by: Zak Greant
cookie problem...
116029 by: rtrt
Re: ucwords()? and åäö
116030 by: Zak Greant
open_basedir without safe mode?
116032 by: Ville Mattila
116035 by: Rasmus Lerdorf
installing php-4.2.3
116037 by: Anil Garg
116038 by: Brad Bonkoski
Text from web form
116039 by: Rick King
116042 by: Jome
116043 by: nicos.php.net
Will return break loop?
116045 by: Kevin Stone
116047 by: SHEETS,JASON (Non-HP-Boise,ex1)
116048 by: David Buerer
116049 by: Zak Greant
116050 by: Kevin Stone
Variable Variables
116046 by: Mike Smith
Extracting Numbers from a string.
116051 by: Jason Caldwell
116053 by: M1tch
116054 by: Brad Bonkoski
116056 by: Dan Ostrowski
116057 by: Zak Greant
Re: Re:[PHP]question
116052 by: timo stamm
Session example at OSCON2002
116055 by: jacob.keystreams.com
116061 by: Chris Shiflett
Re: header question
116058 by: Chris Shiflett
html tables, php, other URL's...
116059 by: Anthony Ritter
Re: LDAP (NDS) authentication example...
116060 by: joshua
Re: mysql_insert_id
116062 by: David Robley
PreCaching Db into Variables Slows it down?!??
116063 by: M1tch
Need 2-way encryption
116064 by: Bob Bowker
116065 by: Bob Bowker
strtolower -> strtoupper
116067 by: Tommi Virtanen
116068 by: Michael Sims
frame
116069 by: dinnie
116075 by: Martin Towell
refresh function?
116070 by: Peter
116072 by: OrangeHairedBoy
116074 by: Peter Houchin
XML Parser Question
116071 by: OrangeHairedBoy
116076 by: Martin Towell
116077 by: OrangeHairedBoy
Re: Mail() function problem
116073 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 ---
Make sure you're accessing your variables correctly as well. Remember,
register_globals is now off by default, so you can't just access POST and GET
vars by variable name, but insterad use $_POST[varname] or $_GET[varname]
On Wednesday 11 September 2002 10:42, Chris Boget wrote:
> Do any of you guys have experience setting PHP up
> with the IPlanet webserver? We are trying it out (for
> a client) and we can't seem to get to so that PHP
> gets the POST or GET variables passed from a form
> and would like to talk with someone who's had experience
> working with or around this problem.
>
> Chris
--
Henrik Hudson
[EMAIL PROTECTED]
Note: Beware of Dragons - Thou art crunchy and taste good with ketchup.
--- End Message ---
--- Begin Message ---
Instead of $myformvalue, try $_POST['myformvalue'] or $_GET['myformvalue'].
Then slap yourself on the forhead for not looking in the manual and seeing
what changes have been made to newer versions, or for not checking this
lists' archives first, because this questions is asked DAILY, if not more
frequently :)
Justin French
on 12/09/02 1:42 AM, Chris Boget ([EMAIL PROTECTED]) wrote:
> Do any of you guys have experience setting PHP up
> with the IPlanet webserver? We are trying it out (for
> a client) and we can't seem to get to so that PHP
> gets the POST or GET variables passed from a form
> and would like to talk with someone who's had experience
> working with or around this problem.
>
> Chris
>
>
>
--- End Message ---
--- Begin Message ---
Can anyone tell me if the latest version of PHP works with the latest Apache
web server? When I try to build the server it says its not, but I wondered
if there were any patches or changes I could make for them to work properly?
Thanks,
glenn
--- End Message ---
--- Begin Message ---
Use the latest Apache 1.3.x and the latest PHP. Works just fine. Apache
2.0.x is a completely different beast.
-Rasmus
On Wed, 11 Sep 2002, Glenn wrote:
> Can anyone tell me if the latest version of PHP works with the latest Apache
> web server? When I try to build the server it says its not, but I wondered
> if there were any patches or changes I could make for them to work properly?
>
> Thanks,
>
> glenn
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
ok then...
thanks
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Use the latest Apache 1.3.x and the latest PHP. Works just fine. Apache
> 2.0.x is a completely different beast.
>
> -Rasmus
>
> On Wed, 11 Sep 2002, Glenn wrote:
>
> > Can anyone tell me if the latest version of PHP works with the latest
Apache
> > web server? When I try to build the server it says its not, but I
wondered
> > if there were any patches or changes I could make for them to work
properly?
> >
> > Thanks,
> >
> > glenn
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
Hello,
I need a PHP programmer ASAP to help with site updates on large childrens
webiste.
Please reply to: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hello,
I need a PHP programmer to assist me with updates to childrens website.
Mike
--- End Message ---
--- Begin Message ---
Hi,
is it a free assistance or a non-free one?
--
Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet
"Michael Plasse" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hello,
>
> I need a PHP programmer to assist me with updates to childrens website.
>
>
> Mike
>
>
--- End Message ---
--- Begin Message ---
Hello,
On 09/10/2002 11:07 AM, Heidi Belal wrote:
> Hi,
>
> I was wondering if anybody could tell me the best way and how to code sending an
>attachement with an email form. I want the user to be able to browse and select the
>file he wants to attach, and i want the reciepent to be able to see the file that has
>been attached with the email.
You may want to try this class that lets you do what you want:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
Apache: 1.3.23
PHP: 4.1.2
Hello PHP Guru's!
I have created a simple web form. When the form is complete and submitted,
the results are emailed to an email account. But I have noticed that the '
character is escaped.
Example: John O\ 'Connor, instead of getting John O'Connor.
Is this a problem within PHP or HTML?
Has anyone else encountered this problem before? If so, what was the
workaround?
Any help would be greatly appreciated!
Rick
--- End Message ---
--- Begin Message ---
use stripslashes() or turn on magic quotes in php.ini
On Wed, 11 Sep 2002, Rick King wrote:
> Apache: 1.3.23
> PHP: 4.1.2
>
> Hello PHP Guru's!
>
> I have created a simple web form. When the form is complete and submitted,
> the results are emailed to an email account. But I have noticed that the '
> character is escaped.
> Example: John O\ 'Connor, instead of getting John O'Connor.
>
> Is this a problem within PHP or HTML?
> Has anyone else encountered this problem before? If so, what was the
> workaround?
>
> Any help would be greatly appreciated!
>
> Rick
>
>
>
>
--- End Message ---
--- Begin Message ---
Hi,
i am using freebsd4.2
I couldnt find if the latest php-versiono 4.2.3 a stable version ?? i mean
shall i use 4.2.2 or 4.2.3 ?
thanx and regards
anil
--- End Message ---
--- Begin Message ---
PHP 4.2.3 is mainly fixes to 4.2.2 but yes it is stable and a suggested
update.
~ Matthew
-----Original Message-----
From: Anil Garg [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 2:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] is php-4.2.3 a stable version?
Hi,
i am using freebsd4.2
I couldnt find if the latest php-versiono 4.2.3 a stable version ?? i
mean shall i use 4.2.2 or 4.2.3 ?
thanx and regards
anil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Sure 4.2.3 is a stable and portable version, feel free to upgrade.
--
Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet
"Anil Garg" <[EMAIL PROTECTED]> a écrit dans le message de news:
018701c259c3$83778c60$[EMAIL PROTECTED]
> Hi,
>
> i am using freebsd4.2
> I couldnt find if the latest php-versiono 4.2.3 a stable version ?? i mean
> shall i use 4.2.2 or 4.2.3 ?
>
> thanx and regards
> anil
>
--- End Message ---
--- Begin Message ---
I am trying to make a class to process xslt transformations.
Here is the class:
class xslTransformer extends makexml {
var $xh;
function xslTransformer($xslfile) {
$this->xh = xslt_create();
$result=xslt_process($this->xh,$this->xmlstr,$xslfile); //errors if
($result) {
print $result;
}
else {
print "Sorry, the xml could not be transformed by the xsl into"; print
" the \$result variable the reason is that . "xslt_error($this->xh) .
print " and the error code is " . xslt_errno($this->xh);
}
xslt_free($this->xh);
}
}
I call it as
$this->xmlstr is valid xml (I have checked) the makexml class works fine
as well.
Here is the error I get:
Warning: Sablotron error on line 1: XML parser error 3: no element found
in /usr/lib/apache/htdocs/xml/clsmakexml.php on line 200
Sorry, the xml could not be transformed by the xsl into and the error
code is 2 the $result variable the reason is that XML parser error 3: no
element found
--- End Message ---
--- Begin Message ---
Isn't this what the salbatron library is for?
> -----Original Message-----
> From: Geoff [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 11, 2002 2:52 PM
> To: php list
> Subject: [PHP] help with making an xslt class
>
>
> I am trying to make a class to process xslt transformations.
>
> Here is the class:
> class xslTransformer extends makexml {
> var $xh;
> function xslTransformer($xslfile) {
> $this->xh = xslt_create();
> $result=xslt_process($this->xh,$this->xmlstr,$xslfile);
> //errors if
> ($result) {
> print $result;
> }
> else {
> print "Sorry, the xml could not be transformed by the xsl
> into"; print
> " the \$result variable the reason is that . "xslt_error($this->xh) .
> print " and the error code is " . xslt_errno($this->xh);
> }
> xslt_free($this->xh);
> }
> }
>
> I call it as
>
> $this->xmlstr is valid xml (I have checked) the makexml class works fine
> as well.
>
> Here is the error I get:
> Warning: Sablotron error on line 1: XML parser error 3: no element found
> in /usr/lib/apache/htdocs/xml/clsmakexml.php on line 200
> Sorry, the xml could not be transformed by the xsl into and the error
> code is 2 the $result variable the reason is that XML parser error 3: no
> element found
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I am using the sablotron xslt library I just want to make a class to
minimize the code I need to write and make it easier to maintain.
When I do it like so:
// create XSLT processor
$xh = xslt_create();
// call xslt processor
// Process the document
$result = xslt_process($xh, 'arg:/_xml', $xmldoc->xslstr, NULL,
$arguments);
if ($result) {
print $result;
}
else {
print "Sorry, the xml could not be transformed by the xsl into";
print " the \$result variable the reason is that " . xslt_error($xh)
.
print " and the error code is " . xslt_errno($xh);
}
xslt_free($xh);
it works fine. I just don't seem to be able to make it work in a class.
On Wed, 2002-09-11 at 14:18, Brian V Bonini wrote:
> Isn't this what the salbatron library is for?
>
> > -----Original Message-----
> > From: Geoff [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 11, 2002 2:52 PM
> > To: php list
> > Subject: [PHP] help with making an xslt class
> >
> >
> > I am trying to make a class to process xslt transformations.
> >
> > Here is the class:
> > class xslTransformer extends makexml {
> > var $xh;
> > function xslTransformer($xslfile) {
> > $this->xh = xslt_create();
> > $result=xslt_process($this->xh,$this->xmlstr,$xslfile);
> > //errors if
> > ($result) {
> > print $result;
> > }
> > else {
> > print "Sorry, the xml could not be transformed by the xsl
> > into"; print
> > " the \$result variable the reason is that . "xslt_error($this->xh) .
> > print " and the error code is " . xslt_errno($this->xh);
> > }
> > xslt_free($this->xh);
> > }
> > }
> >
> > I call it as
> >
> > $this->xmlstr is valid xml (I have checked) the makexml class works fine
> > as well.
> >
> > Here is the error I get:
> > Warning: Sablotron error on line 1: XML parser error 3: no element found
> > in /usr/lib/apache/htdocs/xml/clsmakexml.php on line 200
> > Sorry, the xml could not be transformed by the xsl into and the error
> > code is 2 the $result variable the reason is that XML parser error 3: no
> > element found
> >
> >
> >
> >
> >
> >
> > --
> > 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
>
--- End Message ---
--- Begin Message ---
I've downloaded the patch file for 4.2.2 to 4.2.3 from the PHP website, but,
not sure what to do with this file. I have a Linux 7.x server. Can anyone
tell me how to patch my version of PHP or point me to a source that explains
how this is done?
Thanks!
--- End Message ---
--- Begin Message ---
You should use the patch command, feel free to "man patch".
--
Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet
"Monty" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> I've downloaded the patch file for 4.2.2 to 4.2.3 from the PHP website,
but,
> not sure what to do with this file. I have a Linux 7.x server. Can anyone
> tell me how to patch my version of PHP or point me to a source that
explains
> how this is done?
>
> Thanks!
>
--- End Message ---
--- Begin Message ---
Dear Leif K-Brooks,
Once you wrote about "[PHP] Mail system with folders?":
> I'm designing a site, and I want to put mail with folders on it. Fairly
> simply, but I'm not sure what to do for the default folders. I want to
> have three precreated folders: inbox, trash, and sent. I'm not sure
> about the best way to do these. Any ideas?
I think you should investigate more on the subject of "web mail" if that
is what you need to do. Usually, php (or any other language) is used to
create an interface for an operational mail server, which can be
accessed via IMAP. You can find lots of examples at
http://www.freshmeat.net or any other software repository.
Do not reinvent the wheel. ;)
--
Best regards,
Leonid Mamtchenkov, RHCE
System Administrator
Francoudi & Stephanou Ltd.
--- End Message ---
--- Begin Message ---
Hello,
A query return x rows, by rows there are 4 fields. I'd like to put the
result in an array, a 2 dimensions array. Could you tell me how to do
that ?
Bye
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On September 11, 2002 14:12, Christian Ista wrote:
> Hello,
>
> A query return x rows, by rows there are 4 fields. I'd like to put the
> result in an array, a 2 dimensions array. Could you tell me how to do
> that ?
Something like this may work for you:
# Connect to db, make query, etc.
while( $temp = mysql_fetch_row($mysql_result_handle) ) {
$array[] = array(
'key0' = array(
'keya' => $temp[0],
'keyb' => $temp[1],
),
'key1' = array(
'keya' => $temp[2],
'keyb' => $temp[3],
)
);
}
Good luck!
- --zak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f6tAb6QONwsK8bIRAvjKAJwKN0yvbGaztQzZOKYiy22FMqQ5EgCeP3AH
4sGpVTTX6gUJp8fZJ8xXEfQ=
=eaeg
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
> while( $temp = mysql_fetch_row($mysql_result_handle) ) {
> $array[] = array(
> 'key0' = array(
> 'keya' => $temp[0],
> 'keyb' => $temp[1],
> ),
> 'key1' = array(
> 'keya' => $temp[2],
> 'keyb' => $temp[3],
> )
> );
> }
Hello,
Thanks for your help. But that's not work at all.
bye
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On September 11, 2002 15:05, Christian Ista wrote:
> > while( $temp = mysql_fetch_row($mysql_result_handle) ) {
> > $array[] = array(
> > 'key0' = array(
> > 'keya' => $temp[0],
> > 'keyb' => $temp[1],
> > ),
> > 'key1' = array(
> > 'keya' => $temp[2],
> > 'keyb' => $temp[3],
> > )
> > );
> > }
>
> Hello,
>
> Thanks for your help. But that's not work at all.
Dear Christian,
I assume that you encountered some syntax errors in the code?
(or was there another problem?)
Anyhow, here is the corrected version
while( $temp = mysql_fetch_row($mysql_result_handle) ) {
$array[] = array(
'key0' => array(
'keya' => $temp[0],
'keyb' => $temp[1]
),
'key1' => array(
'keya' => $temp[2],
'keyb' => $temp[3]
)
);
}
- --zak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f7K3b6QONwsK8bIRAiATAJ9TPv/28hZiF136TePF5SXTgDinUACgkg6w
BJVDvRVsVzqplDLOD/u5u4E=
=NbgV
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
> while( $temp = mysql_fetch_row($mysql_result_handle) ) {
> $array[] = array(
> 'key0' => array(
> 'keya' => $temp[0],
> 'keyb' => $temp[1]
> ),
> 'key1' => array(
> 'keya' => $temp[2],
> 'keyb' => $temp[3]
> )
> );
> }
I corrected this error myself but that's not work.
Why that twice ? (only the key change)
'key0' => array(
'keya' => $temp[0],
'keyb' => $temp[1]
),
when I do echo($array[0][1]) I receive array unknown.
Bye
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On September 11, 2002 15:21, Christian Ista wrote:
> > while( $temp = mysql_fetch_row($mysql_result_handle) ) {
> > $array[] = array(
> > 'key0' => array(
> > 'keya' => $temp[0],
> > 'keyb' => $temp[1]
> > ),
> > 'key1' => array(
> > 'keya' => $temp[2],
> > 'keyb' => $temp[3]
> > )
> > );
> > }
>
> I corrected this error myself but that's not work.
>
> Why that twice ? (only the key change)
>
> 'key0' => array(
> 'keya' => $temp[0],
> 'keyb' => $temp[1]
> ),
>
> when I do echo($array[0][1]) I receive array unknown.
Ok - if you want a numeric array, then do something like this:
array(
array( $temp[0], $temp[1] ),
array( $temp[1], $temp[2] )
)
--zak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f7p3b6QONwsK8bIRAhEpAJ4vU+f/AovqfUkHvdnBf6le47N9AACfdK7K
L6Ub877d4ZUwbxSXF6gl9qY=
=Vnxt
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On September 11, 2002 07:57, Dave Rosenberg wrote:
> I'm not sure this is possible, but here's what I'd like to do:
> I know that in order for a set of records from MySQL to display in
> numerical order on a web page, you need to make the column type
> "Integer," but here's my situation:
>
> I'm creating a database of contracts that my organization has.
> Normally, there is a dollar amount on these contracts, and I'd like to
> be able to sort by that value (therefore the Integer column type).
> However, we have some fee-based contracts, and I'd like a way to display
> the amount as "Fee Based" even though I can't enter this in the database
> because of the column type. Is there a way in PHP to have it display
> this although with some kind of if/then statement or something of that
> sort?
>
> Contract A Fee-based
> Contract B 70000
> Contract C 1250
> Contract D 50000
Hi Dave,
You can also do this in your SQL query.
For example:
If your table contains this:
+----------+---------+
| contract | amount |
+----------+---------+
| Jillco | 1000000 |
| Jackco | 10000 |
| ChrisInc | NULL |
+----------+---------+
The the following select:
SELECT contract, IFNULL(amount, "Fee Based") amount FROM contracts;
will return:
Jillco 1000000
Jackco 10000
Chrisinc Fee Based
Cheers!
- --
Zak Greant <[EMAIL PROTECTED]>
MySQL Community Advocate
Feed the Dolphin! Order MySQL support from the MySQL developers at
https://order.mysql.com/?ref=mzgr
"Gosh, Batman! The nobility of the almost-human porpoise." --Robin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f6iab6QONwsK8bIRAjoJAJ9rswcUKNzR5z9wD7HaKqJ42raiwgCeOzVs
TMSVwY5J18Y3zeEmRut9Wyg=
=G1gi
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
we are using apache 1.3.12 server, php 4.2.3 on linux.
Before, we didn't write cookies.txt on harddisk. We changed some
configuration in httpd.conf like.
We disabled mod_proxy module and then cookie had been wrote. But now, we
are not reading
cookie variables from cookies.txt (Netscape). I konw problem could be very
easy but.
I am unsleepy two days.
Tansel Akgul
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Here is a quick replacement script* for ucwords() that can be made to handle
accented characters or interesting casing rules. It is a bit uppercase happy
- - uppercasing any letter that comes after a non-letter character.
*(Taken from the PHP Functions Essential Reference
(http://fooassociates.com/phpfer/))
<?php
function custom_ucwords($map, $string) {
// A state variable that tracks if we are inside
// or outside a block of word characters
$inside_word = TRUE;
for ($index = 0; $index < strlen($string); ++$index) {
// If the current character is a key for the map array,
// we know that the current character is a word character
$is_chr = isset($map[$string[$index]]);
/* If the last character was not a word character
* but the current character is, convert the
* current character to uppercase
*/
if (! $inside_word && $is_chr) {
$string[$index] = $map[$string[$index]];
}
// Track whether this character is a word or a non-word character
// for the next iteration of the loop
$inside_word = $is_chr;
}
return $string;
}
// A map for English characters
$map = array(
'a' => 'A', 'b' => 'B', 'c' => 'C', 'd' => 'D',
'e' => 'E', 'f' => 'F', 'g' => 'G', 'h' => 'H',
'i' => 'I', 'j' => 'J', 'k' => 'K', 'l' => 'L',
'm' => 'M', 'n' => 'N', 'o' => 'O', 'p' => 'P',
'q' => 'Q', 'r' => 'R', 's' => 'S', 't' => 'T',
'u' => 'U', 'v' => 'V', 'w' => 'W', 'x' => 'X',
'y' => 'Y', 'z' => 'Z'
);
$string = <<<_JABBERWOCKY_
"and, has thou slain the jabberwock?<br />
come to my arms, my beamish boy!<br />
o frabjous day! callooh! callay!"<br />
he chortled in his joy.<br />
_JABBERWOCKY_;
echo custom_ucwords($map, $string);
?>
Cheers!
- --zak
On September 11, 2002 08:27, Ville Mattila wrote:
> I can't say correct answer to this, but want also notify that
> strtoupper() -function doesn't affect to those special charters å, ä and ö
> that are very common in Finnish language.
>
> Ville
>
>
> -----Original Message-----
> From: Tommi Virtanen [mailto:[EMAIL PROTECTED]]
> Sent: 11. syyskuuta 2002 17:14
> To: [EMAIL PROTECTED]
> Subject: [PHP] ucwords()?
>
>
> Hi!
>
> I'll try to convert field first char to upper by using ucwords(). Well,
> this doesn't
> seem to work correct.
>
> Well maybe error came, because that characteres are not standard (they
> are special characterers, finnish language).
>
> Example:
>
> $work_text = "perhepäivähoitaja";
>
> $work_text = ucwords (strtolower ($work_text);
>
> print $work_name -> PerhepäIväHoitaja). Every char after finnish-ä is
> upper.
>
>
> How I can correct this error??
>
> gustavus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f6nlb6QONwsK8bIRAhANAJ9Xab9JmsjKxlp+KF01822QmK8zFQCbBXW+
92J2XRJgKmRXRAlhp7QbwTM=
=QEMR
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Hi there,
I was wondering if there is a possibility to get open_basedir preferences
(also set via .htaccess) active in a server running not PHP in open_basedir.
I should create a small home site space for some users with PHP equipped,
but I don't like to put safe mode on as there are some other advanced (not
runnable in safe mode) scripts on the same machine. open_basedir would limit
the user's access to their own directories, but it seems not to work wihtout
safe mode.
Any ideas?
Ville
--- End Message ---
--- Begin Message ---
safe mode and open_basedir are completely separate.
On Thu, 12 Sep 2002, Ville Mattila wrote:
> Hi there,
>
> I was wondering if there is a possibility to get open_basedir preferences
> (also set via .htaccess) active in a server running not PHP in open_basedir.
> I should create a small home site space for some users with PHP equipped,
> but I don't like to put safe mode on as there are some other advanced (not
> runnable in safe mode) scripts on the same machine. open_basedir would limit
> the user's access to their own directories, but it seems not to work wihtout
> safe mode.
>
> Any ideas?
>
> Ville
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
hi,
i am a newbie to php...
i have downloaded php-4.2.3.tar.gz from http://www.php.net/downloads.php
can someone please point me to the right documentaion from where i can know
what to do next..
I am using FreeBSD-4.2.
thanx and regards
anil
--- End Message ---
--- Begin Message ---
unzip that and cd into it and read the INSTALL file
tar -xzvf php-4.2.3.tar.gz
cd php-4.2.3
less INSTALL
HTH
-Brad
Anil Garg wrote:
>
> hi,
>
> i am a newbie to php...
> i have downloaded php-4.2.3.tar.gz from http://www.php.net/downloads.php
> can someone please point me to the right documentaion from where i can know
> what to do next..
> I am using FreeBSD-4.2.
>
> thanx and regards
> anil
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Apache: 1.3.26
PHP: 4.2.3
OS: HPUX-11
Hello PHP Guru's!
After successfully installing PHP and viewing the phpinfo page, I decided to
create a simple web-form. Just a basic "Name" "Message" web-form, when the
form is complete it is emailed to an account. Everything works, except I
don't see the filled in contents in the email message. I don't see the what
the person filled out. But I see "Name:" ane "Message:"
Any ideas?
Here's my config line for installing PHP:
CC=gcc ./configure --prefix=/opt/php \
--without-mysql \ (didn't have MySQL installed)
--with-apxs=/opt/apache/bin/apxs
Here's my config line for installing Apache:
CC=gcc ./configure --prefix=/opt/apache \
--enable-module=most \
--enable-shared=max
Any help would be greatly appreciated!
Rick
--- End Message ---
--- Begin Message ---
> Hello PHP Guru's!
>
> After successfully installing PHP and viewing the phpinfo page, I decided
to
> create a simple web-form. Just a basic "Name" "Message" web-form, when the
> form is complete it is emailed to an account. Everything works, except I
> don't see the filled in contents in the email message. I don't see the
what
> the person filled out. But I see "Name:" ane "Message:"
>
> Any ideas?
Could this be an register_globals issue?
Read on
http://www.php.net/manual/en/language.variables.predefined.php#language.vari
ables.superglobals - it may resolve your problem.
Jome
--- End Message ---
--- Begin Message ---
Hi,
If you have register global off on your php.ini, you should do:
$name = $_POST['name'];
$message = $_POST['message'];
at the top of your script to enable the variables.
--
Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet
"Rick King" <[EMAIL PROTECTED]> a écrit dans le message de
news: [EMAIL PROTECTED]
> Apache: 1.3.26
> PHP: 4.2.3
> OS: HPUX-11
>
> Hello PHP Guru's!
>
> After successfully installing PHP and viewing the phpinfo page, I decided
to
> create a simple web-form. Just a basic "Name" "Message" web-form, when the
> form is complete it is emailed to an account. Everything works, except I
> don't see the filled in contents in the email message. I don't see the
what
> the person filled out. But I see "Name:" ane "Message:"
>
> Any ideas?
>
> Here's my config line for installing PHP:
> CC=gcc ./configure --prefix=/opt/php \
> --without-mysql \ (didn't have MySQL installed)
> --with-apxs=/opt/apache/bin/apxs
>
> Here's my config line for installing Apache:
> CC=gcc ./configure --prefix=/opt/apache \
> --enable-module=most \
> --enable-shared=max
>
> Any help would be greatly appreciated!
>
> Rick
>
>
--- End Message ---
--- Begin Message ---
Really quick question. Will "return" break a loop inside a function?
Example..
myfunc()
{
while($val=0)
{
if ($i=128)
{
return true; //<-break or no?
}
}
}
I know I could easily figure this out my own but I do not have the means to
test it right now. :)
Much thanks!
Kevin
--- End Message ---
--- Begin Message ---
I tested this on PHP 4.2.3 and in my case return does break a while loop.
Jason
-----Original Message-----
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 3:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Will return break loop?
Really quick question. Will "return" break a loop inside a function?
Example..
myfunc()
{
while($val=0)
{
if ($i=128)
{
return true; //<-break or no?
}
}
}
I know I could easily figure this out my own but I do not have the means to
test it right now. :)
Much thanks!
Kevin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
really quik answer...
yes.
really long answer...
from php manual:
"the return() statement immediately ends execution of the current function,
and returns its argument as the value of the function call."
-----Original Message-----
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 2:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Will return break loop?
Really quick question. Will "return" break a loop inside a function?
Example..
myfunc()
{
while($val=0)
{
if ($i=128)
{
return true; //<-break or no?
}
}
}
I know I could easily figure this out my own but I do not have the means to
test it right now. :)
Much thanks!
Kevin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On September 11, 2002 15:57, Kevin Stone wrote:
> Really quick question. Will "return" break a loop inside a function?
>
> Example..
> myfunc()
> {
> while($val=0)
> {
> if ($i=128)
> {
> return true; //<-break or no?
> }
> }
> }
>
> I know I could easily figure this out my own but I do not have the means to
> test it right now. :)
Yes - return will break a loop.
Cheers!
- --zak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f74qb6QONwsK8bIRAl+hAJwI4VaBj6IYtbjgHxGQkmq+Lg2iggCfYqOT
gsTebidZ6s5u2tc5SC60IyM=
=bywU
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Thanks for really quick replies to my really quick question, everyone. Much
appreciated. :)
-Kevin
----- Original Message -----
From: "David Buerer" <[EMAIL PROTECTED]>
To: "'Kevin Stone'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 11, 2002 3:42 PM
Subject: RE: [PHP] Will return break loop?
> really quik answer...
>
> yes.
>
> really long answer...
> from php manual:
>
> "the return() statement immediately ends execution of the current
function,
> and returns its argument as the value of the function call."
>
>
> -----Original Message-----
> From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 11, 2002 2:57 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Will return break loop?
>
>
> Really quick question. Will "return" break a loop inside a function?
>
> Example..
> myfunc()
> {
> while($val=0)
> {
> if ($i=128)
> {
> return true; //<-break or no?
> }
> }
> }
>
> I know I could easily figure this out my own but I do not have the means
to
> test it right now. :)
>
> Much thanks!
> Kevin
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I am stumped on a project for a receiving system. I'm not sure how to handle
receiving more than one line item. I can UPDATE ... WHERE id=$detid when I
have 1 item, but how would I get the SQL to fire X times depending on the
number of line items I have AND UPDATE the appropriate record.
Currently I have the following:
index.php -> results.php -> recv.php
Search for | Results of PO | Page to receive/back order
PO ($ponum | Search | items.
or $vendor)
The code below displays the line items from the PO:
...
$myServer = "myserver";
$myUser = "login";
$myPass = "password";
$myDB = "db";
$s = @mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
$d = @mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");
$sql="SELECT tbl_po.poid, tbl_po.vend_name, tbl_podet.qty,
tbl_podet.unitqty, tbl_podet.um, tbl_podet.partnum, tbl_podet.partdesc FROM
tbl_po INNER JOIN tbl_podet ON tbl_po.poid = tbl_podet.ponum WHERE
(((tbl_po.poid)=$ponum))";
$result = mssql_query($sql);
$numRows = mssql_num_rows($result);
...
[HTML Table header]
...
while($row = mssql_fetch_array($result)) {
echo "<tr align=center valign=top>";
echo "<td align=center>" . $row[0] . "</td>";
echo "<td align=center>" . $row[1] . "</td>";
echo "<td align=center>" . $row[2] . "</td>";
echo "<td align=center>" . $row[3] . "</td>";
echo "<td align=center>" . $row[4] . "</td>";
echo "<td align=left>" . $row[5] . "</td>";
echo "<td align=left>" . $row[6] . "</td>";
echo "<td align=center><input type=\"text\" name=\"recvd\"></td>";
echo "<td align=center><input type=\"text\" name=\"bkord\"></td>";
echo "</tr>";
echo "</font>";
echo "</form>";
}
echo "</table>";
echo "<input type=\"submit\" name=\"Receive\" value=\"Receive\">";
The last 2 boxes in the table are for Recvd qty and Back Order Qty. The
problem is I could have 1 line item or I could have 10 line items. So if I
have 1 item and my SQL is "UPDATE tbl_podetail SET bkorder=$bkord WHERE
id=$detid" that will work fine, but if I have 10 items, the same UPDATE
statement will only update the LAST $detid, it won't fire 10 times for item.
I could add another column with a button next to each line item to save the
changes, but would (for simplicity) rather have the one "Receive" button.
Regards,
Mike Smith
--- End Message ---
--- Begin Message ---
I need to extract the numbers only from a field.
For example: I have an AMOUNT field and so that I can filter out any user
typo's I would like to extract the numbers only.
If the user enters $56.55 for example or just $56 then I would like to be
able to remove the "$" and the "." keeping just the 56 or 5655.
Can I use eregi_replace() to do this -- I've been trying but it doesn't seem
to work right.
Thanks.
Jason
--- End Message ---
--- Begin Message ---
it doesn't use ereg, but it (should) would work:
$mystring = "I have $56.55 dollars, don't you know";
$mystring = substr($mystring, strpos($mystring, "$")); //strip out after
the $ sign
$mystring = substr($mystring, 0, strpos($mystring, " ")); //keep only
till first space
//mystring now contains $56.55
if you want it split into two variables, of '$56', and '55' use:
$a = explode(".", $mystring);
//$a[0'] = $56
//$a[1] = 55
(by the way, there may be functions that work better than using the
substr+strpos functions, I just can't remember off the top of my head!)
Of course, ereg might well work better!
"Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need to extract the numbers only from a field.
>
> For example: I have an AMOUNT field and so that I can filter out any user
> typo's I would like to extract the numbers only.
>
> If the user enters $56.55 for example or just $56 then I would like to be
> able to remove the "$" and the "." keeping just the 56 or 5655.
>
> Can I use eregi_replace() to do this -- I've been trying but it doesn't
seem
> to work right.
>
> Thanks.
> Jason
>
>
--- End Message ---
--- Begin Message ---
Of course they may not always know that the user would insert a '$' or a
'.' which is what you are keying off of. I am not all that familiar
with ereg* functions, I might attack it with stepping through charater
by charater and is is_numeric($c) returns true, place it applend it to
another variable, which at the end would have strictly the numbers...
That would be my initial approach, but I'm sure there are many,many
others...
-Brad
M1tch wrote:
>
> it doesn't use ereg, but it (should) would work:
>
> $mystring = "I have $56.55 dollars, don't you know";
> $mystring = substr($mystring, strpos($mystring, "$")); //strip out after
> the $ sign
> $mystring = substr($mystring, 0, strpos($mystring, " ")); //keep only
> till first space
>
> //mystring now contains $56.55
> if you want it split into two variables, of '$56', and '55' use:
> $a = explode(".", $mystring);
> //$a[0'] = $56
> //$a[1] = 55
>
> (by the way, there may be functions that work better than using the
> substr+strpos functions, I just can't remember off the top of my head!)
>
> Of course, ereg might well work better!
>
> "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I need to extract the numbers only from a field.
> >
> > For example: I have an AMOUNT field and so that I can filter out any user
> > typo's I would like to extract the numbers only.
> >
> > If the user enters $56.55 for example or just $56 then I would like to be
> > able to remove the "$" and the "." keeping just the 56 or 5655.
> >
> > Can I use eregi_replace() to do this -- I've been trying but it doesn't
> seem
> > to work right.
> >
> > Thanks.
> > Jason
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
A simple:
eregi_replace("[^0-9]", "", $myvar);
should do it. it says.. replace everything that is not a number ( character class
"[^0-9]" which means Character class "[" NOT "^" of Decimal "0-9" end character class
"]" ) with a NULL string, thereby ripping out all non-numeric components and leaving
you with a totally numeric string. ( in theory ).
I haven't tested the code so you may have to play with it, but it's pretty simple.
dan
On Wed, 11 Sep 2002 15:31:22 -0700
"Jason Caldwell" <[EMAIL PROTECTED]> wrote:
> I need to extract the numbers only from a field.
>
> For example: I have an AMOUNT field and so that I can filter out any user
> typo's I would like to extract the numbers only.
>
> If the user enters $56.55 for example or just $56 then I would like to be
> able to remove the "$" and the "." keeping just the 56 or 5655.
>
> Can I use eregi_replace() to do this -- I've been trying but it doesn't seem
> to work right.
>
> Thanks.
> Jason
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On September 11, 2002 16:31, Jason Caldwell wrote:
> I need to extract the numbers only from a field.
>
> For example: I have an AMOUNT field and so that I can filter out any user
> typo's I would like to extract the numbers only.
>
> If the user enters $56.55 for example or just $56 then I would like to be
> able to remove the "$" and the "." keeping just the 56 or 5655.
>
> Can I use eregi_replace() to do this -- I've been trying but it doesn't
> seem to work right.
Hey Jason,
You can strip out all non-numeric values with this regular expression:
$v = ereg_replace('[^0-9]', '', $v);
If you want to keep the decimal place, then use this
$v = ereg_replace('[^.0-9]', '', $v);
And finally, if you want a regular expression that recognizes monetary
values, try this :)
$regex = '^' # match the start of a string
. '(' # capture any text that matches the regex
. '[^0-9]*' # match any character that is not 0-9
. ')' # stop capturing text
# Capture match so that we can see if
# they used a currency symbol :)
. '?' # Optionally match the preceding bracketed text
. '(' # capture any text that matches the regex
. '[0-9]+' # match an integer number
.'|[,.][0-9]{0,2}' # or match a decimal value
.'|[0-9]+[,.][0-9]{0,2}' # match integer and decimal
.')' # Stop capturing text
.'([^0-9]+)' # Capture any trailing text (like USD or CAD)
. '?'; # Optionally match the preceding bracketed text
if( ereg($regex, $possible_numeric_value, $captured_text) ) {
echo "$possible_numeric_value might be a monetary value.";
var_dump ($captured_text);
} else {
echo "$possible_numeric_value is probably not a monetary value.";
}
Cheers!
- --zak
Cheers!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f89Cb6QONwsK8bIRAsP4AJ9X6RqWUDJYtagcJvZ37f/UoRJaYgCfbg1S
22ioG6nALcALqXd6xjGxOrQ=
=IbP1
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Hi Meltem,
the second one was a better description of your problem.
Attached is the most convenient approach can come up with for
this problem. It is not optimized, but should be easy to
understand.
Timo
<?php
$submitted = isset($_REQUEST['a']); // submitting data or just
retrieving page?
if($submitted) $fields_complete = ($_REQUEST['a'] &&
$_REQUEST['b'] && $_REQUEST['c']); // are all fields filled?
if(!$submitted) {
$f_a_def = "";
$f_a_err = "";
$f_b_def = "";
$f_b_err = "";
$f_c_def = "";
$f_c_err = "";
};
if($submitted && !$fields_complete) {
if($_REQUEST['a']) { $f_a_def = $_REQUEST['a']; $f_a_err = "";}
else { $f_a_def = ""; $f_a_err = "you forgot to fill this field";};
if($_REQUEST['b']) { $f_b_def = $_REQUEST['b']; $f_b_err = "";}
else { $f_b_def = ""; $f_b_err = "you forgot to fill this field";};
if($_REQUEST['c']) { $f_c_def = $_REQUEST['c']; $f_c_err = "";}
else { $f_c_def = ""; $f_c_err = "you forgot to fill this field";};
};
if(!$submitted || !$fields_complete) {
echo ('
<form name="myform" action="'.$_SERVER['PHP_SELF'].'" method="get">
<input name="a" type="text" size="20" value="'.$f_a_def.'">
'.$f_a_err.'<br>
<input name="b" type="text" size="20" value="'.$f_b_def.'">
'.$f_b_err.'<br>
<input name="c" type="text" size="20" value="'.$f_c_def.'">
'.$f_c_err.'<br>
<input value="submit" type="submit" onClick="self.location.href=\'\'">
</form>
');
};
if(@$fields_complete) {
echo ("all fields filled");
};
?>
--- End Message ---
--- Begin Message ---
A friend of mine took a tutorial at OSCON 2002 (he thinks it was "Intorduction
to PHP") and said that Rasmus had provided a full working version of a class
to handle sessions. While I was at the conference I did not go to that
tutorial (or was it a session?) and so I did not see it. I am wondering if
anyone has a link to it. I looked at pres.php.net and couldn't see anything
Thanks!
--- End Message ---
--- Begin Message ---
http://conf.php.net/oscon2002
Happy hacking.
Chris
[EMAIL PROTECTED] wrote:
>A friend of mine took a tutorial at OSCON 2002 (he thinks it was "Intorduction
>to PHP") and said that Rasmus had provided a full working version of a class
>to handle sessions. While I was at the conference I did not go to that
>tutorial (or was it a session?) and so I did not see it. I am wondering if
>anyone has a link to it. I looked at pres.php.net and couldn't see anything
>
--- End Message ---
--- Begin Message ---
You should always use a full URL in a Location header. Though browsers
may handle improper uses of this header, it is still a bad practice.
Happy hacking.
Chris
Krzysztof Dziekiewicz wrote:
>>On Wed, 11 Sep 2002, Meltem Demirkus wrote:
>>
>>
>>>I want to know if there is any way to send data in
>>>header("Location:login.php") .I know how to send like this <a
>>>href=\"login.php?id=$ID\"> but I need to use header and I dont know howto
>>>do this?...
>>>
>>>
>>header( "Location: login.php?id=${ID}" );
>>
>>
>What for {} ?
>Rather: header( "Location: login.php?id=$ID" );
>
--- End Message ---
--- Begin Message ---
I'm trying to take a certain string from a USGS site that gives real time
water levels and water heights for a certain location and insert it into a
table using php.
I'd like to open and read some of the lines in the USGS table - but not all.
The output from the script - which doesn't have the fopen() and fread()
commands below - gives me the string and then the table headers.
I'd like to transpose it so that the table headers appear first and then the
data from the USGS file is inserted within the columns below.
Thank you.
Tony Ritter
....................................................................
<?
echo "<TABLE BORDER=1>";
echo "<TR><TH>USGS
Station</TH><TH>Location</TH><TH>Date</TH><TH>Time</TH><TH>Level</TH>";
$words1="01427510 DELAWARE RIVER AT CALLICOON NY 09/11 13:15 2.88";
$regexp="0.[A-Z,a-z,0-9]....................................................
.....";
if (ereg($regexp,$words1,$reg))
echo "$reg[0]";
echo "</TABLE>";
?>
--- End Message ---
--- Begin Message ---
i'm not sure if i follow you. i have never used ldap to write
authentication scripts as i've only used the .htaccess method.
to retrieve data you need to bind using a username/password combination
that is valid. i guess you could test your user's username/password by
using it to attempt a bind.
the following is copied verbatim from the manual's user notes:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
[EMAIL PROTECTED] (03-Jan-2002 11:46)
It took quite a while to figure out how to do LDAP authentication as
there wasn't a complete example ... just some cryptic notes about
passwords. So, here's what I came up with that works for me:
// $inp_uid contains the user id to be authenticated
// $inp_passwd contains the plain text password to be authenticated
$ds=ldap_connect("ldap.someserver.com");
//substitute the real host name in the previous statement
if ($ds) {
$r=@ldap_bind($ds); // this is an anonymous bind
$st_search="uid=$res_uid";
// need to set the right root search information in next statement.
// Your requirement may be different
$sr=ldap_search($ds,"ou=mycompany.com,o=My Company", "$st_search");
$info = ldap_get_entries($ds, $sr);
for ($i=0; $i<$info["count"]; $i++) {
$dn=$info[$i]["dn"];
}
// I now know the dn needed to authenticate
// now bind to see if the uid and password work
// the password is still plain text
$r=@ldap_bind($ds, $dn, $inp_passwd);
if ($r) {
$str_passok="Yes";
// ldap_bind will return TRUE if everything matches
} else {
$str_passok="No";
// otherwise ldap_bind will return FALSE
}
ldap_close($ds);
} else {
$error_string="Error -- unable to connect to ldap.someserver.com";
}
I'm sure that there's more error checking that needs to be done, but
this provides the basic skeleton....
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Joshua
Richard Whittaker wrote:
>>If on the other hand you actually want to retrieve data from your LDAP
>>system then i suggest reading the manual. it's not actually a lot harder
>>that connecting to RDBMS.
>>
>>I managed to get a working script straight off the manual page.
>>http://www.php.net/manual/en/ref.ldap.php
>
>
> Unfortunately, what I know about LDAP would fit on the head of a very small
> object (I.E. a pin), so I'm still getting used to the whole idea of LDAP...
>
> So, with NDS, I would just do an ldp_bind to the proper tree, with a
> username and password, and testing for that would tell me if the
> Username/Password combination is valid, or would there be something further
> I'd have to do?....
>
> Thanks!
> Richard W.
>
>
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> Hi guys,
>
> I never can get mysql_insert_id?
> Is this broken with PHP4?
> Please let me know if you can get it to work. or work around.
>
> Thanks.
I have had no problem with it - perhaps if you could show the list your
code someone might be able to see if you have a problem there.
--
David Robley
Temporary Kiwi!
Quod subigo farinam
--- End Message ---
--- Begin Message ---
Grrrrrrr!
Just spent ages (well, 2hours) on a precaching system for my PHP code that
didn't work out!
Hang on, I'll backtrack a bit...
My website is using a php engine that picks at snippets of html from the
database, and builds them up to form the page.
A typical page may use 5 of these html snippets, each at maybe 5kb in size.
I was sat thinking, looking at the debug-timer, and saw that the templates
were one of the more time consuming aspects.
So I said, I know, I'll save the db a bit, and at the start of the script,
read all the templates that I'll need into a global variable, and call them
from that.
Simple, 5 db calls put into 1, and templates taken out of memory.
So why, oh why, has the time taken actually increased??? Does anyone have
sufficient working knowledge of PHP to give me a hint at why this has
happened?
Also, am I right in thinking that as the website hits increase, the db will
be put under increasing pressure, so it serves off better being called only
once instead of 5 times (Even though more data is taken out of it??).
It's late, my eyes are blurring, and I'm annoyed. Very annoyed!
Regards,
Andy
--- End Message ---
--- Begin Message ---
Is there a way to encrypt a large tar file (60+ megs) in a way that it can
be decrypted ...? RH Linux 7.2, PHP 4.06
TIA --
Bob.
--- End Message ---
--- Begin Message ---
Maybe "reversible hashing of a tar file" is a better way to describe what I
need ... I want to make a tar file unreadable (at least can't be
uncompressed) by anyone who doesn't know the key.
Bob.
At 10:43 AM 9/12/2002 +1000, Martin Towell wrote:
>something to do with private and public keys - but don't ask me how to do it
>in PHP
>Hope that leads you on the right path
>Martin
>
>
>-----Original Message-----
>From: Bob Bowker [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, September 12, 2002 10:49 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Need 2-way encryption
>
>
>Is there a way to encrypt a large tar file (60+ megs) in a way that it can
>be decrypted ...? RH Linux 7.2, PHP 4.06
>
>TIA --
>
>Bob.
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi!
Again, problem to convert chars.
example:
$name = "mattson-hedman" # correct format is Mattson-Hedman, but user
can write in many ways. $name came from db.
so how I can convert this $name format "Mattson-Hedman". First name
first-letter is easy, but how about second-name first-letter H. There
are always char '-' before char which should be convert.
gustavus
--- End Message ---
--- Begin Message ---
On Thu, 12 Sep 2002 05:21:01 +0300, you wrote:
[...]
>$name = "mattson-hedman" # correct format is Mattson-Hedman, but user
>can write in many ways. $name came from db.
>
>so how I can convert this $name format "Mattson-Hedman".
[...]
Try this:
function uc_all ($str) {
$temp = preg_split('/(\W)/', $str, -1,PREG_SPLIT_DELIM_CAPTURE);
foreach ($temp as $key => $word) {
$temp[$key] = ucfirst(strtolower($word));
}
return join ('', $temp);
}
--- End Message ---
--- Begin Message ---
hi all,
sorry for disturb all of u for a while...
there's anyone can hel me...??
i'm a beginner in PHPer...
right now... i'm trying to make 2 frames in one file...
example..
setup.php as main program with 2 frame
then i want to call dispsetup.php and display it in second frame...
how the way to make the syntax...??
thanks before all... ^_^
--- End Message ---
--- Begin Message ---
this is more of an HTML question. You'll probably be wanting to look at
<frameset> and <frame>
-----Original Message-----
From: dinnie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 12:59 PM
To: Milist PHP
Subject: [PHP] frame
hi all,
sorry for disturb all of u for a while...
there's anyone can hel me...??
i'm a beginner in PHPer...
right now... i'm trying to make 2 frames in one file...
example..
setup.php as main program with 2 frame
then i want to call dispsetup.php and display it in second frame...
how the way to make the syntax...??
thanks before all... ^_^
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
Is there a function that will auto refresh a page?
Thanks in advance,
-Peter
--- End Message ---
--- Begin Message ---
That's actually an HTML function. Just insert this in the <HEAD>...</HEAD>
tags:
<meta http-equiv="refresh" content="2;URL=www.php.net">
If you want it to refresh itself, use:
<meta http-equiv="refresh" content="2">
In either case, replace "2" with the number of seconds to wait from the time
the page finishes loading before refreshing.
Lewis
"Peter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> Is there a function that will auto refresh a page?
>
> Thanks in advance,
> -Peter
>
>
--- End Message ---
--- Begin Message ---
yeah have a look at ur meta tags.. ie meta refreash
> -----Original Message-----
> From: Peter [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 12 September 2002 1:56 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] refresh function?
>
>
> Hi,
> Is there a function that will auto refresh a page?
>
> Thanks in advance,
> -Peter
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I've been reading the XML parser documention, and I'm not having much luck.
I want to be able to handle the tag <mytag value="x<y"/>, but the parser
keeps telling me that it's not formed correctly (because of the "<" in the
quotes). But shouldn't it ignore that as a tag-opening "<" since it's inside
quotes?? Anyway, is there an option I can set to allow this??
If not, is there a XML parser class that anyone would recommend? I like the
fact that the built in one has the ability to call different subroutines
based on the the tag information. Are there any like that which would
support the use of < and > in quotes??
Thanks all!
Lewis
--- End Message ---
--- Begin Message ---
could you change the "<" to "<" or "%3C" or something similar?
-----Original Message-----
From: OrangeHairedBoy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 1:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] XML Parser Question
I've been reading the XML parser documention, and I'm not having much luck.
I want to be able to handle the tag <mytag value="x<y"/>, but the parser
keeps telling me that it's not formed correctly (because of the "<" in the
quotes). But shouldn't it ignore that as a tag-opening "<" since it's inside
quotes?? Anyway, is there an option I can set to allow this??
If not, is there a XML parser class that anyone would recommend? I like the
fact that the built in one has the ability to call different subroutines
based on the the tag information. Are there any like that which would
support the use of < and > in quotes??
Thanks all!
Lewis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Yeah...i should have mentioned I had thought of that...but I really don't
want to :)
It just doesn't look right when it's a math expression. Know a permenant
solution?
Lewis
"Martin Towell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> could you change the "<" to "<" or "%3C" or something similar?
>
> -----Original Message-----
> From: OrangeHairedBoy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 1:59 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] XML Parser Question
>
>
> I've been reading the XML parser documention, and I'm not having much
luck.
>
> I want to be able to handle the tag <mytag value="x<y"/>, but the parser
> keeps telling me that it's not formed correctly (because of the "<" in the
> quotes). But shouldn't it ignore that as a tag-opening "<" since it's
inside
> quotes?? Anyway, is there an option I can set to allow this??
>
> If not, is there a XML parser class that anyone would recommend? I like
the
> fact that the built in one has the ability to call different subroutines
> based on the the tag information. Are there any like that which would
> support the use of < and > in quotes??
>
> Thanks all!
>
> Lewis
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
says...
> Hi,
>
> does that mean I can do nothing about it?
>
> Alva
>
> "Pekka Saarinen" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > At 9/10/2002, you wrote:
> > >Hi Everyone,
> > >
> > >I did a simple test with this script:
> > >
> > ><?php
> > >mail("[EMAIL PROTECTED]", "test", "this is a test mail");
> > >echo "done";
> > >?>
> > >
> > >I run the script from web accounts on different servers. I can receive
> the
> > >test mail from some but not from others. Is there any configurations that
> I
> > >am missing here?
> >
> > My guesses:
> >
> > Many mail servers are configured so that they send mail only if the sender
> > receives mail at the same time. One other possible pitfall is that reverse
> > IP lookup is not working correctly and your server rejects the mail as it
> > cannot verify the sender host. Also, many (well configured) servers do not
> > send when there is no live account for that sender.
You can use the fourth argument to mail() to set additional headers, such
as From: [EMAIL PROTECTED] to try and get around the
problem.
--
David Robley
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
--- End Message ---