[PHP] Please Send MIME Script

2004-06-21 Thread Ryan Schefke
Could someone please send me a function for MIME mail.  I've been searching
for the past 3 hours and haven't come across anything that is solid and
works for me.  I need the following:

 

1 - send MULTIPLE attachments

2 - send message in html and text.

 

Thanks,

Ryan



Re: [PHP] MySql Close problem

2004-06-21 Thread Curt Zirzow
* Thus wrote Erik Gjertsen:
> I have problem with mysql_close 
> I dont understand why.
> Are ther someone that have any proposal?
> 
> ...
> 
> 
> $query = "SELECT usrid FROM users WHERE username";
>  $result = @mysql_query ($query); //Run the query
>
> ...
>
>   }
>  mysql_close();


perhaps because you didn't open a connection?

Endless questions


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Sorting a large text string alphabetically

2004-06-21 Thread Curt Zirzow
* Thus wrote Andre Dubuc:
> I'm trying to sort alphabetically a large text string filled with first and 
> last names separated by ",  "  That would seem to be a simple task, but 
> sort($txt) does not seem to work even when $txt is an array.
> 
> The code :
> 
>  
> $OK= "Joe Blow, Sam Hill, Henry Forget, etc, etc";
> 
> $_SESSION['txt'] = "$OK";
> session_write_close();

Are you really wanting to do this? this is a lot of overhead.

> $txt = $_SESSION['txt'];
> 
> 
> $names = explode(", ", $txt);
>   foreach($names as $key => $names){
> 
>   sort($names);  //line 235
>   reset($names); // line 236
>   while (list($key, $val) = each($names)) {  //line 237
>   }

>   }
> 
> $sorted = implode(", ", $names);
> return($sorted);

Now for the real issue... I'm not sure what all the foreach and
while loops are for but to simply sort your list you need two lines:

  $sorted = explode(", ", $txt); // actually is $tosort
  sort($sorted); // but its sorted now.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Re: Testing if cookies are enabled

2004-06-21 Thread Curt Zirzow
* Thus wrote Martin Schneider:
> 
> But I have seen pages on which it seems they set und check if the cookie 
> has been set ON THE SAME PAGE. So I want to know how they do that 
> (perhaps with a 302-header or something like that?).

I think you answered you're own question :)

if(! isset($_COOKIE['var']) ) {
  setcookie(...);
  header('Location: this_same_script.php');
} else {
  ...

}

while technically not the same page, it just appears that way to
the client.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Why is PHP Segmentation Faulting?!?!?!?

2004-06-21 Thread Curt Zirzow
* Thus wrote Jeff:
> Hey all
> 
> Total PHP newbie here. I posted a day ago about php working
> 'intermittently'. I was told to check my apache logs which was a good hint
> cause php is seg faulting. I've broken it down to my connection script to my
> database and I ran it in gdb to see if it would tell me anything. Since I am
> linux-tarded I don't have any clue what the problem is.

well, you're not that l-tarded if you know how to obtain a
backtrace :)


There are a lot of variables that are contributing to this
behaviour. 

  1. You're OS and Version
  2. Mysql Version
  3. PHP version.

> Here is the backtrace
> 
> (gdb) bt
> #0  0x4207492e in _int_free () from /lib/tls/libc.so.6
> #1  0x42073908 in free () from /lib/tls/libc.so.6
> #2  0x0812b20d in _efree ()
> #3  0x40962a35 in _close_mysql_link (rsrc=0x0)
> at /usr/src/redhat/BUILD/php-4.2.2/ext/mysql/php_mysql.c:253

This answers 1 and 2.

and by the version of php your using, which happens to be almost 2
years old, You've probably have redhat 3.x installed.

So, at this point I can only tell you to upgrade you're php. But.. if
you installed mysql with an rpm you'll probably want to upgrade
mysql as well.

now how to do that.. is a whole nother ball park, iirc, that has
been answered recently on the list.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Sorting a large text string alphabetically

2004-06-21 Thread Greg Donald
On Mon, 21 Jun 2004 23:19:58 -0400, Andre Dubuc <[EMAIL PROTECTED]> wrote:
> 
> I'm trying to sort alphabetically a large text string filled with first and
> last names separated by ",  "  That would seem to be a simple task, but
> sort($txt) does not seem to work even when $txt is an array.
> 
> The code :
> 
>  
> $OK= "Joe Blow, Sam Hill, Henry Forget, etc, etc";
> 
> $_SESSION['txt'] = "$OK";
> session_write_close();
> $txt = $_SESSION['txt'];
> 
> $names = explode(", ", $txt);
>foreach($names as $key => $names){
> 
>sort($names);  //line 235
>reset($names); // line 236
>while (list($key, $val) = each($names)) {  //line 237
>}
>}
> 
> $sorted = implode(", ", $names);
> return($sorted);
> 
> ?>
> 
> I assumed this would work, but I get error messages (for every value in the
> txt array) stating that '$txt' is not an array -- even though it shows up as
> Array(Joe Blow, Sam Hill, Henry Forget, etc, etc). I'm totally confused here.
> As you may gather, arrays are not one of my 'strong' points :>
> 
> Warning: sort() expects parameter 1 to be array, string given in
> /var/www/html/list.php on line 235
> 
> Warning: reset() [function.reset]: Passed variable is not an array or object
> in /var/www/html/list.php on line 236
> 
> Warning: Variable passed to each() is not an array or object in
> /var/www/html/list.php on line 237
> 
> What am I doing wrong?

foreach($names as $key => $names){

You are reusing the same variable, $names is being overwritten.


-- 
Greg Donald
http://destiney.com/

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



Re: [PHP] cookie question

2004-06-21 Thread Curt Zirzow
* Thus wrote water_foul:
> i figured it out ty

What did you figure out?  People searching the archives would like
to know :)

> ...
> > > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul
> > > > > > <[EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > > whats wrong with this script
> > > > > > > setcookie('link' . $loopnum . '',$url,time()+3600*200);
> > > > > > > setcookie('name' . $loopnum . '',$name,time()+3600*200);
> > > > > > > it doesn't write the cookies
> > > > > > >


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



[PHP] Sorting a large text string alphabetically

2004-06-21 Thread Andre Dubuc
I'm trying to sort alphabetically a large text string filled with first and 
last names separated by ",  "  That would seem to be a simple task, but 
sort($txt) does not seem to work even when $txt is an array.

The code :

 $names){

sort($names);  //line 235
reset($names); // line 236
while (list($key, $val) = each($names)) {  //line 237
}
}

$sorted = implode(", ", $names);
return($sorted);

?>

I assumed this would work, but I get error messages (for every value in the 
txt array) stating that '$txt' is not an array -- even though it shows up as 
Array(Joe Blow, Sam Hill, Henry Forget, etc, etc). I'm totally confused here. 
As you may gather, arrays are not one of my 'strong' points :>

Warning: sort() expects parameter 1 to be array, string given in 
/var/www/html/list.php on line 235

Warning: reset() [function.reset]: Passed variable is not an array or object 
in /var/www/html/list.php on line 236

Warning: Variable passed to each() is not an array or object in 
/var/www/html/list.php on line 237


What am I doing wrong?

Any help greatly appreciated,
Tia,
Andre

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



Re: [PHP] umm i am confused...

2004-06-21 Thread Curt Zirzow
* Thus wrote water_foul:
> i get the following error
> 
> Parse error: parse error, unexpected T_STRING in
> C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\personal\links.php on
> line 21

I get parse error on line 4.. but then again I'm smarter than php's
parser.

