Re: [PHP] phpMyAdmin

2002-08-20 Thread @ Edwin
All depends on your host and how phpMyAdmin was configured. It's better to 
ask them directly...

- E

>
>Is it possible to use phpMyAdmin to add new databases (not tables whole
>databases) to my website? I ask because currently my host has provided
>me with one database and I don't want to mix database tables when adding
>new features (such as shopping carts and bulletin boards)? I am new to
>MySQL and PHP so would like some advice, is the way I describe
>(databases for each website function) a good way to design or should I
>have all my functions in one large database?
>
>Steve Jackson
>Web Developer
>Viola Systems Ltd.
>http://www.violasystems.com
>[EMAIL PROTECTED]
>Mobile +358 50 343 5159
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
$B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!&E>?&(B 
http://career.msn.co.jp/


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


[PHP] phpMyAdmin

2002-08-20 Thread Steve Jackson

Is it possible to use phpMyAdmin to add new databases (not tables whole
databases) to my website? I ask because currently my host has provided
me with one database and I don't want to mix database tables when adding
new features (such as shopping carts and bulletin boards)? I am new to
MySQL and PHP so would like some advice, is the way I describe
(databases for each website function) a good way to design or should I
have all my functions in one large database?

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159




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




Re: [PHP] How Do You Protect Individual Files

2002-08-20 Thread Justin French

On Wednesday 21 August 2002 10:54, Roger Lewis wrote:

> I did, but like I said, I couldn't find much.  Maybe I wasn't using the
> correct key words.  There is a lot about protecting php and html files but
> not much on other, non-php files in external directories.  There is some
> discussion about .htaccess, but I know nothing about this.  Is that the way
> to do it, or can it be done with php.


In real short, you want to store the files outside your htdocs root (so they
can't be served by http), OR restrict them from being served by using a
htaccess file (try an apache list, the apache site, or your ISP sys admin).

Then, you want to serve those files THROUGH a PHP script.  Usually these
scripts will:

- authenticate a user
- set the right mime-type header for the file type using header()
- parse the requested file though the PHP script to the browser



There were a few recent threads on this... search for the following subject
lines in the archives:

- Authenticate files downloads
- secure files acess


Finally, there is a decent script/article/tutorial on the Zend site (another
place you should have looked), which is the basis for my code at the moment.

http://www.zend.com/zend/trick/tricks-august-2001.php



Justin French


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




Re: [PHP] passing checkbox info

2002-08-20 Thread Jaski

1)Name value pairs of check boxes which are checked will be 
returned.
2)To figure out which check box is returning "yes" you can use the 
keys of the cbox[] array which is returned. That is if your query 
returns 10 rows .. and user checks checkbox 1,3 and 5 out of those 
.. then $cbox[0], $cbox[2],$cbox[4] .. will have values "yes".

3)Then you can use $checked = array_keys($cbox) .. and $checked 
will be an array having all the keys of returned cbox array. ie 
(0,2,4) in the above case.

HTH
Jaski

On Wed, 21 Aug 2002 Brian & Shannon Windsor wrote :
>I'm trying to use checkboxes to be able to delete information 
> from my
>database.  It's just not working right.  I can't get the checkbox 
>form to
>pass a variable that makes any sense to me, and I looked into the 
>check box
>function, and it made less sense.  The value passed back from the 
>check
>boxes are always "yes", but there is nothing to tell which box 
>passed it
>back.  Maybe I don't know enough about the check boxes in 
>general.  Any help
>is appreciated.
>
>I'm displaying the checkboxes as I display the data from the 
>database. Can I
>tie in the checkboxes to one of the fields that i could then use 
>to delete
>that entry?
>
>Thanks,
>
>Brian
>
>while ($row = mysql_fetch_row($result))
>{
>  echo "\n";
>   {
>?>
>
>
>   echo "";
>echo "height='50'
>border='0'>";
>   echo "";
>echo $row[1];
>   echo "";
>echo $row[2];
>   echo "";
>echo $row[3];
>   echo "";
>echo $row[4];
>   echo "";
>echo $row[5];
>   echo "";
>echo $row[6];
>   echo "";
>echo $row[7];
>   echo "";
>echo $row[8];
>   echo "\n";
>   }
>
>  echo "\n";
>
>}
>
>echo "";
>
>?>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] How Do You Protect Individual Files

2002-08-20 Thread Jason Wong

On Wednesday 21 August 2002 10:54, Roger Lewis wrote:

> I did, but like I said, I couldn't find much.  Maybe I wasn't using the
> correct key words.  There is a lot about protecting php and html files but
> not much on other, non-php files in external directories.  There is some
> discussion about .htaccess, but I know nothing about this.  Is that the way
> to do it, or can it be done with php.

Try "protect file download" or something along those lines.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Don't make a big deal out of everything; just deal with everything.
*/


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




RE: [PHP] passing checkbox info

2002-08-20 Thread Martin Towell


replace "xxx" with the row number for your id field

when it gets to php, the index of $cbox will be the id from the database,
just use:
   foreach ($cbox as $id=>$dummy)
to loop through the array

HTH
Martin

-Original Message-
From: Brian & Shannon Windsor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 2:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing checkbox info


I'm trying to use checkboxes to be able to delete information from my
database.  It's just not working right.  I can't get the checkbox form to
pass a variable that makes any sense to me, and I looked into the check box
function, and it made less sense.  The value passed back from the check
boxes are always "yes", but there is nothing to tell which box passed it
back.  Maybe I don't know enough about the check boxes in general.  Any help
is appreciated.

I'm displaying the checkboxes as I display the data from the database. Can I
tie in the checkboxes to one of the fields that i could then use to delete
that entry?

Thanks,

Brian

while ($row = mysql_fetch_row($result))
{
 echo "\n";
  {
?>


";
   echo "";
  echo "";
   echo $row[1];
  echo "";
   echo $row[2];
  echo "";
   echo $row[3];
  echo "";
   echo $row[4];
  echo "";
   echo $row[5];
  echo "";
   echo $row[6];
  echo "";
   echo $row[7];
  echo "";
   echo $row[8];
  echo "\n";
  }

 echo "\n";

}

echo "";

?>



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

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




[PHP] passing checkbox info

2002-08-20 Thread Brian & Shannon Windsor

I'm trying to use checkboxes to be able to delete information from my
database.  It's just not working right.  I can't get the checkbox form to
pass a variable that makes any sense to me, and I looked into the check box
function, and it made less sense.  The value passed back from the check
boxes are always "yes", but there is nothing to tell which box passed it
back.  Maybe I don't know enough about the check boxes in general.  Any help
is appreciated.

I'm displaying the checkboxes as I display the data from the database. Can I
tie in the checkboxes to one of the fields that i could then use to delete
that entry?

Thanks,

Brian

while ($row = mysql_fetch_row($result))
{
 echo "\n";
  {
?>


";
   echo "";
  echo "";
   echo $row[1];
  echo "";
   echo $row[2];
  echo "";
   echo $row[3];
  echo "";
   echo $row[4];
  echo "";
   echo $row[5];
  echo "";
   echo $row[6];
  echo "";
   echo $row[7];
  echo "";
   echo $row[8];
  echo "\n";
  }

 echo "\n";

}

echo "";

?>



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




RE: [PHP] How Do You Protect Individual Files

2002-08-20 Thread Roger Lewis



On Wednesday 21 August 2002 08:59, Roger Lewis wrote:
> I haven't been able to find much on this subject in the archives.
>
> Using sessions I have been able to have the server validate the user's
> access level before serving him a page.   I put include files on each page
> that I want authenticated.  This is all well and good, except on my pages
> there are links to non-html, and non-php files that are stored in document
> directories on the server.
>
> How, on a file-by-file basis, do I ensure that the user is authorized to
> download these files?  If he gets to them through the link I provide, this
> is acceptable because he is already authorized to view the page that the
> link is on.  However, if he somehow knows the full path to the file, he
can
> get to it directly, bypassing the link and overriding the authentication
> system.


On Tuesday, August 20, 2002 7:24 PM, Jason Wong wrote:
 < Try searching the archives. It has been discussed many times before.


Jason,
I did, but like I said, I couldn't find much.  Maybe I wasn't using the
correct key words.  There is a lot about protecting php and html files but
not much on other, non-php files in external directories.  There is some
discussion about .htaccess, but I know nothing about this.  Is that the way
to do it, or can it be done with php.
Roger



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


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




Re: [PHP] patch for sablotron

2002-08-20 Thread Tom Rogers

Hi,

Wednesday, August 21, 2002, 6:21:30 AM, you wrote:
G> I have been struggling to compile php(4.2.2, mandrake 8.2, apache
G> 1.3.26) with xslt support for over 3 days now. I can configure with
G> trouble like this: 
G> ./configure \ 
G> --with-apxs=/usr/lib/apache/bin/apxs \ 
G> --with-sybase=/usr/local/freetds \ 
G> --with-mysql \ 
G> --enable-xslt \ 
G> --with-xslt-sablot 

G> then make 
G> I get loads of errors in sablot.c including line 154 multiple definition
G> of 'SXPF_SUPPORTS_UNPARSED_ENTITIES'

G> so I noticed the sablotron site has 2 php patches here that appear to
G> fix this:
G> http://www.gingerall.com/charlie/ga/xml/d_sab.xml

G> HOW do I apply the patches??

>From the same site :)

To apply a patch, copy it to the Sablotron root directory (Sablot-x.xx)
and type: patch -p1 < patch_filename


-- 
regards,
Tom


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




Re: [PHP] xslt extensions

2002-08-20 Thread Tom Rogers

Hi,

Wednesday, August 21, 2002, 8:26:29 AM, you wrote:
G> Is there a soul who has the xslt extensions compiled with php 4.2.2,
G> sablotron 0.95 and expat 1.95.4  and working on Linux who is willing to
G> give me some tips?

G> I have tried the suggestions here:
G> http://www.php.net/manual/en/ref.xslt.php

G> here:
G> http://phpfaq.info/#id98

G> and the patches here:
G> http://www.gingerall.com/charlie/ga/xml/d_sab.xml

G> all to no avail. make always fails due to errors in
G> [phpsourcedir]/ext/xslt/sablot.c

G> Thank you

I could not get 0.95 to compile, I had to go back to version 0.90

-- 
regards,
Tom


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




Re: [PHP] sort()-help needed

2002-08-20 Thread Jason Wong

On Wednesday 21 August 2002 06:41, Øystein Håland wrote:
> "Put them into an array and sort() the array.  The loop through the sorted
> array and output at that point."
>
> Just what I try. But, because of my lack of understanding, the output is my
> problem:
>

You're not doing what has been suggested above. See comments below.

1) In your while loop only read in the filenames into an array (discarding '.' 
and '..').

2) Then sort the array.

3) Then use a foreach to loop through the array elements to create the links.

