RE: [PHP] PHP in HTML

2002-05-16 Thread Peter

true there's not that much difference .. though it would depend on the
server's connection speed as well as the machines "grunt" as to how much of
a difference there is.

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 May 2002 4:40 PM
To: Peter
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP in HTML


Do you really find it noticeable quicker? Benchmarks I've seen (none of
them that current) don't seem to support that. Depending on the software
versions involved, it seems to be anywhere from much faster through PHP to
a few % slower. Certainly no major penalty in any case.

If there's interest I'd be willing to do some benchmarks on a few
different setups to see where things stand with current software.

miguel

On Fri, 17 May 2002, Peter wrote:
> I find it better than having every page go thru php not to mention
quicker.
>
>
>
> -Original Message-
> From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 17 May 2002 3:52 PM
> To: Peter
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] PHP in HTML
>
>
> On Fri, 17 May 2002, Peter wrote:
> >> there are also possible good reasons for sending .html files through
> >> php. like if you don't want users to know that your website is written
> >> in php.
> >
> > a better way to do that would be to make up your own extension so
> > instead of having your server use .php for php files make it use .web or
> > what ever you like ...
>
> Why is that better?
>
> There are certain little weirdnesses that crop up when HTML pages have
> file names that fool lesser platforms into thinking they're not HTML,
> especially when they try to save them locally.
>
> miguel
>
>
>
>



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




Re: [PHP] Problem with sending information with quotes

2002-05-16 Thread Miguel Cruz

On Fri, 17 May 2002, Rosen wrote:
> // if in the input form I enter something with quotes, i.e.  "TEST"
> //here the value of $text  is   \"TEST\" . The PHP send value to
> me with backslah.
> //
> //How can I get the real entered, i.e. "TEST" ? Where is the problem ?

http://php.net/stripslashes

miguel


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




RE: [PHP] PHP in HTML

2002-05-16 Thread Miguel Cruz

Do you really find it noticeable quicker? Benchmarks I've seen (none of
them that current) don't seem to support that. Depending on the software
versions involved, it seems to be anywhere from much faster through PHP to
a few % slower. Certainly no major penalty in any case.

If there's interest I'd be willing to do some benchmarks on a few 
different setups to see where things stand with current software.

miguel

On Fri, 17 May 2002, Peter wrote:
> I find it better than having every page go thru php not to mention quicker.
> 
> 
> 
> -Original Message-
> From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 17 May 2002 3:52 PM
> To: Peter
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] PHP in HTML
> 
> 
> On Fri, 17 May 2002, Peter wrote:
> >> there are also possible good reasons for sending .html files through
> >> php. like if you don't want users to know that your website is written
> >> in php.
> > 
> > a better way to do that would be to make up your own extension so
> > instead of having your server use .php for php files make it use .web or
> > what ever you like ...
> 
> Why is that better? 
> 
> There are certain little weirdnesses that crop up when HTML pages have 
> file names that fool lesser platforms into thinking they're not HTML, 
> especially when they try to save them locally.
> 
> miguel
> 
> 
> 
> 


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




[PHP] Problem with sending information with quotes

2002-05-16 Thread Rosen

Hi,
I have follow PHP file test.php:


if ($action=="")
{
echo "";
echo "";
echo "";
echo "";
echo "";
}

if ($action=="send")
{

echo "$text";

// if in the input form I enter something with quotes, i.e.  "TEST"
//here the value of $text  is   \"TEST\" . The PHP send value to
me with backslah.
//
//How can I get the real entered, i.e. "TEST" ? Where is the problem ?

}


Thanks,
Rosen Marinov



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




[PHP] Multiple Upload using list

2002-05-16 Thread Triax

Hello,
currently I want to implement a multiple upload using a listbox.
I have 2 link which will dynamically add or remove a file to/from the
list box,
I'm writing it as a java script as below.
-
function addFile(){
 var temp, ext;
 document.mform.filUpload.click();
 if(document.mform.filUpload.value != ""){
  ext = document.mform.filUpload.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if ((ext == 'jpg') || (ext == 'gif')) {
   temp = new Option();
   temp.text = document.mform.filUpload.value;
   temp.value = document.mform.filUpload.value;
   document.mform.elements['lstUpload[]'].add(temp, 1);
  }
  else
   alert("Invalid file type selected");
 }
-
Upon sbumitting, my php script can only read the local drive directory
instead of the
temporary directory on the server.
When I did a copy function, it tell me that it cant copy as the source
file does not exist.
Below is part of my php script.
-
  if(!isset($WINDIR)) $filename = str_replace("", "\\", $lstUpload[$i]);
.
   if(!copy($filename,
"/home/fotohub/public_html/memPhotos/$usrID/$img_name") ){
echo "Failed to copy"; exit();
   }
--
Below is my html
--


 

<--!  This will create a link Add Foto... which will open up the file
browser window. -->

 Add Foto ... 
--
Can anyone help me out in how to get the temporary file name?

Thanks
 from Triax



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




[PHP] Can anyone help me with fopen ?

2002-05-16 Thread Roman Duriancik

I have some text file, in this text file i write some information.
But my problem is : How write/append new information on beginning of
document but
old information will be there too. When I used fopen with option "a" or "r+"
and
with command rewind new information rewrited old information.
Thanks for yours help.

roman


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




RE: [PHP] PHP in HTML

2002-05-16 Thread Peter

I find it better than having every page go thru php not to mention quicker.



-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 May 2002 3:52 PM
To: Peter
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP in HTML


On Fri, 17 May 2002, Peter wrote:
>> there are also possible good reasons for sending .html files through
>> php. like if you don't want users to know that your website is written
>> in php.
> 
> a better way to do that would be to make up your own extension so
> instead of having your server use .php for php files make it use .web or
> what ever you like ...

Why is that better? 

There are certain little weirdnesses that crop up when HTML pages have 
file names that fool lesser platforms into thinking they're not HTML, 
especially when they try to save them locally.

miguel



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




[PHP] Sending data from java applet on client ?

2002-05-16 Thread Marco Laponder

Hi All,
 
Does anybody know how to send binary data from an applet to a php page and
save this into a blob ? Or is using  afile upload my only option ( would
like that because then it would have to be a signed applet :-( )
 
Any suggestions welcome !

Marco Laponder
( [EMAIL PROTECTED]  )
 
 

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




Re: [PHP] can any one see a problem with this script?

2002-05-16 Thread Jason Wong

On Friday 17 May 2002 13:26, Peter wrote:
> I have also tried
>
> adding the r option as I only want to read the file as follows
>
> $fp = fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10";,
> "r") or die("Error reading RSS data.");
>
> but I still get the same error message..

This works fine for me:

http://www.phpbuilder.com/rss_feed.php?type=general&limit=10","r";);
fpassthru($fp);
?>

Check the archives & bugs.php.net to see whether there are any issues with 
fopen() & URLs with Windows.

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

/*
The young lady had an unusual list,
Linked in part to a structural weakness.
She set no preconditions.
*/


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




RE: [PHP] PHP in HTML

2002-05-16 Thread Miguel Cruz

On Fri, 17 May 2002, Peter wrote:
>> there are also possible good reasons for sending .html files through
>> php. like if you don't want users to know that your website is written
>> in php.
> 
> a better way to do that would be to make up your own extension so
> instead of having your server use .php for php files make it use .web or
> what ever you like ...

Why is that better? 

There are certain little weirdnesses that crop up when HTML pages have 
file names that fool lesser platforms into thinking they're not HTML, 
especially when they try to save them locally.

miguel


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




Re: [PHP] PHP in HTML

2002-05-16 Thread Jason Wong

On Friday 17 May 2002 13:33, Jerome Houston wrote:
> yeah, just find in your web server where to tell it what kind of files to
> send through php.
>
> there are also possible good reasons for sending .html files through php.
> like if you don't want users to know that your website is written in php.

Unless it has been configured otherwise, they can tell from the HTTP headers 
that you're using php.

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

/*
A student who changes the course of history is probably taking an exam.
*/


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




RE: [PHP] PHP in HTML

2002-05-16 Thread Peter




there are also possible good reasons for sending .html files through php.
like if you don't want users to know that your website is written in php.

-jerome



a better way to do that would be to make up your own extension so instead of
having your server use .php for php files make it use .web or what ever you
like ...


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




Re: [PHP] PHP in HTML

2002-05-16 Thread Jerome Houston

yeah, just find in your web server where to tell it what kind of files to 
send through php.

there are also possible good reasons for sending .html files through php.  
like if you don't want users to know that your website is written in php.

-jerome


Original Message Follows
From: Justin French <[EMAIL PROTECTED]>
To: Jeremy <[EMAIL PROTECTED]>

Your Apache config file will be set to only parse PHP pages if they have the
.php extension this is a feature, not a big, because otherwise every
html page on your server will be parsed, rather than just the php ones...
you could modify your apache config iff you wished, but I wouldn't.  .html
for HTML, .php for PHP, all is well.

Justin French


on 17/05/02 12:14 PM, Jeremy ([EMAIL PROTECTED]) wrote:

 > Hi Folks,
 >
 > A simple question that has me puzzled, obviously I have a config file 
wrong
 > somewhere..
 >
 > Why does a filename.php file run as php and a filename.html with php code
 > embedded not produce a php result?
 >
 > cheers,
 >
 > Jeremy Burton
 > Senior Consultant
 > PERTH TOURIST LOUNGE
 >
 > Level 2 Carillon City
 > Murray Street, Perth
 > Ph: +618 9229 2238
 > Fax: +618 9229 2220
 > Email: [EMAIL PROTECTED]
 >
 >
 >


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





_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




RE: [PHP] can any one see a problem with this script?

2002-05-16 Thread Peter

I have also tried

adding the r option as I only want to read the file as follows

$fp = fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10";,
"r") or die("Error reading RSS data.");

but I still get the same error message..


-Original Message-
From: Steve Buehler [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 May 2002 2:55 PM
To: Peter; Php
Subject: Re: [PHP] can any one see a problem with this script?


Not sure, but it might be the space that you have after the limit=10

Steve

At 11:39 PM 5/16/2002, Peter wrote:
>hi can any one see a problem with this script .. I am trying to use
>phpbuilder's rss link for a site but am having errors
>
>
>$content .= "\n\n";
>$content .= "test\n";
>$content .= "\n";
>$content .= "\n";
>//line 8 starts {
>$fp = fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10
",
>"r") or die("Error reading RSS data.");
>// } line 8 finishes
>
>fclose($fp);
>
>$content .= "\n";
>$content .= "\n";
>
>echo $content;
>?>
>
>The error is as follows
>
>Warning: php_hostconnect: connect failed in c:\phpdev\www\test.php on line
8
>
>Warning:
>fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10","r";)
>- Bad file descriptor in c:\phpdev\www\test.php on line 8
>Error reading RSS data.
>
>Cheers
>
>Peter
>"the only dumb question is the one that wasn't asked"
>
>
>
>--
>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] can any one see a problem with this script?

2002-05-16 Thread Steve Buehler

Not sure, but it might be the space that you have after the limit=10

Steve

At 11:39 PM 5/16/2002, Peter wrote:
>hi can any one see a problem with this script .. I am trying to use
>phpbuilder's rss link for a site but am having errors
>
>
>$content .= "\n\n";
>$content .= "test\n";
>$content .= "\n";
>$content .= "\n";
>//line 8 starts {
>$fp = fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10 ",
>"r") or die("Error reading RSS data.");
>// } line 8 finishes
>
>fclose($fp);
>
>$content .= "\n";
>$content .= "\n";
>
>echo $content;
>?>
>
>The error is as follows
>
>Warning: php_hostconnect: connect failed in c:\phpdev\www\test.php on line 8
>
>Warning: 
>fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10","r";) 
>- Bad file descriptor in c:\phpdev\www\test.php on line 8
>Error reading RSS data.
>
>Cheers
>
>Peter
>"the only dumb question is the one that wasn't asked"
>
>
>
>--
>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] remote fetching??

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Gerard Samuel wrote:
> I was about to modify a script that fetches files for xml content.  It 
> currently does so using fsockopen.
> I originally was going to use plain fopen, and I know that curl can also 
> be used.
> Im looking for preferences as to use one method over another.  Why one 
> is better than the other etc.
> Thanks for any input you may provide...

fopen() is less work and is more portable (doesn't require cURL to be 
built on the server) so if it works, excellent. Otherwise, cURL provides 
a huge amount of additional flexibility. But if you don't need it, it 
doesn't get you anything.

miguel


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




[PHP] can any one see a problem with this script?

2002-05-16 Thread Peter

hi can any one see a problem with this script .. I am trying to use
phpbuilder's rss link for a site but am having errors

\n\n";
$content .= "test\n";
$content .= "\n";
$content .= "\n";
//line 8 starts {
$fp = fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10 ",
"r") or die("Error reading RSS data.");
// } line 8 finishes

fclose($fp);

$content .= "\n";
$content .= "\n";

echo $content;
?>

The error is as follows

Warning: php_hostconnect: connect failed in c:\phpdev\www\test.php on line 8

Warning: fopen("http://www.phpbuilder.com/rss_feed.php?type=general&limit=10
","r") - Bad file descriptor in c:\phpdev\www\test.php on line 8
Error reading RSS data.

Cheers

Peter
"the only dumb question is the one that wasn't asked"



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




RE: [PHP] Passing to an Applet

2002-05-16 Thread Peter

Should be












;)