> --
> for the following code and i cant figure out why (you may need to maxamise
> to read it right)
> 
>  //the function for adding new addresses
> function loop_new_address($loopnum,$url,$name){
> //the ${'link' . $loopnum} says put $link and add $loopnum to the end
> if(isset(${'link' . $loopnum . '})){

extra quote, but I think you already found it.

For readability you might want to consider using a variable
variable:

$linkloop = 'link' . $loopnum;
if (isset($$linkloop)) {
  ...


> loop_new_adderss($loopnum+1,$url,$name);
> };
> else{
> setcookie("link" . $loopnum . "",$url,time()+3600*200);

If you're going to use double quotes might as put the variable
inside of them. but then again, with the readability fix above
you simpley have to do:

setcookie($linkloop, $url, time()+3600*200);

btw, it doesn't make much sense to have hard coded math, better off
just specifying the number and comment it:

time()+72; // +200 hours


> print($name was added);

This line, as well as others below, is absolutly illegal in php.
You must use quotes around strings! double quotes if variables
exist inside, single quotes if not.


> };
> if(isset($_GET[new])) {
> loop_new_address(1,$_GET[name],$_GET[url]);

Be sure to use $_GET['new']; // note the quotes

You're entering the another recursive loop, this is always
dangerous to have these thing dangling around everywhere :)

> ... 

I see you are setting a lot of cookies, you might want to take a
look at (And be sure to read the part about limitations):

 http://wp.netscape.com/newsref/std/cookie_spec.html


HTH your future programming :)

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] recompile your PHP installation with --with-mysql optio n

2004-06-21 Thread Curt Zirzow
* Thus wrote Nguyen, Long P (Mission Systems):
> I recompiled PHP with --with-mysql=/usr/local/sql and still got the following errors:
> 
> Checking PHP configuration settings
> 
> PHP version... success [4.2.2]
> DOMXML extension... success [2.4.23]
> MySQL extension failure [required-extension not installed] 
> 

Um.. how exactly are you doing this, this isn't php configure
output. 


> 
> 
> -Original Message-
> From: John Nichel [mailto:[EMAIL PROTECTED]
>
> ...
> 
> Nguyen, Long P (Mission Systems) wrote:
> > How do you recompile your PHP installation with --with-mysql option??
> > 
> 
> In the PHP source tree
> 
> $ ./configure --with-mysql[=dir] --with-other-options
> $ make
> $ make install
> 
> I'm sure this will bring a few questions. ;)

You jinxed your own message ;)


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] recompile your PHP installation with --with-mysql optio

2004-06-21 Thread FrzzMan
Why did you set the dir to /usr/local/sql???
Did you have mysql there??? It's not the normal installation dir of mysql...
Long P Nguyen wrote:
I recompiled PHP with --with-mysql=/usr/local/sql and still got the following errors:
Checking PHP configuration settings
PHP version... success [4.2.2]
DOMXML extension... success [2.4.23]
MySQL extension failure [required-extension not installed] 

recompile your PHP installation with --with-mysql option 


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Monday, June 21, 2004 1:58 PM
To: php-general Mailing List
Subject: Re: [PHP] recompile your PHP installation with --with-mysql
option
Nguyen, Long P (Mission Systems) wrote:
How do you recompile your PHP installation with --with-mysql option??

In the PHP source tree
$ ./configure --with-mysql[=dir] --with-other-options
$ make
$ make install
I'm sure this will bring a few questions. ;)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] opening Adobe pdf's

2004-06-21 Thread Curt Zirzow
* Thus wrote Scott Taylor:
> 
> It opened Adobe, then an
> Adobe Reader window opened that stated "There was an error opening this
> document.  This file cannot be found."
> 
> So that must mean that the streamfile($file) function (see below) did not 
> return false, otherwise the message would have been "file was not found.  
> please send [EMAIL PROTECTED]"
> 
> Does someone know what's going on here?  Since I am not experincing this 
> problem first handed, I really have no clue.  Also, shouldn't this person 
> get prompted if he wants to save it or open it with Adobe Acrobat?

For the first part, basically, IE thinks it shouldn't cache the
file so by the time adobe gets it there isn't a file for it to use.

As for the second question, you have absolutly no control on what
application will open with what ever mime type is sent.  I've seen
people that had their browser set to try and execute html documents :)

To fix your problem add this before you start your session:

session_cache_limiter('private'); /* more below... */
> 
> session_name("miningstocks_subscribers");
> session_set_cookie_params(TIMEOUT_SUBSCRIBERS);
> session_start();
> 
> ...
> 
>header("Content-Type: " . $type);
>header("Accept-Ranges: bytes");

Becareful sending this header.  The client can get confused and
send special headers requesting a partial file, while also
expecting different results than the whole file.

>header("Content-Length: ".filesize($file));
>header("Content-Disposition: attachment; 
> filename=".basename($file).";");   
>//readfile($file);   
>$fp = fopen($file, 'rb');
>$buffer = fread($fp, filesize($file));

You'll be much better off if you use fpassthru here. This fread
could kill you're machine's memory.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] problem translating single qutoes using ENT_QUOTES

2004-06-21 Thread Curt Zirzow
* Thus wrote Pablo Gosse:
>   
>   if ($mode == 1) {
>   $html = htmlentities($html, ENT_QUOTES);
>   } else {
>   $trans_tbl = get_html_translation_table(HTML_ENTITIES,
> ENT_QUOTES);
>   $trans_tbl = array_flip($trans_tbl);
>   $html = strtr($html, $trans_tbl);
>   }
>   return $html;
> }
> 
> ...
> 
> Can anyone give me an idea as to why single quotes are not being
> translated here?

If you look at $trans_tbl["'"] You'll see that it equals '
instead of '.

> 
> I've fixed the problem simply by adding a str_replace() call to replace
> all instances of ' with ' before returning the $html variable in
> the decode function, but I really want to know why it's not working
> properly.