> function createLinks() {
>  $p = 0;
>  $handle=opendir(".");
>  echo "\n";
>  while ($file = readdir($handle)){
You've read in a filename

>   $files[] = $file;
And added it to the array

>   $sorted = sort($files);
Then sort the array, but why? You haven't read in ALL the files yet so why 
sort now? Also you're not using the results of the sorted filenames ($sorted) 
anywhere else in your code.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The Anglo-Saxon conscience does not prevent the Anglo-Saxon from
sinning, it merely prevents him from enjoying his sin.
--Salvador De Madariaga
*/


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




Re: [PHP] How Do You Protect Individual Files

2002-08-20 Thread Jason Wong

On Wednesday 21 August 2002 08:59, Roger Lewis wrote:
> I haven't been able to find much on this subject in the archives.
>
> Using sessions I have been able to have the server validate the user's
> access level before serving him a page.   I put include files on each page
> that I want authenticated.  This is all well and good, except on my pages
> there are links to non-html, and non-php files that are stored in document
> directories on the server.
>
> How, on a file-by-file basis, do I ensure that the user is authorized to
> download these files?  If he gets to them through the link I provide, this
> is acceptable because he is already authorized to view the page that the
> link is on.  However, if he somehow knows the full path to the file, he can
> get to it directly, bypassing the link and overriding the authentication
> system.

Try searching the archives. It has been discussed many times before.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Dealing with the problem of pure staff accumulation,
all our researches ... point to an average increase of 5.75% per year.
-- C.N. Parkinson
*/


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




Re: [PHP] Online Host Management Software

2002-08-20 Thread Jason Reid

There are quite a few options, but unless you have root access to the
server, most you cant implement. not all of them are php based, but heres
the list:

free:
simplecp (perl)
webmin (perl, not the greatest for hosting)

cost:
cpanel
plesk
hsphere
ensim

there are others, one suggestion is search through the control panel forum
at www.webhostingtalk.com for other suggestions, and peoples opinions on the
different panels.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: "Justin French" <[EMAIL PROTECTED]>
To: "John S. Huggins" <[EMAIL PROTECTED]>; "php list"
<[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 7:47 PM
Subject: Re: [PHP] Online Host Management Software


> My Host runs Plesk, and I tolerate it.
>
> It aint perfect though.
>
>
> Justin French
>
>
>
> on 21/08/02 7:01 AM, John S. Huggins ([EMAIL PROTECTED]) wrote:
>
> >
> > I have been looking around for a solution to provide my customers with a
> > control panel that will allow them to control the basics including mail
> > account, dns, etc.
> >
> > My hosting is strictly a PHP/MySQL shop so I wonder if any of you can
> > suggest control panels that you like and/or tolerate.
> >
> > **
> >
> > John Huggins
> > VANet
> >
> > [EMAIL PROTECTED]
> > http://www.va.net/
> >
> > **
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




RE: [PHP] Sorting a multi-dimensional array

2002-08-20 Thread Martin Towell

http://www.php.net/manual/en/function.usort.php

-Original Message-
From: Ben [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 11:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sorting a multi-dimensional array


I have looked at array_multisort, asort, etc. NONE of them do what I need.

My array looks like this:

$array[0][0] = First Id;
$array[0][1] = First Name;
$array[0][2] = First Rating;

$array[1][0] = Second Id;
$array[1][1] = Second Name;
$array[1][2] = Second Rating;

$array[2][0] = Third Id;
$array[2][1] = Third Name;
$array[2][2] = Third Rating;


Now, I want to sort the array (very very fast if possible cuz the array is
huge...150 such values) based on the "Rating" for each candidate, which is
the third column inside this matrix array. How should I ask PHP to do this?
Also, when I do sort by the Rating I want the ID and the name to remain the
same for each candidate, i.e., I want the indexes to be maintained.

HELP!

Thanks in advance
Ben



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

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




Re: [PHP] Protocol on handling empty checkbox values

2002-08-20 Thread Justin French

Oooops!

Go back to isset() or emoty()

Justin




on 21/08/02 9:48 AM, David Yee ([EMAIL PROTECTED]) wrote:

> Doh- just discovered that this won't work for updates (e.g. if value is
> already = 'Y' and you uncheck the box it'll stay as 'Y').
> 
> David
> 
>> To throw in a curve-ball, you can set the default value for your MySQL
>> column to 'N', which means that any value you DON'T write will be 'N', and
>> those you do will be 'Y'.
>> 
>> 
>> Justin French
>> 
>> 
>> 
>> 
>> 
>> on 17/08/02 4:24 AM, David Yee ([EMAIL PROTECTED]) wrote:
>> 
>>> Hi all.  For a universal form script I'm writing I want to store a 'Y'
> in a
>>> table field if a checkbox is checked and an 'N' if it's not.  The
> problem is
>>> that when the form is posted if the checkbox is not checked the checkbox
>>> variable is not passed.  E.g.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but
> if
>>> not $_POST['my_checkbox_var'] is not even set.  So what I've been doing
> is
>>> putting the variable names of the checkbox fields into an array,
> serializing
>>> it, and then pass the string as a hidden input on the form.  Then in the
>>> page that handles the POST I unserialize the array to determine if
> checkbox
>>> fields were passed and then handle accordingly.  But I'm wondering is
> there
>>> a better way (or at least a standard way) of doing this?
>>> 
>>> David
>>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> 


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




Re: [PHP] Online Host Management Software

2002-08-20 Thread Justin French

My Host runs Plesk, and I tolerate it.

It aint perfect though.


Justin French



on 21/08/02 7:01 AM, John S. Huggins ([EMAIL PROTECTED]) wrote:

> 
> I have been looking around for a solution to provide my customers with a
> control panel that will allow them to control the basics including mail
> account, dns, etc.
> 
> My hosting is strictly a PHP/MySQL shop so I wonder if any of you can
> suggest control panels that you like and/or tolerate.
> 
> **
> 
> John Huggins
> VANet
> 
> [EMAIL PROTECTED]
> http://www.va.net/
> 
> **
> 


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




[PHP] Sorting a multi-dimensional array

2002-08-20 Thread Ben

I have looked at array_multisort, asort, etc. NONE of them do what I need.

My array looks like this:

$array[0][0] = First Id;
$array[0][1] = First Name;
$array[0][2] = First Rating;

$array[1][0] = Second Id;
$array[1][1] = Second Name;
$array[1][2] = Second Rating;

$array[2][0] = Third Id;
$array[2][1] = Third Name;
$array[2][2] = Third Rating;


Now, I want to sort the array (very very fast if possible cuz the array is
huge...150 such values) based on the "Rating" for each candidate, which is
the third column inside this matrix array. How should I ask PHP to do this?
Also, when I do sort by the Rating I want the ID and the name to remain the
same for each candidate, i.e., I want the indexes to be maintained.

HELP!

Thanks in advance
Ben



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




[PHP] How Do You Protect Individual Files

2002-08-20 Thread Roger Lewis

I haven't been able to find much on this subject in the archives.

Using sessions I have been able to have the server validate the user's
access level before serving him a page.   I put include files on each page
that I want authenticated.  This is all well and good, except on my pages
there are links to non-html, and non-php files that are stored in document
directories on the server.

How, on a file-by-file basis, do I ensure that the user is authorized to
download these files?  If he gets to them through the link I provide, this
is acceptable because he is already authorized to view the page that the
link is on.  However, if he somehow knows the full path to the file, he can
get to it directly, bypassing the link and overriding the authentication
system.

Thanks for any help on this question.

Roger Lewis


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




[PHP] Help with COM objects in PHP

2002-08-20 Thread Kyle

I have included my code below.  This is my first experience trying to use
COM objects in PHP.  My problem is that the
foreach loop does not output anything, regardless of whether or not there
are files in the folder.  Can anyone tell me what is wrong with my script?
Thanks for any help.

   Kyle





FolderExists($objPath))
  {
   print "folder exists";

   $objFolder = $objFileManager->GetFolder($objPath);

   $objFolder->Path;

   $fileCollection = $objFolder->Files;


   foreach ( $fileCollection as $file ){

print $file->Path;
   }

  }
  else
   print "doesnt exist";


?>




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




Re: [PHP] Protocol on handling empty checkbox values

2002-08-20 Thread David Yee

Doh- just discovered that this won't work for updates (e.g. if value is
already = 'Y' and you uncheck the box it'll stay as 'Y').

David

> To throw in a curve-ball, you can set the default value for your MySQL
> column to 'N', which means that any value you DON'T write will be 'N', and
> those you do will be 'Y'.
>
>
> Justin French
>
>
>
>
>
> on 17/08/02 4:24 AM, David Yee ([EMAIL PROTECTED]) wrote:
>
> > Hi all.  For a universal form script I'm writing I want to store a 'Y'
in a
> > table field if a checkbox is checked and an 'N' if it's not.  The
problem is
> > that when the form is posted if the checkbox is not checked the checkbox
> > variable is not passed.  E.g.
> >
> > 
> > 
> > 
> >
> > If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but
if
> > not $_POST['my_checkbox_var'] is not even set.  So what I've been doing
is
> > putting the variable names of the checkbox fields into an array,
serializing
> > it, and then pass the string as a hidden input on the form.  Then in the
> > page that handles the POST I unserialize the array to determine if
checkbox
> > fields were passed and then handle accordingly.  But I'm wondering is
there
> > a better way (or at least a standard way) of doing this?
> >
> > David
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP] PHP <-> JBOSS

2002-08-20 Thread Seth Northrop


Hi,

I'm curious if anyone has integrated PHP with Jboss and jetty or tomcat.
We are working on a J2EE application and would like PHP to be able to
interface with the JBOSS server (exchange of data and data structures).
SOAP seems like a logical choice, but, I don't know how developed (alpha)
the PHP-SOAP project is.  Therefore, I'm looking for alternatives (or
reassurances that PHP-SOAP will efficently communicate back and forth with
J2EE) to SOAP or PHP-SOAP.

Thanks in advance!



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




Re: [PHP] sort()-help needed

2002-08-20 Thread Øystein Håland

"Put them into an array and sort() the array.  The loop through the sorted
array and output at that point."

Just what I try. But, because of my lack of understanding, the output is my
problem:

function createLinks() {
 $p = 0;
 $handle=opendir(".");
 echo "\n";
 while ($file = readdir($handle)){
  $files[] = $file;
  $sorted = sort($files);
  if (($file == ".") || ($file == "..") || ($file == basename ($PHP_SELF)))
{ continue; }
  if(is_file($file)) {
$p++;
   $linktext = ucfirst ($file);
$linktext = substr_replace ($linktext,'',-4);
   echo "$linktext\n";
  }
 for($i = 0; $i < $p; $i++) {
//something here
 }
 echo "\n";
 return true;
}
?>



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




[PHP] Re: cURL and POST

2002-08-20 Thread Samantha Savvakis

Thanks for that. I'll look into it.

Sam

"Lallous" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try to post it via other than CURL,
>
> http://Sloppycode.net  and search for clsHtmlSource.php
>
> Good luck,
> Elias
> "Samantha Savvakis" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > HI,
> >
> > I'm using the cURL binary to perform a HTTP POST to a web page. I am
> sending
> > XML data to this web page.
> >
> > The issue I've come up against if the size of the data that I'm trying
to
> > post and it looks like cURL is crapping out.
> >
> > This is the command line that I'm currently using:
> >
> > /usr/local/bin/curl -m 600 -d "$strXML"
http://myurl.com/webpage.php -L -s
> >
> > $strXML - variable containing the XML data. I run this command using
> "exec".
> >
> > The return code I receive is: 127. This means a fatal error has occured
> with
> > cURL but that's all I know.
> >
> > I have read the detail about using the -F option. I do not want to POST
> the
> > "file" as such, but rather the "DATA" in the file is I create a file of
> the
> > XML. The manpage for cURL states:
> >
> > "-F : To just get  the content part from a file, prefix the file name
with
> > the letter <. The difference between @ and < is then that @ makes a file
> get
> > attached in the post as a file upload, while the < makes a text field
and
> > just  get  the contents for that text field from a file."
> >
> > So I've tried going:
> >
> > /usr/local/bin/curl -m 600 -F  > http://myurl.com/webpage.php -L -s
> >
> > /tmp/tempfile.xml - contains the XML data. This isn't working.I'm
getting
> a
> > return code of "2" meaning: "Failed to initialize".
> >
> > I'm at a loss. I need to post this large amount of XML data to a remote
> site
> > and don't know how to get it there.
> >
> > Any ideas?
> >
> > Thanks,
> > Sam
> >
> >
> >
> >
> >
>
>



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




[PHP] xslt extensions

2002-08-20 Thread Geoff

Is there a soul who has the xslt extensions compiled with php 4.2.2,
sablotron 0.95 and expat 1.95.4  and working on Linux who is willing to
give me some tips?

I have tried the suggestions here:
http://www.php.net/manual/en/ref.xslt.php

here:
http://phpfaq.info/#id98

and the patches here:
http://www.gingerall.com/charlie/ga/xml/d_sab.xml

all to no avail. make always fails due to errors in
[phpsourcedir]/ext/xslt/sablot.c

Thank you



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




Re: [PHP] sort()-help needed

2002-08-20 Thread Rasmus Lerdorf

Put them into an array and sort() the array.  The loop through the sorted
array and output at that point.

-Rasmus

On Wed, 21 Aug 2002, Øystein Håland wrote:

> When calling the function createLinks() I get an unsorted result, and that's
> NOT what I want. But I'm not able (lack of knowlegde) to sort the output
> (the links).
>
>   function createLinks() {
>  $handle=opendir(".");
>  echo "\n";
>  while ($file = readdir($handle)){
>   if (($file == ".") || ($file == "..") || ($file == "index.php") || ($file
> == basename ($PHP_SELF))) { continue; }
>   if(is_file($file)) {
>$linktext = ucfirst ($file);
>$linktext = substr_replace ($linktext,'',-4);
>echo "  $linktext\n";
>   }
>  }
>  echo "\n";
>
>  return true;
> }
> ?>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] sort()-help needed

2002-08-20 Thread Øystein Håland

When calling the function createLinks() I get an unsorted result, and that's
NOT what I want. But I'm not able (lack of knowlegde) to sort the output
(the links).

 \n";
 while ($file = readdir($handle)){
  if (($file == ".") || ($file == "..") || ($file == "index.php") || ($file
== basename ($PHP_SELF))) { continue; }
  if(is_file($file)) {
   $linktext = ucfirst ($file);
   $linktext = substr_replace ($linktext,'',-4);
   echo "  $linktext\n";
  }
 }
 echo "\n";

 return true;
}
?>



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