-Original Message-
From: Dennis Moore [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 May 2002 1:10 PM
To: Joshua Baker; [EMAIL PROTECTED]
Subject: Re: [PHP] Passing to an Applet


Am I missing something?  This is too easy... But here goes...















- Original Message -
From: "Joshua Baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 5:18 PM
Subject: [PHP] Passing to an Applet


All right I've seen in done in jsp and asp, but I'd like to know if I can do
it in PHP as well.

I've got an applet, which is in the page replay.php, with these parameters
that I need to fill from a URL.











I need to pass 2 parameter in the URL from another page to this one, those
parameters are
FILEPREFIX and MAXINDEX.

I've set my link to read as 

The question is how to I, if I can, use PHP to take those variables from the
URL string and use them for the values on that page.

I know most people want to just say RTFM or look it up, but at this point if
anyone could just tell me what this would be under or where exactly this
info is, if it's possible in php.  Thanks

Anti-Blank
Site Designer/Unix Admin




--
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] Passing to an Applet

2002-05-16 Thread Dennis Moore

Am I missing something?  This is too easy... But here goes...















- Original Message -
From: "Joshua Baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 5:18 PM
Subject: [PHP] Passing to an Applet


All right I've seen in done in jsp and asp, but I'd like to know if I can do
it in PHP as well.

I've got an applet, which is in the page replay.php, with these parameters
that I need to fill from a URL.











I need to pass 2 parameter in the URL from another page to this one, those
parameters are
FILEPREFIX and MAXINDEX.

I've set my link to read as 

The question is how to I, if I can, use PHP to take those variables from the
URL string and use them for the values on that page.

I know most people want to just say RTFM or look it up, but at this point if
anyone could just tell me what this would be under or where exactly this
info is, if it's possible in php.  Thanks

Anti-Blank
Site Designer/Unix Admin




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




RE: [PHP] Generate every possible combination

2002-05-16 Thread Lance Lovette

Here's the function I use:

// array array_permute(array [, string])
//
// Returns an array containing the permutations of the values in an array.
//
// Example:
// $a = array(1, 2, 3);
// $p = array_permute($a)
//
// Result:
// p[0] = '1,2,3'
// p[1] = '1,3,2'
// p[2] = '2,1,3'
// p[3] = '2,3,1'
// p[4] = '3,2,1'
// p[5] = '3,1,2'
//
function array_permute(&$a, $glue = ',')
{
$retval = array();
array_permute_internal($a, $glue, $retval, 0, count($a));
return $retval;
}

// Private function used by array_permute.
function array_permute_internal(&$a, $glue, &$retval, $depth, $ubound)
{
if ($ubound > 0)
{
for ($i=0; $i < $ubound; $i++)
{
$c = $a[$depth+$i];
$a[$depth+$i] = $a[$depth];
$a[$depth] = $c;
array_permute_internal($a, $glue, $retval, $depth+1, 
$ubound-1);
$c = $a[$depth+$i];
$a[$depth+$i] = $a[$depth];
$a[$depth] = $c;
}
}
else
{
$retval[] = implode($glue, $a);
}
}

-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 12:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Generate every possible combination


I need to generate every possible combination of the the values in an array.
For example, if...

$array = Array("A", "B", "C");

I want to be able to do something like

print_r(magic_function($array));

which would output

Array
(
[0] => "ABC"
[1] => "ACB"
[2] => "BAC"
[3] => "BCA"
[4] => "CAB"
[5] => "CBA"
)

I really have no idea where to begin. The best lead I can think of is that
there are going to be n! elements in the output array, where n is the size
of
the input array.

Any help would be greatly appreciated.


Evan



--
Think not those faithful who praise all thy words and actions, but those who
kindly reprove thy faults.

Socrates


--
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] PHP in HTML

2002-05-16 Thread Peter

if your using apache for you web server .. in httpd.conf you can set it so
you have the following config..
(this is on windows but same basically applies to other OS's)

LoadModule php4_module c:/phpdev/php/sapi/php4apache.dll
AddType application/x-httpd-php .php .html

this will enable .html files to be run through php at the moment you'd have
like this

LoadModule php4_module c:/phpdev/php/sapi/php4apache.dll
AddType application/x-httpd-php .php

there for .html are not run through php and there for the php code in there
is not going to be of use..

hope that helped.



-Original Message-
From: Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 May 2002 12:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP in HTML


Hi Folks,

A simple question that has me puzzled, obviously I have a config file wrong
somewhere..

Why does a filename.php file run as php and a filename.html with php code
embedded not produce a php result?

cheers,

Jeremy Burton
Senior Consultant
PERTH TOURIST LOUNGE

Level 2 Carillon City
Murray Street, Perth
Ph: +618 9229 2238
Fax: +618 9229 2220
Email: [EMAIL PROTECTED]




--
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] PHP in HTML

2002-05-16 Thread Justin French

Your Apache config file will be set to only parse PHP pages if they have the
.php extension this is a feature, not a big, because otherwise every
html page on your server will be parsed, rather than just the php ones...
you could modify your apache config iff you wished, but I wouldn't.  .html
for HTML, .php for PHP, all is well.

Justin French


on 17/05/02 12:14 PM, Jeremy ([EMAIL PROTECTED]) wrote:

> Hi Folks,
> 
> A simple question that has me puzzled, obviously I have a config file wrong
> somewhere..
> 
> Why does a filename.php file run as php and a filename.html with php code
> embedded not produce a php result?
> 
> cheers,
> 
> Jeremy Burton
> Senior Consultant
> PERTH TOURIST LOUNGE
> 
> Level 2 Carillon City
> Murray Street, Perth
> Ph: +618 9229 2238
> Fax: +618 9229 2220
> Email: [EMAIL PROTECTED]
> 
> 
> 


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




[PHP] PHP in HTML

2002-05-16 Thread Jeremy

Hi Folks,

A simple question that has me puzzled, obviously I have a config file wrong
somewhere..

Why does a filename.php file run as php and a filename.html with php code
embedded not produce a php result?

cheers,

Jeremy Burton
Senior Consultant
PERTH TOURIST LOUNGE

Level 2 Carillon City
Murray Street, Perth
Ph: +618 9229 2238
Fax: +618 9229 2220
Email: [EMAIL PROTECTED]




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




[PHP] remote fetching??

2002-05-16 Thread Gerard Samuel

I was about to modify a script that fetches files for xml content.  It 
currently does so using fsockopen.
I originally was going to use plain fopen, and I know that curl can also 
be used.
Im looking for preferences as to use one method over another.  Why one 
is better than the other etc.
Thanks for any input you may provide...


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




Re: [PHP] Newline in fputs

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Henry Grech-Cini wrote:
> header("Content-type: Application/octet-stream");
> 
> The downloaded file does not contain Windows type carriage returns of
> newlines! However it does contains the data thank goodness.

If you want the newlines converted, then you need to use a text data type,
not application/octet-stream. Try text/plain, for instance.

miguel


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




Re: [PHP] PHP and MySQL

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, City Colleges of Chicago - Mannheim wrote:
> 
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
> 

This wasn't your question, but...


$i"; ?>


miguel


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




RE: [PHP] Date and time functions

2002-05-16 Thread David Freeman


 > I am on the East Coast of Australia.

I'm in central Queensland...

 > Do you know if by default if the date/time display will 
 > display only East coast Australia time, or will display  
 > from the user's time zone? eg Will USA users see the 
 > Australian time or their own time? Would this cause a issue 
 > with timestamping an order when it comes to writing to a 
 > mySQL database?

I presume we're talking about php date/time stuff here?  In that case,
php gets it's date/time from the server it is running on.  If your
server is on the east coast of Australia then you'll have local time for
east coast of Aust.

One way to deal with this would be to take everything back to GMT/UTC/Z
and use that instead.  Then all you need to do is add an appropriate
adjustment to get local time where ever the browser is - of course, you
may not easily be able to figure that out so it's not necessarily a
perfect solution.

In the end, the solution will depend on your requirements.  What are you
using a timestamp for?  If it's purely as a reference point in database
queries (i.e. all changes in the past two days, or 10 mins) then it
probably doesn't matter all that much.  Your database will be updated
from your server and your server has a consistent internal time.

If your application is date dependant in an absolute way then it becomes
a little harder I guess.  Although, you'd also ask yourself how relevant
it becomes to someone in a vastly different time zone - i.e. if you're
doing a local event calendar (which just happens to be one of the things
I'm doing right now) then the fact that an event might be happening
right now instead of this time tomorrow (from the perspective of someone
on the other side of the world and their time zone) is largely
immaterial - they aren't going to get there anyway.

Perhaps the simplest approach to that is to include a time/date
reference.  If you're going to include date information let the browser
know the context.  So, you advertise the next 'xxx' event will be at 3PM
17 May and tell them that it's 10:30AM on 17 May right now.  Leave any
relevant math up to them.

 > Can someone suggest a script that may give me the option to 
 > offer both  time zones to the user?

You could probably do something in javascript (being client-side it
knows the time in the browsers' location) to work out equivalencies and
conversions if you like.

CYA, Dave



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




Re: [PHP] Date and time functions

2002-05-16 Thread Miguel Cruz

On Fri, 17 May 2002, DC wrote:
> I am on the East Coast of Australia.
> 
> Do you know if by default if the date/time display will display only
> East coast Australia time, or will display from the user's time zone? eg
> Will USA users see the Australian time or their own time? Would this
> cause a issue with timestamping an order when it comes to writing to a
> mySQL database?

It'll always use the server's time zone unless you explicitly tell it 
otherwise.

> Can someone suggest a script that may give me the option to offer both  time
> zones to the user?

Best is to store times in your server's native time zone, then ask users 
for their preferred time zone and recalculate times as you display them. 
That way all users can be accommodated with the same set of data.

miguel


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




RE: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Peter

I think he was meaning in terms of PHP can do this ASP can't .. ASP can do
that this way and PHP does it that way.. etc..

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, 17 May 2002 10:11 AM
To: Victor Polyushko
Cc: Php
Subject: Re: [PHP] Done w/ PHP - VB or C# ?


On Thu, 16 May 2002, Victor Polyushko wrote:
> Does anyone know if there is any global reliable and free :-) statistics
on
> usage of PHP vs ASP. I am having the same dilemma.,  do I need to stick to
> going deeply into PHP (which in my opinion rulez!!) or start paying more
> attention to ASP...

I think it's pretty hard to measure usage... what would a meaningful
metric be? Number of servers with ASP available? Number of virtual hosts?
Number of page views served by ASP vs PHP? Number of active developers?

miguel


--
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] Done w/ PHP - VB or C# ?

2002-05-16 Thread Victor Polyushko

hmm.. good question,
I guess number of active job openings will be the best measure :-))
(or websites using PHP vs ASP)




- Original Message -
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: "Victor Polyushko" <[EMAIL PROTECTED]>
Cc: "Php" <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 5:11 PM
Subject: Re: [PHP] Done w/ PHP - VB or C# ?


> On Thu, 16 May 2002, Victor Polyushko wrote:
> > Does anyone know if there is any global reliable and free :-) statistics
on
> > usage of PHP vs ASP. I am having the same dilemma.,  do I need to stick
to
> > going deeply into PHP (which in my opinion rulez!!) or start paying more
> > attention to ASP...
>
> I think it's pretty hard to measure usage... what would a meaningful
> metric be? Number of servers with ASP available? Number of virtual hosts?
> Number of page views served by ASP vs PHP? Number of active developers?
>
> miguel
>
>
> --
> 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] Done w/ PHP - VB or C# ?

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Victor Polyushko wrote:
> Does anyone know if there is any global reliable and free :-) statistics on
> usage of PHP vs ASP. I am having the same dilemma.,  do I need to stick to
> going deeply into PHP (which in my opinion rulez!!) or start paying more
> attention to ASP...

I think it's pretty hard to measure usage... what would a meaningful 
metric be? Number of servers with ASP available? Number of virtual hosts? 
Number of page views served by ASP vs PHP? Number of active developers?

miguel


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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

BINGO!! thank you guys for your input
I used a very simple command to accomplish that and it works!!
http://domain.com/images/somepic.gif";;
system( $command, $result);
echo $result; ?>

Victor Polyushko

- Original Message -
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Victor Polyushko" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 2:25 PM
Subject: Re: [PHP] Can anyone help me save img from URL?