Two other ways:

  - Set $trans_tbl["'"] =  '''; before you flip the arrray.

  or 

  - use the translation table instead of htmlentities:
  

  $trans_tbl = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
  if ($mode != 1) {
$trans_tbl = array_flip($trans_tbl);
}
  $html = strtr($html, $trans_tbl);


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Re: is there any application ,

2004-06-21 Thread Chris Shiflett
--- Amit Arora <[EMAIL PROTECTED]> wrote:
> I did hear about a PHP compiler a while back  But I am not sure
> whether that project is still around ?

This may be what you're thinking of:

http://pecl.php.net/package/bcompiler

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] Re: is there any application ,

2004-06-21 Thread Amit Arora
Hi Ravi,
I did hear about a PHP compiler a while back  But I am not sure whether that 
project is still around ?
I think it was on sf.net ...
Regards,
Amit
www.digitalamit.com
Ravi wrote:
HI,
is there any windows application , by using we can produce standalone php
..exe files ?
--- knowledge is power share it ---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] TIFF display problem...

2004-06-21 Thread Dan Joseph
Hey Matt,

That was the trick, thanks..  I passed that function... what is
it... session limit cache something or another.  Worked like a charm!
Thanks much!

-Dan Joseph

-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 21, 2004 5:02 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] TIFF display problem...

[snip]
The only problem with turning them off is I need the page to be
secured.  My only option is session tracking.  
[/snip]

session management does not require that these headers be sent to the
browser to work.  Try turning off the cache-control headers.

The cookie and the headers are the only thing different to the browser
(that I know of) when session_start() is in your file, so I think that
might be what is messing up the display.

-- 
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: MySql Close problem

2004-06-21 Thread Thomas Seifert
you should tell WHAT problem you have.
does it throw an error? 
doesn't it work as expected ... ? 

whats the matter?



thomas

On Sun, 20 Jun 2004 13:47:03 -0700 [EMAIL PROTECTED] (Erik Gjertsen) wrote:

> I have problem with mysql_close 
> I dont understand why.
> Are ther someone that have any proposal?
> 
> Thank for any help
> Erik Gjertsen
> 
> Here is the code
> 
> 
> $query = "SELECT usrid FROM users WHERE username";
>  $result = @mysql_query ($query); //Run the query
>   if (mysql_num_rows($result) == 0) { // Make the query
>   $query = "INSERT INTO users (username, name, email, password, registration_date) 
> VALUES
>   ('$username', '$name', '$email', '$password', NOW() )";
>   $result = @mysql_query ($query);
>if ($result) { // IF it ran OK
>  
> // Send an email, if desired
> echo 'You have been registered!';
> include("./footer.inc");
> exit();
>} else { // If it did not ron OK.
> $message = 'You cout not be registered due to a system error. We apologize 
> for any inconvenience';
>}
>   } else {
>   $message = 'That username is alredy taken.';
>   }
>  mysql_close();
>  
>  
>  } else {
>   $message = 'Please try again.';
>  }
> } // End of the main   submit conditional.
> 
>  // Print the error message if ther is one
>  if (isset($message)) {
>   echo '', $message, '';
>  )

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



[PHP] Re: MySql Close problem

2004-06-21 Thread franciccio
Have you tried to specify the the handler of the connection, when you first
made the connection yo had somethig like:
$handler=mysql_connect(...);
...
...
...
mysql_close($handler);


"Erik Gjertsen" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
I have problem with mysql_close
I dont understand why.
Are ther someone that have any proposal?

Thank for any help
Erik Gjertsen

Here is the code


$query = "SELECT usrid FROM users WHERE username";
 $result = @mysql_query ($query); //Run the query
  if (mysql_num_rows($result) == 0) { // Make the query
  $query = "INSERT INTO users (username, name, email, password,
registration_date) VALUES
  ('$username', '$name', '$email', '$password', NOW() )";
  $result = @mysql_query ($query);
   if ($result) { // IF it ran OK

// Send an email, if desired
echo 'You have been registered!';
include("./footer.inc");
exit();
   } else { // If it did not ron OK.
$message = 'You cout not be registered due to a system error. We
apologize for any inconvenience';
   }
  } else {
  $message = 'That username is alredy taken.';
  }
 mysql_close();


 } else {
  $message = 'Please try again.';
 }
} // End of the main   submit conditional.

 // Print the error message if ther is one
 if (isset($message)) {
  echo '', $message, '';
 )

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



RE: [PHP] TIFF display problem...

2004-06-21 Thread Matt Matijevich
[snip]
The only problem with turning them off is I need the page to be
secured.  My only option is session tracking.  
[/snip]

session management does not require that these headers be sent to the
browser to work.  Try turning off the cache-control headers.

The cookie and the headers are the only thing different to the browser
(that I know of) when session_start() is in your file, so I think that
might be what is messing up the display.

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



[PHP] Re: Association Problem?

2004-06-21 Thread Gabe
Thanks for all the help guys!  All of your suggestions got me going in 
the right direction.  I'm using ADOdb, so some of the code below may 
look a little different than suggested.

//stores the RS in an array and creates a sortable array for relevancy
while ( !$objRS_Results->EOF )
{
$strHaystack = $objRS_Results->fields[1] . $objRS_Results->fields[2];
$intRelevancy = substr_count( $strHaystack, $strCriteria );
	$arrRS_Data[$objRS_Results->fields[0]] = array( "title" => 
$objRS_Results->fields[1], "relevancy" => $intRelevancy );
	
	$arrSort[$objRS_Results->fields[0]] = $intRelevancy;
	
	$objRS_Results->moveNext();
}

//prints out the search results based on the relevancy array
while ( current( $arrSort ) )
{
echo $arrRS_Data[key($arrSort)]["title"] . "";

next( $arrSort );
}
Thanks again
Gabe

Gabe wrote:
Wanted to see if anyone had any input on this.  I have a recordset that 
is returned to me in my script.  What I then would like to do is go 
through each row of the recordset and use the substr_count function to 
count the number of times a string appears in each row.  Then I'd like 
to sort & display the recordset based on how many times the string 
appeared in each row.

Basically this is a very light search with a very quick & dirty way to 
find relevancy.  I've thought that I could just store the relevancy 
numbers in an array, but then how do I know which relevancy number goes 
with what row in the recordset?  That's the association problem I'm 
talking about.  Also, how would I then sort the recordset accordingly 
based on the relevancy array?

I've been looking through the PHP documentation and can't quite get past 
this question.  Anyone have any ideas?  Thanks!

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


RE: [PHP] TIFF display problem...

2004-06-21 Thread Daniel Clark
Do you have a temp directory setup for your session variables?

> Hi,
>
>   that probably would work better, however, the if control isn't
> what's fouling it up.  I can omit that and leave session_start() in there,
> and its fouled up.  Session_start() is the culprit.
>
> -Dan Joseph
>
>> -Original Message-
>> From: Daniel Clark [mailto:[EMAIL PROTECTED]
>> Sent: Monday, June 21, 2004 4:47 PM
>> To: Matt Matijevich
>> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>> Subject: Re: [PHP] TIFF display problem...
>>
>> Do you want...
>>
>> if ( !isset($_SESSION['user_id']) )
>>
>> > [snip]
>> >session_start();
>> >
>> >if ( !$_SESSION['user_id'] )
>> >{
>> >exit();
>> >}
>> >
>> > [/snip]
>> >
>> > Are you sure you are getting past the if ( !$_SESSION['user_id'] )
>> > condition?

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



RE: [PHP] TIFF display problem...

2004-06-21 Thread Dan Joseph
Hi,

that probably would work better, however, the if control isn't
what's fouling it up.  I can omit that and leave session_start() in there,
and its fouled up.  Session_start() is the culprit.

-Dan Joseph 

> -Original Message-
> From: Daniel Clark [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 21, 2004 4:47 PM
> To: Matt Matijevich
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] TIFF display problem...
> 
> Do you want...
> 
> if ( !isset($_SESSION['user_id']) )
> 
> > [snip]
> > session_start();
> >
> > if ( !$_SESSION['user_id'] )
> > {
> > exit();
> > }
> >
> > [/snip]
> >
> > Are you sure you are getting past the if ( !$_SESSION['user_id'] ) 
> > condition?
> 

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



Re: [PHP] TIFF display problem...

2004-06-21 Thread Daniel Clark
Do you want...

if ( !isset($_SESSION['user_id']) )

> [snip]
>   session_start();
>
>   if ( !$_SESSION['user_id'] )
>   {
>   exit();
>   }
>
> [/snip]
>
> Are you sure you are getting past the if ( !$_SESSION['user_id'] )
> condition?

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



RE: [PHP] TIFF display problem...

2004-06-21 Thread Dan Joseph
Hi,

The only problem with turning them off is I need the page to be
secured.  My only option is session tracking.  

-Dan Joseph 

> -Original Message-
> From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 21, 2004 4:42 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] TIFF display problem...
> 
> [snip]
> Yeah, positive, I should probably clarify more.  
> session_start(); is what causes it not to display, and gives 
> me the error.  The error is that the site cannot download the file.
> [/snip]
> 
> I dont know much about the plugins to view the tiff's, but 
> maybe some of the http headers that session_start puts out 
> are messing it up.
> That is just a guess though.  You could try to turn off the 
> headers that are coming from session_start
> 

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



RE: [PHP] TIFF display problem...

2004-06-21 Thread Matt Matijevich
[snip]
Yeah, positive, I should probably clarify more.  session_start(); is
what causes it not to display, and gives me the error.  The error is
that
the site cannot download the file.
[/snip]

I dont know much about the plugins to view the tiff's, but maybe some
of the http headers that session_start puts out are messing it up.
That is just a guess though.  You could try to turn off the headers
that are coming from session_start

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



RE: [PHP] TIFF display problem...

2004-06-21 Thread Dan Joseph
Hi,

Yeah, positive, I should probably clarify more.  session_start(); is
what causes it not to display, and gives me the error.  The error is that
the site cannot download the file.

-Dan Joseph

> -Original Message-
> From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 21, 2004 3:57 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] TIFF display problem...
> 
> [snip]
>   session_start();
> 
>   if ( !$_SESSION['user_id'] )
>   {
>   exit();
>   }
> 
> [/snip]
> 
> Are you sure you are getting past the if ( 
> !$_SESSION['user_id'] ) condition?
> 

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



Re: [PHP] TIFF display problem...

2004-06-21 Thread Matt Matijevich
[snip]
session_start();

if ( !$_SESSION['user_id'] )
{
exit();
}

[/snip]

Are you sure you are getting past the if ( !$_SESSION['user_id'] )
condition?

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



[PHP] TIFF display problem...

2004-06-21 Thread Dan Joseph
Hi All,

I've run into a jam..  I have the follow PHP script:



This works just fine...

When I add...

session_start();

if ( !$_SESSION['user_id'] )
{
exit();
}

...to it, the image does not display.

What I need to do is read in images from a secured directory and display it
on the page.  I was using JPGs before and now need to display TIFF files.
We have the plugins for IE all setup.  Could someone tell me how I could fix
this?  I'm at a complete loss...

-Dan Joseph

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



Re: [PHP] include_path with separate virtualhosts doesn't work

2004-06-21 Thread Vidyut Luther
try this inside the 

 

php_admin_flag engine on
php_admin_value include_path 

 

maybe apache 2 wants something else...


On Mon, 21 Jun 2004 12:18:47 -0700, Jon Drukman <[EMAIL PROTECTED]> wrote:
> 
> in my apache server i have a bunch of virtualhost sections like:
> 
> 
> servername bob.domain.com
> documentroot /var/httpd/users/bob
> php_value include_path ".:/var/httpd/users/bob"
> 
> 
> 
> servername sally.domain.com
> documentroot /var/httpd/users/sally
> php_value include_path ".:/var/httpd/sally/bob"
> 
> 
> and so on... currently there are 10 or more.  however it seems like PHP
> decides which include path to use based on the first request to the
> particular apache child process.  in other words, if there are 5 apache
> children, and bob visits bob.domain.com, the apache child that handles
> that request will ALWAYS use bob's include path.  if sally then tries to
> visit her site, and she gets the apache child process that served bob's
> request, the include path will be bob's.
> 
> any obvious things i can look at to try to fix this?
> 
> here's some of the relevant config detail:
> 
> PHP Version => 4.3.6
> 
> System => Linux c10-gs-dev1.cnet.com 2.4.20-28.7bigmem #1 SMP Thu Dec 18
> 11:04:21 EST 2003 i686
> Configure Command =>  './configure'
> '--with-apxs2filter=/opt/apache2/bin/apxs' '--with-mysql=/opt/mysql'
> '--prefix=/opt/php' '--with-mcrypt=/opt' '--with-xslt-sablot=/opt'
> '--enable-xslt' '--enable-ftp' '--enable-mbstring=ja' '--enable-bcmath'
> '--with-aspell=/opt' '--with-pspell=/opt'
> Virtual Directory Support => disabled
> Configuration File (php.ini) Path => /opt/php/lib/php.ini
> PHP API => 20020918
> PHP Extension => 20020429
> Zend Extension => 20021010
> Debug Build => no
> Thread Safety => disabled
> Registered PHP Streams => php, http, ftp
> 
> --
> 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] include_path with separate virtualhosts doesn't work

2004-06-21 Thread Jon Drukman
in my apache server i have a bunch of virtualhost sections like:

servername bob.domain.com
documentroot /var/httpd/users/bob
php_value include_path ".:/var/httpd/users/bob"


servername sally.domain.com
documentroot /var/httpd/users/sally
php_value include_path ".:/var/httpd/sally/bob"

and so on... currently there are 10 or more.  however it seems like PHP 
decides which include path to use based on the first request to the 
particular apache child process.  in other words, if there are 5 apache 
children, and bob visits bob.domain.com, the apache child that handles 
that request will ALWAYS use bob's include path.  if sally then tries to 
visit her site, and she gets the apache child process that served bob's 
request, the include path will be bob's.

any obvious things i can look at to try to fix this?
here's some of the relevant config detail:
PHP Version => 4.3.6
System => Linux c10-gs-dev1.cnet.com 2.4.20-28.7bigmem #1 SMP Thu Dec 18 
11:04:21 EST 2003 i686
Configure Command =>  './configure' 
'--with-apxs2filter=/opt/apache2/bin/apxs' '--with-mysql=/opt/mysql' 
'--prefix=/opt/php' '--with-mcrypt=/opt' '--with-xslt-sablot=/opt' 
'--enable-xslt' '--enable-ftp' '--enable-mbstring=ja' '--enable-bcmath' 
'--with-aspell=/opt' '--with-pspell=/opt'
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /opt/php/lib/php.ini
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => no
Thread Safety => disabled
Registered PHP Streams => php, http, ftp

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


RE: [PHP] Online HTML editor

2004-06-21 Thread Edward Peloke
not a class but I use this..

http://www.interactivetools.com/products/htmlarea/documentation.html

-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]
Sent: Monday, June 21, 2004 3:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Online HTML editor


I want to create an email application in PHP for my client so they can 
produce email text with different fonts and styles just using a browser. 
  Are there any classes that would provide the means to do the editing?

Todd

-- 
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] Online HTML editor

2004-06-21 Thread Todd Cary
I want to create an email application in PHP for my client so they can 
produce email text with different fonts and styles just using a browser. 
 Are there any classes that would provide the means to do the editing?

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


RE: [PHP] recompile your PHP installation with --with-mysql optio n

2004-06-21 Thread Nguyen, Long P (Mission Systems)
I recompiled PHP with --with-mysql=/usr/local/sql and still got the following errors:

Checking PHP configuration settings

PHP version... success [4.2.2]
DOMXML extension... success [2.4.23]
MySQL extension failure [required-extension not installed] 


recompile your PHP installation with --with-mysql option 




-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Monday, June 21, 2004 1:58 PM
To: php-general Mailing List
Subject: Re: [PHP] recompile your PHP installation with --with-mysql
option


Nguyen, Long P (Mission Systems) wrote:
> How do you recompile your PHP installation with --with-mysql option??
> 

In the PHP source tree

$ ./configure --with-mysql[=dir] --with-other-options
$ make
$ make install

I'm sure this will bring a few questions. ;)

-- 
John C. Nichel
KegWorks.com
716.856.9675
[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



[PHP] opening Adobe pdf's

2004-06-21 Thread Scott Taylor
On my site I use  these two blocks of code to open protected files.  I 
can open the files fine, and so can plenty of others.  The problem is 
that at least one person complained that they couldn't open the file.  
This is what they had to say:

It opened Adobe, then an
Adobe Reader window opened that stated "There was an error opening this
document.  This file cannot be found."
So that must mean that the streamfile($file) function (see below) did not return false, 
otherwise the message would have been "file was not found.  please send [EMAIL 
PROTECTED]"
Does someone know what's going on here?  Since I am not experincing this problem first 
handed, I really have no clue.  Also, shouldn't this person get prompted if he wants 
to save it or open it with Adobe Acrobat?
Best Regards,
Scott Taylor

include("subscriber_functions.php");
session_name("miningstocks_subscribers");
session_set_cookie_params(TIMEOUT_SUBSCRIBERS);
session_start();
if (isset($_SESSION['email']))
{
   $file = $_SERVER['DOCUMENT_ROOT'] . "/subscribers/archive/" . 
$_GET['file'];
   if (streamfile($file) == FALSE)
   {
   include ($_SERVER['DOCUMENT_ROOT'] . "/nonindex_header.shtml");
   ?>
   File not found
   The File was not found.  Please send mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED] 
an email with error code 1000 - file not found.
   
   include ($_SERVER['DOCUMENT_ROOT'] . "/footer.shtml");
   }
}
else
{
   header("Location: 
http://www.miningstocks.com/error_docs2/problem_browser.php";);
   exit();
}
?>

---
in subscriber_functions.php:
// will return FALSE if the file is not found
// will not return anything if the file is found because the headers should
// have already been sent.
function streamfile($file)
{
   if (file_exists($file))
   {
   //find the extension.  hopefully there are no directories with 
periods in them!
   $extension = stristr($_POST['file'], ".");
   $extension = strtolower($extension);   
  
   //now it streams the file
   if ($extension == ".php")
   {
   include($file);
   }
   else if ($extension == ".html" || $extension == ".htm" || 
$extension == ".shtml")
   {
   include($file);
   }
   else
   {

   // a switch would be perfect here,
   // but it just didn't work last time...it was always
   // taking the 'default:' case
   if ($extension == ".doc"){$type = "application/msword";}
   else if ($extension == ".pdf"){$type = "application/pdf";}
   else if ($extension == ".exe"){$type = 
"application/octet-stream";}
   else if ($extension == ".ppt"){$type = 
"application/vnd.ms-powerpoint";}
   else if ($extension == ".xls"){$type = 
"application/vnd.ms-excel";}
   else if ($extension == ".xml"){$type = "text/xml";}
   else if ($extension == ".zip"){$type = "application/zip";}
   else if ($extension == ".txt"){$type = "text/plain";}
   else {
   $type="application/octet-stream";
   }

   header("Content-Type: " . $type);
   header("Accept-Ranges: bytes");
   header("Content-Length: ".filesize($file));
   header("Content-Disposition: attachment; 
filename=".basename($file).";");   
   //readfile($file);   
   $fp = fopen($file, 'rb');
   $buffer = fread($fp, filesize($file));
   fclose($fp);
  
   print $buffer;
  
   exit();   
   }   
  
   }
   else
   {
   return FALSE;
   }
}

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


[PHP] problem translating single qutoes using ENT_QUOTES

2004-06-21 Thread Pablo Gosse
Hi folks.  I'm running into a problem translating single quotes that I'm
hoping someone can help with.

In my CMS, content is encoded using htmlentities() before it is stored
in the database.  During publishing the encoded content from the db is
decoded before being written to the file.

However, for some reason single quotes (') are not being decoded
even though I'm using ENT_QUOTES.

Here are the functions:

function CMS_encode_html($html, $mode = 1)
{
$html = str_replace($this->CMS_base_path,'/',$html);

if ($mode == 1) {
$html = htmlentities($html, ENT_QUOTES);
} else {
$trans_tbl = get_html_translation_table(HTML_ENTITIES,
ENT_QUOTES);
$trans_tbl = array_flip($trans_tbl);
$html = strtr($html, $trans_tbl);
}
return $html;
}

function SITE_decode_html($html)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES,
ENT_QUOTES);
$trans_tbl = array_flip($trans_tbl);
$html = strtr($html, $trans_tbl);
return $html;
}

Can anyone give me an idea as to why single quotes are not being
translated here?

I've fixed the problem simply by adding a str_replace() call to replace
all instances of ' with ' before returning the $html variable in
the decode function, but I really want to know why it's not working
properly.

Can anyone give me any ideas?

Cheers and TIA.

Pablo

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



Re: [PHP] plz help!compiled php but iam still getting old version ???

2004-06-21 Thread John Nichel
Ravi wrote:
HI,
existing configuration :
PHP Version 4.3.4 ( default rpm with fedora fc2 install)
Server version: Apache/2.0.49 (default with fedora fc2 install)
Server built:   May  6 2004 07:15:13
NOw i want to install 4.3.3 , so i compiled and install ( with no errors )
if i type " php -v " at shell iam getting correct version *BUT if tried
phpinfo() in browser iam getting still OLD version :( restarted apache but
no use.
please help
- thanks for your time.
Did you a) Uninstall the 4.3.4 RPM and b) configure your source install 
as a DSO or with APXS?

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] recompile your PHP installation with --with-mysql option

2004-06-21 Thread John Nichel
Nguyen, Long P (Mission Systems) wrote:
How do you recompile your PHP installation with --with-mysql option??
In the PHP source tree
$ ./configure --with-mysql[=dir] --with-other-options
$ make
$ make install
I'm sure this will bring a few questions. ;)
--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] recompile your PHP installation with --with-mysql option

2004-06-21 Thread Nguyen, Long P (Mission Systems)
How do you recompile your PHP installation with --with-mysql option??

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



Re: [PHP] Association Problem?

2004-06-21 Thread Daniel Clark
Good idea storing it in an array.

Sort the unique row ID and the count in the array and use asort().

> Wanted to see if anyone had any input on this.  I have a recordset that
> is returned to me in my script.  What I then would like to do is go
> through each row of the recordset and use the substr_count function to
> count the number of times a string appears in each row.  Then I'd like
> to sort & display the recordset based on how many times the string
> appeared in each row.
>
> Basically this is a very light search with a very quick & dirty way to
> find relevancy.  I've thought that I could just store the relevancy
> numbers in an array, but then how do I know which relevancy number goes
> with what row in the recordset?  That's the association problem I'm
> talking about.  Also, how would I then sort the recordset accordingly
> based on the relevancy array?
>
> I've been looking through the PHP documentation and can't quite get past
> this question.  Anyone have any ideas?  Thanks!

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



Re: [PHP] Encrypt/Decrypt help

2004-06-21 Thread John Brooks
On Mon, 21 Jun 2004 13:01:33 -0400, John Fano
<[EMAIL PROTECTED]> wrote:
> 
> Boy, I feel retarded.  That was it.  Thank you.  I used $filename in the
> encrypt stage and when I copied and pasted into the decrypt file I used
> a snippet from Dreamweaver that I had for reading a file into an array,
> which had $fname in it.  Sometimes it takes a second set of eyes.
> 
> Thanks again
> John
> 
> R'Twick Niceorgaw wrote:
> 
> > Hi John,
> > Quoting John Fano <[EMAIL PROTECTED]>:
> >
> >>BEGIN DECRYPT CODE*
> >>$filename = $_GET["q"];
> >>$getdata = file($fname);
> >
> >
> > What is in $fname? Shouldn't it be $filename?
> >
> > HTH
> > R'twick
> >
> > 
> > This message was sent using IMP, the Internet Messaging Program.
> 
> -- 
> ***
> John Fano
> Network Manager: Hoover High School
> http://www.northcanton.sparcc.org
> [EMAIL PROTECTED]
> 
> Web Developer: Solid Ground Multimedia
> http://solidgroundmultimedia.com
> [EMAIL PROTECTED]
> ***
> Those who can read and don't...
> are not better off then those who can't
> 
> 
> 
> --
> 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] Encrypt/Decrypt help

2004-06-21 Thread John Fano
Boy, I feel retarded.  That was it.  Thank you.  I used $filename in the 
encrypt stage and when I copied and pasted into the decrypt file I used 
a snippet from Dreamweaver that I had for reading a file into an array, 
which had $fname in it.  Sometimes it takes a second set of eyes.

Thanks again
John
R'Twick Niceorgaw wrote:
Hi John,
Quoting John Fano <[EMAIL PROTECTED]>:
BEGIN DECRYPT CODE*
$filename = $_GET["q"];
$getdata = file($fname);

What is in $fname? Shouldn't it be $filename?
HTH
R'twick

This message was sent using IMP, the Internet Messaging Program.
--
***
John Fano
Network Manager: Hoover High School
   http://www.northcanton.sparcc.org
   [EMAIL PROTECTED]
Web Developer: Solid Ground Multimedia
   http://solidgroundmultimedia.com
   [EMAIL PROTECTED]
***
Those who can read and don't...
are not better off then those who can't
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] file locking question

2004-06-21 Thread Michal Migurski
> I have this script whereby I use the php function file().
> Just a quick question, do I need to implement file locking.

If you want to ensure that the file is not changed by other scripts while
you're reading from it, yes. Note that this is advisory only - writer
scripts will only respect the lock if they request a write lock. See
manual for details.

> if so, can I just use something like
>   flock( file("/path/file.ext") );

flock() takes a file handle as an argument, not an array of strings:

$fh = fopen("/path/file.ext", 'r');
flock($fh, LOCK_SH);
// read from file here
flock($fh, LOCK_UN);
fclose($fh);

See example 1 in the manual page for flock for more info.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] Encrypt/Decrypt help

2004-06-21 Thread R'twick Niceorgaw
Hi John,
Quoting John Fano <[EMAIL PROTECTED]>:
> BEGIN DECRYPT CODE*
> $filename = $_GET["q"];
> $getdata = file($fname);

What is in $fname? Shouldn't it be $filename?

HTH
R'twick


This message was sent using IMP, the Internet Messaging Program.

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



Re: [PHP] Association Problem?

2004-06-21 Thread Justin French
Gabe,

Wanted to see if anyone had any input on this.  I have a recordset 
that is returned to me in my script.  What I then would like to do is 
go through each row of the recordset and use the substr_count function 
to count the number of times a string appears in each row.  Then I'd 
like to sort & display the recordset based on how many times the 
string appeared in each row.

Basically this is a very light search with a very quick & dirty way to 
find relevancy.  I've thought that I could just store the relevancy 
numbers in an array, but then how do I know which relevancy number 
goes with what row in the recordset?  That's the association problem 
I'm talking about.  Also, how would I then sort the recordset 
accordingly based on the relevancy array?
If the rows have a unique key / id, then you can always relate other 
data to each row by using that key.

I've been looking through the PHP documentation and can't quite get 
past this question.  Anyone have any ideas?  Thanks!
Since you're sorting the rows by relevancy IN PHP, you need to:
- get the mysql rows into a PHP array
- determin the relevancy of each row
- resort the array by relevancy
- print the contents
I don't think the association is all that much of a worry.  When you're 
creating your PHP array of mysql rows, just add in a Nth array element 
for relevancy, then sort the array on that.

---
Justin French
http://indent.com.au
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Association Problem?

2004-06-21 Thread Rob Ellis
On Mon, Jun 21, 2004 at 12:09:50PM -0400, Gabe wrote:
> Wanted to see if anyone had any input on this.  I have a recordset that 
> is returned to me in my script.  What I then would like to do is go 
> through each row of the recordset and use the substr_count function to 
> count the number of times a string appears in each row.  Then I'd like 
> to sort & display the recordset based on how many times the string 
> appeared in each row.
> 
> Basically this is a very light search with a very quick & dirty way to 
> find relevancy.  I've thought that I could just store the relevancy 
> numbers in an array, but then how do I know which relevancy number goes 
> with what row in the recordset?  That's the association problem I'm 
> talking about.  Also, how would I then sort the recordset accordingly 
> based on the relevancy array?
> 
> I've been looking through the PHP documentation and can't quite get past 
> this question.  Anyone have any ideas?  Thanks!
> 

try array_multisort():

  $search_str = 'abc';
  $sort_array = array();
  foreach ($recordset as $k => $v) {
$sort_array[$k] = substr_count($v, $search_str);
  }
  array_multisort($sort_array, $recordset);

- rob

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



[PHP] Re: Association Problem?

2004-06-21 Thread Justin Patrin
Gabe wrote:
Wanted to see if anyone had any input on this.  I have a recordset that 
is returned to me in my script.  What I then would like to do is go 
through each row of the recordset and use the substr_count function to 
count the number of times a string appears in each row.  Then I'd like 
to sort & display the recordset based on how many times the string 
appeared in each row.

Basically this is a very light search with a very quick & dirty way to 
find relevancy.  I've thought that I could just store the relevancy 
numbers in an array, but then how do I know which relevancy number goes 
with what row in the recordset?  That's the association problem I'm 
talking about.  Also, how would I then sort the recordset accordingly 
based on the relevancy array?

I've been looking through the PHP documentation and can't quite get past 
this question.  Anyone have any ideas?  Thanks!

Gabe
You do have a key field for the row, right? Use the value of it for the 
key of the array.

$sth = mysql_query('SELECT * FROM table');
while($rec = mysql_fetch_assoc($sth)) {
  $rel[$rec['id']] = substr_count(implode('', $rec), 'search phrase');
}
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Encrypt/Decrypt help

2004-06-21 Thread John Fano
Greetings!
I am working on a web site in which there is a need to store the orders. 
 Part of the order is some personal info which should not be stored in 
plain text (SS number).  Basically what I have is a submission order 
form which I want to encrypt the input and store it on the server in a 
protected directory.  The owner of the web site will connect to a 
protected admin page and retrieve the orders in a tabular form.  They 
will then click on each order and it will retrieve that order, decrypt 
it , and then display it for them to print off.  After which they have 
the option to delete the order off the server.

When I try to execute it I can encrypt the text, and save it to a data 
file, but when I retrieve the data file and send it through the decrypt 
function, it comes back in a smaller encrypted form.

I am using the same keys in both functions.  And if I put the encrypt 
and decrypt functions on the same page it works perfectly.  So I know 
there is something that must be passed to the decrypt function so that 
it can truly decrypt the string.

Below are the encrypt and decrypt functions of my code.  The missing 
information is what is constructing the data to be encrypted and then 
rebuilding it to be displayed.  I am new to using the encryption 
features of PHP, so if my code is way wrong please correct me.  If 
anyone can help, I would really appreciate it.

Thanks in advance,
John
BEGIN ENCRYPT CODE*
$key = "Not the real key";
$cryptdata = mcrypt_encrypt(MCRYPT_3DES,$key,$data,MCRYPT_MODE_ECB,"0");
$filename = "data/" . $stamp;
$file = fopen($filename,w);
fwrite($file,$cryptdata);
fclose($file);
print "$cryptdata";   
END ENCRYPT CODE***
BEGIN DECRYPT CODE*
$filename = $_GET["q"];
$getdata = file($fname);
$key = "Not the real key";
$decryptdata=mcrypt_decrypt(MCRYPT_3DES,$key,$getdata[0],MCRYPT_MODE_ECB,"0");
print "$decryptdata";
END DECRYPT CODE***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] " in data

2004-06-21 Thread Chris W. Parker
Curt Zirzow 
on Friday, June 18, 2004 10:38 PM said:

> s/should/will

s/s\/should\/will/s\/should\/will\//

:P

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



[PHP] Association Problem?

2004-06-21 Thread Gabe
Wanted to see if anyone had any input on this.  I have a recordset that 
is returned to me in my script.  What I then would like to do is go 
through each row of the recordset and use the substr_count function to 
count the number of times a string appears in each row.  Then I'd like 
to sort & display the recordset based on how many times the string 
appeared in each row.

Basically this is a very light search with a very quick & dirty way to 
find relevancy.  I've thought that I could just store the relevancy 
numbers in an array, but then how do I know which relevancy number goes 
with what row in the recordset?  That's the association problem I'm 
talking about.  Also, how would I then sort the recordset accordingly 
based on the relevancy array?

I've been looking through the PHP documentation and can't quite get past 
this question.  Anyone have any ideas?  Thanks!

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


Re: [PHP] include question

2004-06-21 Thread Keith Greene
Aaron,
I copied your code to a test file called test.php and created the following 
pages as dummy includes:
verify_faculty_info.php, functions.php and accesscontrol.php
in functions.php, I created a dummy search function:
function search(){
return "Found!";
}

in verify_faculty_info.php, I made a call to the search function thusly:
echo search();
the test page, when called with the action=verify outputs the following:
verifying nowFound!
Found!
If you are not getting the output you are expecting, it probably isn't 
because of a function not being available, but more like variables are not 
available to the function.
Are you getting any error messages at all?

Keith
At 08:31 AM 6/21/2004, Aaron Axelsen wrote:
Below is the chunk of code i am using.  In the verify_faculty_info.php
file i call the search function.  The search function is coded in the
function.php file which is included in the accesscontrol.php.
I thought that it would carry over to the verify_Faculty_info.php file.
Was I mistaken?
Thanks

  if ($_GET['action'] == "add" && $_SESSION['role'] == 1) {
include('includes/add_product.php');
  } elseif ($_GET['action'] == "verify") {
echo "verifying now";
search();
include('includes/verify_faculty_info.php');
  } else {
echo "action asked for is not specified";
  }
} else {
   echo "action is not specified";
}
?>
--
Aaron Axelsen
aim: aaak2
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


[PHP] PHP code causing very high load.  Assistance with cause / diagnosis

2004-06-21 Thread Mark Hutchinson
Morning,

I am hoping that some expert here can shed some light on how I can find out 
why
some PHP code is causing very high load on a Linux server I have.

The code is a Trillium Chat/forums board written in PHP.  There are times of
very high load that it causes that are un-usually high.  Like 500% increases
and more from time to time.  I have put on the IONCube PHPA but that did not
seem to help.

Some of the PHP has been modified and more added.  I am wondering if there is
any software available that can look at it to find loops, bad coding
practice,etc, that might cause this.

Any other reccomendations on what I could do to optimize, anyalyze etc. this?

Assistance appreciated.

Mark

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



Re: [PHP] include_path problem in executing program from root folder

2004-06-21 Thread Greg Donald
On Mon, 21 Jun 2004 14:05:05 +, Sharat Hegde
<[EMAIL PROTECTED]> wrote:
> 
> Hello,
> 
> One of my PHP programs called dailybatch.php3 includes a file in its parent
> directory. The link is
> 
> include "../db_mysql.inc"
> 
> 
> dailybatch.php3 is invoked from the crontab command or run from the command
> line in the root /www folder, gives an error indicating that
> "../db_mysql.inc not found". However, when you change to the folder where
> dailybatch.php3 is present and execute the program, there are no errors and
> the program executes. The include_path has "." folder in it.
> 
> What could possibly be the problem with executing the program from the /www
> folder?

Make the include call to db_mysql.inc a full path.  Cron isn't aware
of much at all as far as system paths.  ../  won't work obviously.

-- 
Greg Donald
http://destiney.com/

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



Re: [PHP] include question

2004-06-21 Thread Greg Donald
On Mon, 21 Jun 2004 10:31:42 -0500 (CDT), Aaron Axelsen
<[EMAIL PROTECTED]> wrote:
> Below is the chunk of code i am using.  In the verify_faculty_info.php
> file i call the search function.  The search function is coded in the
> function.php file which is included in the accesscontrol.php.
> 
> I thought that it would carry over to the verify_Faculty_info.php file.
> Was I mistaken?
> 
> Thanks
> 
>  include('accesscontrol.php');
> if (isset($_GET['action'])){
> 
>  if ($_GET['action'] == "add" && $_SESSION['role'] == 1) {
>include('includes/add_product.php');
>  } elseif ($_GET['action'] == "verify") {
>echo "verifying now";
>search();
>include('includes/verify_faculty_info.php');
>  } else {
>echo "action asked for is not specified";
>  }
> } else {
>   echo "action is not specified";
> }
> ?>

Looks like it would work to me.  You might try function_exists() to
help track down the problem.  Probably a typo or mispelled function
name.

-- 
Greg Donald
http://destiney.com/

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



[PHP] include question

2004-06-21 Thread Aaron Axelsen
Below is the chunk of code i am using.  In the verify_faculty_info.php
file i call the search function.  The search function is coded in the
function.php file which is included in the accesscontrol.php.

I thought that it would carry over to the verify_Faculty_info.php file. 
Was I mistaken?

Thanks




--
Aaron Axelsen
aim: aaak2
email: [EMAIL PROTECTED]

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



[PHP] include_path problem in executing program from root folder

2004-06-21 Thread Sharat Hegde
Hello,
One of my PHP programs called dailybatch.php3 includes a file in its parent 
directory. The link is

include "../db_mysql.inc"


dailybatch.php3 is invoked from the crontab command or run from the command 
line in the root /www folder, gives an error indicating that 
"../db_mysql.inc not found". However, when you change to the folder where 
dailybatch.php3 is present and execute the program, there are no errors and 
the program executes. The include_path has "." folder in it.

What could possibly be the problem with executing the program from the /www 
folder?

With Regards,
Sharat
_
The MSN mobile contest! Free talktime ‘n smart phones! 
http://server1.msn.co.in/sp04/mobilecontest  Register now to win!

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


RE: [PHP] Testing if cookies are enabled

2004-06-21 Thread Michael Sims
Martin Schneider wrote:
> I saw this on some pages and want to do the same:
>
> - On one page the user can login. Before that no cookie is set!
>
> - On the next page they set the cookie and show either the user data
> or a warning that the user has disabled cookies and should enable
> them.
>
> I wasn't able to set and text a cookie on the same page! How is it
> done?

Probably wasn't done on the same page.  Here's my guess at how these sites do that:

(1) User visits login page, no cookie is set.
(2) User enters username and password in the login page form, clicks the submit
button, and the login page form posts back to itself.
(3) The login page has logic at the top to check and see if the form has been
posted...if so it verifies the user's credentials, sets a cookie, and then redirects
to the first page of the application.
(4) The first page of the application (main menu or whatever) checks to see if a
cookie has been provided.  If not, it displays the warning that the user has
disabled cookies.

So, the app sets the cookie and then immediately redirects to the page that checks
the cookie.  To the end user it would appear that the cookie was set and checked in
the same page.  HTH...

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



Re: [PHP] file locking question

2004-06-21 Thread Daniel Clark
If you're just going to read only, no.

>>Hi all
>>
>>I have this script whereby I use the php function file().
>>Just a quick question, do I need to implement file locking.
>>
>>if so, can I just use something like
>>  flock( file("/path/file.ext") );
>>
>>Kind Regards
>>Brent Clark

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



Re: [PHP] hi all can you read me ?

2004-06-21 Thread Daniel Clark
Can read you now().

>>Hi all just wanna check if you can read me
>>
>>Thx

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



Re: [PHP] file locking question

2004-06-21 Thread Marek Kilimajer
Brent Clark wrote --- napísal::
Hi all
I have this script whereby I use the php function file().
Just a quick question, do I need to implement file locking.
if so, can I just use something like
flock( file("/path/file.ext") );
No, you need file locking only for writing.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Testing if cookies are enabled

2004-06-21 Thread Ford, Mike [LSS]
On 21 June 2004 12:11, Martin Schneider wrote:

> thanks for your reply, I think you missunderstood, please read more
> carefully. I know how to set and read a cookie, but as I
> wrote I wasn't
> able to set and text a cookie ON THE SAME PAGE.
> 
> The manual says: http://php.net/setcookie
> "Once the cookies have been set, they can be accessed ON THE
> NEXT PAGE."
> 
> But I have seen pages on which it seems they set und check if
> the cookie
> has been set ON THE SAME PAGE. So I want to know how they do that
> (perhaps with a 302-header or something like that?).

Yes, that's one possibility, but there'd still have to be at least one page
load involved before you'd see the cookie.  What you describe makes it more
likely that there's actually some client-side technology involved, such as
JavaScript.

Cheers!

Mike

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

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



[PHP] Re: Testing if cookies are enabled

2004-06-21 Thread Martin Schneider
Hi Aidan,
> Think about it.
>
> Step 1) Analyse the problem.
> a) Set a cookie.
> b) Test if the cookie has been set.
> c) Display data from cookie
>
> Step 2) Read the fucking manual
> a) http://php.net/setcookie
> b) http://php.net/setcookie
> c) http://php.net/setcookie
thanks for your reply, I think you missunderstood, please read more 
carefully. I know how to set and read a cookie, but as I wrote I wasn't 
able to set and text a cookie ON THE SAME PAGE.

The manual says: http://php.net/setcookie
"Once the cookies have been set, they can be accessed ON THE NEXT PAGE."
But I have seen pages on which it seems they set und check if the cookie 
has been set ON THE SAME PAGE. So I want to know how they do that 
(perhaps with a 302-header or something like that?).

Martin
Aidan Lister schrieb:
If you can't work it out, and have actually done some reading, feel free to
ask for some more help.

"Martin Schneider" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello!
I saw this on some pages and want to do the same:
- On one page the user can login. Before that no cookie is set!
- On the next page they set the cookie and show either the user data or
a warning that the user has disabled cookies and should enable them.
I wasn't able to set and text a cookie on the same page! How is it done?
Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Printing invoices

2004-06-21 Thread bskolb
Thanks, I had something similar in mind.  The reason I was hoping to use RTF
is so the customer can easily create new documents and be able to fill in
the variable data themselves. 

Example.  First Name: $fname 

So they would actually type the PHP variable and I could easily read in the
RTF file from database.  

As much as I appreciate everones suggestions thus far, nobody has yet to
address the issue of actually printing the data.  I have no need to save
and/or display the form, I only need to send it to the server side printer
(optionally client side as well, if possible).  It's looking as if I will
have to parse through the RTF and convert it to the built in PHP printer
functions, but I feel this is ineffecient and therefore not necessarily the
best solution.


Thanks to everyone so far!!

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 20, 2004 10:04 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Printing invoices

On 21/06/2004, at 9:30 AM, bskolb wrote:

> Could someone direct me to a printing solution from a static document 
> that would render variable data elements to be sent to a printer 
> queue?  I was thing perhaps of an RTF for the static page, but can't 
> seem to locate any way of inserting the variable data, then spit out 
> each occurrance to a printer.

You could read the contents of an RTF file straight into a PHP variable,
then perform some regular expressions on it.  You'd have to set-up some
naming conventions, but replacing something like {FIRSTNAME} with the
contents of $myInvoiceData['FIRSTNAME'] would be pretty basic stuff.  I'd
probably use preg_replace_callback() with a callback to a function which:

a) attempts to match {THIS_BIT} with $myInvoiceData['THIS_BIT']
b) if no match, either
- return nothing (it replaces {THIS_BIT} with nothing), or
- return {THIS_BIT} (no replacing done -- probably safer for
debugging and the mysteries of RTF.
c) if there's a match return the value of $myInvoiceData['THIS_BIT'],
replacing {THIS_BIT}


Let me know if you need more help, but
http://php.net/preg_replace_callback should give you enough pointers.


---
Justin French
http://indent.com.au

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


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



[PHP] PHP Contest (rev2)

2004-06-21 Thread Mr. Bogomil Shopov
The Spisanie.com Magazine together with its enlisted partners is the 
organizers of the Balkan PHP programming/developing competition. The 
first stage had already been started and will reach completion on the 
15th of July 2004 with the following task:

Development of an encryption algorithm for communication.
- To be structured in two methods – name_encode and name_decode (see 
example);
- The possibility for the input of more than one parameter;
- The completed solutions are to be tested on versions from 4.2.x to 
4.3.6. (or the latest version of PHP4 available when the evaluation is 
to be performed);
- If your script is for a specific version – please let us know by 
writing it on the attached file as well as any other stuff you’d like us 
to take into consideration;

There are no limitations for the algorithm type, encryption level and 
what is to be encrypted. Which means it is up to your creativity.

Prizes are:
- Zend Studio 3.5
- Maguma Workbench (more info?)
- NuSphere Editor (PHPEd)
- TemplateTamer (Developer edition)
- ionCube Cerberus Encoder
- ionCube Standalone PHP Encoder.
- Activestate Comodo IDE
and a lot of Beer ;))
More info at: http://php.spisanie.com/
Bogomil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: is there any application ,

2004-06-21 Thread Mr. Bogomil Shopov
hello , yes there is a phpBlender application.Please look at
http://phpblender.com
All the Best
Bogomil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] file locking question

2004-06-21 Thread Brent Clark
Hi all

I have this script whereby I use the php function file().
Just a quick question, do I need to implement file locking.

if so, can I just use something like
flock( file("/path/file.ext") );

Kind Regards
Brent Clark

MSN: [EMAIL PROTECTED]
eMail: [EMAIL PROTECTED]
Cell: +27 82 701 7827
Work No: +27 21 683 0069
Fax No: +27 21 683 6137

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



[PHP] Check if cookies are enabled on one page

2004-06-21 Thread Martin Schneider
Hello!
I don't want to alyways set a cookie when a user enters my page. I want 
to set it when the users logs on, not earlier.

The way is:
- "Login-Page": The user enters the page where he can enter his 
name/password in a form and then submits this form. Before this, no 
cookie should be set.

- "After Login-Page":
Here the cookie is set for the first time.
- If the user has enabled cookies, I want to show him his data.
- If the user has disabled cookies, I want to show him a page
  saying that he should enable cookies.
I saw pages doing so, but how is it done? I seem not to be able to set 
and check a cookie on the same page (or am I wrong?)

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


[PHP] Re: email autoresponder

2004-06-21 Thread Aidan Lister
If you don't know what it is, why do you want to make one?

There's a lot more to this than simple PHP, I suggest you start on
google.com


"Syed Ghouse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi All

will anybody explain me what is email autoresponder?.
and how to create in php?

Regards
Syed

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



[PHP] Re: Testing if cookies are enabled

2004-06-21 Thread Aidan Lister
Think about it.

Step 1) Analyse the problem.
a) Set a cookie.
b) Test if the cookie has been set.
c) Display data from cookie

Step 2) Read the fucking manual
a) http://php.net/setcookie
b) http://php.net/setcookie
c) http://php.net/setcookie

If you can't work it out, and have actually done some reading, feel free to
ask for some more help.



"Martin Schneider" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello!
>
> I saw this on some pages and want to do the same:
>
> - On one page the user can login. Before that no cookie is set!
>
> - On the next page they set the cookie and show either the user data or
> a warning that the user has disabled cookies and should enable them.
>
> I wasn't able to set and text a cookie on the same page! How is it done?
>
> Martin

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



[PHP] email autoresponder

2004-06-21 Thread Syed Ghouse
Hi All
(B
(Bwill anybody explain me what is email autoresponder?.
(Band how to create in php?
(B
(BRegards
(BSyed

[PHP] Testing if cookies are enabled

2004-06-21 Thread Martin Schneider
Hello!
I saw this on some pages and want to do the same:
- On one page the user can login. Before that no cookie is set!
- On the next page they set the cookie and show either the user data or 
a warning that the user has disabled cookies and should enable them.

I wasn't able to set and text a cookie on the same page! How is it done?
Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Testing for cookie?

2004-06-21 Thread Martin Schneider
Hello!
Okay, I saw pages doing this and I want exactly the same:
- On a page the user can login. Before, no cookie is set.
- On the next page, the cookie is set. It shows either the user data (is 
the login was correct and cookies where enabled) or a page which tells 
that cookies are disabled.

So how is it done? I was not able to set and test a cookie on the same page.
Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Re: Auth_User

2004-06-21 Thread Marcel Tschopp
Eventually the apache module mod_ntlm (http://modntlm.sourceforge.net/)
could help... don't know if it really works but it looks very
interesting.

cheers
Marcel

> If you are using IIS with PHP as an ISAPI-module, it is possible to find out
> the NT-User through $_SERVER['AUTH_USER'].
> Apparently it is not so easy on Apache.
> Does anyone know a solution?
> 
> Gabor
> 
> 
> "Gerben" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> > This var means something else
> > when you write the following code:
> > Header("WWW-Authenticate: Basic realm=\"Enter username and
> password\"");
> > Header("HTTP/1.0 401 Unauthorized");
> > Your browser will produce a popup requesting a username an password
> >
> > This it what you get returned when using $_SERVER['AUTH_USER']
> >
> >
> >
> >
> > "Gabor NiederläNder" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi!
> > >
> > > I have installed a Apache Server (+php) in a Windows NT network. I
> > > would like to identify the Windows NT user visiting my php pages.
> > > When I was using IIS, I think it was quite easy to find it out through
> > > the $_SERVER['AUTH_USER'] variable. But it doesn't seem to work with
> > > apache. Is there another way?
> > >
> > > Cheers,
> > > Gabor
> 
> -- 
> 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: Printing invoices

2004-06-21 Thread Lester Caine
Bskolb wrote:
Could someone direct me to a printing solution from a static document that
would render variable data elements to be sent to a printer queue?  I was
thing perhaps of an RTF for the static page, but can't seem to locate any
way of inserting the variable data, then spit out each occurrance to a
printer.
Have a look at
http://www.interaktonline.com/products/PDFreportsLite/
I had a couple of false starts, but now have it working off Firebird and 
producing .pdf files which I can display in the browser, or save to file.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Auth_User

2004-06-21 Thread Gabor Niederländer
If you are using IIS with PHP as an ISAPI-module, it is possible to find out
the NT-User through $_SERVER['AUTH_USER'].
Apparently it is not so easy on Apache.
Does anyone know a solution?

Gabor


"Gerben" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> This var means something else
> when you write the following code:
> Header("WWW-Authenticate: Basic realm=\"Enter username and
password\"");
> Header("HTTP/1.0 401 Unauthorized");
> Your browser will produce a popup requesting a username an password
>
> This it what you get returned when using $_SERVER['AUTH_USER']
>
>
>
>
> "Gabor NiederläNder" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi!
> >
> > I have installed a Apache Server (+php) in a Windows NT network. I
> > would like to identify the Windows NT user visiting my php pages.
> > When I was using IIS, I think it was quite easy to find it out through
> > the $_SERVER['AUTH_USER'] variable. But it doesn't seem to work with
> > apache. Is there another way?
> >
> > Cheers,
> > Gabor

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