[PHP] patch for sablotron

2002-08-20 Thread Geoff

I have been struggling to compile php(4.2.2, mandrake 8.2, apache
1.3.26) with xslt support for over 3 days now. I can configure with
trouble like this: 
./configure \ 
--with-apxs=/usr/lib/apache/bin/apxs \ 
--with-sybase=/usr/local/freetds \ 
--with-mysql \ 
--enable-xslt \ 
--with-xslt-sablot 

then make 
I get loads of errors in sablot.c including line 154 multiple definition
of 'SXPF_SUPPORTS_UNPARSED_ENTITIES'

so I noticed the sablotron site has 2 php patches here that appear to
fix this:
http://www.gingerall.com/charlie/ga/xml/d_sab.xml

HOW do I apply the patches??



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




[PHP] Check Unix password in PHP

2002-08-20 Thread Simanhew

Hi all,

I am trying to check password that user typed with the one in Unix system.
Some tutorial(or PHP Manual) just retrieves content in /etc/passwd and
compare it, but
password could be stored in shadow, not in passwd; someone suggested to
write a tiny C code,
chown it to root, change sticky bit and run it in PHP; someone used ypcat to
compare it..

Personally I prefer to write a tiny C code, I just wonder if it is safe?


Is there any "Standard & Safe" way to do this job ?

Thanks in advance,

Siman






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




[PHP] patch for sablton

2002-08-20 Thread Geoff

I have been struggling to compile php(4.2.2, mandrake 8.2, apache
1.3.26) with xslt support for over 3 days now. I can configure with
trouble like this: 
./configure \ 
--with-apxs=/usr/lib/apache/bin/apxs \ 
--with-sybase=/usr/local/freetds \ 
--with-mysql \ 
--enable-xslt \ 
--with-xslt-sablot 

then make 
I get loads of errors in sablot.c including line 154 multiple definition
of 'SXPF_SUPPORTS_UNPARSED_ENTITIES'


so I noticed the sablotron site has 2 php patches here that appear to
fix this:
http://www.gingerall.com/charlie/ga/xml/d_sab.xml