> Victor Polyushko wrote:
> >
> > Hi Guys,
> >
> > Thank you fo your input. I am sorry I am new to the list so + English is
not
> > my first language :-( anyhow., I shoudl 've made my question more clear.
> >
> > I am trying to save the image from the given URL
> > (http://domain.com/image.gif) running a PHP script on the page. I have
tried
> > fread() and it does not allow me to accomplish that :-((
> >
> > Have you guys ever come across such a problem?
>
> $imageData = implode( '', file( 'http://domain.com/image.gif' ) );
> $length = strlen( $imageData );
>
> if( $length > 0 )
> {
> if( (fh = fopen( 'destination', 'w' )) )
> {
> fwrite( fh, $imageData );
> }
> }
>
>
> Cheers,
> Rob.
> --
> .-.
> | Robert Cummings |
> :-`.
> | Webdeployer - Chief PHP and Java Programmer  |
> :--:
> | Mail  : mailto:[EMAIL PROTECTED] |
> | Phone : (613) 731-4046 x.109 |
> :--:
> | Website : http://www.webmotion.com   |
> | Fax : (613) 260-9545 |
> `--'
>
> --
> 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] Done w/ PHP - VB or C# ?

2002-05-16 Thread Victor Polyushko

Does anyone know if there is any global reliable and free :-) statistics on
usage of PHP vs ASP. I am having the same dilemma.,  do I need to stick to
going deeply into PHP (which in my opinion rulez!!) or start paying more
attention to ASP...

Best Regards,
Victor Polyushko







- Original Message -
From: "Peter" <[EMAIL PROTECTED]>
To: "Php" <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 4:52 PM
Subject: FW: [PHP] Done w/ PHP - VB or C# ?


>
> For me personally I find working with ASP & .NET to be a pain in the butt,
> yeah sure you can to use all the fancy GUI's that can take care of some
code
> for you etc..  but then there's the argument about php and having to write
> the code your self.  Personally I find that a better approach as for me
it's
> all about learning and achieving because at the end of the day you can sit
> back and look at it and go wow I did that from scratch  from line 1 of
code
> etc.
>
> Basically it all comes down to personal preference.  I'm coming from a
back
> ground which doesn't include much programming at all (which can  be seen
by
> some of the dumb q's i've posted in here...) and I guess that using
> something with a prodominately (think that's how it's spelt) gui workings
> and that takes care of alot of code for me should be more appealing  but
> it's not  any way basically YOU have to decide what's best for you and
> that your happy with the choices that you've made as in the end it's you
> that's got to live with them.
>
>
> & that's my 2 cents
>
> Peter
>
> -Original Message-
> From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 16 May 2002 7:03 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Done w/ PHP - VB or C# ?
>
>
> I know I'll get mauled big-time on this mailing list but I'm thinking
> about putting PHP on hold for a while and learning ASP.NET
>
> I love PHP and open-source computing but if one wants to get a job in
> web development, you'll have a much better time find a job with both PHP
> and ASP (among others) skills.
>
> I'm going to hop on the ASP bandwagon but I'm not sure if I should
> first learn ASP w/ VB or w/ C#
>
> Any thoughts on this?  What are the pros and cons of both?
>
> 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




FW: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Peter


For me personally I find working with ASP & .NET to be a pain in the butt,
yeah sure you can to use all the fancy GUI's that can take care of some code
for you etc..  but then there's the argument about php and having to write
the code your self.  Personally I find that a better approach as for me it's
all about learning and achieving because at the end of the day you can sit
back and look at it and go wow I did that from scratch  from line 1 of code
etc.

Basically it all comes down to personal preference.  I'm coming from a back
ground which doesn't include much programming at all (which can  be seen by
some of the dumb q's i've posted in here...) and I guess that using
something with a prodominately (think that's how it's spelt) gui workings
and that takes care of alot of code for me should be more appealing  but
it's not  any way basically YOU have to decide what's best for you and
that your happy with the choices that you've made as in the end it's you
that's got to live with them.


& that's my 2 cents

Peter

-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 16 May 2002 7:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Done w/ PHP - VB or C# ?


I know I'll get mauled big-time on this mailing list but I'm thinking
about putting PHP on hold for a while and learning ASP.NET

I love PHP and open-source computing but if one wants to get a job in
web development, you'll have a much better time find a job with both PHP
and ASP (among others) skills.

I'm going to hop on the ASP bandwagon but I'm not sure if I should
first learn ASP w/ VB or w/ C#

Any thoughts on this?  What are the pros and cons of both?

Thanks!


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




[PHP] Re: odbc_fetch_array not working in php 4.2.1 for win?

2002-05-16 Thread Emile Bosch

does'n't matter anyway i rule so i solved it already :D
a nice workaround i made :D /me is sleepy nighty nighty

