[PHP] Re: [PEAR] Re: PDFlib-Lite-6.0.1

2005-01-04 Thread Michael J. Pawlowsky

`phpize' failed
Any ideas?

Do you have php-devel installed?
If not install it and try again.
Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Case Matching

2003-01-06 Thread Michael J. Pawlowsky
What field type did you make the usernames?
TEXT types are case incensitives use VARCHAR



*** REPLY SEPARATOR  ***

On 06/01/2003 at 2:09 PM [EMAIL PROTECTED] wrote:

>Not really sure if this would be a PHP or a MySQL issue. I'm using a
>database to store username for authentication purposes. Is there a way to
>make the user entry match case in the mysql database? Right now I have
>some users with all uppercase usernames that are able to login typing
>their username in all lower case letters.
>
>TIA,
>
>Ed
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


Cheers,
Mike
-
Hlade's Law:If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.




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




[PHP] Web Based PHP CVS

2003-01-05 Thread Michael J. Pawlowsky

Does anyone know of any decent PHP/Web front ends to CVS?

Thanks
Mike


P.S. Still looking for a good Linux SysAdmin Mail list.
I don't understand Romanian but thanks for the answer!  :-)





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




Re: [PHP] Unexpected $end error?

2003-01-05 Thread Michael J. Pawlowsky
look at your loop.  you have mis matched  which starts one


*** REPLY SEPARATOR  ***

On 05/01/2003 at 5:56 PM Vincent Bouret wrote:

>Can someone tell me why I keep getting that error:
>
>Parse error: parse error, unexpected $end in D:\Program Files\Apache
>Group\Apache2\htdocs\proxy\acc_new.php on line 62
>
>line 62 refers to 
>
>Thanks for your help
>
>Vincent
>



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




[PHP] Good Linux Admin Mail List

2003-01-05 Thread Michael J. Pawlowsky

Perhaps a weird place to ask.. but, anyone have a really good (advanced without to 
many newbie questions) Linux System Administrators Mail List?

Thanks,
Mike




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




RE: [PHP] Function to catch all mySQL errors?

2003-01-04 Thread Michael J. Pawlowsky
Also if you dont want ot to break you need to add the "@" operator in front


Mike


*** REPLY SEPARATOR  ***

On 04/01/2003 at 6:47 PM Adam Plocher wrote:

>This encoded message has been converted to an attachment.
>
>How about something like this..
> 
>function runquery($query)
>{
> $query = mysql_query($query);
> if (mysql_error())
> {
> echo "MySQL Error: ". mysql_error()
>."\n";
> exit(1);
> }
> 
>return $query;
>}
> 



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




RE: [PHP] Read-only gif support in 4.3.0

2003-01-04 Thread Michael J. Pawlowsky


If I look at my phpinfo I get:


gd
GD Support  enabled  
GD Version  bundled (2.0 compatible)  
FreeType Support  enabled  
FreeType Linkage  with TTF library  
GIF Read Support  enabled  
JPG Support  enabled  
PNG Support  enabled  
WBMP Support  enabled  

Notice the GIF Read Support

Why dont you try and compile your own on Windoze

Mike



*** REPLY SEPARATOR  ***

On 04/01/2003 at 6:40 PM Adam Plocher wrote:

>This encoded message has been converted to an attachment.
>
>There aren't any, however there is a GD section which says:
> 
>GD Support enabled 
>GD Version bundled (2.0 compatible)
>FreeType Support   enabled 
>FreeType Linkage   with freetype   
>JPG Supportenabled 
>PNG Supportenabled 
>WBMP Support   enabled 
>




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




RE: [PHP] Read-only gif support in 4.3.0

2003-01-04 Thread Michael J. Pawlowsky

when you do a phpinfo() what are the compiled with options?




*** REPLY SEPARATOR  ***

On 04/01/2003 at 6:24 PM Adam Plocher wrote:

>This encoded message has been converted to an attachment.
>
>Michael, thanks for the response..
> 
>Only prob is I'm using the win32 precompiled version.. I got a couple
>linux boxes I could throw this on I suppose, but I was kind of hoping to
>use this machine as a dev box.
> 
>I ran the same code you posted and these were my results:
>
>Fatal error: Call to undefined function: imagecreatefromgif() in
>c:\apache\htdocs\test.php on line 14
> 
>I don't get it - there are two gd dll's that come with it and I've tried
>both.  Any other advice would be appreciated. Thanks
> 




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




Re: [PHP] Second (Bizarre) Question regarding PHP and ASP

2003-01-04 Thread Michael J. Pawlowsky


http://www.php.net/manual/en/ref.curl.php

have the page send back whatever info you need.



*** REPLY SEPARATOR  ***

On 04/01/2003 at 8:33 PM Phil Powell wrote:

>CURL? I only understand CURL as a Vignette command, sorry, you lost me.
>
>Phil
>
>"Michael J. Pawlowsky" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>
>> I'm not sure I totally understand...   But why not just call it like a
>web
>page using curl?




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




Re: [PHP] Read-only gif support in 4.3.0

2003-01-04 Thread Michael J. Pawlowsky


I just installed 4.3 today...  configured as

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mcrypt --with-zlib -
-with-gd --enable-exif --with-jpeg-dir=/usr/lib --with-png --with-ttf --with-fre
etype --enable-gd-native-ttf


I run this code:



and it works fine


Mike




*** REPLY SEPARATOR  ***

On 04/01/2003 at 4:50 PM Adam Plocher wrote:

>This encoded message has been converted to an attachment.
>
>I read on PHP.net that PHP 4.3.0 has read-only GIF support in it's version
>of gdlib.  I am using the windows version with apache and tried both
>php_gd.dll and php_gd2.dll and I could not access any GIF related image
>functions, however I could use JPG, PNG, etc.  Does anyone know if I need
>to do anything special to get those functions to work?  The function I am
>mainly needing to use is imagecreatefromgif().
>
>
>
>Thanks
>
>-Adam





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




Re: [PHP] web visitor viewing a script?

2003-01-04 Thread Michael J. Pawlowsky
or rename the file to .phps
for PHP source. Many servers recognize this mime type as source and send you the file.

But if you are thinking about security...  the script is compiled and executed on the 
server.
What you see are the results of the application.

Get it?

This is good and bad...  Because it means you can only run each application once and 
then you have to call it again.
Possibly with different parameters etc.

It's why I also use JavaScript. The application resides on the client. Meaning the 
client can interact with it,
So lets say you have 2 select boxes. You want to populate the second one with data 
depending on the selection of the first
with out reloading the page. This can be done in JavaScript. Not in PHP. When doing 
something like that I use PHP to populate
my javaScript arrays and JS handle the interaction with the client.


Mike




*** REPLY SEPARATOR  ***

On 04/01/2003 at 7:17 PM Larry Brown wrote:

>This came up in another group and I just wanted to know from the experts
>whether this is possible.  Being someone well versed in PHP can you visit a
>web site, hit a script in PHP and be able to view the script on the page
>rather than just the html it generates.  Is it true that the only way to
>view the script itself is to have some problem with the web server or have
>a
>local login for the server?
>
>Larry S. Brown
>Dimension Networks, Inc.
>(727) 723-8388
>
>
>
>
>--
>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] counter problem

2003-01-04 Thread Michael J. Pawlowsky


I won't keep it up long... but go here...  you will see it works...

http://rc.mikeathome.net:8080/test/index.php



*** REPLY SEPARATOR  ***

On 04/01/2003 at 7:17 PM Anthony Ritter wrote:

>Michael J. Pawlowsky wrote in message:
>
>> This also works with the ternary operator...
>.
>
>No dice Michael.
>
>I treid both your scripts.
>
>The formbox comes up.
>I enter a number.
>I hit submit.
>The box clears out the entered number without any message whether the
>number
>was too high or too low or correct.
>
>Nothing with the counter as well...
>
>Please advise.
>
>TR
>
>
>
>
>-- 
>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] Second (Bizarre) Question regarding PHP and ASP

2003-01-04 Thread Michael J. Pawlowsky

I'm not sure I totally understand...   But why not just call it like a web page using 
curl?




*** REPLY SEPARATOR  ***

On 04/01/2003 at 6:43 PM Phil Powell wrote:

>I don't know how to post this one so I'm sorry for such bizarre
>cross-posting, but honestly I don't know where to go for help on this one!
>
>I have process.php that has to call a remote file called process.asp on
>another site.
>
>



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




Re: [PHP] counter problem

2003-01-04 Thread Michael J. Pawlowsky

This also works with the ternary operator... I don't think it likes the ++ because it 
doesn't know the type yet.


 $numtoguess)
$message="Your guess was too high.";
else
$message="That is the correct number.";

if(isset($_POST['guess']))
$guess=(int)$_POST['guess'];
else
$guess=0;

print_r($_POST);

?>







Guess number: 

Type your guess here:











*** REPLY SEPARATOR  ***

On 04/01/2003 at 6:40 PM Anthony Ritter wrote:

>The following script is found in Matt Zandstra's book on PHP (Sams) on
>page
>160.
>
>He's explaining forms with PHP and has hard coded a value - 42.
>
>He also is explaining a hidden fleld where the user can submit the number
>and each time the user hits submit in the formbox, the counter will
>register
>the total number of guesses.
>
>However, after running this script and submitting the number, I get:
>
>Guess number:  0 \\\"\\
>
>submit again and...
>
>Guess number: 0 \\"", etc...
>
>instead of:
>
>Guess number: 1
>Guess numver : 2
>etc...
>
>Thanking all in advance.
>Tony Ritter
>..
>
>
>$numtoguess=42;
>$num_tries=(isset($num_tries)) ? $num_tries++ : 0;
>$message="";
>if(!isset($guess))
>$message="Welcome to the guessing machine";
>elseif ($guess<$numtoguess)
>$message="Your guess was too low.";
>elseif ($guess>$numtoguess)
>$message="Your guess was too high.";
>else
>$message="That is the correct number.";
>$guess=(int)$guess;
>?>
>
>
>
>
>
>Guess number: 
>
>Type your guess here:
>
>">
>
>
>
>
>
>
>
>
>
>--
>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] counter problem

2003-01-04 Thread Michael J. Pawlowsky


Use this... enjoy



 $numtoguess)
$message="Your guess was too high.";
else
$message="That is the correct number.";

if(isset($_POST['guess']))
$guess=(int)$_POST['guess'];
else 
$guess=0;

print_r($_POST);

?>







Guess number: 

Type your guess here:
















*** REPLY SEPARATOR  ***

On 04/01/2003 at 6:40 PM Anthony Ritter wrote:

>The following script is found in Matt Zandstra's book on PHP (Sams) on
>page
>160.
>
>He's explaining forms with PHP and has hard coded a value - 42.
>
>He also is explaining a hidden fleld where the user can submit the number
>and each time the user hits submit in the formbox, the counter will
>register
>the total number of guesses.
>
>However, after running this script and submitting the number, I get:
>
>Guess number:  0 \\\"\\
>
>submit again and...
>
>Guess number: 0 \\"", etc...
>
>instead of:
>
>Guess number: 1
>Guess numver : 2
>etc...
>
>Thanking all in advance.
>Tony Ritter
>..
>
>
>$numtoguess=42;
>$num_tries=(isset($num_tries)) ? $num_tries++ : 0;
>$message="";
>if(!isset($guess))
>$message="Welcome to the guessing machine";
>elseif ($guess<$numtoguess)
>$message="Your guess was too low.";
>elseif ($guess>$numtoguess)
>$message="Your guess was too high.";
>else
>$message="That is the correct number.";
>$guess=(int)$guess;
>?>
>
>
>
>
>
>Guess number: 
>
>Type your guess here:
>
>">
>
>
>
>
>
>
>
>
>
>-- 
>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] I can't code today to save my life! :(

2003-01-04 Thread Michael J. Pawlowsky

I must be doibg drugs with all those typos...  

Typos removed:






*** REPLY SEPARATOR  ***

On 04/01/2003 at 4:43 PM Michael J. Pawlowsky wrote:

>try
>
>if(stristr($_SERVER['REREQUEST_URI'], "register.php"){
>   echo "at register";
>} else {
>   echo "Not";
>}
>
>Not tested but should work.. also case insensitive now...
>
>



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




Re: [PHP] I can't code today to save my life! :(

2003-01-04 Thread Michael J. Pawlowsky

try

if(stristr($_SERVER['REREQUEST_URI'], "register.php"){
echo "at register";
} else {
echo "Not";
}

Not tested but should work.. also case insensitive now...



*** REPLY SEPARATOR  ***

On 04/01/2003 at 4:21 PM Phil Powell wrote:

>I have $REQUEST_URI that will take two values:
>
>"/event/login.php"
>
>and
>
>"/event/register.php"
>
>What I need to do is so simple it's brainless!!! I need to look into
>$REQUEST_URI and find if it contains "register.php".  I tried this and it
>completely failed, the results were wrong every time:
>
>if (strpos($REQUEST_URI, "register.php") !== 0) { // you're in login.php }
>
>I don't know why I can't get this other than weekend stupidity, can
>someone help?
>
>Thanx
>Phil





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




[PHP] You gotta love it...

2003-01-04 Thread Michael J. Pawlowsky

When doing a function seach at www.php.net I just got:

Parse error: parse error in /local/Web/sites/phpweb/search.php on line 233

Twice in a row...   Maybe they will be posting us a question soon!!  :-)






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




Re: [PHP] Re: PHP and MySQL bug

2003-01-04 Thread Michael J. Pawlowsky

Personally I think the problem lies somewhere between the chair and the keyboard

(Sorry, couldn't resist)  :-)



*** REPLY SEPARATOR  ***

On 04/01/2003 at 4:58 PM Stefan Hinz, iConnect (Berlin) wrote:

>It doesn't work because of the /* Some code including ... */ part ;-)
>




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




Re: [PHP] No Global Code Fixing

2003-01-04 Thread Michael J. Pawlowsky


Hey that's great... I didn't know about $_REQUEST
I suppose the order of overlapping is set in php.ini

I think I saw that somewhere.


Thanks

As for tunring it back on... in .htaccess
I like the idea of having cleaner code




*** REPLY SEPARATOR  ***

On 04/01/2003 at 11:37 AM Rasmus Lerdorf wrote:

>Why don't you just use $_REQUEST['keyword'] ?




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




Re: [PHP] No Global Code Fixing

2003-01-04 Thread Michael J. Pawlowsky

I just found a better answer, but still open to suggestions

with the URI :  
http://rc.mikeathome.net/test/index.php?one=1&two[]=2&two[]=3&three=3&key=This%20is%20the%20key

I tried this:


 $value){
${$key}=$value;
}
echo $one;
echo "";
print_r($two);
echo "";
echo $three . "\n";
echo $key;
}

?>

Result:
-
1
Array ( [0] => 2 [1] => 3 )
3
This is the key



And that actually worked...  I can live without the unset()'s.
Just need to add the same for POST and do an include with it.

Anyone have a better idea?



*** REPLY SEPARATOR  ***

On 04/01/2003 at 1:22 PM Michael J. Pawlowsky wrote:

>
>So just wondering if anyone had something really elegant to replace it.
>
>
>Cheers,
>Mike





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




[PHP] No Global Code Fixing

2003-01-04 Thread Michael J. Pawlowsky
Well I've been fixing up all my code (and other peoples which is worst) getting ready 
to do an upgrade to 4.3. and turning off globals and warnings on.

I very often move parameters that were once POSTed as a GETs.
For instance... some one does a search but is not logged in, they can see the results 
but don's see the "Edit" results button.
So they log in, and I send them back to the search they just did.

The first search is done by a POST and when I redirect them after the login it's done 
by a GET.

So I use to simply not specify if it was a GET or POST and looked to see if the var 
existed or not to see how to load that page.

Now I've been adding alot of:


if (isset($_POST['keyword'])){
$keyword = $_POST['keyword'];
}elseif (isset($_GET['keyword'])){
$keyword = $_GET['keyword'];
} else {
unset($keyword);
}


I suppose I could also do something like this (which is not much different)

 if(isset($_POST['keyword']) || isset($_GET['keyword'])){
$keyword = isset($_POST['keyword'])?$_POST['keyword']:$_GET['keyword'];
 }else{
   unset($keyword);
 }

I guess I could get rid of the unset, but I like it there just in case something 
earlier filled that puppy.

So I end up with alot of these right now at the top of each page.
Especially if the URI is something like 
http:www.mysite.com/index.php?this=that&id=1&lang=en&so=on&so=on&so=on&so=on&so=on&so=on

Know what I mean?

So just wondering if anyine had something really elegant to replace it.


Cheers,
Mike




Re: [PHP] Re: PHP and MySQL bug

2003-01-04 Thread Michael J. Pawlowsky

Personally I say get yourself a good simple dbconnect class and make life easy.
Also if you ever change users, database name etc, you onlu have one place to replace 
it in your code.

I wrote mine based on http://www.vtwebwizard.com/tutorials/mysql/

Take a look at it.  Nice and simple.


Mike



*** REPLY SEPARATOR  ***

On 04/01/2003 at 1:09 PM OrangeHairedBoy wrote:

>You really should be using a $link variable...it's good habit:
>
>$link = mysql_connect(...);
>mysql_select_db( "mydb" , $link);
>$query = mysql_query( "select..." , $link );
>$result = mysql_fetch_array($query);




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




Re: [PHP] REPOST: installation problems (php 4.2.3/mcrypt/curl)

2003-01-04 Thread Michael J. Pawlowsky

Might or might not be helpful.. but I had the same thing happend when I added 
--with-jpeg-dir=/usr/lib
Everything looked fine... but I could not call imagejpeg. (PHP 4.3 - RH8 - apache2)
Once I did a make clean, ./configure -with- ... , make, make test (to see if it 
had jpg), make install
It worked. It really needed to have that make clean done first. Don't know if this 
will help you or not.

Mike


*** REPLY SEPARATOR  ***

On 04/01/2003 at 9:48 AM Michael Geier wrote:

>phpinfo shows mcrypt and curl support, yet both error out on basic
>functions
>(mcrypt_module_open, curl_init)(PHP Fatal Error: call to undefined
>function...)
>



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




Re: [PHP] PHP and MySQL bug

2003-01-04 Thread Michael J. Pawlowsky

I cant give you a solution, and I''m running on Linux.
But I have pages were I do 6-7 queries on one page always using the same connection.
Never had a problem with that.

Mike


*** REPLY SEPARATOR  ***
>I'm using PHP and MySQL to make my programs. But I think I discovered a bug
>in PHP or in MySQL (I don't know!).
>
>---
>I don't know why is this? Because I'm used to do more than a query per
>connection and this never happened!
>I'm using Win 2k, Apache 2.0.43, MySQL 3.23.49-nt and PHP 4.3.
>



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




Re: [PHP] Avoiding Repeat Posts

2003-01-04 Thread Michael J. Pawlowsky
Why not create a unique constraint with the userid, day (without time) and post 
content.
Is it going in a DB?

Mike


*** REPLY SEPARATOR  ***

On 04/01/2003 at 3:26 AM OrangeHairedBoy wrote:

>Hi all,
>
>It seems that there might be some basic solution on this that I never
>received a memo on...
>
>Basically, I'm looking for a way to avoid repeat posts. If someone, for
>example, adds something to a bulletin board, clicks submit, and then
>presses
>F5, they're just 1 click away from re-submitting the form and posting the
>same information for a second time. Is there an easy way to avoid this?
>
>I've thought about using a "unique visit id" or something which gets
>triggered when a visitor posts, but that seems like a lot to do...
>
>Also, do you think I should look into redirecting the user once they've
>posted so they can't go back?
>
>I just don't know where to begin...any input is greatly appreciated.
>
>Thanks!
>
>Lewis
>
>
>
>
>--
>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] locally enabling register_globals?

2003-01-03 Thread Michael J. Pawlowsky

Why not just fix your code?




*** REPLY SEPARATOR  ***

On 03/01/2003 at 2:50 PM Michael Greenspon wrote:

>Our hosting provider installed PHP 4.2 and thus disabled
>register_globals by default which our scripts depend on. We don't have
>access to php.ini to change this. This is with Apache. I tried putting
>
>php_flags register_globals on
>
>into .htaccess in the directory(s) with pages that need this but it does
>not seem to work. How can I enable register_globals selectively for some
>directories of pages so that our old scripts work again?
>
>Thanks
>Michael
>
>-- 
>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: query join 2 databases? or match up arrays?

2003-01-03 Thread Michael J. Pawlowsky


It's a field type called TIMESTAMP...  just name it whatever you want and it will 
update anytime the row is altered.

The just select that row item to get the timestamp.


Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 5:52 PM Jeff Bluemel wrote:

>actually - I believe that may be a workable solution.  you were mentioning
>checking the timestamp on a mysql table.  how would I check the timestamp
>on
>a mysql table?
>



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




Re: [PHP] Re: query join 2 databases? or match up arrays?

2003-01-03 Thread Michael J. Pawlowsky

That's what I was thinking...
or perhaps see it there's someway in Informix to have a trigger call a sql/c app to 
update your MySQL database.


*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:49 PM Philip Hallstrom wrote:

>Any chance you can do a somewhat frequent export from informix into mysql
>or the other way around so all your stuff is in one database?
>
>-philip
>
>On Fri, 3 Jan 2003, Jeff Bluemel wrote:
>
>> ok - here's my problem.  I have some data in mysql, and other data in
>> informix.
>>
>> here is my application.  this is for distributors of prepaid phone cards.
>> prepaid phone cards have 3 numbers they can be identified by pin number
>> (which is unique), or by batch & serial number.  the batch number is
>> basically the type of card, and the serial number & batch number for
>another





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




Re: [PHP] Create Online Test Program

2003-01-03 Thread Michael J. Pawlowsky

What I have is in ColdFusion...  And I don't own it (although I did write it). It was 
written for commercial clients.
So I'm hesitant to send it.
But this is not hard...

Persoanlly what I would do is have 2 db tables...

1-Questions
2-Answers (foreign key to questions).
and if you want to save peoples answers you would have a third table
3-User_Answers

This way you only have one template to build.

If you are really good with DHTML and JavaScript, you can load all the data in to a 
JavaScript array and simply update
the question and answers everytime the user submits an answer. Save the answers in a 
JavaScript array to deal with later.
You can even have something where onUnload(Want to save answers to continue later?);
This means no reloading for every question.

With that many questions you only want them to see one question at a time.
But let them know somewhere how many questions they've done and how many
they have left to answer.

On the last one you submit it all in a post, enter it in a database if you want and 
give them the results.
Can even be the same page. Just look for

if (isset($_POST['answers']) )
check the answer;
} else {
output form;
}

That's the way I would do it. This way it's easy to have many questionnairs, add 
questions, edit answers etc.


If you are not great with DHTML or Javascript, simply insert and retrieve one 
question.user answer at a time.
If you dont want to put answers in the database you can store it in a session.

Cheers,
Mike




*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:16 PM Devin Atencio wrote:

>Mike,
>
>I would assume the questions would vary anywhere from 60-100 questions
>with each question possibly having 4-5 answers. Do you have some code
>I could look at? I have been trying to think about how to store the
>customers response, then score that against the correct answers etc
>in the database.
>
>Any help you could give me would be greatly appreciated.
>
>Devin Atencio.
>
>
>On Fri, 2003-01-03 at 15:14, Michael J. Pawlowsky wrote:
>> I've done a few...  It all depends on how many question and how many
>answers.
>> How often will they change.
>> How many will you have.
>>
>>
>> Mike
>>
>>
>>
>> *** REPLY SEPARATOR  ***
>>
>> On 03/01/2003 at 2:47 PM Devin Atencio wrote:
>>
>> >Dear PHP Users,
>> >
>> >I am in the process of trying to create an Online Program that will
>> >give questions and possible answers then score the test. I was wondering
>> >if anyone has done this type of thing already and might be able to give
>> >me some pointers on what the best method of doing this might be?
>> >
>> >Devin
>> >
>> >
>> >--
>> >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] Help Needed

2003-01-03 Thread Michael J. Pawlowsky


Look at UPDATE at http://www.mysql.com/



*** REPLY SEPARATOR  ***

On 03/01/2003 at 6:37 PM Pushpinder Singh Garcha wrote:

>hello all
>   I am using php and mysql in my web application. I am making use of 
>forms  to accept data from the user and add it to the mysql database. I 
>also have a login system in place. I need to create a way for the user 
>to edit the information that he/she entered. Can you suggest a way I 
>can do that.
>
>I want to be able to display a form to the user where his information 
>is present ... and then he/she can go ahead and make updates.
>
>thanks
>--pS
>
>
>Pushpinder Singh Garcha
>_





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




Re: [PHP] Create Online Test Program

2003-01-03 Thread Michael J. Pawlowsky


I've done a few...  It all depends on how many question and how many answers.
How often will they change.
How many will you have.


Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 2:47 PM Devin Atencio wrote:

>Dear PHP Users,
>
>I am in the process of trying to create an Online Program that will
>give questions and possible answers then score the test. I was wondering
>if anyone has done this type of thing already and might be able to give
>me some pointers on what the best method of doing this might be?
>
>Devin
>
>
>--
>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 post size question

2003-01-03 Thread Michael J. Pawlowsky
Did you also set the file size in the HTML input tag?


Also take a look at http://www.phpbuilder.com/columns/florian19991014.php3?page=4



Mike


*** REPLY SEPARATOR  ***

On 03/01/2003 at 4:15 PM David Jeffress wrote:

>Hi,
>
>I'm using PHP to implement a contract database for a midrange hospital.
>I'm
>having trouble configuring (I assume) the post_max_size and
>upload_max_filesize to allow for pdf's to be uploaded.
>
>Presently, these are set to 1008M and 1006M respectively, and a file of
>size
>620K still gives me a "413 Error - Request Entity Too Large."
>
>Are there any other settings that I need to look at in order to make this
>work?  All of the other basic settings are in place (IE, file_uploads = on
>etc)
>
>Any help would be greatly appreciated.
>
>Thanks,
>David M. Jeffress
>[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] Excel to MySQL

2003-01-03 Thread Michael J. Pawlowsky
I think BiffWriter might do it...

By why not simply output a comma delimited files from excel and import it in with a 
small php script.

Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 2:20 PM Joe LoMoglio wrote:

>Does anyone know of a FREE utility that will export data from an MS
>Excel file and import it to MySQL. I have found a bunch of nice
>utilities, but none of them are FREE. I'm in a bind and have to get
>over 2000 rows imported to my database by morning and don't have to
>order one of the other solutions.
>
>Joe LoMoglio
>
>
>--
>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] Session Question

2003-01-03 Thread Michael J. Pawlowsky


I use both...  and the way I see PHP handling it is like this...

First call in it will add the SESSID to the hrefs.
Next call (page load) if it finds the cookie it will not append SESSID to URL.
However if it doesn't it will.

There are a few instance were I need to get the SESSION ID and append them myself.

Redirects are a good example you need to add it yourself.

header("Location: http://mysite.org/index.php?PHPSESSID=$sid";);


Cheers,
Mike

P.S. This is just from my obeservation






*** REPLY SEPARATOR  ***

On 03/01/2003 at 1:52 PM [EMAIL PROTECTED] wrote:

>Sorry I didn't make myself more clear. I only want to use server side
>sessions. I don't want to have to rely on a client having cookies enabled
>in their browser. So far having trans_sid is just doing the trick. I can
>save values into sessions server side and not explicitly create a client
>side cookie with any values to retrieve the information.
>
>Thanks again,
>
>Ed
>
>
>On Fri, 3 Jan 2003, Ford, Mike   [LSS] wrote:
>
>> -Original Message-
>> From: [EMAIL PROTECTED]
>> To: [EMAIL PROTECTED]
>>
>>  Does php use cookies for sessions even if you don't explicitly use
>> cookie
>> functions to save session data server side?
>> --
>>
>> That question doesn't even make sense to me -- cookie functions can't
>save
>> data server side, for one thing!  Can you try to explain exactly what it
>is
>> you're trying to find out?
>>
>> Cheers!
>>
>> Mike
>>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php





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




Re: [PHP] PHP intereferes with my Javascript

2003-01-03 Thread Michael J. Pawlowsky
It's not because of the splitting up...

Because the browser does not even know about that.


Save both files to disk and do a "diff" on them.  I bet there will be a few lines...


Mike




*** REPLY SEPARATOR  ***

On 03/01/2003 at 5:21 PM Adam Wilson wrote:

>I posted just before, i think i'll try again and re-word...
>
>I have split a page up into three sections, header, content and footer.
>Header and footer are included in content via PHP. Header contains
>Javascript functions. Content and header both call the javascript
>functions.
>When i look at the source generated it looks exactly like before it was
>split.
>
>BUT the javascript generates errors. Does anyone have any idea why this
>might happen?
>
>ANY help is much appreciated.
>
>--
>Adam Wilson
>__
>Webmaster
>123Doc Ltd
>www.123doc.com
>
>
>
>--
>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] ImageCreateFromPNG

2003-01-03 Thread Michael J. Pawlowsky
Oops...  thought you wanted them to upload a file...


So here something else...  just modify it to your needs
It' the code to the URL I sent you...
















*** REPLY SEPARATOR  ***

On 03/01/2003 at 11:58 AM Michael Weiner wrote:

>Does someone have a script of php function or page that has this code
>working that i can review? I am wanting to create a webpage that will
>let a user enter in an image name (i.e. a png or whatever) and have php
>create an image from that...
>
>Thanks in advance
>Michael Weiner
>
>
>--
>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] ImageCreateFromPNG

2003-01-03 Thread Michael J. Pawlowsky

I have something that does it but only with gif since I have the old version of GDLib.
But everthing is the same except for the output and the opening from a specific file..
It's not exactly what you are looking for but it will get you started
I use a db clas for my db calls so dont try and use does. You will have to change them.


I also build some images on the fly from data

Take a look at http://www.rconline.ca/wind/index.php?id=1&club_id=0

It is built on the fly using GDLib





Create("mydb");

if (isset($_POST['action'])) {


/* Update the database records */

$sql->Insert("INSERT INTO photo_item (unum, cat, cutline, create_date, 
hsize, vsize)
  VALUES ( 
$HTTP_COOKIE_VARS[unum], $_POST[cat], '$_POST[cutline]', now(), 0,0)");

$affected_rows = $sql->a_rows;
$lastid = mysql_insert_id();

/* If we have an photo let's move it */
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
{
move_uploaded_file($_FILES['userfile']['tmp_name'], 
"pics/$lastid.gif");
} else {
/* No photo then send error and delete db entry  */
$sql->Delete("DELETE from photo_item where id = $lastid");
echo ("Error no photo uploaded");
Die();
}

$imagehw = GetImageSize("pics/$lastid.gif");

$imagewidth  = $imagehw[0];
$imageheight = $imagehw[1];
$imagetype   = $imagehw[2];


if ($imagetype != 1)
{
$sql->Delete("DELETE from photo_item where id = $lastid");
$err = unlink ("pics/$lastid.gif");
echo ("Photos must be of type .GIF");
Die();
}

// Make sure the pic is at least 250X175
if (($imageheight < 250) AND ($imagewidth < 175))
{
$sql->Delete("DELETE from photo_item where id = $lastid");
$err = unlink ("pics/$lastid.gif");
echo ("Photos should be a minimum of 250x175 pixels");
Die();
}

if (($imageheight < 175) AND ($imagewidth < 250))
{
$sql->Delete("DELETE from photo_item where id = $lastid");
$err = unlink ("pics/$lastid.gif");
echo ("Photos should be a minimum of 250x175 pixels");
Die();
}


// Create or source image for scaling and thumbnail
$src_img=ImageCreateFromGif("pics/$lastid.gif");


if (($imageheight > 600) or ($imagewidth > 600))
{
// We need to scale it
if ($imageheight > $imagewidth)
{
// We have a vertical
$hscale = ($imageheight / 600);
$new_w  = round($imageheight / $hscale);
$new_h  = round($imageheight / $hscale);
} else {
// We have a horizontal or square
$hscale = ($imagewidth / 600);
$new_w  = round($imagewidth / $hscale);
$new_h  = round($imageheight / $hscale);
}

$dst_img=ImageCreate($new_w,$new_h);

ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$imagewidth,$imageheight);
ImageGif($dst_img, "pics/$lastid.gif");
ImageDestroy($dst_img);

} else {
// Keep original dimensions
$new_w  = $imagewidth;
$new_h  = $imageheight;
}



// Let's see if it's vertical or horizontal and create thumbnail scale
if ($imageheight > $imagewidth)
{
// We have a vertical
$tscale = ($imageheight / 250);
$new_tw  = round($imagewidth / $tscale);
$new_th  = round($imageheight / $tscale);
} else {
// We have a horizontal or square
$tscale = ($imagewidth / 250);
$new_tw  = round($imagewidth / $tscale);
$new_th  = round($imageheight / $tscale);
}


// Make the thumbnail
$t_img=ImageCreate($new_tw,$new_th);

ImageCopyResized($t_img,$src_img

Re: [PHP] Re: threads (was "Re: [PHP] BreadCrumb Class")

2003-01-03 Thread Michael J. Pawlowsky
Unfortunately Calypso threads the messages by date etc. Not Mail IDs.
It has a "Show references" command that creates threads but I don't keep these mails 
on my system for more than a day unless there's some really good info in it.
So it had no effect for me.

It's a great mailer if you have many e-mail accounts and many roles.
I have 15 different accounts (for different clients, businesses etc.) and it manages 
multiple personalities very well.

Decent filtering (besides threads)
Templates
Auto-Responder
Bulk Mail
Grouped Mail
Sigs attached to accounts
PGP support
LDAP Support
Multiple Window Layouts
etc.
And uses very little ressources to do so.

It was freeware for a while because support was dropped for it... but it is now it the 
hands of Rose City Software
http://www.rosecitysoftware.com/Calypso/

Ok enough of a plug for Calypso.

I just wanted to say I added php as a quick nick in my address book so it won't 
happend again!

:-)

Cheers,
Mike


>I try not to harp on this, though I vehemently agree that it just
>shouldn't be done.  The probblem is that those who typically do this
>(usually it's LookOut! users; this is the first time I've noticed Calypso
>as the X-Mailer: and I'm sure there are some others) can't even see the
>threading information and can't use it in their MUA, "threading" only by
>a Subject: line, and will probably never learn.  Since I use mutt and
>have the thread-breaking and thread-joining patch installed, I just break
>the thread and move on.
>
>Absolutely classic, though, was Jim MacCormaic's identical attempt at a
>new thread in response to your message!




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




[PHP] Bit manipulation

2003-01-03 Thread Michael J. Pawlowsky

I can't remember who wanted the bit manipulation stuff...
But I was looking for something in my bookmarks when I saw this simple little class.

I use bits to test for user permissions for specific function.
as in   if ((int)$user.permissions & (int)$permbit) {}

I dont use that class but thought it could be helpful to you.
It has a FlipBit.

Mike

  Start Class 
-

 bitfield = ($this -> bitfield | 0);
  }
  function QueryBit ($bit) {
if (($this -> bitfield & $bit) > 0 )
  return 1;
else
  return 0;
  }
  function SetBit ($bit, $boolean) {
if ($boolean == 1)
  $this -> bitfield |= $bit;
else
  $this -> bitfield &= ~$bit;
  }
  function FlipBit ($bit) {
$this -> bitfield ^= $bit;
  }
}

?>

--  End Class -

Example


$bits = new CBitField;
$bits -> SetBit (BIT_1, 1);
$bits -> SetBit (BIT_2, 0);
$bits -> SetBit (BIT_3, 0);
$bits -> FlipBit (BIT_3);
echo $bits -> QueryBit(BIT_1).",";
echo $bits -> QueryBit(BIT_2).",";
echo $bits -> QueryBit(BIT_3);





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




[PHP] Loading Module not in php.ini

2003-01-03 Thread Michael J. Pawlowsky


I doubt that I can do this...  but as someone once told me, "There's no such thing as 
a stupid question".
I guess they were never on any mailing lists!  :-)

So here it goes

Is there anyway to load a module without having access to php.ini
kind of like a ini_set("extension=mymodule.co"); that would load a new process with 
this module and pass the request on to it?


Cheers,
Mike





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




Re: [PHP] Parsing a string

2003-01-03 Thread Michael J. Pawlowsky
Just use explode() and then dont use what you dont want.

Mike


*** REPLY SEPARATOR  ***

On 03/01/2003 at 9:49 AM Greg wrote:

>Hi-
>I'd like to parse the string returned by popen("uptime", "r");.  The string
>that is returned is:
>
>9:47am up 37 days, 16:24, 1 user, load average: 0.09, 0.02, 0.00
>
>What I'd like is 5 strings...the first contains "37 days, 16:24", the
>second
>"1 user", the third "0.09", the fourth "0.02", and the fifth "0.00".
>
>Any easy way to do this?  Thanks very much in advance!
>-Greg
>
>
>
>--
>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-Performance

2003-01-03 Thread Michael J. Pawlowsky

Get in touch with Zend. I bet they have benchmarks with their optimizer engine.
http://www.zend.com/

Cheers,
Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:56 PM Fatih Üstündað wrote:

>Do you know any resource about php performance?
>
>I wonder that can I use php+apache+oracle for a web site
>serving to many clients ( such as 10.000 ) at the same time?




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




Re: [PHP] include/require vs performance

2003-01-03 Thread Michael J. Pawlowsky

These files are parsed by the interpreter...
They are not sent to the client, so I you are thinking bandwidth I dont see how it 
would affect it.
Unless they all output a bunch of data.

Of course there will be some overhead for PHP to interpret all that code.

Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 8:25 AM Radek Zajkowski wrote:

>i am designing a small app that obviuosly works best when I have a lot of
>global files with functions, which cut down on editing.
>
>I will likely have a main page that will contain modules and also load
>all of the required includes like config etc. in total some 10 files will
>be reqested.
>
>Is there, was there ever issue around including a lot files via
>include(). I am running things on a local server so it's hard to gauge.
>
>Thansk in advance.
>
>R>
>
>___
>Radoslaw Zajkowski
>http://www.finalbanana.com
>
>
>--
>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] Mass-mailing method

2003-01-02 Thread Michael J. Pawlowsky


I have the same problem with one of my clients.

I use this...  Just keep it well protected...  you can cat, ls, find etc.  no ps for 
some reason  Might also depend on server security settings. But worth a shot.



-- STart Here 











");
echo ("");
$err = 0;
$result = system ($_POST['cmd'], $err);
echo ("\n\n$err\n\n");
echo ("$result\n\n");
echo ("");


} else {


echo "";
echo "";
echo "";

echo "Cmd: ";
echo "";
echo "";

echo ("error log");
echo "";
}
?>






-  End Here 









*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:19 AM Cesar Aracena wrote:

>I'm going to try changing that. I don't have access to my client's
>server as I work remotely, so I can't view any logs... or can I? If
>anyone else have something for me to try, start shooting...
>
>Thanks,




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




Re: [PHP] Mass-mailing method

2003-01-02 Thread Michael J. Pawlowsky
Take a look at the sendmail.log for some clues...

But I had something weird were it worked fine for me at home Linux 8 PHP 4.2.2
and when I sent it up to the prod server I had to change the ."\r\n";  to ."\n";
Which technically is wrong.

Go figure!

But take a look at the sendmail log to begin with.

Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:08 AM Cesar Aracena wrote:

>Hi all,
>
>I did a registration page for a customer, and now I'm trying to develop
>a way for him to send an e-mail once in a while to the people registered
>with him. I did something (shown below) and everything seems to be ok,
>but the e-mail never reaches... Can someone find the problem or maybe
>point me to something already done to send multiple e-mails as BCC???
>
>Thanks in advance,
>
>$query = "SELECT * FROM mararegistro2 ORDER BY lname";
>$result = mysql_query($query) or die (mysql_errno());
>$num_rows = mysql_num_rows($result);
>
>for ($x=0; $x < $num_rows; $x++)
>{
>$row = mysql_fetch_array($result);
>$bcc .= $row[email]."; ";
>}
>
>$myname = "".$name."";
>$myemail = "".$email."";
>
>$contactemail = $bcc;
>
>$message = "".$mes."";
>$subject = "".$subject."";
>
>$headers .= "MIME-Version: 1.0\r\n";
>$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
>$headers .= "From: ".$myname." <".$myemail.">\r\n";
>$headers .= "Bcc: ".$contactemail."\r\n";
>$headers .= "Reply-To: ".$myname." <".$myemail.">\r\n";
>$headers .= "X-Priority: 1\r\n";
>$headers .= "X-MSMail-Priority: High\r\n";
>$headers .= "X-Mailer: Joyeria Mara";
>
>$mail = mail("", $subject, $message, $headers);
>
>
>
>Cesar L. Aracena
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>(0299) 156-356688
>Neuquén (8300) Capital
>Argentina
>
>
>
>
>--
>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] way to insert timer / pause?

2003-01-02 Thread Michael J. Pawlowsky


Thank god the  tag in HTML was removed.
Don't know how long you've been working on sites,
but I started at the same time the first NSCA Mosaic browser came out. About 10 years 
now.

They had  back then, and everyone starting using it just about 
everywhere!
Imagine trying to read complete pages that were blinking.

The first HTML chats would allow tags inserted...
so someone would open a  tag and not close it to  make the whole page blink.

Anyways... the way I would do it today is to make an animated gif with the text 
blinking and just load that.

Mike




*** REPLY SEPARATOR  ***

On 02/01/2003 at 9:52 PM Jeff Bluemel wrote:


>highlighted text instead (and flashing if I can figure that out).




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




Re: [PHP] email/time question

2003-01-02 Thread Michael J. Pawlowsky

Well a few ways you can do it... how precise does it need to be?

You can have PHP write the mails to files with the time to be sent in then or in the 
filename; like somerandomstring.200301021545
Run a script from cron that would look at the files, parse the time and if it's time 
to send them just direct them into sendmail.

If you cant get to cron or to write scripts on your server.
You can always put some include in a busy page of your site. Put it at the end after a 
flush call.
But of course in someone wants his mail at 03:00 and you donrt have much traffic it 
might be late.
It can check for the files and mail the contents if it needs to.

Might also be otherways but that's one.

Hope this helps...

Mike



*** REPLY SEPARATOR  ***

On 02/01/2003 at 10:48 PM Randy Johnson wrote:

>Here is what i need to do.

>

>I have a form where a user will submit, email address, email text and a
>time
> like 11:15pm  and at 11:15pm the email is supposed to be sent out.   any
>ideas on how i can make this happen automatically???

>

>

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





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




[PHP] BreadCrumb Class

2003-01-02 Thread Michael J. Pawlowsky

I was wondering if anyone had a good BreadCrumb class.
If not I will write my own, but thought surely there must be many out there.
But quick searches only brought up "Poof" which is more than I want.


Thanks,
Mike




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




Re: [PHP] way to insert timer / pause?

2003-01-02 Thread Michael J. Pawlowsky

I'm not sure I totally understand... but...

to pause...  sleep(10);  i.e. 10 second pause Everything stops...  not just output

you can buffer everything and only output it when you want

look at ob_start

But a warning...  your server or the clients might change the expexted behaviour.


Mike



*** REPLY SEPARATOR  ***

On 02/01/2003 at 7:56 PM Jeff Bluemel wrote:

>if there a command, or a way I can put say a 5 second, or a 10 second
>pause
>which will make it so it will output x amount of html, and then continue?
>or if I can pause it will it not display any of the html until the entire
>script has ran?
>
>
>
>--
>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] parse error

2003-01-02 Thread Michael J. Pawlowsky
You need to esape your quotes in the HTML
as in

  echo("");

should be

  echo("");


Mike




*** REPLY SEPARATOR  ***

On 02/01/2003 at 11:27 PM Ezequiel Sapoznik wrote:

>Hi!
>I am receiving a parse error in the following code. The file is located at
>http://www.historiadelpais.com.ar/ppal_bio.php
>
>Anyone can help me?
>
>Thanks!
>
>Ezequiel
>
>
>
>
>Biografias
>
>
>  $db = mysql_connect("localhost", user, password);
>  mysql_select_db(efemerides,$db);
>  $response = mysql_query("select * from biografias where indice=1", $db);
>  while($row = mysql_fetch_array($response));
>
>
>  echo("width="274" height="43">");
>  print "";
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>
>   print($row["texto"] ."\n");
>
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  echo("");
>  }
>
>?>
>
>
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php





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




RE: [PHP] mktime() and the format of the day number entry

2003-01-02 Thread Michael J. Pawlowsky

Just to add to that... what it is doing is reading it as a 0.

0,0,0,09,30,1998 => 883458000
Tue, 30 Dec 1997 00:00:00 -0500

0,0,0,0,30,1998 => 883458000
Tue, 30 Dec 1997 00:00:00 -0500


Did you see this in the manual?

"The last day of any given month can be expressed as the 0 day of the next month, not 
the -1 day. "

I wonder if 0 has some significance in the month also?




Ok back to work  :-)









*** REPLY SEPARATOR  ***

On 02/01/2003 at 7:17 PM Michael J. Pawlowsky wrote:

>Well you are right.. I also get the same results...
>I guess you found a bug...   did you look in the bug reports to see if it
>already exists?
>
>
>




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




RE: [PHP] mktime() and the format of the day number entry

2003-01-02 Thread Michael J. Pawlowsky
Well you are right.. I also get the same results...
I guess you found a bug...   did you look in the bug reports to see if it already 
exists?




Results


Thu, 2 Jan 2003 19:15:35 -0500
0,0,0,10,0,1998 => 907128000
0,0,0,10,00,1998 => 907128000
0,0,0,10,1,1998 => 907214400
0,0,0,10,01,1998 => 907214400
0,0,0,10,2,1998 => 907300800
0,0,0,10,02,1998 => 907300800
0,0,0,10,3,1998 => 907387200
0,0,0,10,03,1998 => 907387200
0,0,0,10,4,1998 => 907473600
0,0,0,10,04,1998 => 907473600
0,0,0,10,5,1998 => 90756
0,0,0,10,05,1998 => 90756
0,0,0,10,6,1998 => 907646400
0,0,0,10,06,1998 => 907646400
0,0,0,10,7,1998 => 907732800
0,0,0,10,07,1998 => 907732800
0,0,0,10,8,1998 => 907819200
Thu, 8 Oct 1998 00:00:00 -0400
0,0,0,10,08,1998 => 907128000
Wed, 30 Sep 1998 00:00:00 -0400

0,0,0,10,9,1998 => 907905600
Fri, 9 Oct 1998 00:00:00 -0400

0,0,0,10,09,1998 => 907128000
Wed, 30 Sep 1998 00:00:00 -0400

0,0,0,9,30,1998 => 907128000
Wed, 30 Sep 1998 00:00:00 -0400

0,0,0,09,30,1998 => 883458000
Tue, 30 Dec 1997 00:00:00 -0500



-  Code --


";
$tmp = mktime(0,0,0,10,0,1998);
echo "0,0,0,10,0,1998 => $tmp";
$tmp = mktime(0,0,0,10,00,1998);
echo "0,0,0,10,00,1998 => $tmp";
$tmp = mktime(0,0,0,10,1,1998);
echo "0,0,0,10,1,1998 => $tmp";
$tmp = mktime(0,0,0,10,01,1998);
echo "0,0,0,10,01,1998 => $tmp";
$tmp = mktime(0,0,0,10,2,1998);
echo "0,0,0,10,2,1998 => $tmp";
$tmp = mktime(0,0,0,10,02,1998);
echo "0,0,0,10,02,1998 => $tmp";
$tmp = mktime(0,0,0,10,3,1998);
echo "0,0,0,10,3,1998 => $tmp";
$tmp = mktime(0,0,0,10,03,1998);
echo "0,0,0,10,03,1998 => $tmp";
$tmp = mktime(0,0,0,10,4,1998);
echo "0,0,0,10,4,1998 => $tmp";
$tmp = mktime(0,0,0,10,04,1998);
echo "0,0,0,10,04,1998 => $tmp";
$tmp = mktime(0,0,0,10,5,1998);
echo "0,0,0,10,5,1998 => $tmp";
$tmp = mktime(0,0,0,10,05,1998);
echo "0,0,0,10,05,1998 => $tmp";
$tmp = mktime(0,0,0,10,6,1998);
echo "0,0,0,10,6,1998 => $tmp";
$tmp = mktime(0,0,0,10,06,1998);
echo "0,0,0,10,06,1998 => $tmp";
$tmp = mktime(0,0,0,10,7,1998);
echo "0,0,0,10,7,1998 => $tmp";
$tmp = mktime(0,0,0,10,07,1998);
echo "0,0,0,10,07,1998 => $tmp";
$tmp = mktime(0,0,0,10,8,1998);
echo "0,0,0,10,8,1998 => $tmp";
echo date("r", $tmp) . "";
$tmp = mktime(0,0,0,10,08,1998);
echo "0,0,0,10,08,1998 => $tmp";
echo date("r", $tmp) . "";
$tmp = mktime(0,0,0,10,9,1998);
echo "0,0,0,10,9,1998 => $tmp";
echo date("r", $tmp) . "";
$tmp = mktime(0,0,0,10,09,1998);
echo "0,0,0,10,09,1998 => $tmp";
echo date("r", $tmp) . "";

$tmp = mktime(0,0,0,9,30,1998);
echo "0,0,0,9,30,1998 => $tmp";
echo date("r", $tmp) . "";

$tmp = mktime(0,0,0,09,30,1998);
echo "0,0,0,09,30,1998 => $tmp";
echo date("r", $tmp) . "";



?>








*** REPLY SEPARATOR  ***

On 02/01/2003 at 4:29 PM Johnson, Kirk wrote:

>The month behaves the same: both '08' and '09' are treated as zero by
>mktime().
>
>Kirk
>



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




Re: [PHP] Timeout during SMTP operation.

2003-01-02 Thread Michael J. Pawlowsky


Am I happy I'm not your hosting provider!  :-)
They will probably flip if they see you send out 7000 e-mails.

Anyways  crontab -e from a shell allows you to create a cronjob.

from a shell just "man crontab"

Cheers,
Mike




*** REPLY SEPARATOR  ***

On 02/01/2003 at 4:39 PM gilrain wrote:

>I do know that my host allows me to use
>crontab, though, and most other common *nix programs.
>
>Could you (or any of the other readers) explain how I would go about using
>cron or at to do what my function is trying to do?
>
>



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




RE: [PHP] Some questions regarding pfsocketopen()

2003-01-02 Thread Michael J. Pawlowsky

Well if you do find the solution please let us know. I would also like to add it to my 
PHP lib archive.
I suppose it would be there for stuff like command line PHP.


Mike


*** REPLY SEPARATOR  ***

On 02/01/2003 at 5:15 PM Gareth Hastings wrote:

>Yes I saw those but what it made me think, what's the point of a
>persistent socket if you can't use it again? And that very last comment
>
>"I did not find an (easy) solution to this problem."
>
>to me implies there is a solution out there, it's just not easy. Well I
>hope there is one about. Anyway back to google :)




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




RE: [PHP] Some questions regarding pfsocketopen()

2003-01-02 Thread Michael J. Pawlowsky

Two comments from the manual that are interesting:


php dot net at domainofdarkness dot com
29-Jan-2001 04:26

OK, WRT to the p* functions opening a new connection when one already exists. It is my 
understanting that (under Apache anyways) this is on a per-process basis. If you do a 
'ps auxw|grep httpd' on your server you will see more than one process. What p* does 
is make a p-connection on one of those processes only, the one that actually handles 
your request. Chances are that when you hit the page again it will be answered by a 
different process. I'm guessing if you keep hitting reload you'll get around to the 
original process again and there will be no error message or second connection open. 
Anyhow, this is true of all p* functions; they open not one connection per server, but 
one connection per server _process_.


venuti at sissa dot it
13-Sep-2001 11:48

Don't expect to be able to open a persistent connection within a script and resume it 
from a different script, not even if you save the value of $fp with session_register 
(in fact, $fp is a resource id and cannot be saved in this way). I did not find an 
(easy) solution to this problem.









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




RE: [PHP] Some questions regarding pfsocketopen()

2003-01-02 Thread Michael J. Pawlowsky

Well I didnt try to write or read to it...

But this works But all that's telling me is that the var is there.. not if it's 
still open.. will leave that to you to find out... Let us know




--file s1.php ---

Next";


?>


  file s2.php -









*** REPLY SEPARATOR  ***

On 02/01/2003 at 4:08 PM Gareth Hastings wrote:

>The only code I've tried so far has been a simple
>
>makeconnection.php
>
>   $mysocket = pfsocketopen("my.server.com", "1234");
>?>
>
>---
>
>testconnection.php
>   echo (isset($mysocket) ? "Socket found and open" : "Socket not
>found");
>?>
>



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




RE: [PHP] Some questions regarding pfsocketopen()

2003-01-02 Thread Michael J. Pawlowsky


Cool...  Maybe I will learn something..  :-)

Well in that case (I already deleted you last mail), where are you keeping the file 
pointer?

You will need to register the var somewhere.. In a session perhaps?


Mike

Send me your code...  I will play with it...




*** REPLY SEPARATOR  ***

On 02/01/2003 at 3:42 PM Gareth Hastings wrote:

>> You will need to have everythng on the same page.  Your program ends
>once
>> the page does.
>
>
>pfsocketopen() is persistent and stays open even after your script has
>finished running until either the timeout period is reached or it gets
>disconnected/closedI think. I just don't know how to access it after
>you script ends.
>
>
>
>--
>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] Some questions regarding pfsocketopen()

2003-01-02 Thread Michael J. Pawlowsky


You will need to have everythng on the same page.  Your program ends once the page 
does.
Here are some examples straight from the manual.

\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>


The example below shows how to retrieve the day and time from the UDP service 
"daytime" (port 13) in your own machine. Example 2. Using UDP connection

\n";
} else {
fwrite($fp,"\n");
echo fread($fp, 26);
fclose($fp);
}
?>






*** REPLY SEPARATOR  ***

On 02/01/2003 at 3:10 PM Gareth Hastings wrote:

>One last question, do you know how or what method I would use to do this
>via a php script? Everything I've tried fails. Like
>
>
>Makeconnection.php
>   $mysocket = pfsocketopen('my.server.com', '1234');
>?>
>--
>
>
>testconenction.php
>   fputs($mysocket, "VERSION\n");
>   echo fgets($mysocket, 255);
>?>
>



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




Re: [PHP] signal handler to ignore kill of parent

2003-01-02 Thread Michael J. Pawlowsky

Actually let me try to be a bit more helpful... nut not much though :-)

Did you write the code for the fork();

Can you modify it?  Read the fork, exec and clone man pages.
This might help you a bit understand the behaviour.

If so just call exec from the forked process... this will create a new process instead 
of a child one.
Then call exit() in your forked process.

Mike






*** REPLY SEPARATOR  ***

On 02/01/2003 at 7:05 PM Thomas Weber wrote:

>Hi,
>
>i need some way for child-processes to ignore the kill of their parent. Any
>idea?
>
>Thanks,
>Thomas 'Neo' Weber
>---
>[EMAIL PROTECTED]
>[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] signal handler to ignore kill of parent

2003-01-02 Thread Michael J. Pawlowsky
You should get together with the the guy who's was looking for a way to kill the child 
processes after killing the parent.
They weren't dying for him. (Which I dont understand why?)

:-)


*** REPLY SEPARATOR  ***

On 02/01/2003 at 7:05 PM Thomas Weber wrote:

>Hi,
>
>i need some way for child-processes to ignore the kill of their parent. Any
>idea?
>
>Thanks,
>Thomas 'Neo' Weber
>---
>[EMAIL PROTECTED]
>[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] 3 colums....

2003-01-02 Thread Michael J. Pawlowsky

I need some sleep right now, my brain is in low gear

Here's what I'm trying to do.

Basically have 3 HTML columns () printed to a web page but have them in 
alphabetical
order from top to bottom and then continuing onto the next column.
Like you would see in an index of a book.

This code works fine except for when there are 4 items (dbrows)
to be displayed. ceil($rows / 3) (see below) becomes 2 so it allows
two items in each colum resulting to only 2 HTML colums being displayed.

Can anyone come up with a better way to do this?


  Start 
---

\n\n";

print "\n\n";

print "\n";

for ($i = 1; $i < $rows+1; $i++) {

print "\n";
print "Data\n";
print "$i\n";
print "\n";

if ($i % ceil($rows / 3) == 0 ){

print "\n";
if ($i != $rows ){
print "\n";
}
}
}
print "\n\n";
print "\n";


print "\n\n\n\n";

print "";
print "";
print "$j";
print "";
print "";

}


?>

--- End ---



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




Re: [PHP] killing child process

2003-01-02 Thread Michael J. Pawlowsky


I was just giving you an example of how to get the listing of all processes.
I didn't actually think you were going to kill all your httpd processes.

I was taking it for granted you would change httpd to the name of your process.

Mike



*** REPLY SEPARATOR  ***

On 02/01/2003 at 4:51 PM Marek Kilimajer wrote:

>Michael J. Pawlowsky wrote:
>
>>Actually to kill all of them would not be hard
>>
>>Try something like
>>
>>ps -eaf | grep httpd | awk '{print $2}'
>>
>>
>actualy it will be named only other_script.php (it doesn't go through
>httpd).
>You can execute the scripts with a dummy parameter that will be a random
>string and grep for
>that in the above command.




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




Re: [PHP] Index page

2003-01-02 Thread Michael J. Pawlowsky
in your http.conf file

Add index.php in the list of default docs.

Or if IIS in the IIS manager properties for that site.



*** REPLY SEPARATOR  ***

On 02/01/2003 at 11:26 PM thkiat wrote:

>Why by only typing http://localhost/ the index.php did not show up. I have
>to type http://localhost/index.php for the page to show up. How can I solve
>this problem?
>
>
>
>--
>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] killing child process

2003-01-02 Thread Michael J. Pawlowsky

Actually to kill all of them would not be hard

Try something like

ps -eaf | grep httpd | awk '{print $2}'


That will give you all the httpd processes...pipe that into kill


Mike



*** REPLY SEPARATOR  ***

On 02/01/2003 at 8:26 PM gamin wrote:

>Hello,
>
>  Running PHP 4.0.6 on RedHat 7.2.
>
>  I'm writing a command line script (called scirpt.php) and am using the
>backtick operator to start other processes from my script.
>
>$com_response = `./other_script.php` ; or #com_response = `wget `;
>
>I can kill scirpt.php easily but that wont kill other_script.php, there
>would be no problem killing one process manually, but i could have many
>scirpts starting from the main script. Killing them all would be a task. I
>could prefix their name them with 'ch_' and kill all these. But thats not
>the solution i'm looking for.
>
>Is there a way to make a process a child, so that when the parent
>termintaes/is terminated  the child terminates also ?
>thx
>
>gamin.
>
>
>
>
>
>
>--
>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] prevent session_replay

2003-01-02 Thread Michael J. Pawlowsky

The problem with that is, if you have a proxy farm you never know which IP might be 
used.
For instance, if the user is on AOL, every request to the server will probably have a 
different IP.

Mike


*** REPLY SEPARATOR  ***

On 02/01/2003 at 3:25 PM Marek Kilimajer wrote:

>This is how it works, but you can tie session to a specific IP (still
>not 100% safe)
>
>scott wrote:
>




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




RE: [PHP] mail attachments

2003-01-02 Thread Michael J. Pawlowsky
While on the subject of Multi-part Mime Type...

I use to use it alot in the past in C cgi's (only Netscape supported at the time) to 
give status reports when doing long processes etc.
This was back in the days when Netscaped ruled

It was nice, since you could have a status message updated on the center of the page.
Looked elegant as opposed to having messages
continually listed.

Anyways I tried the other day for a bit and still could not get it to work in IE. I 
guess they decided never to implement Mutli-part MIME into their browser.
Or is there some other MIME type it's looking for to accomplish the same thing?

If you have Netscape run this in and take a look to see what I mean.


\n";
print "\n";
print "$i\n";
print "\n\n\n\n";
flush();
  sleep(1);
  }
  print "--$TMP--\n";
?>




Re: [PHP] mail attachments

2003-01-02 Thread Michael J. Pawlowsky
Yes and no

You need to add a "Content-type: multipart/mixed; boundary="Some_unique_string_here)"

But then you also need to encode the documants and send them in the "message" of Mail.

Look for multipart MIME types on the net to get an idea.

Also if you find a nice class to encode bin files let us know about it. Maybe take a 
look at SquirrelMail or something. They must have that class.

Mike


*** REPLY SEPARATOR  ***

On 02/01/2003 at 9:07 AM [EMAIL PROTECTED] wrote:

>I hope you all had a great New Year.  Is attaching a document to an e-mail
>simply a matter of adding a new header in the mail function?
>
>Thanks,
>Eddie
>
>
>--
>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] prevent session_replay

2003-01-02 Thread Michael J. Pawlowsky


It's called Session Hijacking.
And that is the normal behaviour.

Since you are supplying the session id it still thinks you are on the same session 
until it has expired. (expiry time set in php.ini)

Mike



*** REPLY SEPARATOR  ***

On 02/01/2003 at 12:48 PM scott wrote:

>hi
>
>I'm running PHP 4.2.3 as module with Apache 1.3.26 on OpenBSD 3.2 with the
>chroot turned off (as it stopped the php_mail() funtion working, but if
>anyone has the fix for that I will re-implement the jail again :o)
>
>I'm having some problems with sessions. I am not using cookies, as many
>people don't allow them to be set
>
>The main page starts a session, takes username and password, and if they
>are
>ok, it registers the users id from the db as a session variable using the
>$_SESSION['user_id'] = $user_id
>
>it then does a header redirect to another page, which at the moment for
>testing just displays the SID and all $_SESSION[vars]
>
>as the SID is being passed in the url, I am able to copy the http://url?SID
>from the browser window
>
>if I close the browser (which from reading the docs on sessions should end
>the session) and then re-open another browser (admittedly on the same
>machine/ip address) and post the http://url?SID back in, I get the page,
>and
>the $SESSION[vars] are still there !!
>
>it is reading them back out of the files in /tmp (if I edit these directly
>and paste the url?SID in, I get the new values I mannually put in !)
>
> :o( is there a official/approved method to prevent this from being done ?
>
>thankyou
>
>_scott
>
>
>
>--
>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] help with script

2003-01-01 Thread Michael J. Pawlowsky

There's your answer...
You do not have permission to insert into the database with that user.

Contact your DBA!   :-)

and if that's you read the MySQL manual.
Especially about the mysql.user table



*** REPLY SEPARATOR  ***

On 01/01/2003 at 1:19 PM Karl James wrote:
>
>Access denied for user: 'kjames@localhost' to database '
>ultimatefootballleague_com'




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




Re: [PHP] help with script!!

2003-01-01 Thread Michael J. Pawlowsky

Without the error message you are making it kind of tough.

What's the response that you get.

Also  you should use long HYPERLINK
>"http://host.makethewebsecure.com/~admin12/do_adduser.phps"http://host.m
>akethewebsecure.com/~admin12/do_adduser.phps
> 
> 
>can someone take a look at this
>and see why this wont work.
> 
>karl
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002





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




Re: [PHP] PHP Insert Data Form

2003-01-01 Thread Michael J. Pawlowsky


Here's what I suggest.  go to http://www.vtwebwizard.com/tutorials/mysql/

This guys has a really nice tutorial along with a nice class for MySQL that makes 
inserting data nice and easy.

Cheers,
Mike







*** REPLY SEPARATOR  ***

On 01/01/2003 at 11:35 PM Edson Waite wrote:

>Hi All,
>
>Hope everyone had a safe and happy New Year, I am still having trouble
>getting an insert data form to work. Below is the code. I was also
>wondering
>if anyone could tell me the PHP Configuration settings necessary to allow a
>form to insert data into a MySQL database.
>
>To view this page, http://www.airforcemuseum.com/newentry.htm
>
>
>Thanks in advance,
>Ed Waite




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




RE: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky
OK But did your browser ask you if it was ok to set a cookie? (You did do the changes 
in privacy)

IE or Netsape (what version)?

Start with a fresh browser.. meaning close all browser windows and the start up your 
browser again.

We need to see if the problem is setting the cookie or reading it.

Mike


*** REPLY SEPARATOR  ***

On 02/01/2003 at 12:56 PM Andrew Williams wrote:

>Mike,
>
> results are
>
>Array ( )
>
>Andrew
>



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




RE: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky

OK so sessions are working... cool...

So now you need to track down a your cookie problem.

Start of by setting your browser to ask you to accept all cookies. EVEN session 
cookies.
In IE  it would be Internet Options->Privacy Tab
Advanced...
Prompt and override defaults...

The take away the ?PHPSESSID=$sessid from the a href in page1.

Post the cookie details here.







*** REPLY SEPARATOR  ***

On 02/01/2003 at 12:32 PM Andrew Williams wrote:

>Mike,
>
>This  the result
>
>Array ( [theSess] => This is my session )
>
>Andrew
>
>



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




Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky


Just so I know who started this thread, is he even still in this thread, or is 
this just amongst ourselves now.

:-)

Hey sorry, what do you expect on the 1st of January.

Cheers,
Mike






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




Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky


OK let me give him something simpler to start with
No Cookies needed.. Just to test... Make sure you have session.name set to PHPSESSID.
Look at phpinfo() output to make sure.


Lets have two pages


Page 1 start (page1.php)

___


 Next Page ";

?>

---
Page 1 END

Page 2 start (page2.php)
___












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




Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky

>
>eeek, that's a whole lotta code for him to learn just to try and get
>sessions working, don't you think??
>
>[mega snip]
>
>Justin


Most it is HTML output...  But If I'm not mistaken...  and I might be...  but wasn't 
this a thread that started about securing web pages?
So basically I gave him my solution to it. And I didn't charge the $150/hr consulting 
fee!  :-)


.
Cheers and HAPPY NEW YEAR!
Mike




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




Re: [PHP] Session Problem

2003-01-01 Thread Michael J. Pawlowsky
You don't need to accept cookies for sessions. That's the beauty of it.
PHP automatically appends ?PHPSESSID=$sessid to URLs.

If you do header("Location: abc") however you will need to add the seession ID to the 
URL.

You cannot read a session var on the same page that you set it I found.

To get around this I personally register the sessions vars and also set 
$_SESSION['whatever'] = 1;
That way the next time I call the function I can still look for it under the same name.

I use a auth.php include file on eachprotected page. It basically looks to see if you 
have a session... if not asks you to log in and creates the session for you.
If you have a session it just skips all the checking.

You will have to tweak this...  especiallu since I use my own class for db stuff...  
but here it is... enjoy.






session_start();
$sessid = session_id();
// DEBUGGING
$debug=false;


if(!(session_is_registered("mysession"))){


// Are we coming from the form?
if (isset($authaction) && $authaction == 1 ) {

require_once("/lib/util.php");

// Lets clean up the email var
$email = strtolower(trim($_POST['email']));

// Create an SQL object
$sql = new MySQL_class;
$sql->Create("rconline_ca");

// Let see if we have this person as a registered user
$sql->QueryRow("Select unum, pw, cur_member, pref_lang 
from user where lower(email) like '$email'");
if ($sql->rows == 0) {
ErrorMsg("Incorrect e-mail or password.");
exit();
}

// Compare passwords
$row = $sql->data;
if (strcmp($_POST['pw'], $row['pw']) != 0 ) {
ErrorMsg("Incorrect e-mail or password.");
exit();
}

// Everything matches up lets register our vars

$mysession = array ("unum" => $row['unum'], "email" => 
"$email", "lang" => $row['pref_lang']);
setcookie ("email", "", time() - 7776000, "/", 
".rconline.ca", 0);
setcookie ("email", "$email", time() + 7776000, "/", 
".rconline.ca", 0);
session_register("mysession");
$_SESSION['mysession']['unum'] = $row['unum'];

// update there last login
$sql->Update("UPDATE user SET last_login = now() WHERE 
unum = " . $row['unum']);


} else {

if (isset($HTTP_COOKIE_VARS['email'])){
$email = $HTTP_COOKIE_VARS['email'];
} else {
$email ="";
}

echo "\n";
echo "\n";
echo "$tags[title]\n";
echo "$tags[style]\n";
echo "\n\n";
echo "$tags[body]\n\n";

echo "\n";
echo "\n\n";

echo "\n";
echo "\n";

echo "\n";

echo "\nPlease log 
in to use this feature.";
echo "Seuls les membres authentifiés peuvent 
continuer.\n";

echo "";
// Start of inner table
echo "";
echo "\n\n";
echo " E-Mail: 
Courriel:\n";
echo "\n";
echo "Password: 
Mot-de-passe:";
echo "\n";
echo "\n";
echo "\n";
echo "";
echo "";
// End of innner table
echo "";
echo " ";
echo "";

echo "If you are not a registered user please go to our \n 
registration page.\n";
echo "Please note, you do not have to be a club member to 
register for the site.\n";

//  echo "Si vous n'etes pas \n registration page.\n";
//  echo "Please note, you do not have to be a club member to 
register for the site.\n";

echo "If you forgot your password click here to retrieve it.\n";
echo "\n";

Re: [PHP] Using mail() for mailist list app

2003-01-01 Thread Michael J. Pawlowsky


Personally I simply get the e-mail addresses spit out to me from the database and then 
I  input them into a application made just for bulk mailingt.
You can also easily write a quick perl or shell script to send it out from a file of 
names and this way you can "nice" the process so as not to bog  down the machine.




*** REPLY SEPARATOR  ***

On 02/01/2003 at 9:58 AM Justin French wrote:

>Check the archives... mail() tends to "break" pretty quickly... sometimes
>on
>less than 100 personalised emails...  The issue ISN'T mail() itself, but
>things like server timeouts, script timeouts, etc etc.  The issue also
>isn't
>really HTML mail, but more the fact that each email has to be sent to the
>mail que, and this is a slow-ish process, so the script timesout.
>
>So another option is Bcc'ing the email to everyone in a non-personalised
>manner... you can squeeze a lot more emails out of mail() before the script
>times out, but you will run into other issues like:
>
>a) Bcc'd mails of more than 100 recipients can't be sent on most shared
>hosts, because it looks like spam -- check with your ISP
>b) some mail programs and servers treat mass Bcc emails as spam, I hear
>
>
>At the moment, I've only got mailing lists that deals with 50-300 people,
>so
>I'm just Bcc'ing them in batches of 20 people... a trade off between lots
>of
>emails to timeout the script, and lots of people in the Bcc list.
>
>
>I think for 6000 though, you will really need to look at a class like
>Manuel's at PHPclasses.org (I think called mimeMail) which has various
>work-arounds, none of which I've tried.
>
>
>
>Cheers,
>
>Justin
>
>
>
>
>on 02/01/03 9:46 AM, Monty ([EMAIL PROTECTED]) wrote:
>
>> Happy New Year everyone!
>>
>> Is the PHP mail() command robust enough to use in a little mailing list
>app?
>> The app will basically send an HTML or Text e-mail to the member
>database of
>> about 6,000 people. I'm using RedHat Linux 7.2 with PHP 4.2.2, by the
>way.
>> I'm concerned I'll bog down my server if I issue the mail() command 6,000
>> times on our server, but, maybe it won't be a problem?
>>
>> Also, although I'm sending HTML e-mail, I'm not including attachments or
>> inline graphics (only direct hotlinks to graphics on a web server). Will
>> mail() still work okay for this, or do I need to use one of the various
>PHP
>> e-mail classes available to send HTML e-mail?
>>
>> Any recommendations for online tutorials about building a mailing list
>> manager using PHP would be much appreciated!
>>
>> Thanks!
>>
>> Monty
>>
>>
>>
>>
>
>
>--
>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] Bcc with mail....

2003-01-01 Thread Michael J. Pawlowsky

Well something weird is going on here.
Both my dev and prod machines are PHP 4.2.2
They might have some differences since they are not distributed from the same people.
One RH8 the other is a network applicace called an InstaRak.

At home on RH8 everything was fine...  on the appliance I needed to remove the "\r" 
(was terminating all header lines with "\r\n") on the end of my header strings.
Otherwise the To: mail was fine however the Bcc: mail was ignoring the headers and 
including them in the mail message.


So just for archives sake... This is how it workes on an InstaRak.



$toname = "Some Guy";
$tomail = "[EMAIL PROTECTED]";

$subject ="My Subject.";
$message .="My Message.\n\n";

$headers  = "Date: " . date("r", mktime ()) . "\n";
$headers .= "From: \"User Name\" <[EMAIL PROTECTED]>\n";
if ($_POST['cc']){
$headers .= "Bcc: [EMAIL PROTECTED]\n";
}
$headers .= "Reply-To: \"User\" <[EMAIL PROTECTED]>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "X-Mailer: MyWebMail v1.B\n";
$headers .= "Content-type: text/plain; charset=us-ascii\n";
$headers .= "X-Priority: 2\n";
$headers .= "X-MSMail-Priority: Medium\n";

if (mail("\"$toname\" <$tomail>", $subject, $message, $headers))
{
echo "mail sent";
}


*** REPLY SEPARATOR  ***

On 02/01/2003 at 4:17 AM Jason Wong wrote:

>On Thursday 02 January 2003 03:01, Michael J. Pawlowsky wrote:
>> Has anyone successfully used BCC with mail... (on Linux with sendmail)
>>
>> If so are you using the header:
>>
>> "Bcc: My Name <[EMAIL PROTECTED]>\r\n"
>
>For Bcc it would be pointless to include "My Name" as Bcc recipients are
>not
>displayed. Thus:
>
>  "Bcc: [EMAIL PROTECTED]\r\n"
>
>would be adequate.
>
>If you really want to include a name with the email address then the
>correct
>format is:
>
>  "Bcc: \"My Name\" <[EMAIL PROTECTED]>\r\n"
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.biz
>Open Source Software Systems Integrators
>* Web Design & Hosting * Internet & Intranet Applications Development *
>
>/*
>"Language shapes the way we think, and determines what we can think about."
>-- B. L. Whorf
>*/
>
>
>--
>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] Bcc with mail....

2003-01-01 Thread Michael J. Pawlowsky


Has anyone successfully used BCC with mail... (on Linux with sendmail)

If so are you using the header: 

"Bcc: My Name <[EMAIL PROTECTED]>\r\n"


Thanks,
Mike





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




Re: [PHP] error when conecting to mysql

2003-01-01 Thread Michael J. Pawlowsky

Sound like your ISP is at fault.

MySql is not acceptind any more connection perhaps.


Mike


*** REPLY SEPARATOR  ***

On 01/01/2003 at 4:28 PM Paul Roberts wrote:

>Hi
>
>my server started reporting an error when connecting to mysql
>
>Warning: Can't connect to local MySQL server through socket
>'/var/lib/mysql/mysql.sock' (2)
>in /path/to/web//login.php on line 35
>
>it's happened a few times now and I'm wondering if it's me or a problem on
>the server (shared, I'm on a virtual host, Cobalt raq, apache )
>
>any pointers to what might could cause the error.
>
>Best Wishes & Happy New Year
>
>Paul Roberts
>[EMAIL PROTECTED]
>





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




Re: [PHP] Securing areas of a web site with PHP

2003-01-01 Thread Michael J. Pawlowsky
It's not a PHP thing but a browser thing. Basically you need to expire a page as soon 
as the browser has loaded it.
This can be done using the meta key expires.




As in




If you are running an IIS server look at the server properties...  you need to enable 
this in there.




*** REPLY SEPARATOR  ***

On 01/01/2003 at 5:22 PM Jean-Christian Imbeault wrote:

>On my web site there are some areas that I want to make accessible only
>after a user has logged in (for example when placing an order, etc ...)
>I have been able to achieve this however I have the following problem:
>
>1- user logs in
>2- user goes to restricted area
>3- user views pages, orders an item, changes his account settings, etc ...
>4- user logs out
>5- user is sent to log out page
>6- user hits back button ...
>
>And here my problems start ... even though the user has logged out, all
>the "restricted" pages he saw are still cached by his browser and
>accessible ...
>
>I have tried using a script that checks a session variable that
>indicates if a user is logged in or not and take appropriate action at
>the start of all "restricted" pages, but that doesn't work since when
>the user hits the back button, the PHP script is not re-executed, the
>page is simply loaded from the browser cache.
>
>What are some PHP techniques I could use so that a user can no longer
>access/use pages once he has logged out?
>
>Basically I would like to have sort of state machine so I that I can
>simply check where a user is coming from and his login "state" to decide
>if a certain page should be presented or not (i.e. you can't get here
>form there or you can't view that page with your current login status).
>
>But it seemed that creating a state machine is not the right way to go
>about it since hitting the back button pretty much allows a user to
>circumvent this ...

>
>Eventually the web site I will build will actually have many "areas",
>each needing a separate/different login, (and you can be logged in to
>multiple "areas" at once) so I would like to be able to generalize this
>problem and understand how I can use PHP to implement the needed
>functionality.
>
>Just as a simple example, once a user has placed an order, he should not
>be able to go back to the "order placing/processing" pages ...
>
>Any tips, hints, or pointers to tutorials are appreciated!
>
>Thanks,
>
>Jc
>
>
>--
>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] fwrite() debugging

2002-12-31 Thread Michael J. Pawlowsky

Try






*** REPLY SEPARATOR  ***

On 31/12/2002 at 5:27 PM Alberto Brea wrote:

>Could somebody please tell me what I'm doing wrong here?
>
>The code is:
>$fd=fopen($filename, "a");
>fwrite($filename, "xyz");
>fclose($fd); ?>
>
>And I get the following error message:
>"Warning: fwrite(): supplied argument is not a valid File-Handle resource
>in c:\archivos de programa\apache
>group\apache\htdocs\visitrep\report_options.inc on line 111"
>
>Thanks a lot in advance and happy new year!
>Alberto Brea
>http://estudiobrea.com





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




Re: [PHP] printing documents on printer

2002-12-30 Thread Michael J. Pawlowsky

Build a file on the disk and use a shell to send it with lpr.



*** REPLY SEPARATOR  ***

On 30/12/2002 at 11:59 PM Larry Brown wrote:

>Does anyone know where I might find specific information on methods of
>sending documents to a printer from the web server to an attached printer.
>My PHP and Perl books don't even touch on the capability for some reason.
>
>Larry S. Brown
>Dimension Networks, Inc.
>(727) 723-8388
>
>
>
>
>--
>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] SQL Error

2002-12-30 Thread Michael J. Pawlowsky


I just tried this in MySQL and it inserted no problem

INSERT INTO c_emotes VALUES (6, ':-)');

Mike





*** REPLY SEPARATOR ***

On 30/12/2002 at 7:14 PM Stephen wrote:
I'm having some troubles. I have an install script which runs a lot of SQL statements 
to create tables then insert info into them. One of them is an emoticons table. Here's 
the error I'm getting:

You have an error in your SQL syntax near '; INSERT INTO c_emotes VALUES \(':\)', 
'emotes/smile.gif'\); INSERT INTO c_emo' at line 4

or, if I change my code a little, it's this:

You have an error in your SQL syntax near '; INSERT INTO c_emotes VALUES \(':)', 
'emotes/smile.gif'\); INSERT INTO c_emo' at line 4

Here's my code which inserts the information:

INSERT INTO c_emotes VALUES (':)', 'emotes/smile.gif'); // I also have tried placing a 
\ infront of the )...no luck
INSERT INTO c_emotes VALUES (';)', 'emotes/wink.gif');
INSERT INTO c_emotes VALUES (':(', 'emotes/sad.gif');
INSERT INTO c_emotes VALUES (':P', 'emotes/tounge.gif');
INSERT INTO c_emotes VALUES (':|', 'emotes/blank.gif');
INSERT INTO c_emotes VALUES (':-|', 'emotes/blank.gif');
INSERT INTO c_emotes VALUES (':-)', 'emotes/smile.gif');
INSERT INTO c_emotes VALUES (';-)', 'emotes/wink.gif');
INSERT INTO c_emotes VALUES (':-P', 'emotes/tounge.gif');
INSERT INTO c_emotes VALUES (':-(', 'emotes/sad.gif');

Anyone see the problem??

Thanks,
Stephen Craton
http://www.melchior.us

"What is a dreamer that cannot persevere?" -- http://www.melchior.us




[PHP] Multi-lingual Language Support in PHP

2002-12-30 Thread Michael J. Pawlowsky

Keywords: Multiple, Language, PHP, $HTTP_ACCEPT_LANGUAGE

I'm just shooting this one up here for the Archives.

Since I could not find a built in PHP function to access the preferred languages on a 
user I came up with this.
The original version acted as a http server in that you needed to have a different 
file for evey language (ie. index.php.en, index.php.fr, index.php.de).

I find that's a complicated way to work since if you need to update code you will have 
to do it in several files.

I prefer simply

if (phpLang_current == 'fr') {
print "Ceci est francais";
} else (
// default to english
print "This is english";
}

If it's a large block of text you can have seperate include text files as in.


if (phpLang_current == 'fr') {
include("mytext.fr");
} else (
// default to english
include("mytext.en");
}


So in case anyone else ever needs this... Here it is...


http://www.gnu.org/copyleft/gpl.html |
// +--+
// | Original release available on phpHeaven: |
// |http://www.phpheaven.net/rubrique7.html?var_recherche=phpLang |
// |  |
// | Authors:  Nicolas Hoizey <[EMAIL PROTECTED]> |
// |   Loïc Chapeaux <[EMAIL PROTECTED]> |
// +--+


// parameter to add in url
if(!defined('phpLang_urlParam'))
define('phpLang_urlParam', 'lang');

// path to image files
if(!defined('phpLang_images'))
define('phpLang_images', '/flags/');

// indicates if it should put a cookie
if(!defined('phpLang_useCookie'))
define('phpLang_useCookie', true);


// list of available languages, order it as you need
$phpLang_languages = array(
"en([-_][[:alpha:]]{2})?|english"   =>  array('en', 'english'),
"fr([-_][[:alpha:]]{2})?|french"=>  array('fr', 'french'),
);



$HTTP_ACCEPT_LANGUAGE = getenv('HTTP_ACCEPT_LANGUAGE');
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT');


// language code detection
function phpLang_detectLanguage($str, $from)
{
$ext = '';
reset($GLOBALS['phpLang_languages']);
while($ext == '' && list($key, $name) = each($GLOBALS['phpLang_languages'])) {
if (($from == 1 && eregi("^".$key."$",$str)) || ($from == 2 && 
eregi("(\(|\[|;[[:space:]])".$key."(;|\]|\))",$str))) {
$ext = $name[0];
}
}

return $ext;
}


// finds the appropriate language file
if (isset($HTTP_GET_VARS[phpLang_urlParam])) {
// a language as been chosen by the user
define('phpLang_current', $HTTP_GET_VARS[phpLang_urlParam]);
}

if (!defined('phpLang_current') && phpLang_useCookie && 
isset($HTTP_COOKIE_VARS['phpLangCookie'])) {
// a language as been found in a cookie previously set
define('phpLang_current', $HTTP_COOKIE_VARS['phpLangCookie']);
}

if (!defined('phpLang_current') && isset($HTTP_ACCEPT_LANGUAGE) && 
trim($HTTP_ACCEPT_LANGUAGE) != '') {
// looks at the languages accepted by the browser
$accepted = explode(',', $HTTP_ACCEPT_LANGUAGE);
while(!defined('phpLang_current') && list($key, $name) = each($accepted)) {
$code = explode(';', $name);
$ext = phpLang_detectLanguage($code[0], 1);
if(file_exists(phpLang_localizedFileName($ext))) {
define('phpLang_current', $ext);
}
}
}

if (!defined('phpLang_current') && isset($HTTP_USER_AGENT) && trim($HTTP_USER_AGENT) 
!= '') {
// looks at the browser's identification
$ext = phpLang_detectLanguage($HTTP_USER_AGENT, 2);
define('phpLang_current', $ext);
}

if(!defined('phpLang_current')) {
// if no language yet found, chose the first existing in site's list
reset($phpLang_languages);
while(!defined('phpLang_current') && list($key, $name) = 
each($phpLang_languages)) {
define('phpLang_current', $name[0]);
}
}

// detection done, cookie update

if(defined('phpLang_current')) {
if(phpLang_useCookie) {
// set a cookie expiring in one year for current language
setcookie('phpLangCookie', phpLang_current, time() + 60*60*24*365, 
"/", "rconline.ca");
}
// defines a string to add at the end of each link
define('phpLang_link', phpLang_urlParam.'='.phpLang_current);
} else {
// no language found
define('phpLang_current', '');
define('phpLang_link', phpLang_urlParam.'=');
}

// function that adds the flags with links for existing files
// give as first parameter the HTML stri

[PHP] Multi Language support

2002-12-30 Thread Michael J. Pawlowsky

Hello,

I have a multi-lingual site and was wondering if anyone knew of a PHP function to 
detetct a browser's preferred laguages.
I know I can parse it in the _SEREVR var [HTTP_ACCEPT_LANGUAGE] => fr, fr-ca;q=0.75, 
en-us;q=0.50, en;q=0.25
But I was just wondering if somewhere PHP already had a function. Something like:

var array get_lang();

where array would be:

"fr"=>0.75
"fr-ca"=>0.75
"en-us"=>0.50
"en"=>0.25

Also I'm guessing that q=? is a score of some sort. With highest score being the 
preferred one?

Mike




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




Re: [PHP] Dropping Tables

2002-12-29 Thread Michael J. Pawlowsky


Basically just do a a php script the sends the sql "show tables";

Then do a strchr() to see if "a" is the first letter in the resuts and if so do a 
delete table.

Just yo play safe do a dump of your db first.





Cheers,
Mike




*** REPLY SEPARATOR  ***

On 29/12/2002 at 7:57 PM Steve Buehler wrote:

>I have researched this and can't find an answer.  Maybe I am just looking
>in the wrong places or not putting the correct keywords into the search
>engines.  So any help would be greatly appreciated.  I am using MySQL with
>PHP.
>   I have some PHP scripts that create tables in a database that are meant
>to
>be temporary but can't actually create "TEMPORARY" tables to do the
>job.  That isn't the problem in itself.  The problem is that sometimes if
>the script is stopped prematurely, it doesn't get to the drop table
>function in it.  All of the tables that are created for this start with an
>"a" and follow with a random number.  What I need to do is to create a
>script that I can run that will delete all tables that start with an "a"
>in
>the database.  Again, since the table name is randomly generated except
>for
>the starting "a", I will need the script to find them and drop them.
>   Has anybody done this before?  I would sure appreciate some help here.
>
>Thanks
>Steve
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>ow3
>
>
>--
>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] Rookie mail() q's .. can't find answer after RTFM...

2002-12-29 Thread Michael J. Pawlowsky

You will need to edit it for your server, remove some stuff etc...
But this should get you going...




RC Online Canada - Feedback Form






Contact RC Online Canada









Create("rconline_ca");

// Lets get some info on who we have
$sql->QueryRow("SELECT contact_fname, contact_lname, contact_email FROM 
club_info WHERE TRIM(LOWER(uname)) LIKE TRIM(LOWER('$_SERVER[PHP_AUTH_USER]'))");
if ($sql->rows == 0) {
ErrorMsg("$_SERVER[PHP_AUTH_USER] was not found in the database");
Exit();
}
$row=$sql->data;

if (!(is_valid_email($row[contact_email]))) {
ErrorMsg("Invalid e-mail address '$row[contact_email]' in database. 
Please update you information before using this service.");
Exit();
}

$frommail = strtolower(trim($row[contact_email]));
$fromname = "$row[contact_fname] $row[contact_lname]";

ini_set("sendmail_path", "/usr/lib/sendmail -t -i");
ini_set("sendmail_from", $frommail);

$tomail = "[EMAIL PROTECTED]";
$toname = "Webmaster";

$message = "$_POST[comment]\n\n";
$subject = "$_POST[subject]";

$headers= "MIME-Version: 1.0\r\n";
$headers.= "From: $fromname <$frommail>\r\n";
if ($_POST[cc]){
$headers.= "Cc: $fromname <$frommail>\r\n";
}
$headers.= "Reply-To: $fromname <$frommail>\r\n";
$headers.= "X-Mailer: R/C Online Canada WebMail v1.B\r\n";
$headers.= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers.= "X-Priority: 1\r\n";
$headers.= "X-MSMail-Priority: High\r\n";

if (mail("$toname <$tomail>", $subject, $message, $headers))
{
echo "Your comments have been sent";
echo "Thank you for your interest in RC Online Canada";
if ($_POST[cc]){
echo "A copy has also been sent to: $fromname 
$frommail\r\n";
}
}else{
echo "Failed to send e-mail.";
echo "";
echo "Please contact [EMAIL PROTECTED]";
echo " ";
}


} else {

echo "";
echo "";

echo "";

echo "";
echo "";
echo "Subject: ";
echo "\n";
echo "  Bug Report\n";
echo "  General Comment\n";
echo "  New Forum Request\n";
echo "  Feature Request\n";
echo "\n";
echo "\n";

echo "";
echo "Message:";
echo "";
echo "";

echo "";
echo "Copy to myself: ";
echo "\n";
echo "\n";


echo "";

echo "";
echo "";
echo "";
echo "";
echo "";

echo "";

echo "";

}
?>






*** REPLY SEPARATOR  ***

On 30/12/2002 at 1:30 AM -<[ Rene Brehmer ]>- wrote:

>Hi y'all
>
>I'm probably trying to do something ridicolously trivial, but here goes:
>
>I'm building a form for sending mail of my website. The idea is simply
>that people plop in their address, the message, and pick a subject line,
>and then click send.
>



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




RE: [PHP] Form duplicate post problem

2002-12-29 Thread Michael J. Pawlowsky
2 ways around that.. make sure you send that before any other ouput...  Even empty 
lines etc In other words nothing before  Not ever a 
carriage return.

or start of with ob_start() and end with ob_end_flush();



*** REPLY SEPARATOR  ***

On 29/12/2002 at 7:12 PM Pag wrote:

>>
>>Yeah, you should be using a header() redirect, not a javascript or META
>>REFRESH redirect...
>
> Well, i tried, but i get an error saying that all the headers
>were
>already sent to the browser. :-P
> I used:
>
> header('Location: http://www.blahblah.com etc');
>
>
> I placed this header right after all the database writes.
>
> Pag
>
>
>
>--
>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] IIS Quit Working

2002-12-29 Thread Michael J. Pawlowsky
Wherever you want them...  C:\windows\temp if you have that.

win??? does not have a /tmp directory link *nix boxes do, so just give it a valid 
directory to write to where you don;t mind having a bunch of session files.


>
>session.save_path = /tmp
>
>What should it be for Windows XP Pro?
>
>
>- Original Message -
>From: "Jason Wong" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, December 29, 2002 3:16 AM
>Subject: Re: [PHP] IIS Quit Working
>
>
>: On Sunday 29 December 2002 09:14, Stephen wrote:
>: > Since I like new things and all, I decided to download and install PHP
>4.3.
>: > Before, I had the latest (4.2.3) and IIS worked fine. But then, after
>: > uninstalling PHP and installing the new one, it just quit working. I go
>to
>: > http://localhost/ and nothing comes up except a "This page cannot be
>: > displayed" thing since I'm using IE. Any ideas why this is happening?
>:
>: Turn on error reporting and log to file and examine it for any clues.
>:
>: --
>: Jason Wong -> Gremlins Associates -> www.gremlins.biz
>: Open Source Software Systems Integrators
>: * Web Design & Hosting * Internet & Intranet Applications Development *
>:
>: /*
>: You can tell how far we have to go, when FORTRAN is the language of
>: supercomputers.
>: -- Steven Feiner
>: */
>:
>:
>: --
>: 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] Formatting text

2002-12-29 Thread Michael J. Pawlowsky

> if ($result=mysql_query($sql)) {
>   $numofrows=mysql_num_rows($result);
> Print "Greengrass database has found the following result that matches
>your search";
> print " \n";
> print " \n";

Add this line here ---> print "\n";
No longer need the BRs below--->
>  while($row=mysql_fetch_array($result)){
> Print "  Identity : ".$row[GGID]."\n"." ";
> Print " Organisation name : ".$row[OrgName]." \n"."";
> Print " Organisation country : ".$row[OrgCountry]." \n"."";
> Print " Organisation Address : ".$row[OrgAddress]."\n"." ";
> Print "  Results : ".$row[Results]."\n";
>  print "\n";
>print "\n";
>}

Add this line here ---> print "\n";




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




Re: [PHP] Formatting text

2002-12-29 Thread Michael J. Pawlowsky
Two ways to do this...

One just use

echo "";
for($i=0; $i < sql->rows; i++){
echo $values['grade'];
echo $values['admno'];
}
echo ";

or create a table


for($i=0; $i < sql->rows; i++){


$value['grade']$value['grade2']$value['grade3']$value['grade4']

}



*** REPLY SEPARATOR  ***

On 29/12/2002 at 11:39 PM Denis L. Menezes wrote:

>Hello friends,
>
>I have to put results of various departments in our school website. All
>results will go in the Mysql database. The problem is formatting the
>output. I have output something like this where the numbers shown are
>student marks :
>
>Quote
>
>Passed with Grade A :
>Adm nos : 8177   9822  1750  0059
>
>Passed with Grade B :
>Adm nos : 6614 8375 0837 1647 5490 3758 7388 7799
>
>Passed with Grade C :
>Adm nos : 9968  0298  1297  1254  4208 4911  6194  9903
>
>Unquote
>
>I made a multiline textboxes and used PHP script and input this in a
>LONGTEXT field in MySQL. Then I used PHP to output this field in a
>webpage. The formatting, carriage return, tabs etc are lost. Formatting is
>very essential in this document for us.
>
>Can someone tell me how to do this?
>
>Thanks
>Denis





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




Re: [PHP] Form duplicate post problem

2002-12-28 Thread Michael J. Pawlowsky


You can close it with JavaScript.

Something like


function open_a_window_please(){
lovechild = window.open("childpage.htm");


Now we have a name that can tell the browser which window to close.
We're ready to use the "window.close()" method. In the parent page add the following 
closing link:


Click here to open a window.
Click here to close the child window.



Dont forget you will need to use "flush" betwen your major parts otherwise it might 
not get sent to the browser right away.

Mike

P.S. Alot of PC's dont allow window.open anymore. People install ad blockers so it 
doesn't work.


*** REPLY SEPARATOR  ***


>
> I gave up on reinventing the wheel and i am trying to use that
>middle-page method you guys mentioned. To make things a little more
>transparent to the user, i thought of using a popup window instead, you
>know, a tiny window pops up, with the code to insert the comment on the
>database, and closes right after it does so.
>
> but err..how can i close it right after the database insert?
>
> Pag
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php





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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Michael J. Pawlowsky

Well at least now you know what your solution is... Time to move!

:-)

Have a good New Year,
Mike



>That proxy server is in our national backbone :))) So I need to change the
>country, not only the ISP :)))
>
>Later all,
>Hatem




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




Re: [PHP] how could a php script return a dns error ?

2002-12-28 Thread Michael J. Pawlowsky
Actually I got the idea he was opening a file through http as in

$fp = fsockopen ("192.168.1.1", 8080, $errno, $errstr, 5);

And whatever he was trying to get at was not being allowed to be retrieved.
But I may be wrong.

Perhaps the server is behind a firewall and needs to get through the proxy.
If this is the case look at CURL.. Just point it to the proxy server,

I also use fsockopen as above to go through a proxy server.
But CURL does it better.

I basically had a similar problem which I handle as such...


if ($proxy) {
$fp = fsockopen ("192.168.1.1", 8080, $errno, $errstr, 5);
} else {
$fp = fsockopen ("adds.aviationweather.noaa.gov", 80, $errno, $errstr, 
5);
if (!($fp)) {
echo ("$errstr");
}
}

if ($fp) {

$header = "GET 
http://adds.aviationweather.noaa.gov/projects/adds/metars/index.php?metarIds=$iac 
HTTP/1.1\r\n";
$header .= "Accept: */*\r\n";
$header .= "Accept-Language: en-ca\r\n";
$header .= "Accept-Encoding: gzip, deflate\r\n";
$header .= "User-Agent: Mozilla/4.0 (compatible)\r\n";
$header .= "Host: www.wimac.org\r\n";
$header .= "Connection: Keep-Alive\r\n";
if ($proxy) {
$header .= "Proxy-Authorization: Basic ";
$header .= base64_encode("username:password");
}
$header .= "\r\n";
$header .= "\r\n";

fputs ($fp, "$header");

if (socket_set_timeout($fp, 5, 0)) {

$fpmetar = fopen ($fname, "w+");
if (!$fpmetar) {
echo "Unable to open new METAR file $fname - Using old 
METAR file\n";
} else {
while (!feof($fp)) {
fputs ($fpmetar, fgets ($fp,128));
}
fclose($fpmetar);
}
}

// close the file
fclose ($fp);
}





Mike



*** REPLY SEPARATOR  ***

On 28/12/2002 at 11:27 PM Sean Burlington wrote:

>Hatem Ben wrote:
>> From: "Sean Burlington" <[EMAIL PROTECTED]>
>>>
>>>it's exactly what it says it is...
>>>
>>>the website is experiencing technical difficulties...
>>>
>>
>>
>> Yep, this make a confusion for me, and a stupid error that could be
>solved
>> in one minute, was done in one day.
>>
>>
>[SNIP]
>>
>>
>> In conclusion our ISP is blocking such websites (an internet censorship
>> system) and returned that message.
>> I have said dns error, coz for dns error we got same message (maybe the
>> server is assumed in all cases down), the original dns error is always
>> blocked and we got that message inspite.
>>
>
>It's not censorship
>
>they are economising by using a proxy server
>
>and using one that gives unhelpful error messages
>
>BTW - they in this case are the people providing you with your
>connection (not the web hosting company)
>
>they are not blocking the site
>
>but when the page returns no data - they return an error message - this
>is resonable - it just isn't very helpful for web developers.
>
>
>I'd suggest that you see if you can get a direct connection for testing
>purposes - either by changing browser settings or getting another isp.
>
>Proxys are great for saving bandwidth - but terrible for developing
>websites through :)
>
>--
>
>Sean
>
>
>--
>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] Kerberos and AFS module

2002-12-28 Thread Michael J. Pawlowsky
This wont be much help to you but

I use to write quite a few for ColdFusion.
Basically the first one is a bit time consuming to see what it's looking for exaclty,
after that it's a lot of cut and paste!

Like I said...  probably not very useful for you...  But I say GO FOR IT!

Especially if you have the source for the LDAP one... more cut and paste.

I use to sell them on the net afterwards for about $20.00 a pop.
I still have one (a NT user and Group Manager) that brings in a couple of hundred a 
month after 3 years.

Cheers,
Mike


*** REPLY SEPARATOR  ***

On 28/12/2002 at 11:56 PM Turbo Fredriksson wrote:
>
>What I'd like to know is 'how difficult task is this'. Naturaly some would
>say 'piece of cake', while's some would say 'very difficult'. Anything is
>easy once you know it, but I never made a PHP module/extension before...
>
>I'm a C/Perl coder at heart (and for may years), but... If someone have
>done
>the job for me previosly, I don't need to :)
>




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




Re: [PHP] file uploads double in size - help!

2002-12-28 Thread Michael J. Pawlowsky
This might help you...

http://www.phpbuilder.com/columns/florian19991014.php3?page=4




*** REPLY SEPARATOR  ***

On 28/12/2002 at 2:00 PM [EMAIL PROTECTED] wrote:

>I am having trouble with php file uploads where the files are arriving
>corrupted and information in the file is repeated.  Perhaps some can help
>point me in the right direction.
>
>A very small text file will work fine.  Anything larger than about 2000k
>and
>strange things happen.  In the case of a text file, after about 1100
>characters, the uploaded file will repeat the text starting not from the
>begining of the file but from about midway through and do this back and
>forth for the length of the file, causing the file to double in size.  The
>same problem happens with every file type that I've tried, .jpg, .png,
>.doc,
>.dwg.  It also happens with all php applications that run on the server,
>not
>just one particular piece of software, so it has to be some configuration
>with the server, but I don't know where to look.
>
>It could be something really simple as I'm just getting started.  Anything
>recomendations on things to check that might point me in the right
>direction
>would be greatly appreciated.
>
>Derek
>please reply to [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] how could a php script return a dns error ?

2002-12-28 Thread Michael J. Pawlowsky
The problem is that it can mean a bunch of things

When I telnet to the server and request the document I get:


 
404 Not Found

Not Found
The requested URL /index-old.php was not found on this server.
 
 Apache/1.3.20 Server at www.vgates.com Port 80
 

I am probably getting that because the server is using virtual hosts.

I've seen that also happend when a Content-type: MIME was not sent etc.

Start commenting out large chunks of your code..  turn it into a hello world to start. 
Then start adding a few lines at a time. See what happends.





*** REPLY SEPARATOR  ***

On 28/12/2002 at 11:07 PM Hatem Ben wrote:

>Ok, this is Netscape shots
>http://www.dynamix-tn.com/28dec2002/Image1.png
>
>If you want with lynx i'll do it, it's always the same.
>



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




  1   2   >