(here is where I reveal my 



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




RE: [PHP] odbc_do()

2002-08-20 Thread Jay Blanchard

[snip]
Not sure if this is the right place to ask. But here it goes. I'm using PHP
4.0.6 and trying to find a way to insert single quoted data. Some of the
values in the INSERT statement are single, double quoted, or use
backslashes. I cannot seem to use an escape character to input these special
characters into an Access database using ODBC. Here's the resulting error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error
in query expression ''[\']hello[\']', SQL state 37000 in SQLExecDirect in
c:\inetpub\wwwroot\blah.php on line 23 INSERT INTO blah (id, title)  VALUES
(10,'[\']hello[\']')

The original string was [']hello['].
If you can help I would greatly appreciate it, if not could you direct me to
the appropriate place.
[/snip]

Are magic quotes turned on in your php.ini? If so you do not have to escape
quotes, they are escaped magically for you. A better bet is to turn magic
quotes off and use addslashes();

http://www.php.net/manual/en/function.addslashes.php

HTH!

Jay

***
* Texas PHP Developers Conf  Spring 2003  *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* San Antonio Area PHP Developers Group   *
* Interested? Contact [EMAIL PROTECTED] *
***



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




[PHP] odbc_do()

2002-08-20 Thread Clayton Butler

Not sure if this is the right place to ask. But here it goes. I'm using PHP
4.0.6 and trying to find a way to insert single quoted data. Some of the
values in the INSERT statement are single, double quoted, or use
backslashes. I cannot seem to use an escape character to input these special
characters into an Access database using ODBC. Here's the resulting error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error
in query expression ''[\']hello[\']', SQL state 37000 in SQLExecDirect in
c:\inetpub\wwwroot\blah.php on line 23 INSERT INTO blah (id, title)  VALUES
(10,'[\']hello[\']')

The original string was [']hello[']. 
If you can help I would greatly appreciate it, if not could you direct me to
the appropriate place.

Clayton Butler
-- Aphex Imaging
-- System Administrator 
-- 519.332.0160 | x291



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




[PHP] Re: phpMyAdmin is this possible

2002-08-20 Thread Seairth Jacobs

What you can and can't do with phpMyAdmin may depend on your host.
phpMyAdmin itself does have the ability to create databases.  However, that
ability is determined by the access rights of the user you access the MySQL
server with.  If your host controls the creation of that user, they may
puposely restrict your access rights to dissallow the creation of additional
databases.  I had this very problem with an old host of mine.  I was given
one database and that was it.  I could not create any more.

Now, my current host (www.webprosinc.net) works a bit different.  It is
using Plesk, which takes over the responsibility of creating databases and
users.  The users that it creates do not have the ability to create
additional databases, though just about all other access rights are granted
(at the database level).  This gives the Plesk software absolute control
over the MySQL server while still allowing me to create new databases.

So, I would make sure your host allows you to create additional databases
before you try to get phpMyAdmin to do it.  If this is an important feature
and your current host does not allow it, there are several other hosts (mine
included) that do give that access (usually with some restrictions, of
course).

---
Seairth Jacobs
[EMAIL PROTECTED]


"Steve Jackson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am new to MySQL and PHP.
> Having looked at PHPMyAdmin the GUI I was wondering if it's possible to
> create a new database within the system?
> If so what are the commands? I ask because I only have one database on my
> server and don't want to populate it with different tables, I'd rather
have
> seperate ones for seperate functions.. Ideas or advice? is the way I am
> suggesting better or worse than the way my hosting company expects me to
> work?
> Thanks in advance.
> Steve.
>



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




[PHP] Re: phpMyAdmin is this possible

2002-08-20 Thread Alexander Skwar

So sprach Steve Jackson am 2002-08-20 um 22:11:58 +0300 :
> seperate ones for seperate functions.. Ideas or advice? is the way I am
> suggesting better or worse than the way my hosting company expects me to
> work?

What does your hosting company suggest?

Any how, for "system" stuff like creating databases and especially
setting ACL, I much more prefer to use Webmin.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.biz |Jabber: [EMAIL PROTECTED]
   iso-top.biz - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 2 days 2 hours 27 minutes

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




RE: [PHP] phpMyAdmin is this possible

2002-08-20 Thread Steve Bradwell

Do you have phpMyAdmin running yet? If so you create new databases with the
click of a button. The first page you see should say Welcome to phpMyAdmin
...ver etc. If you have set phpMyAdmin to run on an existing MySQL install,
the drop down boxes "should" contain your existing databases if configured
correctly. To create a new database just type the name in the box on the
home page and click create, from there you can create new tables etc.

hth
Steve.

-Original Message-
From: Steve Jackson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 3:12 PM
To: MYSQL; Php-General
Subject: [PHP] phpMyAdmin is this possible


I am new to MySQL and PHP.
Having looked at PHPMyAdmin the GUI I was wondering if it's possible to
create a new database within the system?
If so what are the commands? I ask because I only have one database on my
server and don't want to populate it with different tables, I'd rather have
seperate ones for seperate functions.. Ideas or advice? is the way I am
suggesting better or worse than the way my hosting company expects me to
work?
Thanks in advance.
Steve.


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

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




Re: [PHP] phpMyAdmin is this possible

2002-08-20 Thread Adam Williams

I always create a database by hand.  On the console type:

mysql -u root -p

(It will prompt you for the mysql superuser's password.  Then run:

CREATE DATABASE db_name_here;

Then you would use the grant statement accordly to give users permissions
to it.

Adam

On Tue, 20 Aug 2002, Steve Jackson wrote:

> I am new to MySQL and PHP.
> Having looked at PHPMyAdmin the GUI I was wondering if it's possible to
> create a new database within the system?
> If so what are the commands? I ask because I only have one database on my
> server and don't want to populate it with different tables, I'd rather have
> seperate ones for seperate functions.. Ideas or advice? is the way I am
> suggesting better or worse than the way my hosting company expects me to
> work?
> Thanks in advance.
> Steve.
>
>
>


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




[PHP] phpMyAdmin is this possible

2002-08-20 Thread Steve Jackson

I am new to MySQL and PHP.
Having looked at PHPMyAdmin the GUI I was wondering if it's possible to
create a new database within the system?
If so what are the commands? I ask because I only have one database on my
server and don't want to populate it with different tables, I'd rather have
seperate ones for seperate functions.. Ideas or advice? is the way I am
suggesting better or worse than the way my hosting company expects me to
work?
Thanks in advance.
Steve.


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




RE: [PHP] Problem with mysql_query

2002-08-20 Thread Jay Blanchard

[snip]
mySQL Error: You have an error in your SQL syntax near ''LIMIT 25,25'' at
line 1

with this query:

SELECT * FROM dvd_library WHERE genre=BUDGET ORDER BY description ASC LIMIT
25,25
[/snip]

Try

SELECT * FROM dvd_library WHERE genre = 'BUDGET' ORDER BY description ASC
LIMIT 25, 25

Also (I have been seeing this a lot lately and don't know if folks are using
it to shorten up e-mails to this list or if they really do this, so I am
going to say it) it is a performance robbing and potential code buster to
use "SELECT *" where all things are selected from a table(s).

1. On the database side there are performance penalties incurred for not
being more specific in queries as the DBMS must manage each facet of the
table. May not be noticeable on big, high-powered servers until the
connections start to climb the ladder.

2. On the PHP side it makes code much cleaner and easier to document.

HTH!

Jay

***
* Texas PHP Developers Conf  Spring 2003  *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* San Antonio Area PHP Developers Group   *
* Interested? Contact [EMAIL PROTECTED] *
***



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




Re: [PHP] Problem with mysql_query

2002-08-20 Thread Jeff Lewis

Please disregard, it was a silly problem (I was echoing the SQL query and
editing that, not the main SQL query).

Jeff
- Original Message -
From: "Jeff Lewis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 3:04 PM
Subject: [PHP] Problem with mysql_query


mysql_query is returning an odd error. I don't know if I'm just totally
missing something or not but I keep getting this error:

mySQL Error: You have an error in your SQL syntax near ''LIMIT 25,25'' at
line 1

with this query:

SELECT * FROM dvd_library WHERE genre=BUDGET ORDER BY description ASC LIMIT
25,25

Does anyone else notice what the error is?



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




[PHP] Problem with mysql_query

2002-08-20 Thread Jeff Lewis

mysql_query is returning an odd error. I don't know if I'm just totally missing 
something or not but I keep getting this error:

mySQL Error: You have an error in your SQL syntax near ''LIMIT 25,25'' at line 1 

with this query:

SELECT * FROM dvd_library WHERE genre=BUDGET ORDER BY description ASC LIMIT 25,25

Does anyone else notice what the error is?



[PHP] LDAP + PHP = referenced symbol not found

2002-08-20 Thread Benji Spencer

I am attempting to compile PHP with LDAP (again). Our current production 
server has LDAP enabled, and works fine. However, I needed to recompile PHP 
to add additional functionality. Now I can't seem to get things to work.

PHP 4.0.6
Netscape LDAP SDK 4.0
Solaris 2.8

The compile process goes fine when I use

./configure --prefix=/usr/local/apache/localhost 
--with-apxs=/usr/local/apache/localhost/bin/apxs 
--with-ldap=/usr/local/netscape

however, when I try to start Apache, I get

Syntax error on line 207 of /usr/local/apache/localhost/conf/httpd.conf:
Cannot load /usr/local/apache/localhost/libexec/libphp4.so into server: 
ld.so.1: /usr/local/apache/localhost/bin/httpd: fatal: relocation error: 
file /usr/local/apache/localhost/libexec/libphp4.so: symbol 
ldap_parse_reference: referenced symbol not found
./apachectl start: httpd could not be started

Typically modifying the LD_LIBRARY_PATH to include the lib dir (in this 
case /usr/local/netscape/lib) at the top of the apachectl file.  This 
doesn't seem to work this time. I have set the LD_LIBRARY_PATH to 
"/usr/local/netscape/lib:/usr/local/lib:/usr/lib" which would normally take 
care of this problembut this time it doesn't.

Anyone have any idea while it can not find that symbol, despite telling it 
where it should look via the LD_LIBRARY_PATH

benji

---
Ben Spencer
Web Support
[EMAIL PROTECTED]
x 2288


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




RE: [PHP] 4.04 --> 4.1.2 incompatible

2002-08-20 Thread Mark Middleton


> Another tip you might find useful if you're writing code that outputs a
>  that posts to itself, is to echo $PHP_SELF instead of hard-coding
> the target.  If you happen to move your code elsewhere in the future,
> this will save you the time of having to go back and specify a new POST
> target.
>

I've personally had difficulties with this technique, as Netscape browsers
didn't return $PHP_SELF the way I had written it.  Make sure to make it such
that Netscape users can see it too.

http://www.faqts.com/knowledge_base/view.phtml/aid/139/fid/6

-Mark



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




[PHP] Re: suggestions for a good php+mysql isp?

2002-08-20 Thread Seairth Jacobs

www.webprosinc.net has several plans, starting as little as $4.95 (1 MySQL
database/1 domain/125 MB space/2GB transfer) to $49.95 (unlimited
databases/100 domains/1GB space/16GB transfer).  They are currently using
PHP 4.1.0 and seem to regularly updated their system (they use Plesk for
maintenance).  As with any host, there are some limitations to what you can
and cannot do.

Oh.  And very, very important:  they have *always* gotten back to me within
a few hours of any support call I have made.  This is a vast difference from
some prior hosts that I was lucky to hear from within 24 hours of a support
call.

Good luck in your search.  :)

---
Seairth Jacobs
[EMAIL PROTECTED]


"Or Not Db Db" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have searched the archives and the last time this was seriously
discussed
> was september of last year...unless I have a giant gaping hole in my
> archive!  :)  I was considering northwesthost.com and would like some
> opinions on them or anybody you are happy with  The list of isp's on
php.net
> doesn't mean much to me without some current comments about their
> performance.
> I need php and mysql support for my site - I'm moving the domain name and
> site from myhosting.com (they're ASP and perl2exe'd scripts only).  TIA!
>
> -Kirk
>
>



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




[PHP] Unexplained Socket Error

2002-08-20 Thread David Buerer

Anyone know why I might get this error?

I was working on development of a socket server several weeks ago and it was
working fine.  When I returned to it this morning, I am getting this error:

Listening on port 1482 (sucess message from socket_create)
Warning: socket_bind() unable to lookup host [1001]: Recursion too deep,
stack overflowed. in test_server.php on line 31
AIEE -- Couldn't bind! (failure message from socket_bind)

Line 31 says : 
if (!socket_bind($listenfd, "172.25.190.4", $PORT))
{
socket_close($listenfd);
die("AIEE -- Couldn't bind!\n");
}




RE: [PHP] Agh! trim (#$@#@^%!!!)

2002-08-20 Thread Mike At Spy



Sorry, I mistyped - $date should be $single.  

Thanks for the suggestions and help to everyone! - I will pursue them.  :)

-Mike


> -Original Message-
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 12:50 PM
> To: Mike At Spy; [EMAIL PROTECTED]
> Subject: Re: [PHP] Agh! trim (#$@#@^%!!!)
> 
> 
> > $single = "The date is 20-Aug-2002." // This is an example - see below
> > $trimmed = rtrim($date, ".");
> 
> Where is $date?  I think your attempting to trim the wrong string.
> 
> This worked for me:
> 
>  $single = "The date is 20-Aug-2002.";
> $trimmed = rtrim($single, ".");
> echo $trimmed;
> ?>
> 
> 
> To slice off the last character of any string, you could use substr():
> 
>  $single = "The date is 20-Aug-2002.";
> $trimmed = substr($single, 0, -1);
> echo $trimmed;
> ?>
> 
> 
> Justin French
> 
> 
> 
> on 21/08/02 2:35 AM, Mike At Spy ([EMAIL PROTECTED]) wrote:
> 
> > 
> > Hey!
> > 
> > :)
> > 
> > I have an issue with trim / triml.  Whenever I put a string in 
> to trimmed,
> > it refuses to take the period at the end of the string off.
> > 
> > I did put more things to trim first, but this is basically what 
> I am doing:
> > 
> > 
> > $single = "The date is 20-Aug-2002." // This is an example - see below
> > $trimmed = rtrim($date, ".");
> > 
> > 
> > Is there an issue with this?  I've tried using trim() too.
> > 
> > The source of $single is a reponse from a server.  I should 
> note that when I
> > put this in as an experiment, it works fine.  When I get the 
> line from the
> > server, it doesn't work!
> > 
> > The only thing I can think of is the possibility that the "." I 
> am seeing at
> > the end of the line isn't really one (it looks like a duck, 
> copies like a
> > duck, but...isn't a duck??!!).
> > 
> > Is there a way to just strip the last character off regardless 
> of what it
> > is?
> > 
> > Thanks,
> > 
> > -Mike
> > 
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP] 4.04 --> 4.1.2 incompatible

2002-08-20 Thread Douglas Winslow

Petre Agenbag wrote:
> My oh my
> OK, can someone help with this one???
> My original Form conatined the following:
> 
> bla, bla
> 
> 
> And then things broke, so, out of curiosity, I removed the enctype=""
> part, and now it works/

Another tip you might find useful if you're writing code that outputs a 
 that posts to itself, is to echo $PHP_SELF instead of hard-coding 
the target.  If you happen to move your code elsewhere in the future, 
this will save you the time of having to go back and specify a new POST 
target.

drw



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




[PHP] Agh! trim (#$@#@^%!!!)

2002-08-20 Thread Mike At Spy


Hey!

:)

I have an issue with trim / triml.  Whenever I put a string in to trimmed,
it refuses to take the period at the end of the string off.

I did put more things to trim first, but this is basically what I am doing:


$single = "The date is 20-Aug-2002." // This is an example - see below
$trimmed = rtrim($date, ".");


Is there an issue with this?  I've tried using trim() too.

The source of $single is a reponse from a server.  I should note that when I
put this in as an experiment, it works fine.  When I get the line from the
server, it doesn't work!

The only thing I can think of is the possibility that the "." I am seeing at
the end of the line isn't really one (it looks like a duck, copies like a
duck, but...isn't a duck??!!).

Is there a way to just strip the last character off regardless of what it
is?

Thanks,

-Mike



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




Re: [PHP] Agh! trim (#$@#@^%!!!)

2002-08-20 Thread Jeff Lewis

Sorry, just saw Rasmus' reply, lso I didn't read your code entirely, noticed
you specified for the period to be chopped off :)

Jeff
- Original Message -
From: "Jeff Lewis" <[EMAIL PROTECTED]>
To: "Mike At Spy" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 12:53 PM
Subject: Re: [PHP] Agh! trim (#$@#@^%!!!)


> Trim clears whitespace not characters (I'm pretty sure), try using this to
> rid yourself of the period:
>
> $trimmed = substr($date, 0, -1);  // returns everything but that last
> character (the period)
>
> Jeff
> - Original Message -
> From: "Mike At Spy" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 20, 2002 12:35 PM
> Subject: [PHP] Agh! trim (#$@#@^%!!!)
>
>
> >
> > Hey!
> >
> > :)
> >
> > I have an issue with trim / triml.  Whenever I put a string in to
trimmed,
> > it refuses to take the period at the end of the string off.
> >
> > I did put more things to trim first, but this is basically what I am
> doing:
> >
> >
> > $single = "The date is 20-Aug-2002." // This is an example - see below
> > $trimmed = rtrim($date, ".");
> >
> >
> > Is there an issue with this?  I've tried using trim() too.
> >
> > The source of $single is a reponse from a server.  I should note that
when
> I
> > put this in as an experiment, it works fine.  When I get the line from
the
> > server, it doesn't work!
> >
> > The only thing I can think of is the possibility that the "." I am
seeing
> at
> > the end of the line isn't really one (it looks like a duck, copies like
a
> > duck, but...isn't a duck??!!).
> >
> > Is there a way to just strip the last character off regardless of what
it
> > is?
> >
> > Thanks,
> >
> > -Mike
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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




Re: [PHP] Agh! trim (#$@#@^%!!!)

2002-08-20 Thread Justin French

> $single = "The date is 20-Aug-2002." // This is an example - see below
> $trimmed = rtrim($date, ".");

Where is $date?  I think your attempting to trim the wrong string.

This worked for me:




To slice off the last character of any string, you could use substr():




Justin French



on 21/08/02 2:35 AM, Mike At Spy ([EMAIL PROTECTED]) wrote:

> 
> Hey!
> 
> :)
> 
> I have an issue with trim / triml.  Whenever I put a string in to trimmed,
> it refuses to take the period at the end of the string off.
> 
> I did put more things to trim first, but this is basically what I am doing:
> 
> 
> $single = "The date is 20-Aug-2002." // This is an example - see below
> $trimmed = rtrim($date, ".");
> 
> 
> Is there an issue with this?  I've tried using trim() too.
> 
> The source of $single is a reponse from a server.  I should note that when I
> put this in as an experiment, it works fine.  When I get the line from the
> server, it doesn't work!
> 
> The only thing I can think of is the possibility that the "." I am seeing at
> the end of the line isn't really one (it looks like a duck, copies like a
> duck, but...isn't a duck??!!).
> 
> Is there a way to just strip the last character off regardless of what it
> is?
> 
> Thanks,
> 
> -Mike
> 
> 


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




Re: [PHP] Agh! trim (#$@#@^%!!!)

2002-08-20 Thread Rasmus Lerdorf

> Trim clears whitespace not characters (I'm pretty sure), try using this to
> rid yourself of the period:

You can optionally specify that trim should trim any other chars.

-Rasmus


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




Re: [PHP] Agh! trim (#$@#@^%!!!)

2002-08-20 Thread Jeff Lewis

Trim clears whitespace not characters (I'm pretty sure), try using this to
rid yourself of the period:

$trimmed = substr($date, 0, -1);  // returns everything but that last
character (the period)

Jeff
- Original Message -
From: "Mike At Spy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 12:35 PM
Subject: [PHP] Agh! trim (#$@#@^%!!!)


>
> Hey!
>
> :)
>
> I have an issue with trim / triml.  Whenever I put a string in to trimmed,
> it refuses to take the period at the end of the string off.
>
> I did put more things to trim first, but this is basically what I am
doing:
>
>
> $single = "The date is 20-Aug-2002." // This is an example - see below
> $trimmed = rtrim($date, ".");
>
>
> Is there an issue with this?  I've tried using trim() too.
>
> The source of $single is a reponse from a server.  I should note that when
I
> put this in as an experiment, it works fine.  When I get the line from the
> server, it doesn't work!
>
> The only thing I can think of is the possibility that the "." I am seeing
at
> the end of the line isn't really one (it looks like a duck, copies like a
> duck, but...isn't a duck??!!).
>
> Is there a way to just strip the last character off regardless of what it
> is?
>
> Thanks,
>
> -Mike
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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




Re: [PHP] Agh! trim (#$@#@^%!!!)

2002-08-20 Thread Rasmus Lerdorf

Well, perhaps you have something after the . in that string?

You can strip off the last char of a string very simply with:

   substr($str,0,-1)

-Rasmus

On Tue, 20 Aug 2002, Mike At Spy wrote:

>
> Hey!
>
> :)
>
> I have an issue with trim / triml.  Whenever I put a string in to trimmed,
> it refuses to take the period at the end of the string off.
>
> I did put more things to trim first, but this is basically what I am doing:
>
>
> $single = "The date is 20-Aug-2002." // This is an example - see below
> $trimmed = rtrim($date, ".");
>
>
> Is there an issue with this?  I've tried using trim() too.
>
> The source of $single is a reponse from a server.  I should note that when I
> put this in as an experiment, it works fine.  When I get the line from the
> server, it doesn't work!
>
> The only thing I can think of is the possibility that the "." I am seeing at
> the end of the line isn't really one (it looks like a duck, copies like a
> duck, but...isn't a duck??!!).
>
> Is there a way to just strip the last character off regardless of what it
> is?
>
> Thanks,
>
> -Mike
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] suggestions for a good php+mysql isp?

2002-08-20 Thread Neil Freeman

www.aletia.com

db or not db wrote:
> **
> This Message Was Virus Checked With : SAVI 3.60 May 2002 
> Last Updated 16th August 2002
> **
> 
> They (futurequest) really are impressive, but 39.95/month is a little pricey
> for me...if they offered MySQL with the basic plans (with 1-2 db's instead
> of 6) I'd go for it.  The site I'm handling is for a small mortgage company
> so the 39.95/mo plan is overkill for their needs.
> 
> Anyone else with a suggestion for a good (<$20) basic php+mysql provider?
> 
> -Kirk
> 
> 
> "Met" <[EMAIL PROTECTED]> wrote in message
> 001f01c2485a$8e265ad0$6901a8c0@SURVIVAL">news:001f01c2485a$8e265ad0$6901a8c0@SURVIVAL...
> 
>>http://www.futurequest.com
>>
>>Fantastic!!
>>
>>~ Matthew
>>
>>-Original Message-
>>From: db, or not db [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, August 20, 2002 11:01 AM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] suggestions for a good php+mysql isp?
>>
>>
>>I have searched the archives and the last time this was seriously
>>discussed was september of last year...unless I have a giant gaping hole
>>in my archive!  :)  I was considering northwesthost.com and would like
>>some opinions on them or anybody you are happy with  The list of isp's
>>on php.net doesn't mean much to me without some current comments about
>>their performance. I need php and mysql support for my site - I'm moving
>>the domain name and site from myhosting.com (they're ASP and perl2exe'd
>>scripts only).  TIA!
>>
>>-Kirk
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 
> 
> 


-- 
--
  www.curvedvision.com
--


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




[PHP] cookies with super global arrays

2002-08-20 Thread Justin French

Hi all,

I can ACCESS a cookie with something like:




but I can't seem to modify a cookie in the same way:



Much in the same way that I *can* do it with $_SESSION.


To change the value of a cookie, I seem to have to set it again, with the
different values.

I *assume* this is expected behaviour, but I thought I'd check, and make
sure that it is.


If at all possible, it'd be a great feature in a future release... have
$_COOKIE respond to new values the same way as $_SESSION.  I guess the catch
is that it'd have to be PRIOR to any browser output, to avoid errors.


Justin French


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




Re: [PHP] suggestions for a good php+mysql isp?

2002-08-20 Thread Justin French

experthost.com

I have 15 sites with them.

Justin French


on 21/08/02 2:27 AM, db or not db ([EMAIL PROTECTED]) wrote:

> They (futurequest) really are impressive, but 39.95/month is a little pricey
> for me...if they offered MySQL with the basic plans (with 1-2 db's instead
> of 6) I'd go for it.  The site I'm handling is for a small mortgage company
> so the 39.95/mo plan is overkill for their needs.
> 
> Anyone else with a suggestion for a good (<$20) basic php+mysql provider?
> 
> -Kirk
> 
> 
> "Met" <[EMAIL PROTECTED]> wrote in message
> 001f01c2485a$8e265ad0$6901a8c0@SURVIVAL">news:001f01c2485a$8e265ad0$6901a8c0@SURVIVAL...
>> http://www.futurequest.com
>> 
>> Fantastic!!
>> 
>> ~ Matthew
>> 
>> -Original Message-
>> From: db, or not db [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, August 20, 2002 11:01 AM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] suggestions for a good php+mysql isp?
>> 
>> 
>> I have searched the archives and the last time this was seriously
>> discussed was september of last year...unless I have a giant gaping hole
>> in my archive!  :)  I was considering northwesthost.com and would like
>> some opinions on them or anybody you are happy with  The list of isp's
>> on php.net doesn't mean much to me without some current comments about
>> their performance. I need php and mysql support for my site - I'm moving
>> the domain name and site from myhosting.com (they're ASP and perl2exe'd
>> scripts only).  TIA!
>> 
>> -Kirk
>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 
> 


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




Re: [PHP] suggestions for a good php+mysql isp?

2002-08-20 Thread Adam Voigt

I've heard good things about hostway.com.

Adam Voigt
[EMAIL PROTECTED]

On Tue, 2002-08-20 at 12:27, db or not db wrote:
> They (futurequest) really are impressive, but 39.95/month is a little pricey
> for me...if they offered MySQL with the basic plans (with 1-2 db's instead
> of 6) I'd go for it.  The site I'm handling is for a small mortgage company
> so the 39.95/mo plan is overkill for their needs.
> 
> Anyone else with a suggestion for a good (<$20) basic php+mysql provider?
> 
> -Kirk
> 
> 
> "Met" <[EMAIL PROTECTED]> wrote in message
> 001f01c2485a$8e265ad0$6901a8c0@SURVIVAL">news:001f01c2485a$8e265ad0$6901a8c0@SURVIVAL...
> > http://www.futurequest.com
> >
> > Fantastic!!
> >
> > ~ Matthew
> >
> > -Original Message-
> > From: db, or not db [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 20, 2002 11:01 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] suggestions for a good php+mysql isp?
> >
> >
> > I have searched the archives and the last time this was seriously
> > discussed was september of last year...unless I have a giant gaping hole
> > in my archive!  :)  I was considering northwesthost.com and would like
> > some opinions on them or anybody you are happy with  The list of isp's
> > on php.net doesn't mean much to me without some current comments about
> > their performance. I need php and mysql support for my site - I'm moving
> > the domain name and site from myhosting.com (they're ASP and perl2exe'd
> > scripts only).  TIA!
> >
> > -Kirk
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




Re: [PHP] Freetds + Sybase-ct + mssql problems

2002-08-20 Thread Adam Voigt

Hmm, weird, mine worked perfectly the first time through when I
installed it, no havingto mess with permissions or anything.

Adam Voigt
[EMAIL PROTECTED]

On Tue, 2002-08-20 at 12:18, Benji Spencer wrote:
> 
> >Your path to the interface file must be wrong, in
> >my php.ini I have it set to "/usr/local/freetds/conf/freetds.conf"
> >Are you sure the path is right?
> 
> At the top of the freetds.conf file...is..
> 
> # FreeTDS will search for a conf file in the following order:
> #
> # 1) check if a file was set programatically via dbsetifile() and
> #is in .conf format, if so use that,
> #
> # 2) look in ~/.freetds.conf
> #
> # 3) look in @sysconfdir@/freetds.conf
> #
> # If FreeTDS has found no suitable conf file it will then search for
> # an an interfaces file in the following order:
> #
> # 1) check if a file was set programatically via dbsetifile() and
> #is in interfaces format, if so use that,
> #
> # 2) look in ~/.interfaces
> #
> # 3) look in $SYBASE/interfaces (where $SYBASE is an environment
> #variable)
> 
> I do have $SYBASE set in apachectl (which gets passed to PHP) and for the 
> fun of it, I changed things to /usr/local/freetds/etc/freetds.conf (default 
> install location). No luck.
> 
> You did make a few other buttons click. I verified permissions. The web 
> server had problems reading the config files, so I modified the perms. It 
> also didn't seem to like the freetds.conf file, so I changed it back to 
> /usr/local/freetds/interfaces. It worked.
> 
> It was a permission problem...thanks to those who had suggestions...
> 
> benji
> 
> ---
> Ben Spencer
> Web Support
> [EMAIL PROTECTED]
> x 2288
> 



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




Re: [PHP] suggestions for a good php+mysql isp?

2002-08-20 Thread db or not db

They (futurequest) really are impressive, but 39.95/month is a little pricey
for me...if they offered MySQL with the basic plans (with 1-2 db's instead
of 6) I'd go for it.  The site I'm handling is for a small mortgage company
so the 39.95/mo plan is overkill for their needs.

Anyone else with a suggestion for a good (<$20) basic php+mysql provider?

-Kirk


"Met" <[EMAIL PROTECTED]> wrote in message
001f01c2485a$8e265ad0$6901a8c0@SURVIVAL">news:001f01c2485a$8e265ad0$6901a8c0@SURVIVAL...
> http://www.futurequest.com
>
> Fantastic!!
>
> ~ Matthew
>
> -Original Message-
> From: db, or not db [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 11:01 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] suggestions for a good php+mysql isp?
>
>
> I have searched the archives and the last time this was seriously
> discussed was september of last year...unless I have a giant gaping hole
> in my archive!  :)  I was considering northwesthost.com and would like
> some opinions on them or anybody you are happy with  The list of isp's
> on php.net doesn't mean much to me without some current comments about
> their performance. I need php and mysql support for my site - I'm moving
> the domain name and site from myhosting.com (they're ASP and perl2exe'd
> scripts only).  TIA!
>
> -Kirk
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




Re: [PHP] Freetds + Sybase-ct + mssql problems

2002-08-20 Thread Benji Spencer


>Your path to the interface file must be wrong, in
>my php.ini I have it set to "/usr/local/freetds/conf/freetds.conf"
>Are you sure the path is right?

At the top of the freetds.conf file...is..

# FreeTDS will search for a conf file in the following order:
#
# 1) check if a file was set programatically via dbsetifile() and
#is in .conf format, if so use that,
#
# 2) look in ~/.freetds.conf
#
# 3) look in @sysconfdir@/freetds.conf
#
# If FreeTDS has found no suitable conf file it will then search for
# an an interfaces file in the following order:
#
# 1) check if a file was set programatically via dbsetifile() and
#is in interfaces format, if so use that,
#
# 2) look in ~/.interfaces
#
# 3) look in $SYBASE/interfaces (where $SYBASE is an environment
#variable)

I do have $SYBASE set in apachectl (which gets passed to PHP) and for the 
fun of it, I changed things to /usr/local/freetds/etc/freetds.conf (default 
install location). No luck.

You did make a few other buttons click. I verified permissions. The web 
server had problems reading the config files, so I modified the perms. It 
also didn't seem to like the freetds.conf file, so I changed it back to 
/usr/local/freetds/interfaces. It worked.

It was a permission problem...thanks to those who had suggestions...

benji

---
Ben Spencer
Web Support
[EMAIL PROTECTED]
x 2288


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




[PHP] xml scipt not working :/

2002-08-20 Thread Pafo

anyone know why this scritp dont read all the posts..?
xml file: http://www.camelotherald.com/xml/servers.xml
script in action: http://www.ant.nu/test.php

if u look at the script in action, it prints out the xml file, except 1
line..
the output looks like this:

Relicname Relictype Relicowner
 Midgard
Merlin's Staff Magic Hibernia

it should look like this according to the xmlfile:

Relicname Relictype Relicowner
Scabbard of Excalibur Melee Midgard
Merlin's Staff Magic Hibernia

this is the script:
";
   print
"KeepnameKeepownerKeepclaimant";
 }

 function PrintInfo() {
   for ($i = 0; $i < count($this->KeepName); $i++) {
 if ($this->KeepRealm[$i] == "Albion") { print "{$this->KeepName[$i]}"; }
 if ($this->KeepRealm[$i] == "Midgard") { print "{$this->KeepName[$i]}"; }
 if ($this->KeepRealm[$i] == "Hibernia") { print "{$this->KeepName[$i]}"; }
 if ($this->KeepRealm[$i] == "Neutral") { print "{$this->KeepName[$i]}"; }
 print "{$this->KeepOwner[$i]}";
 print "{$this->KeepClaimant[$i]}\n";
   }
 }

 function SetName($name) {
 $this->KeepName[] = $name;
 }

 function SetOwner($owner) {
   $this->KeepOwner[] = $owner;
 }

 function SetRealm($realm) {
   $this->KeepRealm[] = $realm;
 }

 function SetClaimant($claim) {
   $this->KeepClaimant[] = $claim;
 }
}