"Emile Bosch" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> odbc_fetch_array not working in php 4.2.1 for win?
>
> Here it says undefined function :(
> How can i solve it, do i have an old version or something??
>
> Warm regards
> Emile Bosch
>
>



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




[PHP] Date and time functions

2002-05-16 Thread DC

Hi all,

I am on the East Coast of Australia.

Do you know if by default if the date/time display will display only East
coast Australia time, or will display  from the user's time zone?
eg Will USA users see the Australian time or their own time?
Would this cause a issue with timestamping an order when it comes to writing
to a mySQL database?

Can someone suggest a script that may give me the option to offer both  time
zones to the user?

DC




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




[PHP] odbc_fetch_array not working in php 4.2.1 for win?

2002-05-16 Thread Emile Bosch

odbc_fetch_array not working in php 4.2.1 for win?

Here it says undefined function :(
How can i solve it, do i have an old version or something??

Warm regards
Emile Bosch



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




Re: [PHP] BUG?: for loop using chars

2002-05-16 Thread Kevin Stone

No, no bug.  I believe you would end up with something like that if the for
loop is evaluating the letters numerically (either as ASCII values or some
other value).  The examples below would be the proper way of printing a
range of letters...

$letters = range('a', 'z');
for ($i=0; $i
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:27 AM
Subject: [PHP] BUG?: for loop using chars


> Hello,
>
> I'm trying to generate this list of letters A..Z, using this
>
>for ($l='A'; $l<='Z'; $l++)
>   echo $l."-";
>
> And it doesn't work. It generates the output included at the end of
> this message (I used  to be shorter)
>
> But this works
>for ($l='A'; $l<='Y'; $l++)
>   echo $l."-";
> generating the expected output.
>
> IS this a bug in PHP?
>
> Any help? Please, if you can, Cc to my email: [EMAIL PROTECTED]
>
> TIA,
> Erich
>
> ---
> Wrong output:
> A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z-AA-AB-AC-AD-AE-AF-
> AG-AH-AI-YV-YW-YX-YY-YZ-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Re: [PHP-DEV] Console application with PHP

2002-05-16 Thread Markus Fischer

Windows too.

- Markus

On Thu, May 16, 2002 at 02:31:52PM -0700, Vail, Warren wrote : 
> Does this work on Windows, or is it restricted to Linux/unix?
> 
> 
> Warren Vail
> Tools, Metrics & Quality Processes
> (415) 667-7814
> Pager (877) 774-9891
> 215 Fremont 02-658
> 
> 
> -Original Message-
> From: Markus Fischer [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 11:58 AM
> To: DoL
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] Re: [PHP-DEV] Console application with PHP
> 
> 
> Hi,
> 
> all is possible. I suggest taking a look at
> http://gtk.php.net/ and
> http://www.php.net/manual/en/features.commandline.php for a
> start.
> 
> - Markus
> 
> On Fri, May 17, 2002 at 12:12:20AM +0800, DoL wrote : 
> > Hi All
> > 
> > I am trying to write something similar to a server console display, is it
> a
> > good idea to use PHP?
> > 
> > Wondering how things like
> > 1. server clock (similar to a clock applet)
> > 2. server status
> > can be displayed with PHP code?
> > 
> > Note: I need to display the above two in a continuous fashion on the
> status
> > bar!!
> > 
> > Many Thanks
> > Dominic
> > 
> > 
> > 
> > 
> > -- 
> > PHP Development Mailing List 
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> Please always Cc to me when replying to me on the lists.
> GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
> -
> "I mean "When in doubt, blame mcrypt" is more often right than wrong :)"
> "Always right, never wrong :)"
> - Two PHP developers who want to remain unnamed
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
-
"I mean "When in doubt, blame mcrypt" is more often right than wrong :)"
"Always right, never wrong :)"
- Two PHP developers who want to remain unnamed

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




[PHP] Key is an undefined function?

2002-05-16 Thread Damian Harouff

Fatal error: Call to undefined function:  key() in /var/www/explorer/test.php on line 
18

When it's listed right here: http://www.php.net/manual/en/function.key.php

I was playing with the library from: http://phpconcept.free.fr/pclzip/index.en.php

This is the code:


listContent();

//print_r($list);

for ($i = 0 ; $i <= count($list); $i++) {

for ( reset($list[$i]); $keyloc = key($list[$i]); next($list[$i]) ) {
echo "File $i / [$keyloc] = " . $list[$i][$keyloc] . "";
}
echo "";
}

?>


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




RE: [PHP] Re: [PHP-DEV] Console application with PHP

2002-05-16 Thread Vail, Warren

Does this work on Windows, or is it restricted to Linux/unix?


Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-Original Message-
From: Markus Fischer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 11:58 AM
To: DoL
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Re: [PHP-DEV] Console application with PHP


Hi,

all is possible. I suggest taking a look at
http://gtk.php.net/ and
http://www.php.net/manual/en/features.commandline.php for a
start.

- Markus

On Fri, May 17, 2002 at 12:12:20AM +0800, DoL wrote : 
> Hi All
> 
> I am trying to write something similar to a server console display, is it
a
> good idea to use PHP?
> 
> Wondering how things like
> 1. server clock (similar to a clock applet)
> 2. server status
> can be displayed with PHP code?
> 
> Note: I need to display the above two in a continuous fashion on the
status
> bar!!
> 
> Many Thanks
> Dominic
> 
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
-
"I mean "When in doubt, blame mcrypt" is more often right than wrong :)"
"Always right, never wrong :)"
- Two PHP developers who want to remain unnamed

-- 
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] Can anyone help me save img from URL?

2002-05-16 Thread Robert Cummings

Victor Polyushko wrote:
> 
> Hi Guys,
> 
> Thank you fo your input. I am sorry I am new to the list so + English is not
> my first language :-( anyhow., I shoudl 've made my question more clear.
> 
> I am trying to save the image from the given URL
> (http://domain.com/image.gif) running a PHP script on the page. I have tried
> fread() and it does not allow me to accomplish that :-((
> 
> Have you guys ever come across such a problem?

$imageData = implode( '', file( 'http://domain.com/image.gif' ) );
$length = strlen( $imageData );

if( $length > 0 )
{
if( (fh = fopen( 'destination', 'w' )) )
{
fwrite( fh, $imageData );
}
}


Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Michael Kimsal

Miguel Cruz wrote:


>>As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
>>I'd have to say that you could definitely at least read a directory's
>>contents without having to purchase external libraries.  Please don't
>>go overboard.
> 
> 
> It's been a while, but I remember that it was impossible to create a
> functional directory browser with off-the-shelf ASP functionality. The
> file component was categorically unwilling to follow mounted shares until
> we got some extra add-in. This was after a month of debate in newsgroup
> microsoft.public.this.that.the-other-thing, and plenty of experimentation
> during which I discovered, reported, and was contacted by MS engineers
> about more bugs than I've ever encountered in PHP.


This isn't specifically ASP, but NT permissions in general.  PHP running
under "off the shelf" Windows can't access shares either.

> 
> I don't think it's a bad thing that they see a niche and try to fill it. I 
> think it's a bad thing from the web developer's perspective that there are 
> so many unfilled niches.
> 
> Furthermore, in contrast to the PHP/Open Source world I find the
> profiteering got annoying after a while. It was a drag just having to fill
> out a P.O. every week to buy another ridiculous little thing that may or
> may not be production-quality and had a no-refund policy.
> 
> And the fact is, most of those little companies provide wretched
> documentation and support, and there is no real onlne user community in
> the Windows world to exchange information with. Well, there are lots of
> users, but the ratio of crap-to-usefulness in the fora is so high that
> finding information is painful at best.
> 

Honestly, I find that now in the PHP community as well, to a larger 
extent than I used to, but perhaps it's because I/we aren't in the
'sessions v cookies' mentality anymore.

Compiling GD support, for one, is a pain in the ass which you
can't get really get good support for, due to the variety of systems. 
Servlet support as well.  Java support has gotten better, but
it generally just magically happens.  I don't think I've had too
many deep technical issues that have been resolved with help
from the PHP community.  Not because they're 'lesser' people,
but we're trying to do stuff that most people don't do.  It'd be
like trying to get JScript support at an ASP site.  Yeah,
JScript works with ASP, but no one really uses it much,
compared to VBScript.






> 
>>
>>Where the heck did you read that?  Do you know what .NET is?
> 
> 
> Slashdot. And no, to be honest.

:)  Great answer.  Honestly.


> 
> 
>>There's a lot of interesting concepts in the .NET codebase out there now
>>(ASP.NET webforms, for example) as well as other platforms (Java springs
>>to mind).  Just because it's "not PHP" shouldn't mean you ignore it or
>>worse yet, publicly denigrate it.
> 
> 
> Public denigration of what I don't understand is how I strike out at a
> callous world that's denied me my just deserts: fame, millions, and a
> torrid love affair with Nancy Reagan. Either address the fundamental
> injustice here or cut me some slack.
> 

Not sure how old you are or when you had this thing for Nancy -
never been 'fanciable' since I've known her (but maybe I'm too much
of a youngster).


Michael Kimsal
http://www.logicreate.com


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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

Hi Guys,

Thank you fo your input. I am sorry I am new to the list so + English is not
my first language :-( anyhow., I shoudl 've made my question more clear.

I am trying to save the image from the given URL
(http://domain.com/image.gif) running a PHP script on the page. I have tried
fread() and it does not allow me to accomplish that :-((


Have you guys ever come across such a problem?

Again thank you very much for your suggestions

Best Regards,
Victor Polyushko




- Original Message -
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Miguel Cruz" <[EMAIL PROTECTED]>
Cc: "Victor Polyushko" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 2:01 PM
Subject: Re: [PHP] Can anyone help me save img from URL?


> Miguel Cruz wrote:
> >
> > On Thu, 16 May 2002, Victor Polyushko wrote:
> > > I was wondering if someone knows how to save the image from the given
> > > url http://domain.com/image.gif into a file on a local machine
> >
> > lynx -source -dump  > image.gif
>
> If there were actually an image I'd use:
>
> wget http://domain.com/image.gif
>
> Cheers,
> Rob.
> --
> .-.
> | Robert Cummings |
> :-`.
> | Webdeployer - Chief PHP and Java Programmer  |
> :--:
> | Mail  : mailto:[EMAIL PROTECTED] |
> | Phone : (613) 731-4046 x.109 |
> :--:
> | Website : http://www.webmotion.com   |
> | Fax : (613) 260-9545 |
> `--'
>


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




[PHP] Passing to an Applet

2002-05-16 Thread Joshua Baker

All right I've seen in done in jsp and asp, but I'd like to know if I can do it in PHP 
as well.

I've got an applet, which is in the page replay.php, with these parameters that I need 
to fill from a URL.

 









I need to pass 2 parameter in the URL from another page to this one, those parameters 
are
FILEPREFIX and MAXINDEX.

I've set my link to read as 

The question is how to I, if I can, use PHP to take those variables from the URL 
string and use them for the values on that page.

I know most people want to just say RTFM or look it up, but at this point if anyone 
could just tell me what this would be under or where exactly this info is, if it's 
possible in php.  Thanks

Anti-Blank
Site Designer/Unix Admin




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Robert Cummings

Miguel Cruz wrote:
> 
> On Thu, 16 May 2002, Victor Polyushko wrote:
> > I was wondering if someone knows how to save the image from the given
> > url http://domain.com/image.gif into a file on a local machine
> 
> lynx -source -dump  > image.gif

If there were actually an image I'd use:

wget http://domain.com/image.gif

Cheers,
Rob.
--
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Robert Cummings

Miguel Cruz wrote:
> 
> Public denigration of what I don't understand is how I strike out at a
> callous world that's denied me my just deserts: fame, millions, and a
> torrid love affair with Nancy Reagan. Either address the fundamental
> injustice here or cut me some slack.

Couldn't have said it better *heheheh*

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Victor Polyushko wrote:
> I was wondering if someone knows how to save the image from the given
> url http://domain.com/image.gif into a file on a local machine

lynx -source -dump http://domain.com/image.gif > image.gif

miguel


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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Michael Kimsal wrote:
> Miguel Cruz wrote:
>> all the power of DOS batchfiles. Every single thing you want to do - even
>> basic filesystem operations like working with directories and file
>> permissions!!! - requires purchasing expensive and buggy .COM components
>> from nasty little companies with horrible documentation and nonexistent
>> customer service. I consider it an incredibly developer-hostile
>> environment (unless you're in the business of developing developer tools,
>> which seems to be the lynchpin of the ASP ponzi scheme).
> 
> As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
> I'd have to say that you could definitely at least read a directory's
> contents without having to purchase external libraries.  Please don't
> go overboard.

It's been a while, but I remember that it was impossible to create a
functional directory browser with off-the-shelf ASP functionality. The
file component was categorically unwilling to follow mounted shares until
we got some extra add-in. This was after a month of debate in newsgroup
microsoft.public.this.that.the-other-thing, and plenty of experimentation
during which I discovered, reported, and was contacted by MS engineers
about more bugs than I've ever encountered in PHP.

> Wouldn't it be cool if you didn't have to be a C programmer to write PHP
> extensions that you could distribute to others (whether for profit or
> not)?  I certainly think so, but it's currently not possible right now.  
> All those "nasty little companies" you mention are making some money
> because they can program VB, wrap up stuff as DLLs, and sell them.  
> They see a need in the ASP community and address it, while being able to
> make some money too.  What a novel concept!

I don't think it's a bad thing that they see a niche and try to fill it. I 
think it's a bad thing from the web developer's perspective that there are 
so many unfilled niches.

Furthermore, in contrast to the PHP/Open Source world I find the
profiteering got annoying after a while. It was a drag just having to fill
out a P.O. every week to buy another ridiculous little thing that may or
may not be production-quality and had a no-refund policy.

And the fact is, most of those little companies provide wretched
documentation and support, and there is no real onlne user community in
the Windows world to exchange information with. Well, there are lots of
users, but the ratio of crap-to-usefulness in the fora is so high that
finding information is painful at best.

> It's all perspective.  I'm not saying everyone who does PHP is a loser,
> but I have met more than a few losers who happen to work in PHP.  Same
> with every other language.

No doubt. But a development environment that's the centerpiece of every
late-night-TV-commercial "Are you tired of your Burger Hut job? We'll
teach you to be a computer programmer earning $70k/year in only 3
weeks!!!" tech school is bound to have a higher percentage of losers than
others.

>> As for .NET, I thought I just read that Microsoft was pulling everything 
>> in for a rethink because of all the negative reactions it was getting.
> 
> Where the heck did you read that?  Do you know what .NET is?

Slashdot. And no, to be honest.

> There's a lot of interesting concepts in the .NET codebase out there now
> (ASP.NET webforms, for example) as well as other platforms (Java springs
> to mind).  Just because it's "not PHP" shouldn't mean you ignore it or
> worse yet, publicly denigrate it.

Public denigration of what I don't understand is how I strike out at a
callous world that's denied me my just deserts: fame, millions, and a
torrid love affair with Nancy Reagan. Either address the fundamental
injustice here or cut me some slack.

miguel


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




Re: [PHP] upload but restrict

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, r wrote:
> Here goes,
> I have a program that uploads any file and allows the person to see whats in
> a particular directory without any problems,
> not bad for a newbie eh? stand up and clap!!!
> 
> what i want to do is make sure that whatever the person uploads cannot "run"
> or be executedany ideas on how to do this?
> 
> Baically its a file sharing program..."a" uploads something "b" downloads
> it...I just dont want to get screwed in the bargain

Not sure I get your question. Cannot be "run" or "executed" by whom? By 
the web server? Just don't let it run them. By people who download them? 
Impossible. There are too many executable formats. The only choice would 
be to have a whitelist of file formats (i.e., "GIF", "JPEG", "PNG", use 
'file' to check the prologue of each file, and then toss anything else.

miguel

P.S. Your system clock is about 11 hours fast (or you've selected the
wrong time zone), which is annoying since it puts your messages out of 
sequence and I can't tell whether or not they've been replied to without 
reading through 200 other headers.


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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Michael Kimsal

Miguel Cruz wrote:
> 



> all the power of DOS batchfiles. Every single thing you want to do - even
> basic filesystem operations like working with directories and file
> permissions!!! - requires purchasing expensive and buggy .COM components
> from nasty little companies with horrible documentation and nonexistent
> customer service. I consider it an incredibly developer-hostile
> environment (unless you're in the business of developing developer tools,
> which seems to be the lynchpin of the ASP ponzi scheme).

As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
I'd have to say that you could definitely at least read a directory's
contents without having to purchase external libraries.  Please don't
go overboard.

Wouldn't it be cool if you didn't have to be a C programmer to
write PHP extensions that you could distribute to others (whether
for profit or not)?  I certainly think so, but it's currently not
possible right now.  All those "nasty little companies" you mention
are making some money because they can program VB, wrap up stuff
as DLLs, and sell them.  They see a need in the ASP community and
address it, while being able to make some money too.  What a novel
concept!

> 
> Your choices are your own, but it's always seemed to me that it makes more 
> sense to be focus on being really good at something fun, than to spread 
> out to things that every other loser is already doing. 

It's all perspective.  I'm not saying everyone who does PHP is a loser,
but I have met more than a few losers who happen to work in PHP.  Same
with every other language.

> Insofar as it can 
> be said about a programming language, PHP is actually fun - in a way that 
> only Perl seems to match (though Perl is certainly a more frustrating kind 
> of fun).
> 
> As for .NET, I thought I just read that Microsoft was pulling everything 
> in for a rethink because of all the negative reactions it was getting.

Where the heck did you read that?  Do you know what .NET is?
Glad that you do, because most other people don't - there really
isn't a good definition, so it's hard to say someone 'pulled everything 
in'.  What MS has done is retarget the 'hailstorm' service to
corporate intranets looking to do internal authentication as opposed
to a public authentication system.  Hardly retracting .NET from
the scene.

There's a lot of interesting concepts in the .NET codebase out there now 
(ASP.NET webforms, for example) as well as other platforms
(Java springs to mind).  Just because it's "not PHP" shouldn't mean
you ignore it or worse yet, publicly denigrate it.



Michael Kimsal
http://www.logicreate.com/
734-480-9961





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




Re: [PHP] fsockopen

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Scott St. John wrote:
> I am using fsockopen to test several of our SQL and WEB servers at our 
> office.  Testing ports 80, 1433 and 8080 work fine, but I would like to 
> set something up to test ports on our mainframe.  These are printers 
> listening on 9100 and when I test it fails.  I don't see anything in the 
> online docs about going above a certain port - or is there something else.

"When I test it fails" is not a useful problem report.

Show the relevant parts of the code you're running and tell us what, 
specifically is happening (i.e., if an error message is displayed, paste 
that into your problem report; if a variable seems to be getting an 
unexpected value, change your code to print that value out, and then show 
us both the code and the value that it actually printed out).

Otherwise it's just sort of a guessing game.

miguel


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




[PHP] Informix compile problem

2002-05-16 Thread Mike Baranski

I posted a fix on the bug report form, but don't know how to implement it in 
the configure script.  Someone should add it that knows what they're doing.

http://bugs.php.net/bug.php?id=15177

Mike B.
-- 
##
#  Mike Baranski   #
# Security Management Consulting  #
#  http://www.secmgmt.com #
#   919-788-9200 #
#


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




RE: [PHP] refreshing PHP on onClick

2002-05-16 Thread Leotta, Natalie (NCI/IMS)

This sounds like it might work.  Thanks for your help!!  I knew there had to
be a better way than what my coworkers came up with :-)

-Natalie

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 16, 2002 4:09 PM
To: Leotta, Natalie (NCI/IMS)
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] refreshing PHP on onClick


"Leotta, Natalie (NCI/IMS)" wrote:
> 
> It's all in a password protected site because the data's all 
> confidential at this point in time, but I can give you a mental 
> picture.
> 
> There are a bunch of dropdowns - State, Cancer, Sex, Race, Age.  We're 
> drawing a graph of best fit lines - up to 5 allowed on the graph, then 
> we start over replacing them.  We don't draw the actual data points 
> unless the user clicks on a checkbox.  They want that checkbox to be 
> instant gratification, without making the user refresh.  I just want a 
> way to make it do the refresh (and let me change that one variable, so 
> it draws the points or doesn't draw the points), but not a full submit 
> because that would add another line to the graph.

Since you're already using javascript... you could try generating 2 images
at the same time, one with the data points drawn, the other without, then
using the same technology as for javascript rollovers, you could replace the
image when the onClick event is caught. Instant gratification, and no messy
varable replacements.

> I'm sorry I can't send you the URL at this stage of the game.  it 
> should be up and running this summer though :-)

No problem, completely understandable :)

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] BUG?: for loop using chars

2002-05-16 Thread Erich Reimberg N

Hello,

I'm trying to generate this list of letters A..Z, using this

   for ($l='A'; $l<='Z'; $l++)
  echo $l."-";

And it doesn't work. It generates the output included at the end of
this message (I used  to be shorter)

But this works
   for ($l='A'; $l<='Y'; $l++)
  echo $l."-";
generating the expected output.

IS this a bug in PHP?

Any help? Please, if you can, Cc to my email: [EMAIL PROTECTED]

TIA,
Erich

---
Wrong output:
A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z-AA-AB-AC-AD-AE-AF-
AG-AH-AI-YV-YW-YX-YY-YZ-

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




Re: [PHP] refreshing PHP on onClick

2002-05-16 Thread Robert Cummings

"Leotta, Natalie (NCI/IMS)" wrote:
> 
> It's all in a password protected site because the data's all confidential at
> this point in time, but I can give you a mental picture.
> 
> There are a bunch of dropdowns - State, Cancer, Sex, Race, Age.  We're
> drawing a graph of best fit lines - up to 5 allowed on the graph, then we
> start over replacing them.  We don't draw the actual data points unless the
> user clicks on a checkbox.  They want that checkbox to be instant
> gratification, without making the user refresh.  I just want a way to make
> it do the refresh (and let me change that one variable, so it draws the
> points or doesn't draw the points), but not a full submit because that would
> add another line to the graph.

Since you're already using javascript... you could try generating 2 images
at the same time, one with the data points drawn, the other without, then using
the same technology as for javascript rollovers, you could replace the image
when the onClick event is caught. Instant gratification, and no messy varable
replacements.

> I'm sorry I can't send you the URL at this stage of the game.  it should be
> up and running this summer though :-)

No problem, completely understandable :)

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] Re: Configuration.... XML.... Life

2002-05-16 Thread Manuzhai

Do you really have to use attributes for things like name?

And the sense of having section-description inside section escapes me.

Regards,

Manuzhai

"Michael Dransfield" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have started writing an app which helps (mainly win32, new) users to
> generate config files correctly to prevent glaring security holes on
> production servers.
>
> I started by using parse_config_file(), but this ends up causing problems
> because it strips comments.  This means that some variables which are
> commented are lost from the program.  There are also potential problems
> because some of the config file has [sections] and some of it doesnt.
Some
> of this is valid in win32 environments and some are not.  This can cause
> problems if users download the win32 default config file and then upload
it
> to Linux or BSD, it will fail.
>
> Will uncommenting some of the variables (and then setting them to the
> default) affect the running of php at all?  is there a reason why they are
> commented and not just set with their default / NULL value?
>
> I then began playing with an xml file which stores the comments and
> variables along with other useful information relating to the
configuration
> variable. I then added warnings to the XML document so that the front-end
> can read if a setting is potentially insecure (in the current
> environment).  I think the best way to explain it is by looking at the
> attached file, most of it is obvious, i have commented where necessary.
>
> Do you think this format looks OK, I am sure i have missed a lot of
> information which could be of interest, for example storing a default
value
> with each variable, which could be different in different environments (eg
> ).  Maybe add a severity to the warning.
>
> What would you think about the possibility of including the XML ini file
> format in later release of php?  it is easy enough to parse the file when
> the server is started as easilly as it can parse the current ini
> file(?).  It could enable many possibilities because is can store multiple
> environments within it, along with relavent information about the setting
> itself, which would make overall administration much much easier, and
> quicker.  ini files are s Windows 95, dont you think?
>
> I am going to write the front-end as a web application and as a php-gtk
app
> (hopefully with the same code).
>
> Does anybody have any comments or suggestions (or would like to
> help)?  (please try to keep them constructive ;)  i have looked for
similar
> projects, but cant find any.
>
> Regards
> Mike
>



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




RE: [PHP] refreshing PHP on onClick

2002-05-16 Thread Leotta, Natalie (NCI/IMS)

It's all in a password protected site because the data's all confidential at
this point in time, but I can give you a mental picture.  

There are a bunch of dropdowns - State, Cancer, Sex, Race, Age.  We're
drawing a graph of best fit lines - up to 5 allowed on the graph, then we
start over replacing them.  We don't draw the actual data points unless the
user clicks on a checkbox.  They want that checkbox to be instant
gratification, without making the user refresh.  I just want a way to make
it do the refresh (and let me change that one variable, so it draws the
points or doesn't draw the points), but not a full submit because that would
add another line to the graph.

I'm sorry I can't send you the URL at this stage of the game.  it should be
up and running this summer though :-)

Thanks for any help you can give me!!

-Natalie

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 16, 2002 3:56 PM
To: Leotta, Natalie (NCI/IMS)
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] refreshing PHP on onClick


"Leotta, Natalie (NCI/IMS)" wrote:
> 
> This might be a little bit JS and a little bit PHP.  I'm wondering if 
> there's an easy way to refresh a PHP page on an "onClick" and change 
> one parameter (say someone wants to redraw the graph, but with the 
> points).  I don't want to pay attention to any of the other parameters 
> that could have changed on the screen (we've got a bunch of selects).  
> We had come up with a really complicated way which involved changing 
> the parameters to the most recent line drawn, deleting the most recent 
> line, and then submitting with those parameters and the showPoints 
> value changed, but that sounds pretty complicated.
> 
> If anyone could come up with a quicker way that didn't involve the 
> whole submitting thing, that would be easier.  My page has all of the 
> vars that are necessary in hidden vars, and has HTML, PHP, and a 
> handful of JS.

You wouldn't happen to have a demo would you? A visualization would help me
a lot.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] refreshing PHP on onClick

2002-05-16 Thread Kevin Stone

I'm not certain I understand your situation.  If you're trying to keep state
between each new input then I would recommend PHP sessions to store your
variables. Could you elaborate more what you're trying to do?
-Kevin

- Original Message -
From: "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 1:48 PM
Subject: [PHP] refreshing PHP on onClick


> This might be a little bit JS and a little bit PHP.  I'm wondering if
> there's an easy way to refresh a PHP page on an "onClick" and change one
> parameter (say someone wants to redraw the graph, but with the points).  I
> don't want to pay attention to any of the other parameters that could have
> changed on the screen (we've got a bunch of selects).  We had come up with
a
> really complicated way which involved changing the parameters to the most
> recent line drawn, deleting the most recent line, and then submitting with
> those parameters and the showPoints value changed, but that sounds pretty
> complicated.
>
> If anyone could come up with a quicker way that didn't involve the whole
> submitting thing, that would be easier.  My page has all of the vars that
> are necessary in hidden vars, and has HTML, PHP, and a handful of JS.
>
> Thanks!
>
> -Natalie
>
>
> Natalie S. Leotta
> Information Management Services, Inc.
> (301) 680-9770
> [EMAIL PROTECTED]
>
>
>



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




Re: [PHP] refreshing PHP on onClick

2002-05-16 Thread Robert Cummings

"Leotta, Natalie (NCI/IMS)" wrote:
> 
> This might be a little bit JS and a little bit PHP.  I'm wondering if
> there's an easy way to refresh a PHP page on an "onClick" and change one
> parameter (say someone wants to redraw the graph, but with the points).  I
> don't want to pay attention to any of the other parameters that could have
> changed on the screen (we've got a bunch of selects).  We had come up with a
> really complicated way which involved changing the parameters to the most
> recent line drawn, deleting the most recent line, and then submitting with
> those parameters and the showPoints value changed, but that sounds pretty
> complicated.
> 
> If anyone could come up with a quicker way that didn't involve the whole
> submitting thing, that would be easier.  My page has all of the vars that
> are necessary in hidden vars, and has HTML, PHP, and a handful of JS.

You wouldn't happen to have a demo would you? A visualization
would help me a lot.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] refreshing PHP on onClick

2002-05-16 Thread Leotta, Natalie (NCI/IMS)

This might be a little bit JS and a little bit PHP.  I'm wondering if
there's an easy way to refresh a PHP page on an "onClick" and change one
parameter (say someone wants to redraw the graph, but with the points).  I
don't want to pay attention to any of the other parameters that could have
changed on the screen (we've got a bunch of selects).  We had come up with a
really complicated way which involved changing the parameters to the most
recent line drawn, deleting the most recent line, and then submitting with
those parameters and the showPoints value changed, but that sounds pretty
complicated.
 
If anyone could come up with a quicker way that didn't involve the whole
submitting thing, that would be easier.  My page has all of the vars that
are necessary in hidden vars, and has HTML, PHP, and a handful of JS.
 
Thanks!
 
-Natalie
 

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

 



Re: [PHP] Making Multiple Pages

2002-05-16 Thread J Smith


You should also add an ORDER BY clause in there, as the SQL standard doesn't 
guarantee the order that rows are retrieved in. There's a chance that 
you'll get, say, 20 rows on the first page, go to the second page and get 
some of the rows you've already seen on the first page. If you use an ORDER 
BY, you'll at least guarantee that you'll get them in the same order each 
time.

J


Kevin Stone wrote:

> $query = "SELECT * FROM mytable LIMIT $i, 20";
> 
> Where 20 is the number of rows to retrieve and $i is the starting row.
> 
> By incrementing $i + 20 you can do next, prev buttons, or parse the total
> number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - next).
> 
> Search www.mysql.com for more information about using LIMIT in your
> queries.
> 
> -Kevin
> 


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




RE: [PHP] Making Multiple Pages

2002-05-16 Thread Cal Evans

Do a google search for ADODB. It's a PHP database abstraction layer. It has
built in 'pagination' methods (Previous X, next X) along with an example of
how to use them.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Jason Soza [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 1:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Making Multiple Pages


I have some ideas on how this should be done, but I'm at work and can't
really test them, so I was thinking maybe I could run it by you all and
maybe get some feedback and/or new ideas.

I have a PHP/MySQL-generated page that displays image thumbnails.
Currently, I have a loop that makes a table and table rows, fills the
rows with the thumbnails, then when there's no more information, it
completes whatever row it's on with blank 's, then closes the table.

This was working fine, but my site is actually attracting more traffic
than I originally thought, and I'm getting more image submissions. It's
getting to where it's no longer practical to arrange all the thumbnails
onto one page, I need to have like 25 on one page, then have the script
create a link at the bottom so users can click and see the next 25.

I'm thinking I need to use some kind of row count language in the
script, i.e. first count how many rows are in the MySQL table, if it's
less than 25, just display them all. If there's more than 25, display
only 1 - 25, then create a link to view 26 - 50, etc.

Is that what I need to be looking into? Any other ideas would be
appreciated. Thanks!

Jason Soza


--
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] Configuration.... XML.... Life

2002-05-16 Thread Michael Dransfield

I have started writing an app which helps (mainly win32, new) users to 
generate config files correctly to prevent glaring security holes on 
production servers.

I started by using parse_config_file(), but this ends up causing problems 
because it strips comments.  This means that some variables which are 
commented are lost from the program.  There are also potential problems 
because some of the config file has [sections] and some of it doesnt.  Some 
of this is valid in win32 environments and some are not.  This can cause 
problems if users download the win32 default config file and then upload it 
to Linux or BSD, it will fail.

Will uncommenting some of the variables (and then setting them to the 
default) affect the running of php at all?  is there a reason why they are 
commented and not just set with their default / NULL value?

I then began playing with an xml file which stores the comments and 
variables along with other useful information relating to the configuration 
variable. I then added warnings to the XML document so that the front-end 
can read if a setting is potentially insecure (in the current 
environment).  I think the best way to explain it is by looking at the 
attached file, most of it is obvious, i have commented where necessary.

Do you think this format looks OK, I am sure i have missed a lot of 
information which could be of interest, for example storing a default value 
with each variable, which could be different in different environments (eg 
).  Maybe add a severity to the warning.

What would you think about the possibility of including the XML ini file 
format in later release of php?  it is easy enough to parse the file when 
the server is started as easilly as it can parse the current ini 
file(?).  It could enable many possibilities because is can store multiple 
environments within it, along with relavent information about the setting 
itself, which would make overall administration much much easier, and 
quicker.  ini files are s Windows 95, dont you think?

I am going to write the front-end as a web application and as a php-gtk app 
(hopefully with the same code).

Does anybody have any comments or suggestions (or would like to 
help)?  (please try to keep them constructive ;)  i have looked for similar 
projects, but cant find any.

Regards
Mike



php_ini.xml
Description: application/xml

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


[PHP] Re: Warning: Max file size of 4194304 bytes exceeded...

2002-05-16 Thread Lee P Reilly

> - Is there anyway to prevent the error message from being displayed on
> screen, and perhaps set a flag so we know that the problem has occured?

I know that if I set display_errors = Off in php.ini I can stop the message
from being displayed, but can I set a flag to say the upload_max_filesize
has been exceeded and handle the error my own way?

Cheers,
Lee


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




Re: [PHP] Making Multiple Pages

2002-05-16 Thread Kevin Stone

One way to get it started would be to work strictly within the links.  Don't
initilize $i unless it is not set (which logically would mean your visitng
the page for the first time).  So..

if (!isset($_GET['i']))
$i = 0;
else
$i += 20;

Another way would be to extract the number of total rows, divide by 20, and
build a list of links in a for() loop.
$num_rows = mysql_num_rows($sql);
$num_pages = floor($num_rows/20);
for ($i=0; $i
To: "Kevin Stone" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 1:15 PM
Subject: Re: [PHP] Making Multiple Pages


> Great! I think that's the SQL function I needed.
>
> Now for the PHP part - I'm a bit fo a newbie at writing code, so bear
> with me here. My query string is currently something like:
>
> $sql = mysql_query("SELECT * FROM mytable WHERE color=$color");
>
> So I would modify that to read:
>
> $sql = mysql_query("SELECT * FROM mytable WHERE color=$color LIMIT $i,
> 25");
>
> Where $i = 1 To get just the first 25 records. I think I'm confused on
> how to set $i and create links. Would I just initially set $i = "1";
> then make links that point to:
>
> myscript.php?color=red&i=25
>
> Then have a $_GET['i'] variable in my script and set $i equal to that?
>
> Your help is appreciated. Thanks again.
>
> Jason Soza
>
> - Original Message -
> From: "Kevin Stone" <[EMAIL PROTECTED]>
> Date: Thursday, May 16, 2002 10:53 am
> Subject: Re: [PHP] Making Multiple Pages
>
> > $query = "SELECT * FROM mytable LIMIT $i, 20";
> >
> > Where 20 is the number of rows to retrieve and $i is the starting row.
> >
> > By incrementing $i + 20 you can do next, prev buttons, or parse
> > the total
> > number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 -
> > next).
> >
> > Search www.mysql.com for more information about using LIMIT in
> > your queries.
> >
> > -Kevin
> >
> > - Original Message -
> > From: "Jason Soza" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, May 16, 2002 12:31 PM
> > Subject: [PHP] Making Multiple Pages
> >
> >
> > > I have some ideas on how this should be done, but I'm at work
> > and can't
> > > really test them, so I was thinking maybe I could run it by you
> > all and
> > > maybe get some feedback and/or new ideas.
> > >
> > > I have a PHP/MySQL-generated page that displays image thumbnails.
> > > Currently, I have a loop that makes a table and table rows,
> > fills the
> > > rows with the thumbnails, then when there's no more information, it
> > > completes whatever row it's on with blank 's, then closes
> > the table.
> > >
> > > This was working fine, but my site is actually attracting more
> > traffic> than I originally thought, and I'm getting more image
> > submissions. It's
> > > getting to where it's no longer practical to arrange all the
> > thumbnails> onto one page, I need to have like 25 on one page,
> > then have the script
> > > create a link at the bottom so users can click and see the next 25.
> > >
> > > I'm thinking I need to use some kind of row count language in the
> > > script, i.e. first count how many rows are in the MySQL table,
> > if it's
> > > less than 25, just display them all. If there's more than 25,
> > display> only 1 - 25, then create a link to view 26 - 50, etc.
> > >
> > > Is that what I need to be looking into? Any other ideas would be
> > > appreciated. Thanks!
> > >
> > > Jason Soza
> > >
> > >
> > > --
> > > 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




[PHP] Warning: Max file size of 4194304 bytes exceeded...

2002-05-16 Thread Lee P Reilly

Hi,

I have another quick question (still on the topic of validating uploaded
files). I have upload_max_filesize = 4194304 in my php.ini file. When I
upload the file, the script that processes does the following:

1-Sets up the session info
2-Starts the HTML header template
3-Displays user login info
4-Does some error checking - file validation & file content validation.
5-Various info & menus are displayed
6- echos the HTML footer

This way, if there are any errors I can display them in a nice way i.e.
in between the HTML headers.

The question(s):

- Is there anyway to catch the error that causes the "Warning: Max file
size of blah exceeded" message
  e.g. something like if (max_file_exceeded) {...} ? Right now, this
message appears at the top of the screen (therefore, before any of the
script is processes).

- Is there anyway to prevent the error message from being displayed on
screen, and perhaps set a flag so we know that the problem has occured?

Thank you very much in advance for any input.

- Lee




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




Re: [PHP] Making Multiple Pages

2002-05-16 Thread Jason Soza

Great! I think that's the SQL function I needed.

Now for the PHP part - I'm a bit fo a newbie at writing code, so bear 
with me here. My query string is currently something like:

$sql = mysql_query("SELECT * FROM mytable WHERE color=$color");

So I would modify that to read:

$sql = mysql_query("SELECT * FROM mytable WHERE color=$color LIMIT $i, 
25");

Where $i = 1 To get just the first 25 records. I think I'm confused on 
how to set $i and create links. Would I just initially set $i = "1"; 
then make links that point to:

myscript.php?color=red&i=25

Then have a $_GET['i'] variable in my script and set $i equal to that?

Your help is appreciated. Thanks again.

Jason Soza

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
Date: Thursday, May 16, 2002 10:53 am
Subject: Re: [PHP] Making Multiple Pages

> $query = "SELECT * FROM mytable LIMIT $i, 20";
> 
> Where 20 is the number of rows to retrieve and $i is the starting row.
> 
> By incrementing $i + 20 you can do next, prev buttons, or parse 
> the total
> number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 -
> next).
> 
> Search www.mysql.com for more information about using LIMIT in 
> your queries.
> 
> -Kevin
> 
> - Original Message -
> From: "Jason Soza" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 16, 2002 12:31 PM
> Subject: [PHP] Making Multiple Pages
> 
> 
> > I have some ideas on how this should be done, but I'm at work 
> and can't
> > really test them, so I was thinking maybe I could run it by you 
> all and
> > maybe get some feedback and/or new ideas.
> >
> > I have a PHP/MySQL-generated page that displays image thumbnails.
> > Currently, I have a loop that makes a table and table rows, 
> fills the
> > rows with the thumbnails, then when there's no more information, it
> > completes whatever row it's on with blank 's, then closes 
> the table.
> >
> > This was working fine, but my site is actually attracting more 
> traffic> than I originally thought, and I'm getting more image 
> submissions. It's
> > getting to where it's no longer practical to arrange all the 
> thumbnails> onto one page, I need to have like 25 on one page, 
> then have the script
> > create a link at the bottom so users can click and see the next 25.
> >
> > I'm thinking I need to use some kind of row count language in the
> > script, i.e. first count how many rows are in the MySQL table, 
> if it's
> > less than 25, just display them all. If there's more than 25, 
> display> only 1 - 25, then create a link to view 26 - 50, etc.
> >
> > Is that what I need to be looking into? Any other ideas would be
> > appreciated. Thanks!
> >
> > Jason Soza
> >
> >
> > --
> > 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




[PHP] Re: Date Function in Php

2002-05-16 Thread Baba Buehler

Vinod Palan wrote:
> hi ,
> Do any one have date functions like that we have in asp 1) Dateadd()
> 2) Datediff()
> etc?

There are some classes in PEAR that may do what you want, take a look at 
Date & Date::Calc.

baba


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




[PHP] Re: [PHP-DEV] Console application with PHP

2002-05-16 Thread Markus Fischer

Hi,

all is possible. I suggest taking a look at
http://gtk.php.net/ and
http://www.php.net/manual/en/features.commandline.php for a
start.

- Markus

On Fri, May 17, 2002 at 12:12:20AM +0800, DoL wrote : 
> Hi All
> 
> I am trying to write something similar to a server console display, is it a
> good idea to use PHP?
> 
> Wondering how things like
> 1. server clock (similar to a clock applet)
> 2. server status
> can be displayed with PHP code?
> 
> Note: I need to display the above two in a continuous fashion on the status
> bar!!
> 
> Many Thanks
> Dominic
> 
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
-
"I mean "When in doubt, blame mcrypt" is more often right than wrong :)"
"Always right, never wrong :)"
- Two PHP developers who want to remain unnamed

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




Re: [PHP] Making Multiple Pages

2002-05-16 Thread Kevin Stone

$query = "SELECT * FROM mytable LIMIT $i, 20";

Where 20 is the number of rows to retrieve and $i is the starting row.

By incrementing $i + 20 you can do next, prev buttons, or parse the total
number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - next).

Search www.mysql.com for more information about using LIMIT in your queries.

-Kevin

- Original Message -
From: "Jason Soza" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 12:31 PM
Subject: [PHP] Making Multiple Pages


> I have some ideas on how this should be done, but I'm at work and can't
> really test them, so I was thinking maybe I could run it by you all and
> maybe get some feedback and/or new ideas.
>
> I have a PHP/MySQL-generated page that displays image thumbnails.
> Currently, I have a loop that makes a table and table rows, fills the
> rows with the thumbnails, then when there's no more information, it
> completes whatever row it's on with blank 's, then closes the table.
>
> This was working fine, but my site is actually attracting more traffic
> than I originally thought, and I'm getting more image submissions. It's
> getting to where it's no longer practical to arrange all the thumbnails
> onto one page, I need to have like 25 on one page, then have the script
> create a link at the bottom so users can click and see the next 25.
>
> I'm thinking I need to use some kind of row count language in the
> script, i.e. first count how many rows are in the MySQL table, if it's
> less than 25, just display them all. If there's more than 25, display
> only 1 - 25, then create a link to view 26 - 50, etc.
>
> Is that what I need to be looking into? Any other ideas would be
> appreciated. Thanks!
>
> Jason Soza
>
>
> --
> 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] LDAP Search Scope / Schema Retrieval