class RelicInfo {

  var $RelicName = Array();
  var $RelicType = Array();
  var $RelicRealm = Array();
  var $RelicOwner = Array();

   function PrintHeader() {
   print "";
   print
"RelicnameRelictypeRelicowner
";
 }

 function PrintInfo() {
   for ($i = 0; $i < count($this->RelicName); $i++) {
 if ($this->RelicRealm[$i] == "Albion") { print "{$this->RelicName[$i]}"; }
 if ($this->RelicRealm[$i] == "Midgard") { print "{$this->RelicName[$i]}"; }
 if ($this->RelicRealm[$i] == "Hibernia") { print "{$this->RelicName[$i]}"; }
 print "{$this->RelicType[$i]}";
 print "{$this->RelicOwner[$i]}\n";
   }
 }

 function SetName($name) {
 $this->RelicName[] = $name;
 }

 function SetType($type) {
   $this->RelicType[] = $type;
 }

 function SetRealm($realm) {
   $this->RelicRealm[] = $realm;
 }

 function SetRelicOwner($owner) {
   $this->RelicOwner[] = $owner;
 }

}

class ServerInfo {
  var $ServerName = Array();
  var $ServerPopulation = Array();
  var $ServerType = Array();
  var $ServerStatus = Array();
  var $Totalpop = 0;

   function PrintHeader() {
   print "";
   print
"Servername/typeStatusPopulation<
/b>";
 }