2002-05-16 Thread Matt Rohrer

On Thu, May 16, 2002 at 09:34:16AM -0500, D Canfield wrote:
> Two related questions:
> 
> 1) Is there any work being done to support the retrieval of the LDAP
> schema in PHP (similar to Perl's Net::LDAP::Schema)?  Is there any other
> good way to get this information into PHP?
> 
> 2) Is there any way to change the search scope of an LDAP search in
> PHP?  Specifically, the following OpenLDAP search command will fetch the
> schema from the server: 
>  ldapsearch -s base -x -b 'cn=subschema' objectclass=* +
> But, I can find no way to switch the search scope from SUB to BASE, so
> the equivalent call in PHP won't work.
> 
> Any suggestions?

look into ldap_read() and the optional arguments to ldap_search()

 matt

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




Re: [PHP] eregi(mail)

2002-05-16 Thread Liam Gibbs

Thanks to all who helped out with the eregi(mail)
stuff. I got my problem solved, and on top of that,
there were some bugs that I found in the code. Thanks
again to everyone.


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




[PHP] Making Multiple Pages

2002-05-16 Thread Jason Soza

I have some ideas on how this should be done, but I'm at work and can't 
really test them, so I was thinking maybe I could run it by you all and 
maybe get some feedback and/or new ideas.