 function PrintInfo() {
   for ($i = 0; $i < count($this->ServerName); $i++) {
 print "{$this->ServerName[$i]}";
 if ($this->ServerType[$i]) { print
"({$this->ServerType[$i]})"; }
 print "";
 print "{$this->ServerStatus[$i]}";
 print "{$this->ServerPopulation[$i]}\n";
   }
 }

 function PrintTotal() {
   print $this->Totalpop;
 }

 function SetServer($server) {
 $this->ServerName[] = $server;
 }

 function SetType($type) {
   $this->ServerType[] = $type;
 }

 function SetStatus($status) {
   $this->ServerStatus[] = $status;
 }

 function SetPopulation($pop) {
   $this->ServerPopulation[] = $pop;
   $this->Totalpop += $pop;
 }

}

function startElement($parser, $tagName, $attrs) {
global $ServerToPrint, $server, $depth, $insideitem, $insidekeep, $tag,
$da_server, $da_type, $da_relicname, $da_relictype, $da_relicrealm,
$da_keepname, $da_keeprealm;
 if ($insideitem) {
  $tag = $tagName;
 } elseif ($tagName == "RELIC")   {
 $insideitem = true;
 while (list ($key, $val) = each ($attrs)) {
  switch($key) {
  case "NAME": $da_relicname=$val;break;
  case "TYPE": $da_relictype=$val;break;
  case "REALM": $da_relicrealm=$val;break;
  } // end case
 } // end while

 } elseif($tagName == "SERVER")  {
   $depth[$parser]++;
 $insideitem = true;
 while (list ($key, $val) = each ($attrs)) {
  if ($key == "NAME") { $da_server=$val; if($val == $ServerToPrint) {
$server = true; } else { $server = false; } }
  if ($key == "TYPE") { $da_type=$val; }
 } // end while
 } elseif($tagName == "KEEP")  {
 $insideitem = true;
 $insidekeep = true;
 while (list ($key, $val) = each ($attrs)) {
  switch($key) {
  case "NAME": $da_keepname=$val;break;
  case "REALM": $da_keeprealm=$val;break;
  } // end case
 } // end while
 }
}


function characterData($parser, $data) {
global $insideitem, $insidekeep, $tag, $da_server, $da_population, $da_type,
$da_status,$da_totalpop, $da_relicowner, $da_keepowner, $da_keepclaimant;
 if ($insideitem) {
 if ($insidekeep) {
  switch($tag) {
   case "OWNER" : $da_keepowner .= $data; break;
   case "CLAIMANT" : $da_keepclaimant .= $data; break;
  }
 } else {
switch ($tag) {
  case "POPULATION": $da_population .= $data; $da_totalpop += $data; break;
  case "STATUS":  $da_status .= $data; break;
  case "OWNER":  $da_relicowner .= $data; break;
  }

 }
 }

}


function endElement($parser, $tagName) {
global $cserver, $ckeep, $crelic, $printedserver, $server, $depth,
$insideitem, $insidekeep, $tag, $da_server, $da_population, $da_type,
$da_status, $da_reli

RE: [PHP] Freetds + Sybase-ct + mssql problems

2002-08-20 Thread Scott Houseman

Hi.

I cant tell you off-hand what the problem might be, but this article is very
helpful, and might answer your question:

http://www.phpbuilder.com/columns/alberto2919.php3?print_mode=1

-Scott

> -Original Message-
> From: Benji Spencer [mailto:[EMAIL PROTECTED]]
> Sent: 20 August 2002 05:21
> To: [EMAIL PROTECTED]
> Subject: [PHP] Freetds + Sybase-ct + mssql problems
>
>
> I finally got PHP 4.0.6 compiled with
> sybase-ct=/usr/local/freetds for use
> with mssql. However, it seems like php doesn't know where to find the
> interfaces file. Is there a configuration option which allows me to tell
> PHP where to find the interfaces file and/or where is it looking for the
> interfaces file?
>
> my PHP script
>
>  $ms_conn=mssql_connect("interface_name",'username','password');
> ?>
>
> and the results
>
> Warning: Sybase: Unable to connect in
> /usr/local/apache/localhost/htdocs/go.php on line 2
>
> putting sybase.interface_file="/usr/local/freetds/interfaces" in php.ini
> also didn't seem to make a difference. anyone have ideas?
>
> benji
>
> ---
> Ben Spencer
> Web Support
> [EMAIL PROTECTED]
> x 2288
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] Freetds + Sybase-ct + mssql problems

2002-08-20 Thread Adam Voigt

Your path to the interface file must be wrong, in
my php.ini I have it set to "/usr/local/freetds/conf/freetds.conf"
Are you sure the path is right?

Adam Voigt
[EMAIL PROTECTED]

On Tue, 2002-08-20 at 11:20, Benji Spencer wrote:
> I finally got PHP 4.0.6 compiled with sybase-ct=/usr/local/freetds for use 
> with mssql. However, it seems like php doesn't know where to find the 
> interfaces file. Is there a configuration option which allows me to tell 
> PHP where to find the interfaces file and/or where is it looking for the 
> interfaces file?
> 
> my PHP script
> 
>  $ms_conn=mssql_connect("interface_name",'username','password');
> ?>
> 
> and the results
> 
> Warning: Sybase: Unable to connect in 
> /usr/local/apache/localhost/htdocs/go.php on line 2
> 
> putting sybase.interface_file="/usr/local/freetds/interfaces" in php.ini 
> also didn't seem to make a difference. anyone have ideas?
> 
> benji
> 
> ---
> Ben Spencer
> Web Support
> [EMAIL PROTECTED]
> x 2288
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




[PHP] Freetds + Sybase-ct + mssql problems

2002-08-20 Thread Benji Spencer

I finally got PHP 4.0.6 compiled with sybase-ct=/usr/local/freetds for use 
with mssql. However, it seems like php doesn't know where to find the 
interfaces file. Is there a configuration option which allows me to tell 
PHP where to find the interfaces file and/or where is it looking for the 
interfaces file?

my PHP script



and the results

Warning: Sybase: Unable to connect in 
/usr/local/apache/localhost/htdocs/go.php on line 2

putting sybase.interface_file="/usr/local/freetds/interfaces" in php.ini 
also didn't seem to make a difference. anyone have ideas?

benji

---
Ben Spencer
Web Support
[EMAIL PROTECTED]
x 2288


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




Re: [PHP] Remove \n from text

2002-08-20 Thread Justin French

$str = str_replace('\r',$str)
$str = str_replace('\n',$str)

Justin French


on 21/08/02 1:00 AM, Erich Kolb ([EMAIL PROTECTED]) wrote:

> How can I remove all \n and \r from a txt file?
> 
> 


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




Re: [PHP] POST & SID

2002-08-20 Thread Justin French

When you say "it does not work", are you trying to POST the SID, or
continuing to pass it around in the URL *whilst* posting a form.

This SHOULD work:






blah.php should recognise the session.


Justin French





on 20/08/02 2:29 PM, simanhew ([EMAIL PROTECTED]) wrote:

> hi all,
> 
> I have a question regarding POST and SID:
> I am trying to make a no-cookies browser work with session_id, according to
> some tutorial, using  in URL is one choice.  I tried that and it
> worked if it is only a hyperlink, but it DOES NOT work when I use POST.
> 
> Any one has experience in this ?
> 
> Thanks in advance,
> 
> siman
> 
> 


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




Re: [PHP] Remove \n from text

2002-08-20 Thread Jason Wong

On Tuesday 20 August 2002 23:00, Erich Kolb wrote:
> How can I remove all \n and \r from a txt file?

file(), str_replace(), fopen(), fwrite(), fclose(), add seasoning to taste.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Perfection is acheived only on the point of collapse.
- C. N. Parkinson
*/


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




Re: [PHP] NS4.x / IE3.0 Browser Detection

2002-08-20 Thread Lowell Allen

> From: Andre Dubuc <[EMAIL PROTECTED]>
> 
> 
> That's the problem -- I don't know whether to exclude Mac NS4 as well. I'm
> using a lot of CSS1, and NS4's output is horrible. Rather than re-write the
> whole site, or try to patch things up, I'm re-directing them to WaSP.
> 
> So, the question is: does Mac NS4 behave like the PC version? If so, I'll
> just use what I have, and re-direct.
> 
> Any ideas on the Mac?
> 
If you're redirecting either platform NS4 without support, then I'd say you
might as well redirect all platforms for NS4, but you can check out the
differences here:



--
Lowell Allen


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




RE: [PHP] parameters not seen

2002-08-20 Thread Jay Blanchard

[snip]
to my big surprise when i am executing test.php?abc=testvalue
where test.php =



I get empty string

can somebody say what's wrong?
[/snip]

register_globals = Off in php.ini

try 

Jay




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




Re: [PHP] parameters not seen

2002-08-20 Thread Adam Williams

is register_globals = off in php.ini?  if so, that is why.

Adam

On Tue, 20 Aug 2002, Maris Kalnins wrote:

> Hi!
>
> just installed latest php and apache on windows nt!
>
> to my big surprise when i am executing test.php?abc=testvalue
> where test.php =
>
> 
>
> I get empty string
>
> can somebody say what's wrong?
>
> Thanks, Maris
>
>
>
>


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




[PHP] parameters not seen

2002-08-20 Thread Maris Kalnins

Hi!

just installed latest php and apache on windows nt!

to my big surprise when i am executing test.php?abc=testvalue
where test.php =



I get empty string

can somebody say what's wrong?

Thanks, Maris



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




Re: [PHP] NS4.x / IE3.0 Browser Detection

2002-08-20 Thread Andre Dubuc

On Tuesday 20 August 2002 10:57 am, Lowell Allen wrote:
> > From: Andre Dubuc <[EMAIL PROTECTED]>
> >
> > I need to differentiate between different versions of NS4, particularly
> > the ones that are used by Mac. So far, I've used the following to detect
> > variants:
> >
> > if(eregi("(Mozilla/4.[0-8][0-9])",$_SERVER['HTTP_USER_AGENT']))
> >
> > However, I'm aware that it will not distinguish between PC and Mac-based
> > NS4. My question is: what versions of NS (if any) do Mac's use? I've used
> > the following to detect IE3.0 users:
> >
> > if(eregi("(mozilla/3.0)",$_SERVER['HTTP_USER_AGENT']))
> >
> > Is this correct?
> >
> > Any insights or advice most welcome.
>
> Here's what I use to detect Mac Netscape 4.x:
>
> if((eregi("Mozilla", getenv("HTTP_USER_AGENT"))) &&
> (!eregi("MSIE", getenv("HTTP_USER_AGENT"))) &&
> (!eregi("Gecko", getenv("HTTP_USER_AGENT"))) &&
> (eregi("Mac", getenv("HTTP_USER_AGENT"
>
> Do you really need to differentiate between 4.x versions? It looks like
> you're matching any 4.x version.


Thanks Lowell,

That's the problem -- I don't know whether to exclude Mac NS4 as well. I'm 
using a lot of CSS1, and NS4's output is horrible. Rather than re-write the 
whole site, or try to patch things up, I'm re-directing them to WaSP.

So, the question is: does Mac NS4 behave like the PC version? If so, I'll 
just use what I have, and re-direct.

Any ideas on the Mac?

Tia,
Andre 

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




Re: [PHP] Embeding images in HTML emails

2002-08-20 Thread Jason Wong

On Tuesday 20 August 2002 22:06, Andrew Perevodchik wrote:
> Hello, Michael Sims!
>
> MS> I imagine that
> MS> Manuel Lemos' PHP Classes site has a class that would take care of
> MS> this for you...
>
> url, plz :)

Use your noodle:

google -> "Manuel Lemos PHP Classes"

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Being frustrated is disagreeable, but the real disasters in life begin
when you get what you want.
*/


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




[PHP] Remove \n from text

2002-08-20 Thread Erich Kolb

How can I remove all \n and \r from a txt file?



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




Re: [PHP] Embeding images in HTML emails

2002-08-20 Thread Stas Maximov

www.phpclasses.org

Stas

- Original Message - 
From: "Andrew Perevodchik" <[EMAIL PROTECTED]>
To: "Michael Sims" <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 3:06 PM
Subject: Re: [PHP] Embeding images in HTML emails


> Hello, Michael Sims!
> 
> MS> I imagine that
> MS> Manuel Lemos' PHP Classes site has a class that would take care of
> MS> this for you...
> 
> url, plz :)
> 
> -- 
> Andrew Perevodchik
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP] POST & SID

2002-08-20 Thread Rasmus Lerdorf

Put a hidden field in your form with the session id.

On Tue, 20 Aug 2002, simanhew wrote:

> hi all,
>
> I have a question regarding POST and SID:
> I am trying to make a no-cookies browser work with session_id, according to
> some tutorial, using  in URL is one choice.  I tried that and it
> worked if it is only a hyperlink, but it DOES NOT work when I use POST.
>
> Any one has experience in this ?
>
> Thanks in advance,
>
> siman
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] NS4.x / IE3.0 Browser Detection