I have a PHP/MySQL-generated page that displays image thumbnails. 
Currently, I have a loop that makes a table and table rows, fills the 
rows with the thumbnails, then when there's no more information, it 
completes whatever row it's on with blank 's, then closes the table.

This was working fine, but my site is actually attracting more traffic 
than I originally thought, and I'm getting more image submissions. It's 
getting to where it's no longer practical to arrange all the thumbnails 
onto one page, I need to have like 25 on one page, then have the script 
create a link at the bottom so users can click and see the next 25.

I'm thinking I need to use some kind of row count language in the 
script, i.e. first count how many rows are in the MySQL table, if it's 
less than 25, just display them all. If there's more than 25, display 
only 1 - 25, then create a link to view 26 - 50, etc.

Is that what I need to be looking into? Any other ideas would be 
appreciated. Thanks!

Jason Soza


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




Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-16 Thread Andre Dubuc

Thanks Rasmus,

I thought there had to be function out there that could examine the actual 
contents. 

Now the question remains, would an ereg/eregi check for html/code/commands 
work on a "jpg/jpeg" type file? From a brief examination of one, I note that 
it's not text, but code. I tried writing some text commands into a jpeg file 
to see what would happen, and wasn't too surprised that the file didn't load 
-- but then again, I don't know what I'm doing:>

I suppose, following what I saw in a movie "Along Came a Spider" -- 
manipulating image files with hidden text files, etc. -- sort of put me on 
guard. I have no idea whether this is even possible. . . sounds probable 
though. Would be great to find out before the site is compromised.

Tia,
Andre


On Tuesday 14 May 2002 10:32 pm, you wrote:
> Have a look at the getimagesize() function.  This function looks at the
> actual file data, not the mime type nor the file's extension but the data
> itself and tells you what sort of image file it is.
>
> And no, it wouldn't really be after the fact because because stores the
> file with a temporary random filename in /tmp ensuring not to overwrite
> anything that is already there.  It is then your job to perform the check
> and copy the file to some appropriate directory on your server.  If you
> don't do anything with the file, PHP will automatically delete it at the
> end of the request.
>
> -Rasmus
>
> On Tue, 14 May 2002, Andre Dubuc wrote:
> > My question will probably expose my woeful lack understanding of security
> > breaches, but perhaps someone can enlighten me.
> >
> > On my site, registered members will be allowed to upload jpg/jpeg
> > pictures. I'm concerned about possible security problems. First, is there
> > a way to ensure that a picture (and not some other malicious stuff) has
> > been uploaded?
> >
> > Aside from checking the mime type info associated with the file, is there
> > any way of verifying what's in the file that has been uploaded? (I'm
> > using Linux LM8.2) Would it be possible to fake info to fool this check?
> > Would verification checks for html/scripts/commands be of any use?
> >
> > Secondly, since the file in question is already uploaded and saved to
> > disk in /tmp or wherever, wouldn't any verification scheme be sort of,
> > 'after-the-fact'?
> >
> > I would appreciate any input, suggestions, or ideas on what to do here.
> > Am I being overly-paranoid about this, or do I have  legitimate security
> > concern.
> >
> > Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2
> >
> > Tia,
> > Andre
> >
> >
> >  --
> > Please pray the Holy Rosary to end the holocaust of abortion.
> > Remember in your prayers the Holy Souls in Purgatory.
> >
> > May God bless you abundantly in His love!
> > For a free Cenacle Scriptural Rosary Booklet:
> > http://www.webhart.net/csrb/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

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




Re: [PHP] uh, oh errors?

2002-05-16 Thread Robert Cummings

[EMAIL PROTECTED] wrote:
> 
> What are some benefits to using output buffering versus just letting it
> generate as it goes?

Pros:

- headers can be added at any time
- buffer content can be post processed (gz compression) (xslt)
- if an error occurs can avoid serving half a document

Cons:

- transmission of content doesn't start until preprocessor completes
- slightly more overhead since content must be stored in memory until
  buffer is flushed.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




RE: [PHP] uh, oh errors?

2002-05-16 Thread Jerome Houston

one REALLY notable advantage is:

if you us ob_*() functions, instead of writing HTML pages with php tags 
inserted, you can write XML pages with PHP tags inserted.  then after you're 
done, you can pass the contents of the output buffer to an XSLT processer 
like sablotron, THEN outputting an HTML page.

-jerome


Original Message Follows
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] uh, oh errors?
Date: Thu, 16 May 2002 13:43:30 -0400

What are some benefits to using output buffering versus just letting it
generate as it goes?

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 1:24 PM
To: PHP-general
Subject: Fw: [PHP] uh, oh errors?


Don't feel bad about this.  This is something that messes a lot of
people
up.  The browser knows where your headers end and where content begins
by
adding blank line between the headers and the rest of the page.  ALL
headers
must come before any content is printed to the page.  PHP will give you
that
error if you attempt to write a new header.  So in fact your problem is
not
on Line 13.. but is actually on Line 11.  There are at least two ways to
avoid this...

1. Don't print content before headers.  :)
2. Use output buffering to write the whole page before it is outputed
to the
browser.

Hope this helps,
-Keivn

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:10 AM
Subject: [PHP] uh, oh errors?


 > Not sure how to resolve this, looked at php.net for the headers
available
 > and this is the error I am recieving:
 >
 > Warning: Cannot add header information - headers already sent by
(output
 > started at /path/to/connection/script/db.php:6) in
/path/to/login/checking
 > file/auth_done.php on line 13
 >
 > Here is the code that is in auth_done.php:
 >
 > session_start();
 > require '/path/to/login/checking file/db.php';
 > $db_table = 'auth_users';
 > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
 > password(\"$p_word\")";
 > $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
 > $num = mysql_numrows($result);
 >  if ($num !=0) {
 >   session_register('u_name');
 >   session_register('p_word');
 >   $msg_success = "Good freakin job poindexter!!";
 >   } else {
 >   header ("Location: index.php"); // This is line 13 that is my error
 > generator
 >   }
 >
 > This is the code for the db.php script:
 >  $dbh = mysql_connect('localhost','username','password') or die('Could
not
 > connect to database, please try again later');
 > mysql_select_db('db_name') or die('Could not select database, please
try
 > again later');
 > ?>
 >
 > Any help would be great!  I am assuming there is another way to
redirect
 > users besides the header function, just not sure what it is or how to
use
 > it.  Thanks in advance,
 > Jas
 >
 >
 >
 > --
 > 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


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: [PHP] uh, oh errors?

2002-05-16 Thread Sysadmin

What are some benefits to using output buffering versus just letting it 
generate as it goes?

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 1:24 PM
To: PHP-general
Subject: Fw: [PHP] uh, oh errors?


Don't feel bad about this.  This is something that messes a lot of 
people
up.  The browser knows where your headers end and where content begins 
by
adding blank line between the headers and the rest of the page.  ALL 
headers
must come before any content is printed to the page.  PHP will give you 
that
error if you attempt to write a new header.  So in fact your problem is 
not
on Line 13.. but is actually on Line 11.  There are at least two ways to
avoid this...

1. Don't print content before headers.  :)
2. Use output buffering to write the whole page before it is outputed 
to the
browser.

Hope this helps,
-Keivn

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:10 AM
Subject: [PHP] uh, oh errors?


> Not sure how to resolve this, looked at php.net for the headers 
available
> and this is the error I am recieving:
>
> Warning: Cannot add header information - headers already sent by 
(output
> started at /path/to/connection/script/db.php:6) in 
/path/to/login/checking
> file/auth_done.php on line 13
>
> Here is the code that is in auth_done.php:
>
> session_start();
> require '/path/to/login/checking file/db.php';
> $db_table = 'auth_users';
> $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> password(\"$p_word\")";
> $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> $num = mysql_numrows($result);
>  if ($num !=0) {
>   session_register('u_name');
>   session_register('p_word');
>   $msg_success = "Good freakin job poindexter!!";
>   } else {
>   header ("Location: index.php"); // This is line 13 that is my error
> generator
>   }
>
> This is the code for the db.php script:
>  $dbh = mysql_connect('localhost','username','password') or die('Could 
not
> connect to database, please try again later');
> mysql_select_db('db_name') or die('Could not select database, please 
try
> again later');
> ?>
>
> Any help would be great!  I am assuming there is another way to 
redirect
> users besides the header function, just not sure what it is or how to 
use
> it.  Thanks in advance,
> Jas
>
>
>
> --
> 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


[PHP] Gettext and PHP4.2.0?

2002-05-16 Thread Bram van Leur

Hi everyone,

I've recently (for once in my life!) succesfully compiled PHP4.2.0 using 
the following configure command-line:
'./configure' '--prefix=/usr' '--with-config-file-path=/etc' 
'--disable-debug' '--enable-pic' '--enable-inline-optimization' 
'--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' 
'--with-regex=system' '--with-gettext=shared' '--with-zlib' 
'--with-gdbm' '--with-layout=GNU' '--enable-debugger' 
'--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem=shared' 
'--enable-sysvshm=shared' '--enable-track-vars' '--enable-yp' 
'--enable-ftp' '--enable-wddx' '--without-unixODBC' '--without-oracle' 
'--without-oci8' '--with-mysql=/usr' '--with-gd-dir=/usr' '--with-flex' 
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-ttf'

As you can see it contains "--with-gettext" so I'd expect a function 
like bindtextdomain() is availible. However, Horde (chora, actually) 
reports:
Fatal error: Call to undefined function: bindtextdomain() in 
/home/virtual/site4/fst/var/www/html/horde/lib/Lang.php on line 91

What could have gone wrong and how can I fix it?

Thanks in advance

-- 
Bram v. Leur
The Netherlands

Proud to PHP!


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




Re: [PHP] Using Sessions under Win98/Apache

2002-05-16 Thread Edward Marczak

On 5/16/02 5:17 AM, "Neil Freeman" <[EMAIL PROTECTED]> wrote:

> FYI...
> 
> I'm using sessions successfully using PHP v4.1.0 on Windows NT.

Hurmph.  Well, the upgrade to 4.2.x did it for me under 98.  I just need to
check the rest of my code, though.  For now, seems pretty harmless.  Thanks,
though.
-- 
Ed Marczak
[EMAIL PROTECTED]

P.S.  Are you also using Apache?  Or IIS?


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




Re: [PHP] uh, oh errors?

2002-05-16 Thread Kevin Stone

DOH!  I retract that statement about Line 11.. I saw it and immediately
thought you were printing out that line, clearly you're not.  But the rest
of my point is still valid, and Rasmus pointed out the true location of the
error.  Anyway glad to hear you got the problem solved so quickly.

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: "PHP-general" <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:23 AM
Subject: Fw: [PHP] uh, oh errors?


> Don't feel bad about this.  This is something that messes a lot of people
> up.  The browser knows where your headers end and where content begins by
> adding blank line between the headers and the rest of the page.  ALL
headers
> must come before any content is printed to the page.  PHP will give you
that
> error if you attempt to write a new header.  So in fact your problem is
not
> on Line 13.. but is actually on Line 11.  There are at least two ways to
> avoid this...
>
> 1. Don't print content before headers.  :)
> 2. Use output buffering to write the whole page before it is outputed to
the
> browser.
>
> Hope this helps,
> -Keivn
>
> - Original Message -
> From: "Jas" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 16, 2002 11:10 AM
> Subject: [PHP] uh, oh errors?
>
>
> > Not sure how to resolve this, looked at php.net for the headers
available
> > and this is the error I am recieving:
> >
> > Warning: Cannot add header information - headers already sent by (output
> > started at /path/to/connection/script/db.php:6) in
/path/to/login/checking
> > file/auth_done.php on line 13
> >
> > Here is the code that is in auth_done.php:
> >
> > session_start();
> > require '/path/to/login/checking file/db.php';
> > $db_table = 'auth_users';
> > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> > password(\"$p_word\")";
> > $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> > $num = mysql_numrows($result);
> >  if ($num !=0) {
> >   session_register('u_name');
> >   session_register('p_word');
> >   $msg_success = "Good freakin job poindexter!!";
> >   } else {
> >   header ("Location: index.php"); // This is line 13 that is my error
> > generator
> >   }
> >
> > This is the code for the db.php script:
> >  > $dbh = mysql_connect('localhost','username','password') or die('Could
not
> > connect to database, please try again later');
> > mysql_select_db('db_name') or die('Could not select database, please try
> > again later');
> > ?>
> >
> > Any help would be great!  I am assuming there is another way to redirect
> > users besides the header function, just not sure what it is or how to
use
> > it.  Thanks in advance,
> > Jas
> >
> >
> >
> > --
> > 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




Fw: [PHP] uh, oh errors?

2002-05-16 Thread Kevin Stone

Don't feel bad about this.  This is something that messes a lot of people
up.  The browser knows where your headers end and where content begins by
adding blank line between the headers and the rest of the page.  ALL headers
must come before any content is printed to the page.  PHP will give you that
error if you attempt to write a new header.  So in fact your problem is not
on Line 13.. but is actually on Line 11.  There are at least two ways to
avoid this...

1. Don't print content before headers.  :)
2. Use output buffering to write the whole page before it is outputed to the
browser.

Hope this helps,
-Keivn

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:10 AM
Subject: [PHP] uh, oh errors?


> Not sure how to resolve this, looked at php.net for the headers available
> and this is the error I am recieving:
>
> Warning: Cannot add header information - headers already sent by (output
> started at /path/to/connection/script/db.php:6) in /path/to/login/checking
> file/auth_done.php on line 13
>
> Here is the code that is in auth_done.php:
>
> session_start();
> require '/path/to/login/checking file/db.php';
> $db_table = 'auth_users';
> $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> password(\"$p_word\")";
> $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> $num = mysql_numrows($result);
>  if ($num !=0) {
>   session_register('u_name');
>   session_register('p_word');
>   $msg_success = "Good freakin job poindexter!!";
>   } else {
>   header ("Location: index.php"); // This is line 13 that is my error
> generator
>   }
>
> This is the code for the db.php script:
>  $dbh = mysql_connect('localhost','username','password') or die('Could not
> connect to database, please try again later');
> mysql_select_db('db_name') or die('Could not select database, please try
> again later');
> ?>
>
> Any help would be great!  I am assuming there is another way to redirect
> users besides the header function, just not sure what it is or how to use
> it.  Thanks in advance,
> Jas
>
>
>
> --
> 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] Uploading JPEG's - Security Issues?

2002-05-16 Thread Jim Winstead

Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> Are you afraid of someone embedding PHP in a .jpg file?  That's not really
> an issue as your web server is probably configured to only serve up PHP as
> .php files.  Likewise, your web server config is likely such that any .jpg
> file is served up as content-type image/jpeg and as such it really doesn't
> matter what sort of junk is embedded in the image.  At most it will show
> up as a broken image icon in your browser.

right.

the thing you may need to worry about, if you provide some sort of
service that allows for anyone to upload a jpeg file that anyone else
can then download, is people using programs that piggyback other data
(mp3 files, rar archives, etc) on those images.

one simple check you can do to minimize this is to compare the image
dimensions to the file size -- if you've got a 120x120 image in a three
meg jpeg file, something is probably awry. so with a combination of
php's getimagesize() and filesize(), you can try to detect that sort of
thing.

(this is one of the problems that plague sites that provide free
webspace. it's only a security issue insofar as this can constitute an
effective denial-of-service 'attack' on your systems.)

jim

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




Re: [PHP] uh, oh errors?

2002-05-16 Thread Jas

That worked, I had about 3 blank lines trailing my ?>.  Thanks a ton!
Jas

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What is on line 6 of the db.php file?  Do you have a stray carriage return
> at the end of this file?
>
> On Thu, 16 May 2002, Jas wrote:
>
> > Not sure how to resolve this, looked at php.net for the headers
available
> > and this is the error I am recieving:
> >
> > Warning: Cannot add header information - headers already sent by (output
> > started at /path/to/connection/script/db.php:6) in
/path/to/login/checking
> > file/auth_done.php on line 13
> >
> > Here is the code that is in auth_done.php:
> >
> > session_start();
> > require '/path/to/login/checking file/db.php';
> > $db_table = 'auth_users';
> > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> > password(\"$p_word\")";
> > $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> > $num = mysql_numrows($result);
> >  if ($num !=0) {
> >   session_register('u_name');
> >   session_register('p_word');
> >   $msg_success = "Good freakin job poindexter!!";
> >   } else {
> >   header ("Location: index.php"); // This is line 13 that is my error
> > generator
> >   }
> >
> > This is the code for the db.php script:
> >  > $dbh = mysql_connect('localhost','username','password') or die('Could
not
> > connect to database, please try again later');
> > mysql_select_db('db_name') or die('Could not select database, please try
> > again later');
> > ?>
> >
> > Any help would be great!  I am assuming there is another way to redirect
> > users besides the header function, just not sure what it is or how to
use
> > it.  Thanks in advance,
> > Jas
> >
> >
> >
> > --
> > 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] Console application with PHP

2002-05-16 Thread Vail, Warren

PHP and Web Servers probably make a bad choice for what is essentially a
real time application.  PHP and web servers expect to serve up a page of
essentially HTML(and Javascript, or Java Applets), then close the connection
to a browser so that it can handle the requests of others, and not deal with
that connection again until the browser makes another connection, usually as
a result of a hotlink click, or submit.

There is a way to simulate what you want using JavaScript (if PHP can output
HTML, it can also output Javascript).  Check http://www.hotscripts.com in
their JavaScript section for routines to perform 3 functions,

1. a routine which will cause the a page to request a refresh every 10
seconds or so, there by requesting the same page, which your PHP can fill
with the latest (real-time?) data.
2. a routine for using JavaScript to display data on the status line.
3. a routine for displaying the time (using the clock on the browser
machine).

hope this helps,


Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-Original Message-
From: DoL [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 9:12 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Console application with PHP


Hi All

I am trying to write something similar to a server console display, is it a
good idea to use PHP?

Wondering how things like
1. server clock (similar to a clock applet)
2. server status
can be displayed with PHP code?

Note: I need to display the above two in a continuous fashion on the status
bar!!

Many Thanks
Dominic




-- 
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] Can anyone help me save img from URL?

2002-05-16 Thread Patrick Lynch

As fas as I know, the only way to do this is to give somebody
instructions to right click on the file and so "Save As".

Plan B is to put the GIF in a ZIP file and let it be downloaded like
that.

Best Regards,
Patrick Lynch.

Optip Ltd, Internet & Mobile Development
Co. Clare, Ireland.
http://www.optip.com/



-Original Message-
From: Victor Polyushko [mailto:[EMAIL PROTECTED]] 
Sent: 16 May 2002 18:05
To: [EMAIL PROTECTED]
Subject: [PHP] Can anyone help me save img from URL?


Hi,

I was wondering if someone knows how to save the image from the given
url http://domain.com/image.gif   into a file on a local machine

Any suggestion will be greatly appreciated.
Thank you in advance


Victor Polyushko





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




Re: [PHP] some Javascript functions with PHP

2002-05-16 Thread Kevin Stone

The user's IP address is stored in the PHP global, $REMOTE_ADDR.  Browser
information can be extracted from the get_browser()
 function.  http://www.php.net/manual/en/function.get-browser.php
-Kevin

- Original Message -
From: "savaidis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 7:44 AM
Subject: [PHP] some Javascript functions with PHP


>
> I use:
> print('');
> print('document.write("Code Name: "+navigator.appCodeName+"
");'); > print(''); > > How is possible to keep this info to a MySQL database with PHP? > I think is not possible becouse PHP runs first. > Also how is possible to get with PHP info like this (browser type ecc) > and user's IP address without Javascript? > Or use Javascript and then run a php script to write it to the MySQL > database? > > > Thanks > > Prodromos Savaidis > > > > -- > 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] uh, oh errors?

2002-05-16 Thread Patrick Lynch

Hi Jas,

I normally output can output a JaveScript
document.location.href="XXX.XXX"; command

Plan B is to do your processing before there is any output and then
decide whether or not to do a redirect using the header() function.

Best Regards,
Patrick Lynch.

Optip Ltd, Internet & Mobile Development
Co. Clare, Ireland.
http://www.optip.com/



-Original Message-
From: Jas [mailto:[EMAIL PROTECTED]] 
Sent: 16 May 2002 18:11
To: [EMAIL PROTECTED]
Subject: [PHP] uh, oh errors?


Not sure how to resolve this, looked at php.net for the headers
available and this is the error I am recieving:

Warning: Cannot add header information - headers already sent by (output
started at /path/to/connection/script/db.php:6) in
/path/to/login/checking file/auth_done.php on line 13

Here is the code that is in auth_done.php:

session_start();
require '/path/to/login/checking file/db.php';
$db_table = 'auth_users';
$sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
password(\"$p_word\")"; $result = @mysql_query($sql,$dbh) or
die("Couldn't execute query"); $num = mysql_numrows($result);  if ($num
!=0) {
  session_register('u_name');
  session_register('p_word');
  $msg_success = "Good freakin job poindexter!!";
  } else {
  header ("Location: index.php"); // This is line 13 that is my error
generator
  }

This is the code for the db.php script:


Any help would be great!  I am assuming there is another way to redirect
users besides the header function, just not sure what it is or how to
use it.  Thanks in advance, Jas



-- 
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] uh, oh errors?

2002-05-16 Thread Rasmus Lerdorf

What is on line 6 of the db.php file?  Do you have a stray carriage return
at the end of this file?

On Thu, 16 May 2002, Jas wrote:

> Not sure how to resolve this, looked at php.net for the headers available
> and this is the error I am recieving:
>
> Warning: Cannot add header information - headers already sent by (output
> started at /path/to/connection/script/db.php:6) in /path/to/login/checking
> file/auth_done.php on line 13
>
> Here is the code that is in auth_done.php:
>
> session_start();
> require '/path/to/login/checking file/db.php';
> $db_table = 'auth_users';
> $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> password(\"$p_word\")";
> $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> $num = mysql_numrows($result);
>  if ($num !=0) {
>   session_register('u_name');
>   session_register('p_word');
>   $msg_success = "Good freakin job poindexter!!";
>   } else {
>   header ("Location: index.php"); // This is line 13 that is my error
> generator
>   }
>
> This is the code for the db.php script:
>  $dbh = mysql_connect('localhost','username','password') or die('Could not
> connect to database, please try again later');
> mysql_select_db('db_name') or die('Could not select database, please try
> again later');
> ?>
>
> Any help would be great!  I am assuming there is another way to redirect
> users besides the header function, just not sure what it is or how to use
> it.  Thanks in advance,
> Jas
>
>
>
> --
> 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] uh, oh errors?

2002-05-16 Thread Jas

Not sure how to resolve this, looked at php.net for the headers available
and this is the error I am recieving:

Warning: Cannot add header information - headers already sent by (output
started at /path/to/connection/script/db.php:6) in /path/to/login/checking
file/auth_done.php on line 13

Here is the code that is in auth_done.php:

session_start();
require '/path/to/login/checking file/db.php';
$db_table = 'auth_users';
$sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
password(\"$p_word\")";
$result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
$num = mysql_numrows($result);
 if ($num !=0) {
  session_register('u_name');
  session_register('p_word');
  $msg_success = "Good freakin job poindexter!!";
  } else {
  header ("Location: index.php"); // This is line 13 that is my error
generator
  }

This is the code for the db.php script:


Any help would be great!  I am assuming there is another way to redirect
users besides the header function, just not sure what it is or how to use
it.  Thanks in advance,
Jas



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




[PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

Hi,

I was wondering if someone knows how to save the image from the given  url 
http://domain.com/image.gif   into a file on a local machine

Any suggestion will be greatly appreciated.
Thank you in advance


Victor Polyushko





Re: [PHP] tag img and php

2002-05-16 Thread Maciej Przybycien


Thank you for responding to my email. I am still stuck with my problem.

I am using additionally jpgraph-1.6.1. Here is the content of my try.php
file:
SetScale("textlin");
$graph->img->SetMargin(30,30,50,50);
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->title->Set("SMT HISTOGRAMS");

// A new plot
$ydata =
array(55,66,67,66,67,67,66,68,67,66,68,67,68,67,68,67,68,68,68,68,68,69,68,68,68,68,68,68,68,68,68,69,68,68,70,67,69,68,69,68,69,68,69,68,68,69,68,68,68,69,68,68,68,69,68,68,68,68,69,68,69,67,69,68,68,68,69,69,68,68,69,67,68,68,68,69,69,69,69,69,69,69,68,68,68,68,68,68,68,68,68,68,68,68,68,68,69,68,69,67,69,68,69,68,69,68,69,68,69,67,68,67,69,68,68,68,69,69,69,68,68,69,69,68,69,69,69,68);
// Create the linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);

// A new plot
$ydata1 =
array(57,68,69,68,69,69,69,70,69,70,69,69,70,70,70,70,70,69,70,70,71,70,70,70,70,70,71,70,71,70,71,70,71,69,70,71,71,70,70,71,70,70,71,70,71,70,70,70,71,69,71,70,71,70,71,70,70,70,70,70,70,70,69,70,70,69,70,69,71,69,70,69,70,69,70,69,70,69,71,69,70,69,71,69,70,69,70,70,70,69,70,69,70,69,70,69,70,69,69,69,70,69,69,69,70,69,70,69,69,69,70,69,70,69,69,69,70,69,70,69,69,69,70,69,70,68,69,69);
// Create the linear plot
$lineplot1=new LinePlot($ydata1);
// Add the plot to the graph
$graph->Add($lineplot1);

$graph->Stroke();
?>


I thought that I maight have set some file access uncerrectly and Java
servlets cannot read them so I tried to display simple file:
"; ?>
I got the same result as previously.


I can display any of those files when I load html file:



SMT MONITORING---







So I am really confused. I just suppose that the problem is somehow
related to html being generated on-fly in Java servlets. But I don't
understand why is that.

The source of Java generated html page is:


SMT MONITORING







 Thanks,
   Maciek




On Thu, 16 May 2002, Jim lucas wrote:

> show the contents of 'try_param.php' please.
> 
> Jim Lucas
> - Original Message - 
> From: "Maciej Przybycien" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, May 15, 2002 10:38 AM
> Subject: [PHP] tag img and php
> 
> 
> > 
> > Hi,
> > I included php file as html img:
> >  > height="240" >
> > and Netscape brawser seems not to interpret that. However if I change 
> > try_param.php -> try_param.png then image can be desplayed. 
> > 
> > According to the documentation 'try_param.php' should be interpereted
> > fine. 
> > What could be the problem?
> > 
> >  Thank you,
> > Maciek
> > 
> > 
> > 
> > -- 
> > 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] Console application with PHP

2002-05-16 Thread DoL

Hi All

I am trying to write something similar to a server console display, is it a
good idea to use PHP?

Wondering how things like
1. server clock (similar to a clock applet)
2. server status
can be displayed with PHP code?

Note: I need to display the above two in a continuous fashion on the status
bar!!

Many Thanks
Dominic




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




[PHP] some Javascript functions with PHP

2002-05-16 Thread savaidis


I use:
print('');
print('document.write("Code Name: "+navigator.appCodeName+"
");'); print(''); How is possible to keep this info to a MySQL database with PHP? I think is not possible becouse PHP runs first. Also how is possible to get with PHP info like this (browser type ecc) and user's IP address without Javascript? Or use Javascript and then run a php script to write it to the MySQL database? Thanks Prodromos Savaidis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-16 Thread Rasmus Lerdorf

Are you afraid of someone embedding PHP in a .jpg file?  That's not really
an issue as your web server is probably configured to only serve up PHP as
.php files.  Likewise, your web server config is likely such that any .jpg
file is served up as content-type image/jpeg and as such it really doesn't
matter what sort of junk is embedded in the image.  At most it will show
up as a broken image icon in your browser.

-Rasmus

On Tue, 14 May 2002, Andre Dubuc wrote:

> Thanks Rasmus,
>
> I thought there had to be function out there that could examine the actual
> contents.
>
> Now the question remains, would an ereg/eregi check for html/code/commands
> work on a "jpg/jpeg" type file? From a brief examination of one, I note that
> it's not text, but code. I tried writing some text commands into a jpeg file
> to see what would happen, and wasn't too surprised that the file didn't load
> -- but then again, I don't know what I'm doing:>
>
> I suppose, following what I saw in a movie "Along Came a Spider" --
> manipulating image files with hidden text files, etc. -- sort of put me on
> guard. I have no idea whether this is even possible. . . sounds probable
> though. Would be great to find out before the site is compromised.
>
> Tia,
> Andre
>
>
> On Tuesday 14 May 2002 10:32 pm, you wrote:
> > Have a look at the getimagesize() function.  This function looks at the
> > actual file data, not the mime type nor the file's extension but the data
> > itself and tells you what sort of image file it is.
> >
> > And no, it wouldn't really be after the fact because because stores the
> > file with a temporary random filename in /tmp ensuring not to overwrite
> > anything that is already there.  It is then your job to perform the check
> > and copy the file to some appropriate directory on your server.  If you
> > don't do anything with the file, PHP will automatically delete it at the
> > end of the request.
> >
> > -Rasmus
> >
> > On Tue, 14 May 2002, Andre Dubuc wrote:
> > > My question will probably expose my woeful lack understanding of security
> > > breaches, but perhaps someone can enlighten me.
> > >
> > > On my site, registered members will be allowed to upload jpg/jpeg
> > > pictures. I'm concerned about possible security problems. First, is there
> > > a way to ensure that a picture (and not some other malicious stuff) has
> > > been uploaded?
> > >
> > > Aside from checking the mime type info associated with the file, is there
> > > any way of verifying what's in the file that has been uploaded? (I'm
> > > using Linux LM8.2) Would it be possible to fake info to fool this check?
> > > Would verification checks for html/scripts/commands be of any use?
> > >
> > > Secondly, since the file in question is already uploaded and saved to
> > > disk in /tmp or wherever, wouldn't any verification scheme be sort of,
> > > 'after-the-fact'?
> > >
> > > I would appreciate any input, suggestions, or ideas on what to do here.
> > > Am I being overly-paranoid about this, or do I have  legitimate security
> > > concern.
> > >
> > > Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2
> > >
> > > Tia,
> > > Andre
> > >
> > >
> > >  --
> > > Please pray the Holy Rosary to end the holocaust of abortion.
> > > Remember in your prayers the Holy Souls in Purgatory.
> > >
> > > May God bless you abundantly in His love!
> > > For a free Cenacle Scriptural Rosary Booklet:
> > > http://www.webhart.net/csrb/
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> Please pray the Holy Rosary to end the holocaust of abortion.
> Remember in your prayers the Holy Souls in Purgatory.
>
> May God bless you abundantly in His love!
> For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/
>


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




Re: [PHP] tag img and php

2002-05-16 Thread Jim lucas

show the contents of 'try_param.php' please.

Jim Lucas
- Original Message - 
From: "Maciej Przybycien" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 15, 2002 10:38 AM
Subject: [PHP] tag img and php


> 
> Hi,
> I included php file as html img:
>  height="240" >
> and Netscape brawser seems not to interpret that. However if I change 
> try_param.php -> try_param.png then image can be desplayed. 
> 
> According to the documentation 'try_param.php' should be interpereted
> fine. 
> What could be the problem?
> 
>  Thank you,
> Maciek
> 
> 
> 
> -- 
> 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] Uploading JPEG's - Security Issues?

2002-05-16 Thread Andre Dubuc

My question will probably expose my woeful lack understanding of security 
breaches, but perhaps someone can enlighten me.

On my site, registered members will be allowed to upload jpg/jpeg 
pictures. I'm concerned about possible security problems. First, is there a 
way to ensure that a picture (and not some other malicious stuff) has been 
uploaded? 

Aside from checking the mime type info associated with the file, is there any 
way of verifying what's in the file that has been uploaded? (I'm using Linux 
LM8.2) Would it be possible to fake info to fool this check? Would 
verification checks for html/scripts/commands be of any use?

Secondly, since the file in question is already uploaded and saved to disk in 
/tmp or wherever, wouldn't any verification scheme be sort of, 
'after-the-fact'?

I would appreciate any input, suggestions, or ideas on what to do here. Am I 
being overly-paranoid about this, or do I have  legitimate security concern.

Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2

Tia,
Andre


 -- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/


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




Re: [PHP] recognising plain text files

2002-05-16 Thread Rasmus Lerdorf

The uploaded mime type is set by the browser, not by PHP.  So I guess in
your Netscape case it isn't sending the right type.

Perhaps have a look at the 'file' UNIX-level command and use that.

-Rasmus

On Thu, 16 May 2002, Lee P Reilly wrote:

> Hi,
>
> I am doing some validation on files that are being upload. I only wish
> to allow users to upload files that are in *plain text* format (not
> neccessarily with a .txt extension). I have the following piece of code,
> which works fine in IE, but in Netscape Navigator:
>
> if ($file_type != "text/plain")
> ... error handling...
>
> Can anyone explain the reason for this, or offer a better solution?
>
> Thanks,
>
> Lee
>
>
>
> --
> 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] recognising plain text files

2002-05-16 Thread Lee P Reilly

Hi,

I am doing some validation on files that are being upload. I only wish
to allow users to upload files that are in *plain text* format (not
neccessarily with a .txt extension). I have the following piece of code,
which works fine in IE, but in Netscape Navigator:

if ($file_type != "text/plain")
... error handling...

Can anyone explain the reason for this, or offer a better solution?

Thanks,

Lee



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




[PHP] Problems with mail() w/Win2k

2002-05-16 Thread Jared Boelens

Hey guys I recently join this list and this is my first real post to it so
if I f**k something up please do beat me to death. :)

I have a simple mailer script that was mailing POSTed form information to a
client, this script was running on a Debian box w/Apache.  This server is
having hardware issues so I moved the sites to a win2k machine.  The same
script bombs out when it trys to use the mail() function.

The error message I receive is not so enlightening:

Warning: Server Error in D:\Inetpub\belcoind.com\mailFunc.php on line 24

I changed the line in the php.ini to read:

SMTP = localhost;

the server has its own smtp service running on it

I also tried:

SMTP = mail.mydomain.com;

This genereated the same problem.

I have been using PHP with Apache forever but I rarely use it on Windows so
any insight into this problem would be great.


Thanks in advance,

-Jared


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




  1   2   >