2002-08-20 Thread Lowell Allen

> From: Andre Dubuc <[EMAIL PROTECTED]>
> 
> I need to differentiate between different versions of NS4, particularly
> the ones that are used by Mac. So far, I've used the following to detect
> variants:
> 
> if(eregi("(Mozilla/4.[0-8][0-9])",$_SERVER['HTTP_USER_AGENT']))
> 
> However, I'm aware that it will not distinguish between PC and Mac-based NS4.
> My question is: what versions of NS (if any) do Mac's use? I've used the
> following to detect IE3.0 users:
> 
> if(eregi("(mozilla/3.0)",$_SERVER['HTTP_USER_AGENT']))
> 
> Is this correct?
> 
> Any insights or advice most welcome.

Here's what I use to detect Mac Netscape 4.x:

if((eregi("Mozilla", getenv("HTTP_USER_AGENT"))) &&
(!eregi("MSIE", getenv("HTTP_USER_AGENT"))) &&
(!eregi("Gecko", getenv("HTTP_USER_AGENT"))) &&
(eregi("Mac", getenv("HTTP_USER_AGENT"

Do you really need to differentiate between 4.x versions? It looks like
you're matching any 4.x version.

--
Lowell Allen


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




RE: [PHP] suggestions for a good php+mysql isp?

2002-08-20 Thread MET

http://www.futurequest.com

Fantastic!!

~ Matthew

-Original Message-
From: db, or not db [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 20, 2002 11:01 AM
To: [EMAIL PROTECTED]
Subject: [PHP] suggestions for a good php+mysql isp?


I have searched the archives and the last time this was seriously
discussed was september of last year...unless I have a giant gaping hole
in my archive!  :)  I was considering northwesthost.com and would like
some opinions on them or anybody you are happy with  The list of isp's
on php.net doesn't mean much to me without some current comments about
their performance. I need php and mysql support for my site - I'm moving
the domain name and site from myhosting.com (they're ASP and perl2exe'd
scripts only).  TIA!

-Kirk



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


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




[PHP] suggestions for a good php+mysql isp?

2002-08-20 Thread db, or not db

I have searched the archives and the last time this was seriously discussed
was september of last year...unless I have a giant gaping hole in my
archive!  :)  I was considering northwesthost.com and would like some
opinions on them or anybody you are happy with  The list of isp's on php.net
doesn't mean much to me without some current comments about their
performance.
I need php and mysql support for my site - I'm moving the domain name and
site from myhosting.com (they're ASP and perl2exe'd scripts only).  TIA!

-Kirk



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




Re: [PHP] Embeding images in HTML emails

2002-08-20 Thread Andrew Perevodchik

Hello, Michael Sims!

MS> I imagine that
MS> Manuel Lemos' PHP Classes site has a class that would take care of
MS> this for you...

url, plz :)

-- 
Andrew Perevodchik


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




Re: [PHP] Apache

2002-08-20 Thread Chris Hewitt

Roman,

It seems http.conf has not been set to parse ".pl" files. Have you got 
an unconditional "
LoadModule perl_module" and "AddModule mod_perl.c" lines? Is your perl 
script in a directory with ExecCGI permissions and is the script's 
executable bit set (for the user apache is running as). Restart apache 
after any changes. Best suggestions I have.

But yes, not a php question.

HTH
Chris

 Roman Duriancik wrote:

>create script with some name (e.g. test.pl) and if in www expoler write
>http://server/test.pl result is source code of script. But I need result of
>this script.
>



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




[PHP] object creation

2002-08-20 Thread Jose Jeria

The code below also works if you omit the declaration of the $userAgent,
will it be any difference?

/José J

class Browser
{
# the line below is not necessary?
var $userAgent;

function Browser()
   {
$this->userAgent = $GLOBALS["HTTP_USER_AGENT"];
}
}



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




Re: [PHP] 4.04 --> 4.1.2 incompatible

2002-08-20 Thread Jason Wong

On Tuesday 20 August 2002 22:07, Petre Agenbag wrote:
> My oh my
> OK, can someone help with this one???
> My original Form conatined the following:
> 
> bla, bla
>
>
> And then things broke, so, out of curiosity, I removed the enctype=""
> part, and now it works/

php.info -> file_uploads

Next time read all the releases notes, history, readme, changelog etc *before* 
you upgrade.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Do not do unto others as you would they should do unto you.  Their tastes
may not be the same.
-- George Bernard Shaw
*/


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




RE: [PHP] NS4.x / IE3.0 Browser Detection

2002-08-20 Thread Brian V Bonini

HTTP_USER_AGENT returns platform info as well  doesn't it...??

> -Original Message-
> From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 10:10 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] NS4.x / IE3.0 Browser Detection
> 
> 
> I need to differentiate between different versions of NS4, particularly 
> the ones that are used by Mac. So far, I've used the following to detect 
> variants:
> 
> if(eregi("(Mozilla/4.[0-8][0-9])",$_SERVER['HTTP_USER_AGENT']))
> 
> However, I'm aware that it will not distinguish between PC and 
> Mac-based NS4. 
> My question is: what versions of NS (if any) do Mac's use? I've used the 
> following to detect IE3.0 users:
> 
> if(eregi("(mozilla/3.0)",$_SERVER['HTTP_USER_AGENT']))
> 
> Is this correct?
> 
> Any insights or advice most welcome.
> Tia,
> Andre
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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




[PHP] Apache 2.0.40 and PHP

2002-08-20 Thread Adam Williams

Yesterday it was recommended that I get the latest PHP from
http://snaps.php.net.  I did that last night and today, and I am compiling
it as follows.  Currently this error was on the snapshot of 200208200600.

./configure --enable-track-vars --with-mysql --with-mail 
--with-apxs2=/usr/local/apache2/bin/apxs
make
make install

and it errors out on the make install with:

chmod 755 /usr/local/apache2/modules/libphp4.so
Installing shared extensions:
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/
Installing PHP CLI binary:/usr/local/bin/
Installing PEAR environment:  /usr/local/lib/php/
[PEAR] Archive_Tar- already installed: 0.9
[PEAR] Console_Getopt - already installed: 0.11
[PEAR] PEAR   - already installed: 0.91-dev
make[1]: *** [install-pear-installer] Segmentation fault
make: *** [install-pear] Error 2

PHP seems to have build tho, because the timestamp on it is correct:

[root@missioncontrol php4-200208200600]# ls -l
/usr/local/apache2/modules/libphp4.so
-rwxr-xr-x1 root root  4080175 Aug 20 09:19
/usr/local/apache2/modules/libphp4.so

and when I go to my web page that has a PHP include() statement, it works
fine.  Is anyone else having similar problems and have a solution?  Or
since PHP is working, even though the install errors out, to just not
worry about it?

Adam


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




RE: [PHP] php Transaction question

2002-08-20 Thread Steve Bradwell

Ya that's pretty much it. Just do:

mysql_query("BEGIN");
$sql = "Update bla...";
$result = mysql_query($sql);
if($result)
 mysql_query("COMMIT");
else
 mysql_query("ROLLBACK");

HTH
Steve.

-Original Message-
From: Randy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 10:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php Transaction question


I know I saw this somewhere before but cannot find the answer

In a php/mysql script  how do a do a transaction

is it like this or is their a better way to do it? 

innodb table method

$query="set autocommitt=0;"
mysql_query($query);

$query="select blah from blah;";
mysql_query($query);

$query="update blah where blah;";
mysql_query($query);

$query="committ;";
mysql_query($query);


Thanks

Randy



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

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




Re: [PHP] 4.04 --> 4.1.2 incompatible

2002-08-20 Thread Petre Agenbag

My oh my
OK, can someone help with this one???
My original Form conatined the following:

bla, bla


And then things broke, so, out of curiosity, I removed the enctype=""
part, and now it works/




On Tue, 2002-08-20 at 13:05, Thies C. Arntzen wrote:
> On Tue, Aug 20, 2002 at 12:01:24PM +0200, Petre Agenbag wrote:
> > Yes, phpinfo() returns that register globals is ON...
> 
> and does a simple testpage work?
> 
> 
> test.php
>  echo $hallo;
> ?>
> 
> http://localhost/test.php?hallo=test
> 
> should show a page containing the word test
> 
> re,
> tc
> > 
> > On Tue, 2002-08-20 at 11:52, Thies C. Arntzen wrote:
> > > On Tue, Aug 20, 2002 at 11:28:55AM +0200, Petre Agenbag wrote:
> > > > Hi
> > > > Can someone please tell me what settings to check for on 4.1.2 in order
> > > > to ensure that scripts that runs on 4.0.4 will run on 4.1.2?
> > > > 
> > > > I HAVE checked registered_globals = on, but I still get variables that
> > > > are not passed on via URL and form submits.
> > > > 
> > > > The app has a "login" form that submits to an action page, on the action
> > > > page I generate a link that goes to another form, I append the username
> > > > and password to the end of the URL of the link on the action page, and
> > > > then create hidden fields that echo the username and password in the
> > > > subsequent form to be passed along with the extra form field to the last
> > > > page.
> > > > 
> > > > This whole process works 100% on 4.0.4, but breaks at the second page on
> > > > 4.1.2 (ie, it DOESN't pass the username and password to the action page
> > > > from the form fields).
> > > > 
> > > > I need to resove this, as I have lots of applications that was written
> > > > in this way, and are currently working, but want to upgrade the server
> > > > to RedHat 7.3 that comes with 4.1.2 and don't want to end up with a
> > > > bunch of broken apps.
> > > > 
> > > > I know it's not the correct way to have coded, but it's done now, and
> > > > for now, I won't mind to have register_globals = On, although THAT
> > > > doesn't seem to be the solution...
> > > > Please advise.
> > > > Thanks
> > > 
> > > have you checked that register_globals _is_ actually on? just
> > > look at the output of phpinfo();
> > > 
> > > re,
> > > tc
> > > 
> > > -- 
> > > 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
> 
> -- 
> Thies C. Arnzten   -   Looking for all sorts of freelance work  -   just ask..
> Whishlist:  http://www.amazon.de/exec/obidos/wishlist/AB9DY62QWDSZ
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




[PHP] php Transaction question

2002-08-20 Thread Randy Johnson

I know I saw this somewhere before but cannot find the answer

In a php/mysql script  how do a do a transaction

is it like this or is their a better way to do it? 

innodb table method

$query="set autocommitt=0;"
mysql_query($query);

$query="select blah from blah;";
mysql_query($query);

$query="update blah where blah;";
mysql_query($query);

$query="committ;";
mysql_query($query);


Thanks

Randy



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




php-general Digest 20 Aug 2002 14:05:45 -0000 Issue 1536

2002-08-20 Thread php-general-digest-help


php-general Digest 20 Aug 2002 14:05:45 - Issue 1536

Topics (messages 113283 through 113323):

Re: database value count retrieval
113283 by: David Freeman

Re: tracking visitors till registration?
113284 by: Randy Johnson
113287 by: Rasmus Lerdorf
113289 by: Daren Cotter
113291 by: Manuel Lemos

Replicate string or something similar
113285 by: Saci
113286 by: Martin Towell
113288 by: Tom Rogers
113290 by: Tom Rogers
113293 by: Saci
113307 by: lallous

Re: Php page runs from one computer but not another
113292 by: Jaskirat  Singh

Can i send post variable thur header?
113294 by: NoWhErEMan
113295 by: Jome
113318 by: robert mischke

Re: fopen(http:...) problems
113296 by: php

cURL and POST
113297 by: Samantha Savvakis
113306 by: lallous

 4.1.2 incompatible
113303 by: Petre Agenbag
113304 by: Thies C. Arntzen
113305 by: Petre Agenbag
113308 by: Thies C. Arntzen

Apache 2
113309 by: Adrian Ciutureanu

Embeding images in HTML emails
113310 by: Radu Manole
113316 by: Michael Sims

crone job for iptc image creation
113311 by: Sascha Braun

array_splice()
113312 by: Riccardo Sepe

how to fight backslash in char variable???
113313 by: Maris Kalnins
113314 by: Michael Sims
113315 by: Jason Wong

Apache
113317 by: Roman Duriancik
113320 by: David Robley

Re: halloween documents
113319 by: Steve Mallett

POST & SID
113321 by: simanhew

NS4.x / IE3.0 Browser Detection
113323 by: Andre Dubuc

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


 > >SELECT COUNT(x) FROM table;
 > >
 > >Make 'x' equal to any column name in the table and add WHERE to the
 > >clause as needed.
 > 
 >  err...all very well, but how do i retrieve the 
 > value afterwards? 

 >  $sqlcom="select count(codigo) from comments where 
 > codigo=$id";

  SELECT COUNT(codigo) AS SomeName FROM comments WHERE codigo='$id'

Then you'll have 'SomeName' to play with.

CYA, Dave




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

How do I surpress php warnings from being displayed to the screen


Randy



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

See your php.ini file.  Specifically the display_errors directive.  See
also log_errors and error_log.

-Rasmus

On Mon, 19 Aug 2002, Randy Johnson wrote:

> How do I surpress php warnings from being displayed to the screen
>
>
> Randy
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

php.ini config file

--- Randy Johnson <[EMAIL PROTECTED]> wrote:
> How do I surpress php warnings from being displayed
> to the screen
> 
> 
> Randy
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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

On 08/19/2002 06:01 PM, Andy wrote:
> Hi there,
> 
> I am wondering if following scenario would be possible:
> 
> - Create a unique referer id to make sure that the visitior has been refered
> by a particular person. (e.g. server.com?ref=20)
> - The visitor enters the site and browses around, but the ref=20 should not
> be stored inside the url, but in a coockie
> - If the visitor signs up and there is a referer id assign the person who
> refered it some points.
> 
> The problem I see, is how to make sure that the refered id does not get lost
> and in case the person comes back another day still be able to asign the
> person who refered it the points.
> 
> Has anybody a good suggestion on that?

Cookies and volatile referer id in URL are not a good idea because many 
of them will get lost in the process and the referer looses credits. 
That is why affiliate programs like those use by Barnes and Noble are 
worthless as they hardly return any credit to the referer.

OTOH, referral tracking methods that pass the referer page by page like 
the one that Amazon uses are much more efficient because they survive 
bookmarking as the referer id is always in the URL and not in a cookie 
that may be discarded if the user only registers some other day going to 
the bookmarked pages.

The problem of Amazon method of keeping the referer id in the URL is 
that all pages that the user goes in the site have to be dynamically 
generated so the links are personalized to always include the referer id.

A better method that I use to keep track of referal, is to include the 
r

[PHP] NS4.x / IE3.0 Browser Detection

2002-08-20 Thread Andre Dubuc

I need to differentiate between different versions of NS4, particularly 
the ones that are used by Mac. So far, I've used the following to detect 
variants:

if(eregi("(Mozilla/4.[0-8][0-9])",$_SERVER['HTTP_USER_AGENT']))

However, I'm aware that it will not distinguish between PC and Mac-based NS4. 
My question is: what versions of NS (if any) do Mac's use? I've used the 
following to detect IE3.0 users:

if(eregi("(mozilla/3.0)",$_SERVER['HTTP_USER_AGENT']))

Is this correct?

Any insights or advice most welcome.
Tia,
Andre

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




[PHP] RE: RE: array_unique & multi-dimensional arrays

2002-08-20 Thread Tim Ward

Sasha ... I'm sending this again to the list as it seemed to bounce from
your address

the way I was doing it prevents unique values from being created in the
first place. The only array that gets overwritten is one that would be the
same any way

while ($row = mysql_fetch_array($result))
{   $month = date("m", $row['timestamp']);
$year = date("Y", $row['timestamp']);
$archive_date = mktime(1,1,1,$month,1,$year);

$archive_nav[$archive_date] = $archive_date;
}

... ensures that if the date has already been added to the array then it
overwrites the existing one instead of adding a new element.

Tim Ward


> -Original Message-
> From: sasha [mailto:[EMAIL PROTECTED]]
> Sent: 20 August 2002 14:36
> To: Tim Ward
> Subject: Re: RE: array_unique & multi-dimensional arrays
> 
> 
> It may just have been that I was not putting your 
> sample code in the right location...  I had ended up 
> doing it differently than I originally intended:
> 
> while ($row = mysql_fetch_array($result)) {
>   $month = date("m", $row['timestamp']);
>   $year = date("Y", $row['timestamp']);
>   $archive_date = mktime(1,1,1,$month,1,$year);
>   
>   array_push($archive_nav, $archive_date);
> }
> $archive_nav = array_values(array_unique
> ($archive_nav));
> 
> And then later on, I do a date check on the new 
> timestamp to get the month/year/longmonth out of it.  
> Only 3 extra lines of code this way.
> 
> I don't understand exactly how your code works.  If I 
> do it inside of the while loop, it would overwrite the 
> previous contents of the array (unless I did a '.=', 
> instead of just '=').  So when I tried doing it 
> outside of the loop, all I ended up with was nothing.
> 
> thanks
> sasha
> 
> 8/20/2002 3:58:01 AM, Tim Ward 
> <[EMAIL PROTECTED]> wrote:
> 
> >array_unique tests the values of each element of the 
> top level array - which
> >are all 'array' - hence you only get one element left
> >
> >the way I'd do this is ...
> >$archive_nav["$year/$month"] = array(month => $month, 
> year => $year,
> >longmonth => $longmonth);
> >
> >this will prevent duplicate combinations of month and 
> year (and,
> >incidentally, allow you to sort on year and month 
> very easily).
> >
> >Tim Ward
> >www.chessish.com
> >
> >> -Original Message-
> >> From: sasha [mailto:[EMAIL PROTECTED]]
> >> Sent: 19 August 2002 19:10
> >> To: [EMAIL PROTECTED]
> >> Subject: array_unique & multi-dimensional arrays
> >> 
> >> 
> >> I am trying to clean up some junky code in a 
> journal/news type 
> >> script and redoing the archive navigation.  I am 
> pulling all of 
> >> the dates of the entries and pushing it into a 
> multi-
> >> dimensional array like so:
> >> 
> >> array_push($archive_nav, array(month => $month, 
> year => $year, 
> >> longmonth => $longmonth));
> >> 
> >> I assumed I could just use array_unique to filter 
> out all of 
> >> the duplicates in the array.  But it doesn't seem 
> to work that 
> >> way, and the only month/year combo I end up with is 
> the very 
> >> oldest one (according to year/month) in the array.
> >> 
> >> $archive_nav = array_unique($archive_nav);
> >> 
> >> If I leave out array_unique, I am getting all of 
> the 
> >> appropriate month/year combos in my script while 
> doing a 
> >> foreach... just one for every single entry in the 
> database for 
> >> that combo (which is a lot in some cases!).
> >> 
> >> Is there a better way to do this?
> >> 
> >> sasha
> >> 
> >> 
> >> 
> >
> 
> 
> 

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




[PHP] POST & SID

2002-08-20 Thread simanhew

hi all,

I have a question regarding POST and SID:
I am trying to make a no-cookies browser work with session_id, according to
some tutorial, using  in URL is one choice.  I tried that and it
worked if it is only a hyperlink, but it DOES NOT work when I use POST.

Any one has experience in this ?

Thanks in advance,

siman



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




[PHP] Re: Apache

2002-08-20 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Please help me with my trouble.
> This is not php trouble but trouble with apache and perl scripts. How I
> configure apache (httpd.conf) for running pearl script in web page. If I
> create script with some name (e.g. test.pl) and if in www expoler write
> http://server/test.pl result is source code of script. But I need result of
> this script.

You probably should be asking this in an Apache newsgroup or mailing list.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: halloween documents

2002-08-20 Thread Steve Mallett

A plea for help

Would anyone be willing to code the Halloween Documents so we could 
print them as PDF files

http://opensource.org/halloween/

-- 

Steve Mallett | [EMAIL PROTECTED]
http://open5ource.net 

"The more I contemplate death and my mortality, the
more it inspires me to live my life like a work of art."
-Brian Clifton


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




AW: [PHP] Can i send post variable thur header?

2002-08-20 Thread robert mischke

Possibly you could use the header() function.

header(Content-type: application/x-www-form-urlencoded);
header(Content-length: echo $conten_length_in_byte;);
header(var=$content&var2=$conten3);

It's a gess,
didn't tryed.

Try curl 
or 
snoppy class <- at sourceforge
also at phpclasse.org a lot of dealing with http.

robert


> -Ursprüngliche Nachricht-
> Von: NoWhErEMan [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 20. August 2002 07:54
> An: [EMAIL PROTECTED]
> Betreff: [PHP] Can i send post variable thur header?
> 
> 
> Hi all,
> 
> I want to redirect to another page and pass some post
> variables to that page. I know how to pass get variables ( 
> just include at the end of url) But i have no idea how to 
> pass post variables, is it possible ?
> 
> Thanks
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




[PHP] Apache

2002-08-20 Thread Roman Duriancik

Please help me with my trouble.
This is not php trouble but trouble with apache and perl scripts. How I
configure apache (httpd.conf) for running pearl script in web page. If I
create script with some name (e.g. test.pl) and if in www expoler write
http://server/test.pl result is source code of script. But I need result of
this script.

Thank you

Roman



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




Re: [PHP] Embeding images in HTML emails

2002-08-20 Thread Michael Sims

On Tue, 20 Aug 2002 14:52:21 +0300, you wrote:

>Hi,
>
>Does anyone know how to embed images in HTML emails in order to avoid a
>server request (no http://server/foo.img";>)?
>Is this possible?

It is possible.  If you are sending a multipart MIME message, attach
the image as MIME type image/gif or image/jpeg with a particular name,
and then inside your HTML attachment reference the image like so:

cid:myimage.gif";>

I'm personally using a Perl module, MIME::Lite, as the basis for the
above.  There may be other ways to implement it.  I imagine that
Manuel Lemos' PHP Classes site has a class that would take care of
this for you...

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




Re: [PHP] how to fight backslash in char variable???

2002-08-20 Thread Jason Wong

On Tuesday 20 August 2002 20:13, Maris Kalnins wrote:
> Hi guys!
>
> Situation:
>
> $intext = "blablabla ' blablabla";
> then this $intext is passed to out.php (as parameter out.php?intext=...)
>
> the problem is that from out.php I need to echo this $intext but I get:
>
> blablabla \' blablabla
>
> the question is.. how to fight this backslash out of there?

If you want to disable this behaviour:

  php.ini -> magic_quotes_gpc

Otherwise use stripslashes()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The idle mind knows not what it is it wants.
-- Quintus Ennius
*/


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




Re: [PHP] how to fight backslash in char variable???

2002-08-20 Thread Michael Sims

On Tue, 20 Aug 2002 15:13:53 +0300, you wrote:

>the problem is that from out.php I need to echo this $intext but I get:
>
>blablabla \' blablabla
>
>the question is.. how to fight this backslash out of there?

The magic_quotes_gpc setting is enabled on your server.  If you have
access to the server config, I would suggest disabling it (I find it
to be a huge pain).  If you don't, but can place PHP directives in
.htaccess files, you can disable it on a per-directory basis.  If that
option is unavailable, you'll be forced to use the stripslashes()
function on data that comes from get, post, or cookie.

HTH

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




[PHP] how to fight backslash in char variable???

2002-08-20 Thread Maris Kalnins

Hi guys!

Situation:

$intext = "blablabla ' blablabla";
then this $intext is passed to out.php (as parameter out.php?intext=...)

the problem is that from out.php I need to echo this $intext but I get:

blablabla \' blablabla

the question is.. how to fight this backslash out of there?


Thanks, Maris



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




[PHP] array_splice()

2002-08-20 Thread Riccardo Sepe

Hi evey1,
in order to remove a whole array of values from a multidimensional array 
I tried the following:

foreach($bkmks as $val) { 
if($val[8]==$cod){
array_splice($bkmks,$val,1);
}
   }
It works fine for all the arrays but the first ($bkmks[0]) When I 
try to remove that array this is what I get :
Fatal error: Maximum execution time of 30 seconds exceeded in .
 after that if I read $bkmks all the arrays have been removed but 
$bkmks[0](the array I wanted to  remove)
Why ?
Is there a better way to do it ?

thanks again


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




[PHP] crone job for iptc image creation

2002-08-20 Thread Sascha Braun

Hi,

I want to build up an image library for the first time and there are some problems to 
solve.

I need to create a cron job (whatever this may be) for picking up pictures in an 
special folder and extracting the iptc text fields in the images and write them to a 
DB. On the other hand the cronejob should create jpeg preview images on the fly and 
also create small thumbnails.

I'm not the super dupa PHP Programmer and need some informations or help about doing 
this. If you got some information or scripts you would like to provide, please send me 
an email.

Ciao, Folks

Schura



  1   2   >