Re: [PHP] Fatal Execution Error

2001-06-30 Thread Aral Balkan

Are you doing a database query by chance or anything with sessions? I'm
getting the same errors logged in the Apache logs for something I'm working
on (see my previous posts for details.)

Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] accessing files not in www root directory.

2001-06-30 Thread Sterling Anderson

Hi,
I am trying to write a page that will perform a select on a DB and get the
path and file name of an image. Then display the image.
The DB part if fine but I am having difficulty figuring out how to get the
images to display. For example:

result from select:
$file_path = "/home/pics/friends/"
$file_name = "bob.jpg"

Now, say my web root directory is "/etc/http/wwwroot"

How do I create a link to my file "/home/pics/friends/bob.jpg"?
I tried symlink() but the link created appears to hang around after it is no
longer needed.

By the way, this is a Linux server running Apache.

Any ideas?

Thanks,

Sterling Anderson
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] accessing files not in www root directory.

2001-06-30 Thread Chris Anderson

you may want to send this as a NON-reply, because many people view mail by
grouped threads, and thus would miss your question

Original Message -
From: "Sterling Anderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 01, 2001 12:05 AM
Subject: [PHP] accessing files not in www root directory.


> Hi,
> I am trying to write a page that will perform a select on a DB and get the
> path and file name of an image. Then display the image.
> The DB part if fine but I am having difficulty figuring out how to get the
> images to display. For example:
>
> result from select:
> $file_path = "/home/pics/friends/"
> $file_name = "bob.jpg"
>
> Now, say my web root directory is "/etc/http/wwwroot"
>
> How do I create a link to my file "/home/pics/friends/bob.jpg"?
> I tried symlink() but the link created appears to hang around after it is
no
> longer needed.
>
> By the way, this is a Linux server running Apache.
>
> Any ideas?
>
> Thanks,
>
> Sterling Anderson
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] accessing files not in www root directory.

2001-06-30 Thread Sterling Anderson

Hi,
I am trying to write a page that will perform a select on a DB and get the 
path and file name of an image. Then display the image.
The DB part if fine but I am having difficulty figuring out how to get the 
images to display. For example:

result from select:
$file_path = "/home/pics/friends/"
$file_name = "bob.jpg"

Now, say my web root directory is "/etc/http/wwwroot"

How do I create a link to my file "/home/pics/friends/bob.jpg"?
I tried symlink() but the link created appears to hang around after it is no 
longer needed.

By the way, this is a Linux server running Apache.

Any ideas?

Thanks,

Sterling Anderson
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Ò»¸öÓòÃû6¸öÍøÕ¾(ÓòÃû×¢²á´óÓÅ»Ý)

2001-06-30 Thread ÍøÂçʱ´ú Today'Network


×𾴵Ŀͻ§£ºÄúºÃ!

·²ÔÚ6ÔÂ23ºÅµ½7ÔÂ23ºÅÖ®¼äÔÚToday's 
NetworkÍê³É¹úÄÚ¡¢¹ú¼Ê¡¢ÐÂÓòÃû×¢²á£¬¾Í¿ÉÒÔÒ»¸öÓòÃû¾ÍÄÜͬʱ½¨Á¢Áù¸öÍøÕ¾,Ò²¾ÍÊÇ˵´Î¼¶ÓòÃûÊýÓÉÔ­À´µÄ3¸ö±äΪ6¸ö!ÔÙ¼ÓÉÏVDNSÌØÓеÄÈýÖÖÖ¸Ïò¹¦ÄÜ£¬Òª½¨Éè×Ô¼ºµÄδÀ´ÍøÒ׺ÍËѺü£¬¾ÍÒª´ÓÏÖÔÚ¿ªÊ¼£¡
  
   »¥ÁªÍøÉÏÿÁ½ÃëÖ־ͻáÏûʧһ¸öÓòÃû£¡Í¶×Ê×Ô¼ºµÄÍøÂç×ÊÔ´£¬ÄúµÄÊÕ»ñ½«´ó´ó³¬³öÄúµÄÏëÏó£¡

   Today¡¯s 
Network(http://www.now.net.cn)´´ÏÈ¿ª·¢µÄVDNSÓòÃû·þÎñÆ÷£¬ÄÜʵÏÖ£Õ£Ò£Ìת·¢¡¢Ö÷»ú£Á¼Ç¼¡¢£Í£ØÓʼþ¼Ç¼¡¢£É£ÐÖ¸Ïò¿ØÖƵȲÙ×÷,¸ü¿ÉÒÔËæÐÄËùÓûµØÔö¼Ó×Ô¼ºµÄ´Î¼¶ÓòÃû£¬
 
°ïÖúÄú½¨Á¢¶à¸öÍøÕ¾£¬Äã¿ÉÒÔÈÃËýÖ¸ÏòÈκοռ䣬Ҳ¿ÉÒÔÉêÇëÒ»´Î¿Õ¼ä¾Í½¨Áù¸öÍøÕ¾,Ò²¿ÉÒÔ²»ÉêÇë¿Õ¼ä¶øÓÃÔ­À´µÄ¿Õ¼ä,ÉõÖÁÓÃÃâ·Ñ¿Õ¼ä£¬
 ¸üÀûÓÚÄúÓÅ»¯Ê¹Óÿռä×ÊÔ´¡£
 
ºÍÄú¹²Í¬Íƶ¯»¥ÁªÍø·¢Õ¹£¬ÎÒÃÇÏÖÍƳö¡°×¢²áÓòÃûÊîÆÚ´óÓŻݻ¡±£¬
 
³ý´ËÖ®Í⣬ÎÒÃÇ»¹ÎªÄúËÍÉÏÎÒÃÇÌØÓеÄÍøÕ¾¹ÜÀí¹¤¾ßWEB-ADMIN£¬ËüÊǼ¯ÉÏ´«,ÏÂÔØ ÍøÒ³±à¼­ 
ÎļþÒƶ¯ ɾ³ý ¿½±´µÈ¹¦ÄÜÓÚÒ»ÌåÍøÕ¾¹ÜÀí¹¤¾ß£¬Ó봫ͳFTPºÏÓÃ,¸üÓÐЧ,¸ü·½±ãµØ¹ÜÀíÄúµÄÍøÕ¾¡£
 
±¾´Î»î¶¯½ØÖ¹ÓÚ7ÔÂ23ºÅ£¬ÇëץסÄúµÄ»úÓö£¬¿ªÍØÄúµÄÍøÉÏÉÌ»ú£¬¸Ï¿ì×¢²áÄúÃÎÏëµÄÓòÃû£¡Çëµã»÷http://www.now.net.cn/register/
 
ÎÒÃÇÒ»Ö±ÒÔרҵ¡¢ÓÅÖÊ¡¢ÁìÏÈΪ×ÚÖ¼£¬ÈȳÏΪÄú·þÎñ£¡
 
»¶Ó­ÖÂÐÅ Today's Network [EMAIL PROTECTED]
»¶Ó­Äã·ÃÎÊ ÎÒÃǵÄÍøÕ¾ http://www.now.net.cn

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Page not found for MSIE in SSL mode

2001-06-30 Thread Fikko Adhipranta

I am using MSIE 5.5, with web-hosting apache. When
do the secure connection SSL, sometime, it displays:
Page Not Found. I find out it happens because MSIE
doesn't kill the secured connection. (I refer to the
documentation:
http://www.modssl.org/docs/2.6/ssl_faq.html#ToC48

The web-hosting refushed to change the directive in
apache.

Can I do it in PHP level?


Thanks in advance.

 
Fikko



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Fatal Execution Error

2001-06-30 Thread Chris Cameron

I'm getting quite the whacked out error when trying to run this one php
file.

FATAL:  erealloc():  Unable to allocate 15728640 bytes

When trying to load it as a webpage I get:

Alert!: Unexpected network read error; connection aborted.

from lynx. When running the file from the command line with php, I get the
first error.

Any ideas? At all?

Thanks,
Chris

--
"If you don't find it in the index, look very carefully through the entire catalogue."
- Sears, Roebuck, and Co., Consumer's Guide, 1897


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] (slightly OT) the bad and the good (hosting recommentations)

2001-06-30 Thread Justin French

Jack Sasportas wrote:
> 
> It sounds like price is more important to you then quality of service etc.


Not at all.  That's why I asked if any one had experience with
experthost.com, bad or good.  I do want to know about the service before
signing up.

So far almost everyone that has responded has been promoting their own
hosting service though, so I still don't know for sure what sort of
service levels they have.


Sure, price is a key factor (why pay double or tripple for a simular
service?), but end of the day, if it doesn't work, it's a waste of money.


Justin French

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time out Errors?

2001-06-30 Thread Aral Balkan

I've been having the same problem with Apache 1.3.19 / PHP 4.0.5 running on
WinMe -- and not just with my scripts either: phpMyAdmin does it sometimes
too. So, I reckon that the problem is with the configuration.

Has anyone experienced this on Win2000? (I'm in the process of moving my
files to a Win2000 box so I'll you know when I do if the problem repeats.)

Aral :)

__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Cookie ?

2001-06-30 Thread Jon Yaggie

i had this problem a while back.  the problem with this is cookies work by
the users time not the servers time.  so if the server is in america and my
computer is on japanese time even a cookie set for time()+18000 will be
valid because my computer is actually +50400 for a server in EST.   i have
have worked with two alternatives here.  one set another cookie that holds a
timestamp of the time you want the other cookie to expire and then compare
server time and the expiration cookie.  or do the same thing basically b ut
use a variable set in a session.



Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0


- Original Message -
From: "Jack Sasportas" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Sunday, July 01, 2001 9:44 AM
Subject: [PHP] Cookie ?


> I wanted to do something like set the cookie for 5 minutes, then as the
> user uses the system each page would refresh so to speak the timeout
> always setting it back to 5 minutes as long as he was using it.
> I beleive this is not really working.
> Any Ideas on how I can accomplish this ??
>
> Thanks
> Here is the function I was using to set the cookies...
>
>
> function f_put_cookie($user_name,$user_email,$account_type) {
>
> global $HTTP_COOKIE_VARS;
>
> if(isset($c_user_name)) {
>
> setcookie("c_uas_time","GREEN",(time()+400),'/','website.com',0);
> } else {
>
>
setcookie("c_user_name",$user_name,(time()+400*30*12),'/','.website.com',0);
>
>
>
setcookie("c_user_email",$user_email,(time()+400*30*12),'/','.website.com',0
);
>
>
>
setcookie("c_account_type",$account_type,(time()+400*30*12),'/','.website.co
m',0);
>
> setcookie("c_uas_time",
> "GREEN",(time()+400),'/','.website.com',0);
> }
> }
> ___
> Jack Sasportas
> Innovative Internet Solutions
> Phone 305.665.2500
> Fax 305.665.2551
> www.innovativeinternet.com
> www.web56.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Capturing output of shell script.

2001-06-30 Thread Brad Hubbard

On Sat, 30 Jun 2001 06:36, Charles Williams wrote:
> Hello all,
>
> I have an .sh shell script being executed from a php4 call.  I need to
> capture the string return and work with that in the php script.  The only
> problem is that the call works but I cannot get the returned string.  I've
> tried using exec, passthru, ``, system, and escapeshellcommand.  Nothing
> seems to work.  any ideas?

$capture = `script.sh 2>&1`; // redirect standard error to standard output


Cheers,
Brad
-- 
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: [EMAIL PROTECTED]
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cookie ?

2001-06-30 Thread Jack Sasportas

I wanted to do something like set the cookie for 5 minutes, then as the
user uses the system each page would refresh so to speak the timeout
always setting it back to 5 minutes as long as he was using it.
I beleive this is not really working.
Any Ideas on how I can accomplish this ??

Thanks
Here is the function I was using to set the cookies...


function f_put_cookie($user_name,$user_email,$account_type) {

global $HTTP_COOKIE_VARS;

if(isset($c_user_name)) {

setcookie("c_uas_time","GREEN",(time()+400),'/','website.com',0);
} else {

setcookie("c_user_name",$user_name,(time()+400*30*12),'/','.website.com',0);


setcookie("c_user_email",$user_email,(time()+400*30*12),'/','.website.com',0);


setcookie("c_account_type",$account_type,(time()+400*30*12),'/','.website.com',0);

setcookie("c_uas_time",
"GREEN",(time()+400),'/','.website.com',0);
}
}
___
Jack Sasportas
Innovative Internet Solutions
Phone 305.665.2500
Fax 305.665.2551
www.innovativeinternet.com
www.web56.net



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] (slightly OT) the bad and the good (hosting recommentations)

2001-06-30 Thread Jack Sasportas

It sounds like price is more important to you then quality of service etc.


John Monfort wrote:

>   www.pepiedesigns.com
>
>   PHP 4
>   Perl 5
>   MySQL
>   ASP
>   Apache
>   Web Access Panel
>   SSH
>   and a whole lot more...
>
> __John Monfort_
> _+---+_
>  P E P I E  D E S I G N S
>www.pepiedesigns.com
> "The world is waiting, are you ready?"
> -+___+-
>
> On Fri, 29 Jun 2001, Justin French wrote:
>
> > hi all,
> >
> > i'm about to change ISPs, and i'll probably be moving to a US based
> > server, on Unix, with Apache, PHP4, CGI, Perl 5, MySQL, etc etc.
> >
> > so far the best I can find (price/service level/features) is
> > experthost.com.au.  Has anyone got a bad experience with these guys, or
> > a good experience with annother ISP that they can recommend?
> >
> >
> > for what it's worth they offer a reseller package with 2-4 domains for
> > US$10/month each, all the way down to 25+ for US$4.99 each / month.
> > this is with 50 meg space, MySQL DB, 20 POPs, and much more.
> >
> >
> > i don't require dial up access, just hosting.
> >
> >
> > i'd be interested to hear of competitors to this ISP, or of any good /
> > bad experiences.  I'm ony interested in Australian, US, Canada or UK ISPs.
> >
> >
> >
> > many thanks
> >
> > jsutin french
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
___
Jack Sasportas
Innovative Internet Solutions
Phone 305.665.2500
Fax 305.665.2551
www.innovativeinternet.com
www.web56.net



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GMT Time and Setting Cookies in PHP

2001-06-30 Thread Gonyou, Austin

What's a good method for setting time in GMT? as in the expiration date for
cookies? I saw two functions to do this with, but I haven't been able to get
them to output anything properly. 

-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-796-9023
email: [EMAIL PROTECTED] 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] (slightly OT) the bad and the good (hosting recommentations)

2001-06-30 Thread John Monfort



  www.pepiedesigns.com

  PHP 4
  Perl 5
  MySQL
  ASP
  Apache
  Web Access Panel
  SSH
  and a whole lot more...

__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___+-

On Fri, 29 Jun 2001, Justin French wrote:

> hi all,
>
> i'm about to change ISPs, and i'll probably be moving to a US based
> server, on Unix, with Apache, PHP4, CGI, Perl 5, MySQL, etc etc.
>
> so far the best I can find (price/service level/features) is
> experthost.com.au.  Has anyone got a bad experience with these guys, or
> a good experience with annother ISP that they can recommend?
>
>
> for what it's worth they offer a reseller package with 2-4 domains for
> US$10/month each, all the way down to 25+ for US$4.99 each / month.
> this is with 50 meg space, MySQL DB, 20 POPs, and much more.
>
>
> i don't require dial up access, just hosting.
>
>
> i'd be interested to hear of competitors to this ISP, or of any good /
> bad experiences.  I'm ony interested in Australian, US, Canada or UK ISPs.
>
>
>
> many thanks
>
> jsutin french
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] undefined symbol: sk_new_null

2001-06-30 Thread Jack Lauman

Does anyone know what extension the following symbol belongs to?

sk_new_null

TIA,

Jack

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] emalloc / erealloc problem (was: help with custom session handler)

2001-06-30 Thread Aral Balkan

Well finally I am 99.9% sure that the problem is with Metabase. I've managed
to bring the code down to the absolute minimum to simplify things and I can
now state the bug clearly:

On Pentium III 500Mhz running WinMe, Apache 1.3.19 and PHP 4.0.5, use of
Metabase calls in custom session handler to update a MySQL database randomly
crash Apache with (again, randomly) errors in either PHP4TS.DLL or
MSVCRT.DLL.

When Apache does not crash, the code does work (I tested this with a simple
variable increment).

When the Metabase session handler is replaced with one using MySQL calls,
the problem goes away.

Entries noticed in Apache's error.log that may be related are:
FATAL:  emalloc():  Unable to allocate 1701082243 bytes
FATAL:  erealloc():  Unable to allocate 369098752 bytes

I've already written to Manuel about this and I'm sure he'll have the
problem figured out in no time but in the meanwhile, I'm posting my code
here so that this post may benefit others trying to do this in the future
(and with the hope that maybe someone can discover something that *I'm*
doing wrong that could be causing all this!)

http://www.phpbuilder.com/columns/ying2602.php3?page=1)

 metabase by Manuel Lemos ([EMAIL PROTECTED],
 http://www.phpclasses.upperdesign.com/)

 copyright (c) 2001, aral balkan ([EMAIL PROTECTED])
  http://www.aralbalkan.com
*/

// metabase database abstraction layer
require_once "metabase/metabase_parser.php";
require_once "metabase/metabase_manager.php";
require_once "metabase/metabase_database.php";
require_once "metabase/metabase_interface.php";

$SESS_LIFE = get_cfg_var('session.gc_maxlifetime');

// default life of session to an hour
if ($SESS_LIFE == '') { $SESS_LIFE = 3600; }

function on_session_start ($save_path, $session_name)
{
 global $database;

 /*  db_init.php holds the values for
  $db_type, $db_user, $db_pass, $db_host
 */
 require_once('db_init.php');

 $metabase_init = array(
 "Type"=>$db_type,
 "User"=>$db_user,
 "Password"=>$db_pass,
 "Host"=>$db_host,
 "IncludePath"=>"metabase/",
 "Persistent"=>TRUE
 );

 $metabase_error = MetabaseSetupDatabase(&$metabase_init, &$database);

 if ($metabase_error != '') {
  die('Database setup error: '.$metabase_error);
  return false; // failure
 }

 // select database
 $previous_database_name = MetabaseSetDatabase($database, $db_name);
 return true;
}

function on_session_end()
{
 // Nothing needs to be done in this function
 // since we used a persistent connection
 return true;
}

function on_session_read ($key)
{
 global $database;

 $key = MetabaseGetTextFieldValue($database, $key);

 $stmt = "SELECT sessionData FROM sessions";
 $stmt .= " WHERE sessionID = $key";
 $stmt .= " AND sessionExpire > ". time();

 if (!($result = MetabaseQuery($database, $stmt))) {
   // query failed
   echo '> Main query (sql) failed.'.$e;
   echo '> Error: '.MetabaseError($database).$e;
   die();
 }

 $stmt_rows = MetabaseNumberOfRows($database, $result);

 if ($stmt_rows) {
  $sessionData = MetabaseFetchResult($database, $result, 0, 'sessionData');;
  return($sessionData);
 } else {
  return false;
 }
}

function on_session_write ($key, $val)
{
 global $session_db, $SESS_LIFE;
 global $database;

 // convert the text value to a format suitable for use in current database
 $expiry = time() + $SESS_LIFE;
 $key = MetabaseGetTextFieldValue($database, $key);
 $val = MetabaseGetTextFieldValue($database, $val);

 $replace_stmt = "REPLACE INTO sessions (sessionID, sessionData,
sessionExpire)"
 ." values($key, $val, $expiry)";

 $success = MetabaseQuery($database, $replace_stmt);

 return $success;
}

function on_session_destroy ($key)
{
 global $database;

 $key = MetabaseGetTextFieldValue($database, $key);
 $stmt = "DELETE FROM sessions WHERE sessionID = $key";
 $success = MetabaseQuery($database, $stmt);
 return $success;
}

function on_session_gc ($max_lifetime)
{
 global $database;

 $stmt = "delete from sessions where sessionExpire < " . time();
 $success = MetabaseQuery($database, $stmt);
 return $success;
}

// Set the save handlers
session_set_save_handler("on_session_start", "on_session_end",
   "on_session_read", "on_session_write",
   "on_session_destroy", "on_session_gc");

?>

Thanks,
Aral :)

__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] emalloc / erealloc problem (was: help with custom sessionhandler)

2001-06-30 Thread Rasmus Lerdorf

> Do you have any idea what sort of database query could cause a memory leak
> like that? Could it have anything to do with the serialized data being
> written to the database having a '|' character and that character somehow
> being interpretted as a concatenation character in a Metabase function?

That would be really silly if that were the case.  I rather doubt that
could be it.

> I'm going to look into this and let you know if I find a solution (I really
> hope I do as my thesis pretty much depends on it!)

No problem.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Time out Errors?

2001-06-30 Thread Chris Anderson

I have mayn scripts on a website that use MySQL connections for various tasks. 
Strangely sometimes a task will hit the timeout (30 sec), then work perfectly when I 
refresh. Or even work perfectly other times. I'm using Apache on Windows 98 and I'd 
never had this bug before. Would it be because I connect to MySQL so much? Should I 
use mysql_pconnect instead of normal connect to alleviate this? Any help would be 
appreciated



Re: [PHP] emalloc / erealloc problem (was: help with custom session handler)

2001-06-30 Thread Aral Balkan

Rasmus,

When I try it with the MySQL handler you provided everything goes well -- no
errors. I guess I was hoping that the problem was with some php.ini setting
or something and not with Metabase as I'm dreading going into all code but
alas, I guess I must.

Do you have any idea what sort of database query could cause a memory leak
like that? Could it have anything to do with the serialized data being
written to the database having a '|' character and that character somehow
being interpretted as a concatenation character in a Metabase function?

I'm going to look into this and let you know if I find a solution (I really
hope I do as my thesis pretty much depends on it!)

Thanks again for all your help,

Aral :)

__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] caching

2001-06-30 Thread Jon Yaggie

Ok I am dynamically creating images.  my problem is my browser is caching the images 
(or at least half ot them - i see no particular system to which)  i have no idea how 
to stop this.  i have tried using the header Cache-Control: no-cahe  However it seems 
to have no helped.  maybe i am using it wrongly?  is there another method i can clear 
the browser cache?




Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0





Re: [PHP] php not run as cgi.

2001-06-30 Thread Julia A. Case

You can change the group to the group the webserver runs as and then make 
the file mod 660 (this way the webserver can read but other people can't)

Hope this helps,
Julia

Quoting Jack ([EMAIL PROTECTED]):
> hi everyone,
>  Does anyone know the best way to secure php source code so it is not
> group/world readable?
> I can read other users' php source code by writing a simple php script.
> I do not prefer to run php as cgi because all user's php file need to
> add the header
> #/usr/bin/php again.
> 
> Thanks.
> 
> Jack
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

 PGP signature


RE: [PHP] Website dealing with PHP image generation?

2001-06-30 Thread Jon Yaggie

Jeff,

I am not extremely fimilar with this function.  However, I did notice you are copying 
your image at a width and height of 1x1.   this is my guess as far as i know by 
default this pixels.  so the likehood you would see an image copied at 1x1 is rather 
low.  

but perhaps i am complete wrong . . .let us know.






Ok, I have tried Experts Exchange, Devshed, and even posted on here asking.
Does anyone know how to use the image generation?

I looked for a good site on it but found nothing...

My problem.

I am creating an image on the fly based on newest entries in one my mySQL
tables.  In this created image I am trying to add a small one to it.  Now I
am TRYING to use the below code:

$image = ImageCreate(500, 70);
$bg = ImageColorAllocate($image, 255, 255, 255);
$blue = ImageColorAllocate($image, 0, 0, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$himage= "usr/hyrum/public_html/images/topics/hyrum.gif";
ImageRectangle($image, 0, 0, 500, 70, $white);
ImageString($image, 4, 0, 0, $text, $blue);
ImageString($image, 3, 0, 20, $title1, $black);
ImageString($image, 3, 0, 35, $title2, $black);
ImageString($image, 3, 0, 50, $title3, $black);
//ImageCopy($image, $himage, 400, 20, 1, 1, 60, 60)

Imagepng($image, "signature.png");
ImageDestroy($image);

Am I using ImageCopy incorrectly?  It doesn't put anything in the new image.

Jeff
Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0





Re: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread Rasmus Lerdorf

> > Ok, stop right there.  Sessions and authentication have nothing to do with
> > each other.  To create a secure authenticated site you should be using
> > HTTP-based authentication over SSL.  Sessions are simply for maintaining
> > state across http requests and have nothing to do with authentication.
> >
> > -Rasmus
>
> So setting a 'loggedin' session variable once a person has authenticated, and
> checking for that session variable each request before proceeding is not ok?

No, this is what I was trying to make sure people realized.  It is only ok
if this happens over SSL and there is no chance that someone else can
sniff the session id.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Website dealing with PHP image generation?

2001-06-30 Thread Jeff Lewis

Ok, I have tried Experts Exchange, Devshed, and even posted on here asking.
Does anyone know how to use the image generation?

I looked for a good site on it but found nothing...

My problem.

I am creating an image on the fly based on newest entries in one my mySQL
tables.  In this created image I am trying to add a small one to it.  Now I
am TRYING to use the below code:

$image = ImageCreate(500, 70);
$bg = ImageColorAllocate($image, 255, 255, 255);
$blue = ImageColorAllocate($image, 0, 0, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$himage= "usr/hyrum/public_html/images/topics/hyrum.gif";
ImageRectangle($image, 0, 0, 500, 70, $white);
ImageString($image, 4, 0, 0, $text, $blue);
ImageString($image, 3, 0, 20, $title1, $black);
ImageString($image, 3, 0, 35, $title2, $black);
ImageString($image, 3, 0, 50, $title3, $black);
//ImageCopy($image, $himage, 400, 20, 1, 1, 60, 60)

Imagepng($image, "signature.png");
ImageDestroy($image);

Am I using ImageCopy incorrectly?  It doesn't put anything in the new image.

Jeff



Re: [PHP] emalloc / erealloc problem (was: help with custom sessionhandler)

2001-06-30 Thread Rasmus Lerdorf

> FATAL:  emalloc():  Unable to allocate 1701082243 bytes
> FATAL:  erealloc():  Unable to allocate 369098752 bytes
>
> in the log. Somehow when I query the database it must be trying to
> allocate -- unless my eyes deceive me -- ~1.6 GBs of memory in the first
> entry and ~350 Megs in the second.
>
> What could be causing this???
>
> As I mentioned earlier, I have a custom session handler set up that uses
> Manuel Lemos' Metabase library to save the session to a database (of the
> supported ones, I'm using mySQL.)
>
> I hope this message makes it to the list in a day or so (I really don't
> understand why the list is so slow...) because this is driving me crazy!

Well, the lists were on my personal DSL connection for a while.  The
bandwidth requirements were too high.  Sorry to drive you crazy.  The
lists should be quite a bit quicker now.

As for your problem.  Try to narrow down exactly where it might be
happening.  For example, try eliminating the MetaBase part and use a
generic mysql session save handler like the following:



The schema for this handler is:

CREATE TABLE sessions (
  id char(32) NOT NULL,
  data text,
  ts timestamp,
  PRIMARY KEY (id)
)

Does it still leak with this handler?  If not, if it does let us know.  If
it doesn't, then it must be somewhere in the Metabase code.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] emalloc / erealloc problem (was: help with custom session handler)

2001-06-30 Thread Aral Balkan

ok, I found what's making Apache crash... my getting entries like:

FATAL:  emalloc():  Unable to allocate 1701082243 bytes
FATAL:  erealloc():  Unable to allocate 369098752 bytes

in the log. Somehow when I query the database it must be trying to
allocate -- unless my eyes deceive me -- ~1.6 GBs of memory in the first
entry and ~350 Megs in the second.

What could be causing this???

As I mentioned earlier, I have a custom session handler set up that uses
Manuel Lemos' Metabase library to save the session to a database (of the
supported ones, I'm using mySQL.)

I hope this message makes it to the list in a day or so (I really don't
understand why the list is so slow...) because this is driving me crazy!

Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php / apache

2001-06-30 Thread Matt McClanahan

On Fri, Jun 29, 2001 at 03:54:13PM +, Pétur Björn Thorsteinsson wrote:

> can anyone tell me how to configure a php script so that it can only be
> accessed by other scripts and not directly by typing its url in the
> webrowser?

Just move the script outside the web root.  Browsers can't directly
access files that aren't inside web-visible directories.

Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php not run as cgi.

2001-06-30 Thread Jack

hi everyone,
 Does anyone know the best way to secure php source code so it is not
group/world readable?
I can read other users' php source code by writing a simple php script.
I do not prefer to run php as cgi because all user's php file need to
add the header
#/usr/bin/php again.

Thanks.

Jack

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php code security problem?

2001-06-30 Thread Rasmus Lerdorf

>  Does anyone know the best way to secure php source code so it is not
> group/world readable?
> I can read other users' php source code by writing a simple php script.

Turn on safe-mode.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php code security problem?

2001-06-30 Thread Jack

hi everyone,
 Does anyone know the best way to secure php source code so it is not
group/world readable?
I can read other users' php source code by writing a simple php script.

Thanks.

Jack

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] newbie has include path error

2001-06-30 Thread Justin French

Hi,

If you can "surf" local host for standard HTML pages and other php pages
(without includes in them) eg:

http://localhost/file.html

Then the problem isn't the server really, it seems to me that the server
document root for your files should be something like:

/usr/local/apache/ not /etc/httpd/php/prepend.php

Can you ftp into your server?  What's the path to your document root for
all your html / php files?  I doubt it's /etc/httpd/php/file.html, if it
isn't this, then the problem is somewhere in your php cnfig to indicate
where the document root is.

Eh, it's kidna hard to explain...  maybe someone else can explain it
better :)


Justin French
Creative Director
Indent.com.au



Daniel Goldin wrote:

> I had php/apache/mysql working perfectly for awhile on my redaht 7.1 box.
> Compiled them all from source and was very proud, as I am at best an amateur
> programmer. In other words, I love this stuff, but it doen't come naturally.
> 
> Recently I've been fiddling with networking (to little avail), installed a
> new ethernet card and did some other stuff... Anyway, now when I go into
> http://localhost (apache is running), I get this error:
> 
> Warning: Failed opening '/etc/httpd/php/prepend.php' for
> inclusion (include_path=") in unknown in line 0.
> 
> I've tried putting in this include path in my php.ini file to no effect.
> Please help. I have several projects I'm working on that require php and I
> have no way of working on them on my development box.
> 
> Any help gratefully appreciated. Also, I apologize for being too chatty.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] making e-mail link

2001-06-30 Thread Brad Hubbard

On Fri, 29 Jun 2001 01:28, richard greene wrote:
> Bill
>
> I grabed this function from the www.php.net manual and it works great, it
> covers all your bases, except that it will show you
> http://www.something.com for http://www.something.com or www.something.com.
> If somone knows how to modify it so it would only show www.something.com 
> when linked, that would be perfect.

Dohh!

if( !ereg( "http", $text ) )

should be

if( !ereg( "ftp|http", $text ) )

Cheers,
Brad
-- 
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: [EMAIL PROTECTED]
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Regular Expression help

2001-06-30 Thread Brad Hubbard

On Fri, 29 Jun 2001 23:43, Clayton Dukes wrote:
> Okay, here's what I have so far:
>
> ---snip---
> if ((!$email)
>
>|| ($email=="")
>|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email))
>
>)
> $stop = ""._ERRORINVEMAIL."";
> ---snip---
>
> This works, but how can I add a second domain?

How 'bout;

---snip---
 if ((!$email)
|| ($email=="")
|| (!eregi("^[_\.0-9a-z-]+@domain|otherdomain.+[a-z]",$email)

)
 $stop = ""._ERRORINVEMAIL."";
---snip---

Cheers,
Brad
-- 
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: [EMAIL PROTECTED]
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] reading records alphebetically

2001-06-30 Thread Jack Sasportas

Since you only have a few records, creating a second index with the first
letter doesn't apply to you, but is a good idea in a huge db scheme.

The simplest & fastest way is to take the suggestions a few people made which
is
SELECT * FROM
table WHERE name LIKE '$letter%'

I would not suggest this
$result = mysql_query("SELECT * FROM table order by name");
while ($row = mysql_fetch_array($result))  {
  extract($row);
   $first_letter = strtolower($name[0]);
 }

NOT that it won't work, but you should consider CPU in your design, and you
don't want to make the computer go through all the records sequentially to
display the valid records.  This would take a lot longer to deliver the results
in a large file, and would consume more resources...

Jack


Ethan Schroeder wrote:

> You can either select the letter you want through mysql with "SELECT * FROM
> table WHERE name LIKE '$letter%'
>
> Or you can select everything:
> $result = mysql_query("SELECT * FROM table order by name");
> while ($row = mysql_fetch_array($result))  {
>   extract($row);
>$first_letter = strtolower($name[0]);
>  }
>
> lets say
> $name = "Fred";
> then
> $name[0]  is set to "F";
> $name[1] is set to "r";
> $name[2]  is set to"e";
> and so on...
> - Original Message -
> From: "Jamie Saunders" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, June 30, 2001 9:29 AM
> Subject: [PHP] reading records alphebetically
>
> > Hi,
> >
> > I have a MySQL database set-up containing a few hundred records.  I'm
> trying
> > to make a script that reads the 'name' field of the records and displays
> > only the records of which the name field begins with a specific letter:
> >
> > if ($letter = A) {
> > display all records of which field 'name' beings with A
> > } else if ($letter = B) {
> > ...
> >
> > I'm just starting out on this, so please excuse my ignorance :)
> >
> > Jamie Saunders
> > [EMAIL PROTECTED]
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
___
Jack Sasportas
Innovative Internet Solutions
Phone 305.665.2500
Fax 305.665.2551
www.innovativeinternet.com
www.web56.net



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Auto submit form, How?

2001-06-30 Thread Henrik Hansen

Fates <[EMAIL PROTECTED]> wrote:

 > How do I auto load or auto submit a form on the same page?  I don't want
 > to have to press the submit button instead just click on a value in the
 > drop down form and it loads (I am lazy).  
 > 

use javascript, to find you answer look here

http://www.developer.irt.org/script/script.htm

-- 
Henrik Hansen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] reading records alphebetically

2001-06-30 Thread Julia A. Case

Try using a query like

select * from table_name where name like '$letter%';

Julia

Quoting Jamie Saunders ([EMAIL PROTECTED]):
> Hi,
> 
> I have a MySQL database set-up containing a few hundred records.  I'm trying
> to make a script that reads the 'name' field of the records and displays
> only the records of which the name field begins with a specific letter:
> 
> if ($letter = A) {
> display all records of which field 'name' beings with A
> } else if ($letter = B) {
> ...
> 
> I'm just starting out on this, so please excuse my ignorance :)
> 
> Jamie Saunders
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

 PGP signature


RE: [PHP] reading records alphebetically

2001-06-30 Thread Warren Vail

If you are planning to have a lot of records, you may want to create a
column with just that letter and index it, followed by the full name.

SELECT name from Table
WHERE first_letter = "$letter"
ORDER by name

should produce pretty fast results if "first_letter, name" is indexed.

Warren Vail

-Original Message-
From: Jamie Saunders [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 30, 2001 10:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] reading records alphebetically


Hi,

I have a MySQL database set-up containing a few hundred records.  I'm trying
to make a script that reads the 'name' field of the records and displays
only the records of which the name field begins with a specific letter:

if ($letter = A) {
display all records of which field 'name' beings with A
} else if ($letter = B) {
...

I'm just starting out on this, so please excuse my ignorance :)

Jamie Saunders
[EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Urgent Help: Problem with apache+php

2001-06-30 Thread teo

Hi Imran!
On Sat, 30 Jun 2001, Imran Hussain wrote:

> hi
> 
>   Iam running Freebsd4.3 i hv installed  apache-1.3.20,php4.0.5 and
> postgres-6.5.3. there was no problem with the configuration of all
> the above packages, My problem is when i start apache it gives me this error.
> 
> hub#/usr/local/apache/bin/apachectl start
> Syntax error on line 205 of /usr/local/apache/conf/httpd.conf:
> Cannot load /usr/local/apache/libexec/libphp4.so into server:
> /usr/local/apache/libexec/libphp4.so: Undefined symbol "PQoidValue"
> /usr/local/apache/bin/apachectl start: httpd could not be started
> hub#
> 
>  before this it was saying libphp4.so not found then i had to do
> ldconfig with the path to the lib dir then it gave me this errorcan
> anyone help me on this issue.
> 

as root:
ldconfig -m /path/to/postgres/libs/dir/

e.g.:
ldconfig -m  /usr/local/pgsql/lib

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Telnet and PHP

2001-06-30 Thread jon

Instead of performing a send for each stroke, the user code type in a whole
string in a text box, and then submit that string. I have found this code at
http://www.phpbuilder.com/mail/php-general/2001051/1479.php:

sock = fsockopen($host,$port);
socket_set_timeout($this->sock,2,0);
}


function close() {
if ($this->sock)
fclose($this->sock);
$this->sock = NULL;
}


function write($buffer) {
$buffer = str_replace(chr(255),chr(255).chr(255),$buffer);
fwrite($this->sock,$buffer);
}


function getc() {
return fgetc($this->sock);
}


function read_till($what) {
$buf = '';
while (1) {
$IAC = chr(255);


$DONT = chr(254);
$DO = chr(253);


$WONT = chr(252);
$WILL = chr(251);


$theNULL = chr(0);


$c = $this->getc();


if ($c === false)
  return $buf;


if ($c == $theNULL) {
continue;
}


if ($c == "\021") {
continue;
}


if ($c != $IAC) {
$buf .= $c;


if ($what ==
(substr($buf,strlen($buf)-strlen($what {
return $buf;
} else {
continue;
}
}


$c = $this->getc();


if ($c == $IAC) {
$buf .= $c;
} else if (($c == $DO) || ($c == $DONT)) {
$opt = $this->getc();
// echo "we wont ".ord($opt)."\n";
fwrite($this->sock,$IAC.$WONT.$opt);
} elseif (($c == $WILL) || ($c == $WONT)) {
$opt = $this->getc();
// echo "we dont ".ord($opt)."\n";
fwrite($this->sock,$IAC.$DONT.$opt);
} else {
// echo "where are we? c=".ord($c)."\n";
}
}


}
}


$tn = new telnet("192.168.255.100",23);
echo $tn->read_till("ogin: ");
$tn->write("admin\r\n");
echo $tn->read_till("word: ");
$tn->write("thieso\r\n");
echo $tn->read_till(":> ");
$tn->write("ps\r\n");
echo $tn->read_till(":> ");
echo $tn->close();
?>





- Original Message -
From: "Warren Vail" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, June 30, 2001 2:01 PM
Subject: RE: [PHP] Telnet and PHP


> By "active user input", I would assume that you mean every time the user
> makes a keystroke, the keystroke is sent to the host machine.  This is not
a
> characteristic of html which only sends information to the host machine
when
> some form of submit is clicked.  The advantage of the applet for this sort
> of thing is it runs on the browser client, and has the capability of
sending
> every keystroke directly to the host, bypassing the server side.
>
> On the server side, once the (PHP) application is done sending the
requested
> files to the web browser for one user, it moves on to handling the
requests
> for other users.  Can you imagine the load on a server if it had to reload
> your application every time, your user pressed a key.
>
> You never really made it clear where you expected this client to run,
> although PHP, at this point, can only run on the server.  Now if you are
> looking for something that your PHP code could use to 1. signon to a host
> somewhere, 2. execute some commands, 3. capture and process the results
and
> 4. disconnect before completing a single page to a web browser client (it
> will probably never do "active user input", because of the nature of PHP
and
> the web server), then I would suggest you consider "rexec", "rcp", "rsh"
or
> if what you want is in a file on the host machine, you could use the ftp
> functions.  These are not telnet, and do require special deamons running
on
> the host machine, but may do the trick.
>
> I have been looking for your telnet client for a long time as well, and if
> you find one, please remember to post it here, but I would suspect that
one
> of the problems in doing a telnet client in php is that the telnet client
> needs to be multi-threaded.  Perhaps someone will someday take open source
> like Dave's Telnet and fashion an extension to PHP.
>
> Til then, try the options above,
>
> Warren Vail
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 30, 2001 10

RE: [PHP] Adding 1 to a whole number

2001-06-30 Thread Don Read


On 30-Jun-01 Richard Kurth wrote:
> Way is this doing this Starting with 1000 all I what to do is increse
> this number by one the first time I run it it adds  1 to the number 10001
> second time it 10001002
> Shouldn't it just add 1 to the number 1000,1001,1002,1003
> 

strings don't add well, give a hint to php to use integers:

> 
> $data = fgets($fp2, 1000);
> 
> $data1 = $data + "1";
> 
> fwrite($fp2,$data1); 
> 
> echo $data1;

Strings don't add nearly as well as numbers, give a hint to php 
to use integers; & reset your file pointer.

$data = 1 + $data;
rewind($fp);
fwrite($fp, "$data");

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Telnet and PHP

2001-06-30 Thread Warren Vail

By "active user input", I would assume that you mean every time the user
makes a keystroke, the keystroke is sent to the host machine.  This is not a
characteristic of html which only sends information to the host machine when
some form of submit is clicked.  The advantage of the applet for this sort
of thing is it runs on the browser client, and has the capability of sending
every keystroke directly to the host, bypassing the server side.

On the server side, once the (PHP) application is done sending the requested
files to the web browser for one user, it moves on to handling the requests
for other users.  Can you imagine the load on a server if it had to reload
your application every time, your user pressed a key.

You never really made it clear where you expected this client to run,
although PHP, at this point, can only run on the server.  Now if you are
looking for something that your PHP code could use to 1. signon to a host
somewhere, 2. execute some commands, 3. capture and process the results and
4. disconnect before completing a single page to a web browser client (it
will probably never do "active user input", because of the nature of PHP and
the web server), then I would suggest you consider "rexec", "rcp", "rsh" or
if what you want is in a file on the host machine, you could use the ftp
functions.  These are not telnet, and do require special deamons running on
the host machine, but may do the trick.

I have been looking for your telnet client for a long time as well, and if
you find one, please remember to post it here, but I would suspect that one
of the problems in doing a telnet client in php is that the telnet client
needs to be multi-threaded.  Perhaps someone will someday take open source
like Dave's Telnet and fashion an extension to PHP.

Til then, try the options above,

Warren Vail


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 30, 2001 10:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Telnet and PHP


I was doing some research on creating a webbased telnet client and I am
unsatisfied with Java applets. I would like to create a server side telnet
client, so the user side is only required to have a working web browser that
supports HTML.

Thus, I turned to PHP. I found one example, but it does not allow for active
user input. While I will sit down this evening and work with the code, I was
wondering if anyone had/knew of a good example of a PHP telnet client.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] reading records alphebetically

2001-06-30 Thread Ethan Schroeder

You can either select the letter you want through mysql with "SELECT * FROM
table WHERE name LIKE '$letter%'

Or you can select everything:
$result = mysql_query("SELECT * FROM table order by name");
while ($row = mysql_fetch_array($result))  {
  extract($row);
   $first_letter = strtolower($name[0]);
 }

lets say
$name = "Fred";
then
$name[0]  is set to "F";
$name[1] is set to "r";
$name[2]  is set to"e";
and so on...
- Original Message -
From: "Jamie Saunders" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 30, 2001 9:29 AM
Subject: [PHP] reading records alphebetically


> Hi,
>
> I have a MySQL database set-up containing a few hundred records.  I'm
trying
> to make a script that reads the 'name' field of the records and displays
> only the records of which the name field begins with a specific letter:
>
> if ($letter = A) {
> display all records of which field 'name' beings with A
> } else if ($letter = B) {
> ...
>
> I'm just starting out on this, so please excuse my ignorance :)
>
> Jamie Saunders
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Pricing Advice Needed

2001-06-30 Thread teo

Hi Brad!
On Sat, 30 Jun 2001, Brad Hubbard wrote:

> On Fri, 29 Jun 2001 01:42, Thomas Deliduka wrote:
> 
> > I think in general it's about $100-$150/hour for programming/database work.
> 
> Yankee dollars?
> 
> Gawwd... I AM being exploited due to geographic disadvantage!
> 
to make you feel better, lemme tell you that after more than 3ys w/ PHP
I earn somewhere arround 3 ( I mean 3!) $/h in Romania 
so let me tell you more about geographic disadvantages :)

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Pricing Advice Needed

2001-06-30 Thread Brad Hubbard

On Fri, 29 Jun 2001 01:42, Thomas Deliduka wrote:

> I think in general it's about $100-$150/hour for programming/database work.

Yankee dollars?

Gawwd... I AM being exploited due to geographic disadvantage!

Cheers,
Brad
-- 
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: [EMAIL PROTECTED]
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Telnet and PHP

2001-06-30 Thread jon

I was doing some research on creating a webbased telnet client and I am unsatisfied 
with Java applets. I would like to create a server side telnet client, so the user 
side is only required to have a working web browser that supports HTML.

Thus, I turned to PHP. I found one example, but it does not allow for active user 
input. While I will sit down this evening and work with the code, I was wondering if 
anyone had/knew of a good example of a PHP telnet client.



[PHP] reading records alphebetically

2001-06-30 Thread Jamie Saunders

Hi,

I have a MySQL database set-up containing a few hundred records.  I'm trying
to make a script that reads the 'name' field of the records and displays
only the records of which the name field begins with a specific letter:

if ($letter = A) {
display all records of which field 'name' beings with A
} else if ($letter = B) {
...

I'm just starting out on this, so please excuse my ignorance :)

Jamie Saunders
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ImageCopy

2001-06-30 Thread Jeff Lewis

I am creating an image on the fly based on newest entries in one my mySQL
tables.  In this created image I am trying to add a small one to it.  Now I
am TRYING to use the below code:

$image = ImageCreate(500, 70);
$bg = ImageColorAllocate($image, 255, 255, 255);
$blue = ImageColorAllocate($image, 0, 0, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$himage= "usr/hyrum/public_html/images/topics/hyrum.gif";
ImageRectangle($image, 0, 0, 500, 70, $white);
ImageString($image, 4, 0, 0, $text, $blue);
ImageString($image, 3, 0, 20, $title1, $black);
ImageString($image, 3, 0, 35, $title2, $black);
ImageString($image, 3, 0, 50, $title3, $black);
//ImageCopy($image, $himage, 400, 20, 1, 1, 60, 60)

Imagepng($image, "signature.png");
ImageDestroy($image);

Am I using ImageCopy incorrectly?  It doesn't put anything in the new image.

Jeff



Re: [PHP] Auto submit form

2001-06-30 Thread Justin French

David wrote:

> How do I autoload a selection from a drop down menu form based on the
> selection without having to click a submit button?

Everything to do with forms is either to do with hitting a submit button
(call to a server) or without (which means that the browser/client is
handling it), so anything you want to do (like auto-submits, dynamic
pop-ups, etc etc) is done via the browser -- Javascript would be the
obvious one.

I Suggest looking at onChange and onBlur attributes of  elements
for more info.


As per usual, you'll probably be able to learn quite a bit by looking at
the HTML/JavaScript source code of a page that already does it.


It's not really PHP related, try to think of it as a HTML / browser /
client side issue.  Also, be aware that you shoudl still prolly include
a submit button, so that people with stone age browsers, or worse still,
javascript turned off, can still submit the form and use your site.


I saw an e-commerce site once that ignored this basic little rule, thus
preventing sales to those without javascript.  I don't think any online
store is doing well enough yet to start excluding customers :)


Justin French
Creative Director
Indent.com.au

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Capturing output of shell script.

2001-06-30 Thread Don Read


On 29-Jun-01 Charles Williams wrote:
> Hello all,
> 
> I have an .sh shell script being executed from a php4 call.  I need to
> capture the string return and work with that in the php script.  The only
> problem is that the call works but I cannot get the returned string.  I've
> tried using exec, passthru, ``, system, and escapeshellcommand.  Nothing
> seems to work.  any ideas?

$cmd='stuff.sh';
$p=popen($cmd, 'r');
if ($p) {
   while ($str=fgetss($p,1000)) {
 do_foo($str);
   }
   pclose($p);
} else {
   echo "phsst. bad command: $cmd ";
}

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ½Ãµð ÆË´Ï´Ù

2001-06-30 Thread ¼ºÀ±±â

¿©·¯ºÐ¿¡°Ô °¡Àå ÇÊ¿äÇÏ°í À¯ÀÍÇÑ ÄÄÇ»ÅÍ °ü·ÃÇÁ·Î±×·¥À»
ÆÄ°ÝÀûÀ¸·Î ½Ñ °¡°Ý¿¡ °ø±ÞÇÕ´Ï´Ù

ÃֽŰÔÀÓ. À¯Æ¿°ü·ÃÇÁ·Î±×·¥. MP3. ºñµð¿À½Ãµð µîµî
¸ðµç ÇÁ·Î±×·¥À» ÆǸÅÇÕ´Ï´Ù. 6¿ù ÃֽŸ®½ºÆ®ÀÔ´Ï´Ù

¹°·Ð ½Å¿ë °ÆÁ¤À» ÀüÇô ½Å°æ¾²Áö ¸¶½Ê½Ã¿ä
ÀÌ ¸ÞÀÏÀ» º¸³½ ¾ÆÀ̵ð·Î´Â ¿¬¶ôÀÌ µÇÁö ¾Ê½À´Ï´Ù.
¾ÐÃàÈ­Àϼӿ¡ ¿¬¶ôó°¡ ÀÖ½À´Ï´Ù(¸ÞÀÏ.ÀüÈ­¹øÈ£) 

=== Ưº° º¸³Ê½º ½Ãµð¸¦ ÁõÁ¤ÇÕ´Ï´Ù ===

È®½ÇÇÏ°Ô ÈÞ´ëÆùÀ¸·Î ¿¬¶ôÁֽʽÿä
°¨»çÇÕ´Ï´Ù

³¡À¸·Î Çã¶ô¾øÀÌ ¸ÞÀÏÀ» µå¸°°ÍÀ» »ç°úµå¸³´Ï´Ù.±×¸®°í ¿©·¯ºÐÀÇ ¸ÞÀÏÁÖ¼Ò´Â
¹«ÀÛÀ§·Î ¸ð¾ÆÁø°ÍÀÌ´Ï ´Ù¸¥ °ÆÁ¤Àº ÇÏÁö ¾ÊÀ¸¼Åµµ µË´Ï´Ù.  

¹Ø¿¡ À̾îÁö´Â ±Û¿¡¼­ ¸®½ºÆ®¸¦ ´Ù¿î¹ÞÀ¸½Ç¼ö ÀÖ½À´Ï´Ù
¹Ø¿¡ ±ÛÀÌ º¸ÀÌÁö ¾ÊÀ¸½Ã¸é ÷ºÎµÈ È­ÀÏ cdlist.htm À» ¿©½Ã°í ´Ù¿î¹ÞÀ¸½Ã¸é µË´Ï´Ù
   



 Next Entertainment, LYCOS

 Áñ°ÌÁö ¾ÊÀ¸¸é ÀÎÅͳÝÀÌ ¾Æ´Õ´Ï´Ù!!   http://www.lycos.co.kr
 ÀÎÅÍ³Ý ¸¸È­ÀÇ ÃÖ°­, ¶óÀÌÄÚ½º ¸¸È­   (http://comics.lycos.co.kr) 
 ½±°í ºü¸¥ ¹®ÀÚ¸Þ¼¼Áö, ¶óÀÌÄÚ½º ¹«¼±¸ÞÀÏ  (http://m-mail.lycos.co.kr)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] setting up / configuring mail()

2001-06-30 Thread James Cox

hey

does anyone know any good resource sites or documents about configuring the
mail services for php so it works?

Thanks,

James Cox.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
James Cox :: Creative Director :: AWP imaJes
t: +44 (0)7968 349990 | f: +44 (0)1992 300939
e: [EMAIL PROTECTED]
w: http://www.awpimajes.com/
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.




Re: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread adam (dahamsta)

Hi again Rasmus, thanks for your reply.

Rasmus Lerdorf <[EMAIL PROTECTED]> said:

> I wasn't trying to be overly critical, I just worry that new users are
> reading these posts and see these insecure solutions to this problem and
> don't realize that they are inherently insecure.
> 
I understand Rasmus, and don't worry, I wasn't being overly-sensitive. 
However as I said, I'm not looking for the ultimate authentication solution 
here, I'm looking for the best I can possibly do - without making it too 
awkward - in a forms- and sessions- based situation. What I have difficulty 
with is understanding how the thousands of websites I mentioned manage it 
without being overly concerned about security. Or is that the problem - 
they're not concerned enough, and we should all be using PKI's? For regular 
websites though, I think that might be overkill, especially when a huge 
majority of people don't understand even the fundamentals of security and 
encryption. (I tried to explain it to my Dad last night, it was painful but 
productive. :)

> Well, "pretty hard to spoof" is very relative.  It is basically security
> through obscurity.  From the description you just provided it is trivial
> to spoof it.  Remember that the HTTP_REFERER comes from the client and can
> very easily be spoofed.
> 
I know security through obscurity is a bad thing (or at least it's *seen* as 
a bad thing. I don't necessarily subscribe to it being inherently bad, just 
something that should be used with care) but in this case I have to clench my 
teeth, put my hands over my head and say I think you're missing my point, or 
that you're not following me fully.

I realise that the HTTP_REFERER can be spoofed - quite easily in fact, I 
could spoof it myself in a few lines of PHP code - but the chances of Eve 
guessing the right HTTP_REFERER to send are pretty remote, don't you think? 
Unless they're standing behind Alice and looking over her shoulder - in which 
case Alice's security is compromised anyway - Eve isn't going to know which 
page Alice last visited. So the only way Eve could take over Alice's session 
is to visit every page on the site using Alice's session ID. And if Alice is 
still browsing the site, it makes it even harder, because Alice will be 
moving the target around.

Yes, it's security through obscurity, but isn't is so obscure that It Just 
Might Work? Please, I'm not saying your wrong here, I'm genuinely interested 
in your opinion. If you think I'm wrong, tell me, I'd prefer to know. And if 
you have a better solution for the problem I'm facing, I'd love to hear about 
it. I just have a blank wall in front of me and I can't find my sledge. :)

adam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread Robert Klinkenberg

Depends on what you want to do, first you have to define what are valid
sessions,
So think of things like this
- One Session can only come from one IP address
- A session ID that was created n minutes ago is no longer valid
- A user using Netscape x can't be using IExplorer y


After a user connects to you with a session ID you could check all those
things
yourself in your PHP script and respond appropriately. In this case, store
the 
session in a Database with the remote IP address, expire the Session and
check
the referer. That should block a lot of script kiddies but of course slows
down the 
site.

Also, it's not that hard to create cookies by hand so that won't stop people
who realy
want to enter your site :-( and remember sessions are not meant to be
secure, 
that is why we have SSL :-)


Robert Klinkenberg

> -Oorspronkelijk bericht-
> Van:  Bill Rausch [SMTP:[EMAIL PROTECTED]]
> Verzonden:Saturday, June 30, 2001 12:43 AM
> Aan:  [EMAIL PROTECTED]
> Onderwerp:AW: [PHP] Stopping stolen / spoofed / linked sessions
> 
> Sebastian Stadtlich said:
> 
> >there is an option in php ini :
> >
> >session.referer_check =
> >
> >which should fit your needs
> >
> >not sure how to use it, but probably one of the php-developers on this
> >list can assist...
> 
> I looked at this thing and can't figure out that it does very much. 
> If someone makes a web page that contains a link to my site that 
> contains the PHPSESSID=... then that session id will be invalid. 
> However, if they just type the same string into their browser by 
> hand, it is accepted?
> 
> It seems that there is no stopping session spoofing if using the URL 
> method. The only work around is to expire sessions quickly or to 
> require that cookies be used?
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread adam (dahamsta)

Hi Richard,

Richard Lynch <[EMAIL PROTECTED]> said:

> > I want to use PHP4 sessions for authentication, but I'm having difficulty
> 
> If it's as important as all that, go with SSL.
> 
Ah, I'll be using SSL for the original authentication anyway. But the users 
will be browsing using regular HTTP, which means I need a session to *keep* 
them authenticated. I could use HTTP-AUTH of course, but I don't particularly 
want to - some users don't seem to be able to understand it (I kid you not).

> Otherwise, live with the risk and just use HTTP Basic Authentication,
> perhaps via PHP sending the headers.
> 
See above.

> Unsolicited (and only slightly related) Tip:  I recently figured out that
> RaQ servers
>
I am on a RaQ(4) right now, gods love me, but this is an across the board 
thing. I'm developing this for my customers use, but I'll be releasing it as 
open source later. So it needs to be as compatible as possible, and cater for 
all possible eventualities - including users who don't use cookies and don't 
understand HTTP-AUTH. It's a wee bit ironic you mentioned it too, because 
I'll be using it to create a server management interface, so I can dump the 
RaQ altogether. They're great little machines, but they're about as secure as 
my tummy after 10 pints of Heineken. (Too graphic? :)

> have some funky-ass httpd.conf settings already in them
>
Very funky actually. They use Perl Sections (mod_perl) to configure the SSL 
VirtualHosts on the fly when httpd is started. I'm experimenting with it 
meself at the moment, but I'm going to use PHP instead of Perl, because 
mod_perl makes for very fat httpd processes, which is pretty annoying when 
you don't even use it on the server. Unfortunately, PHP can't be embedded in 
httpd.conf (add that to the wish list lads), so I'm building a custom 
apachectl to read configuration data from a MySQL database and build a 
httpd.conf, and then start Apache with that confid file. It's really quite 
cool, even if I do say so myself. :)

> doing HTTP Basic Authentication already, so trying to do HTTP Basic 
> Authentication via .htaccess just plain won't work.  (Or, rather, it will 
> only work for users already defined in their goofy interface...)
>
Kind of, but not really. Actually a RaQ has two httpd's running, one 
listening on ports 80 and 443, and one listening on 81. The regular httpd 
uses mod_rewrite to listen for requests for secured areas 
(/admin, /siteadmin, /personal and /stats on boxes that use Webalizer), and 
redirects to the port 81 server, which then authenticates using the users and 
groups defined on the machine. So you can use HTTP-AUTH as normal on the 
regular httpd, as long you define your AuthUserFile/AuthGroupFile's 
correctly, and the HTTP-AUTH protected areas don't clash with the RaQ secured 
areas. The server is configured with 'AllowOverride none' by default though, 
but you just need to change it to 'AuthConfig' to fix that.

> PHP sending the headers, however, works just fine and dandy. :-)
>
Yip.

> I have decided I don't really like RaQ servers.  They don't totally suck, 
> especially if you're in a hurry, but if you can do it a little later and 
> way better, don't go RaQ.  YMMV.
> 
Well, it the same old problem, isn't it? Convenience V security. The RaQ's 
are *very* convenient for a small but reasonably busy webdev/hosting company 
that doesn't have their own interface. When it comes to security though, it's 
not the best solution in the world by any manner of means. But if we were to 
be 100% secure all the time, everyone would use SSH and SC. If only life were 
that simple... :)

Like I said above though, I'll be losing the RaQ as soon as I get the chance. 
I'd prefer to write and use my own code, I'd prefer to take the 
responsibility myself. And I'd just like to point out that I'm on this box 
now for conveniences sake, because it's closer to home than my prefered box 
(Red Hat, sorry :).

Anyway, thanks Richard,
adam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread Rasmus Lerdorf

I wasn't trying to be overly critical, I just worry that new users are
reading these posts and see these insecure solutions to this problem and
don't realize that they are inherently insecure.

> What I'm asking is basically "What's the best and easiest way to go about
> this?" I have come up with a solution of sorts though, and I'd be interested
> in your opinion. I set up a user with a PHP session, and of course a timeout.
> If they have cookies turned on, I set another cookie with a hash of the
> username and password, or somthing else. But my final line of defense for
> users that don't have cookies is a URL and HTTP_REFERER comparison check.
> That is, on every request I log the URL requested as a session variable. On
> every subsequent request I compare the HTTP_REFERER with the logged URL, and
> if they match there's a pretty good chance it's not someone spoofing.
> Granted, it's not foolproof, but it'd be pretty hard to spoof, right?

Well, "pretty hard to spoof" is very relative.  It is basically security
through obscurity.  From the description you just provided it is trivial
to spoof it.  Remember that the HTTP_REFERER comes from the client and can
very easily be spoofed.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread adam (dahamsta)

Hi Rasmus, nice to see you still watching over us on the lists. I feel like 
I've been ticked off by my dad though... :)

Rasmus Lerdorf <[EMAIL PROTECTED]> said:

> > I want to use PHP4 sessions for authentication,
> 
> Ok, stop right there.  Sessions and authentication have nothing to do with
> each other.  To create a secure authenticated site you should be using
> HTTP-based authentication over SSL.  Sessions are simply for maintaining
> state across http requests and have nothing to do with authentication.
> 
Ah, have a little more faith in one of your older users Rasmus. I'm not 
talking about the be-all and end-all of authentication here - if I was doing 
that, I would set up a PKI. I'm talking about regular authentication on 
websites, like thousands - tens of thousands - of sites use every day. Sites 
like Hotmail, Yahoo!, even Zend.com, which uses PHP sessions for tracking a 
users session after they been authenticated (which is really a follow-on type 
of authentication). It also uses the users IP address, which seems a bit icky 
for the reasons stated in my previous email, but maybe they've figured a way 
around the problem.

What I'm asking is basically "What's the best and easiest way to go about 
this?" I have come up with a solution of sorts though, and I'd be interested 
in your opinion. I set up a user with a PHP session, and of course a timeout. 
If they have cookies turned on, I set another cookie with a hash of the 
username and password, or somthing else. But my final line of defense for 
users that don't have cookies is a URL and HTTP_REFERER comparison check. 
That is, on every request I log the URL requested as a session variable. On 
every subsequent request I compare the HTTP_REFERER with the logged URL, and 
if they match there's a pretty good chance it's not someone spoofing. 
Granted, it's not foolproof, but it'd be pretty hard to spoof, right?

Anyway, I'd be interested in your opinion, and I'd also be interested in 
whether you're coming to Dublin for ApacheCon Europe? I hope to meet you 
there if you are.

adam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question on Commercial Offerings

2001-06-30 Thread James Moore

Thomas Deliduka wrote:
> 
> I don't know quite how to word that subject but here's what we want to do.
> 
> We have a shopping cart softwre (like a million others out there) which
> based in windows NT with a COM+ object to guard the source code.
> 
> We mainly offer this product to our hosting customers as an add-on solution
> to their hosting.
> 
> Well, we want to migrate this to PHP/MySQL and I don't know how to protect
> the source code. My boss is suggesting to make a DSO but I really am not a C
> programmer to do all that. I want to make it all in PHP but somehow protect
> the code. Any ideas?

http://www.zend.com/zend/products.php#encoder

- James

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] closing window after submit

2001-06-30 Thread DAve Goodrich

on 6/28/01 3:57 PM, Richard Kurth at [EMAIL PROTECTED] wrote:

> I have a form that is in a pop up window it has an image for a submit
> button how can I close the pop up after submitting. I know I can do it
> with javascript with a standard submit button. but how can I do it when
> I use an image for a submit button
> 
> 
> 
> 
> 
> 

> Best regards,
> Richard  
> mailto:[EMAIL PROTECTED]
> 

Set a hidden variable within the form, then have PHP check the value when
the page reloads. if the variable is set, have PHP add a JavaScript line to
close the window immediately. !!! Note my syntax may be incorrect.

Test page

 














I believe this will do what you want. If the form has been submitted then
the value of my_hidden_var should cause PHP to insert the correct JavaScript
to close the window.

Is that what you are looking for?

I think a cleaner solution would be to have PHP check the value of the
my_hidden_var and redirect to a thank you page. This could be set to time
out and close if you wanted, or offer a validation step as well.

DAve

--
Dave Goodrich
Director of Interface Development
Reality Based Learning Company
9521 NE Willows Road, Suite 100
Redmond, WA 98052 
Toll Free 1-877-869-6603 ext. 237
Fax (425) 558-5655 
[EMAIL PROTECTED] 
http://www.rblc.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help with custom session handler

2001-06-30 Thread Aral Balkan

I'm writing a custom session handler that saves sessions using Manuel Lemos'
excellent Metabase library. The problem is, although I've got the
session_set_save_handler function pointing to the correct start, end, read,
write, destroy and garbage collection functions, when I call session_start
and session_register, the "write" function does not get called (the only
function that gets called is the "read" function.)

I read on a post at PHPBuilder that the write function cannot output to the
browser so just to make sure I logged my debug code to a global variable and
it really is not getting called.

I'd really appreciate any suggestions you might have -- it's got me stumped!

Thanks, Aral :)
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] making e-mail link

2001-06-30 Thread Brad Hubbard

On Fri, 29 Jun 2001 01:28, richard greene wrote:
> Bill
>
> I grabed this function from the www.php.net manual and it works great, it
> covers all your bases, except that it will show you
> http://www.something.com for http://www.something.com or www.something.com.
> If somone knows how to modify it so it would only show www.something.com 
> when linked, that would be perfect.

How about;

function getAutoLink($text)
{
if( !ereg( "http", $text ) )
{
$text = 
ereg_replace("((www.)([a-zA-Z0-9@:%_.~#-\?&]+[a-zA-Z0-9@:%_~#\?&/]))","http://\\1\"; TARGET=\"_blank\">\\1", $text);
return $text;
}
$text = 
ereg_replace("((ftp://|http://|https://){2})([a-zA-Z0-9@:%_.~#-\?&]+[a-zA-Z0-9@:%_~#\?&/])",
 
"http://\\3";, $text);
$text = 
ereg_replace("(((ftp://|http://|https://){1})[a-zA-Z0-9@:%_.~#-\?&]+[a-zA-Z0-9@:%_~#\?&/])",
 
"\\1", $text);
$text = 
ereg_replace("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","mailto:\\1\";>\\1", $text);
return $text;
}

Excuse the wrapping butchery.

Cheers,
Brad
-- 
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: [EMAIL PROTECTED]
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] ENC: ADD a user in linux using PHP

2001-06-30 Thread Chadwick, Russell

 
http://expect.nist.gov/  
 
---

Toolshed Computer Productions - Professional PHP Hosting

Hosting - Dedicated Servers - Design - Programming

http://www.toolshed51.com  

-Original Message-
From: Bruno Freire [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 9:24 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] ENC: ADD a user in linux using PHP





BM__MailData-Mensagem original- 
De: Bruno Freire 
Enviada em: quinta-feira, 28 de junho de 2001 11:31 
Para:   '[EMAIL PROTECTED]' 
Cc: '[EMAIL PROTECTED]' 
Assunto:ADD a user in linux using PHP 

Hi! I'm Bruno, from brazil 

Somebody knows how to create a new user in LINUX (not http server) using
PHP? 

Something like useradd and passwd 

Thanks, 

Bruno. 




Re: [PHP] Parse error: Needs T_VARIABLE or $

2001-06-30 Thread Delbono

Try this:

$r = trim($rowData[3]);
if ( !empty( $r  ) )
{
$tdStr.= trim($rowData[3]);
}


I tokk a look at the manual:

1. Note: empty() is a language construct.
so:
!empty is like to say   !if  or !while  : so it's wrong-

2.
Note that this is meaningless when used on anything which isn't a variable;
i.e. empty (addslashes ($name)) has no meaning since it would be checking
whether something which isn't a variable is a variable with a false value.





- Original Message -
From: "Jason Lustig" <[EMAIL PROTECTED]>
To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]>
Sent: Friday, June 29, 2001 11:55 PM
Subject: [PHP] Parse error: Needs T_VARIABLE or $


> This is really weird. Very, very, very weird. I have the following code in
a
> script:
>
> if (!empty(trim($rowData[3])))
> {
> $tdStr.= trim($rowData[3]);
> }
>
>
> Now, when I run it, I get the following error:
>
>
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
> c:\server\wwwroot\contributors.php on line 70
>
> (note: line 70 is the first liine of the code snippet above)
>
> Now, this shouldn't be a problem. There is no problem with the parens, and
I
> don't see anything wrong with the code. Can someone help me out with this?
> This is happening in another script (when I use the empty() function) and
it
> is really weird...
>
> --Jason
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP & ImageMagick

2001-06-30 Thread Chadwick, Russell


Did you try the escapeshellcmd () function ?  - Russ

---
Toolshed Computer Productions - Professional PHP Hosting
 Hosting - Dedicated Servers - Design - Programming
 http://www.toolshed51.com

-Original Message-
From: Jeffrey Barendse [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 8:01 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP & ImageMagick


In PHP I try to run a shell command with the following source code:

$fotonaam = 'convert -font arial -pointsize 20 -gravity center -fill
white -draw "text 5,5 VERKOCHT" image.jpg image2.jpg';
exec($fotonaam);

PHP runs the program but the -draw "text 5,5 VERKOCHT" is not executed
(there is no VERKOCHT in the image2.jpg). I tried everything but I can't
solve the problem. Could somebody explain to me how it's possible that the
program (convert) runs but there (seams to be) a problem with -draw "text
5,5 VERKOCHT". If I run the same command troughs telnet/ssh as root or
nobody it works fine

Is it something with the " and the combinative with the exec function (I
also tried \")?

Or is it because I run PHP in safe mode and the convert program tries to run
a external program what is not in the . path (you now, the basic safe mode
restriction)?

Please help me.. I'm getting despaired on this in. ;-)

Regards,

Jeffrey Barendse




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php / apache

2001-06-30 Thread Jason Lustig

Why would you want to do that?

I don't think it's really possible... unless you do something wacky with
Apache...

--Jason


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] extracting element for TOC

2001-06-30 Thread Chris Komlenic

I have a directory with many small html files...which I'd like to return the
text within the  tags for the purpose of creating a table of contents
(TOC).

I currently have a script which reads the directory, and returns all the
files which I'd like to open.  I'm a bit lost on how to write a loop which
would open each file, and return the info within  tags.

How could this best be accomplished?

Thanks in advance.

Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread Jason Brooke

> > I want to use PHP4 sessions for authentication,
>
> Ok, stop right there.  Sessions and authentication have nothing to do with
> each other.  To create a secure authenticated site you should be using
> HTTP-based authentication over SSL.  Sessions are simply for maintaining
> state across http requests and have nothing to do with authentication.
>
> -Rasmus

So setting a 'loggedin' session variable once a person has authenticated, and
checking for that session variable each request before proceeding is not ok?

jason




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parse error: Needs T_VARIABLE or $

2001-06-30 Thread Justin Farnsworth

You are trying to add the output of a function call,
called twice, BTW, to a string, apparantly.  You don't
saw what $tdStr is, really, in the scope.


Jason Lustig wrote:
> 
> This is really weird. Very, very, very weird. I have the following code in a
> script:
> 
> if (!empty(trim($rowData[3])))
> {
> $tdStr.= trim($rowData[3]);
> }
> 
> Now, when I run it, I get the following error:
> 
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
> c:\server\wwwroot\contributors.php on line 70
> 
> (note: line 70 is the first liine of the code snippet above)
> 
> Now, this shouldn't be a problem. There is no problem with the parens, and I
> don't see anything wrong with the code. Can someone help me out with this?
> This is happening in another script (when I use the empty() function) and it
> is really weird...
> 
> --Jason
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




AW: [PHP] Stopping stolen / spoofed / linked sessions

2001-06-30 Thread Bill Rausch

Sebastian Stadtlich said:

>there is an option in php ini :
>
>session.referer_check =
>
>which should fit your needs
>
>not sure how to use it, but probably one of the php-developers on this
>list can assist...

I looked at this thing and can't figure out that it does very much. 
If someone makes a web page that contains a link to my site that 
contains the PHPSESSID=... then that session id will be invalid. 
However, if they just type the same string into their browser by 
hand, it is accepted?

It seems that there is no stopping session spoofing if using the URL 
method. The only work around is to expire sessions quickly or to 
require that cookies be used?


-- 
  Bill Rausch, Software Development, Unix, Mac, Windows
  Numerical Applications, Inc.  509-943-0861   [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Convert

2001-06-30 Thread Henrik Hansen

"Roman" <[EMAIL PROTECTED]> wrote:

 > Have you some program for convert Microsoft Access Database (*.mdb) to the
 > MySQL database ?

take a look at mysqlfront, mysqlfront.de, which can import data from
ODBC-datasources.

you can also convert your db to csv files and import it to mysql that way.

-- 
Henrik Hansen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Automatic backup application

2001-06-30 Thread rodrigo

Hello. I was wondering if there was a free app that will:

a) Backup my entire Mysql Database (via a dump, I guess).
b) Backup the entire directory where my pages are, preferrably to a
different location (say a remote server by FTP or Mail).

Thanks in advance.
-- 

Ivan R. Quintero E.* (507)228-3477  
Aptdo 1263 * (507)228-9105
Balboa, Ancon  * 612-1103
Republic of Panama * 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Please Help......

2001-06-30 Thread Kurth Bemis

I think that maybe when somebody subs to the list they get a 
info-email.  mostly saying "THIS IS PHP ONLY.  Not a clueless linux newbie 
list.  that's why they have LUGS."  Do any of you agree with me?  I think 
that its neededbasically saying - look at the manual first..then ask on 
the list.or your post will be ignored.

what about a php-experts mailing list.  a list for people that have php 
running know php but just need collaboration from their peers?  If the list 
maintainer is unwilling to set such a list up, I can set one up on one of 
USAExpress.net Servers

~kurth


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mail()'s not playing nicely :(

2001-06-30 Thread Robin Chen

Instead of \n try \r\n

Robin

Jamie Thompson wrote:
> 
> ok so i got
> 
> mail("[EMAIL PROTECTED]", "$message", "sms alert", "Return-Path: $email
> <$email>\nFrom: $email <$email>\nReply-To: $email <$email>\nX-Mailer: " .
> phpversion());
> 
> the email appears as from [EMAIL PROTECTED] istead of [EMAIL PROTECTED] which it
> should (and always has done previousy)
> 
> I looked at the headers and from reply-to and return path are all set ok but
> it sticks in another return path right at the top to [EMAIL PROTECTED]
> 
> wtf is going on?/
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Parse error: Needs T_VARIABLE or $

2001-06-30 Thread Jason Lustig

This is really weird. Very, very, very weird. I have the following code in a
script:

if (!empty(trim($rowData[3])))
{
$tdStr.= trim($rowData[3]);
}


Now, when I run it, I get the following error:


Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
c:\server\wwwroot\contributors.php on line 70

(note: line 70 is the first liine of the code snippet above)

Now, this shouldn't be a problem. There is no problem with the parens, and I
don't see anything wrong with the code. Can someone help me out with this?
This is happening in another script (when I use the empty() function) and it
is really weird...

--Jason


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Compiling PHP with IMAP

2001-06-30 Thread Sagar Chand

Hiall,
I am compiling php4.0.5 with imap support as a DSO
for APache. with 
./configure --with-apxs. --with-imap
And I got an error saying rfc822.h missing.
So I downloaded the latest Imap Beta 2001 tilldate
And cp'd the c-client to /usr/include
And after compiling the imapd and ipop3d
I cp'd the imapd and ipopd to /usr/sbin
and activated them thru inetd.conf (I'm on RH6.2)

Now configure --with-imap is giving a different error
like this
"cannot find imap Library, Check your imap
installation"
But the imap server is working fine.

Any suggestions ?
/Chandu


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Convert

2001-06-30 Thread Jason Murray

> Have you some program for convert Microsoft Access Database
> (*.mdb) to the MySQL database ?

http://www.google.com/

Type in "convert database access mysql".

Press "I'm feeling lucky".

You'd find the answers a lot faster than asking on a mailing list for PHP.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] $REMOTE_ADDR subnet consistency?

2001-06-30 Thread Jason Murray

> BUT I WAS WONDERING, and now here comes my question, do the first 
> two subnets of an IP address (i.e. 204.57.x.x) typically stay the 
> same, so that they could be relied upon for general authenticity? 

In practice, I would say yes.

However, theoretically, AOL may suddenly use switch your connection
to use a proxy on the other side of the country on a completely 
different B class if their proxy gets congested. And if they can
do that within a country (I'm almost sure they do, or can now), they
can do it around the world :)

So in practice yes, in theory and perhaps in practice no.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Fw: [PHP] problems with round ..

2001-06-30 Thread Gyozo Papp


- Original Message - 
From: "Clayton Dukes" <[EMAIL PROTECTED]>
To: "Gyozo Papp" <[EMAIL PROTECTED]>; "Chad Day" <[EMAIL PROTECTED]>
Sent: 2001. június 29. 20:50
Subject: Re: [PHP] problems with round ..


> Hey,
> Could one of you do me a favor and post this to the list, it doesn't seem to
> be posting my messages
> 
> 
> Thanks!
> 
> Clayton Dukes
> CCNA, CCDA, CCDP, CCNP
> Download Free Essays, Term Papers and Cisco Training from http://www.gdd.net
> 
> - Original Message -
> From: "Clayton Dukes" <[EMAIL PROTECTED]>
> To: "Clayton Dukes" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, June 29, 2001 9:43 AM
> Subject: Re: Regular Expression help
> 
> 
> > Okay, here's what I have so far:
> >
> > ---snip---
> > if ((!$email)
> >|| ($email=="")
> >|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email))
> >)
> > $stop = ""._ERRORINVEMAIL."";
> > ---snip---
> >
> > This works, but how can I add a second domain?
> > ie:
> >
> > ---snip---
> > if ((!$email)
> >|| ($email=="")
> >|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email))
> >|| (!eregi("^[_\.0-9a-z-]+@otherdomain.+[a-z]",$email))
> >)
> > $stop = ""._ERRORINVEMAIL."";
> > ---snip---
> >
> > This doesn't work. (it returns the error no matter what I enter)
> >
> > Thanks guys (and gals?)
> >
> > Clayton Dukes
> > CCNA, CCDA, CCDP, CCNP
> > Download Free Essays, Term Papers and Cisco Training from
> http://www.gdd.net
> >
> >
> > - Original Message -
> > From: "Clayton Dukes" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, June 29, 2001 9:08 AM
> > Subject: Regular Expression help
> >
> >
> > > Hi everyone,
> > >
> > > I have a new user function that checks e-mail addresses.
> > > I wish to only allow people from two different domains to register.
> > > How can I filter out all other e-mail addresses and return an error if
> > it's
> > > not from those domains.
> > >
> > > Here's what I have:
> > >
> > > if ((!$email) || ($email=="") ||
> > > (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$",$email)))
> > $stop
> > > = ""._ERRORINVEMAIL."";
> > >
> > > What this currently does is just makes sure it's a valid e-mail address.
> > > What I'd like it to do is if the user enters anything except
> @domain1.com
> > or
> > > @domain2.com it spits out the error (ERRORINVEMAIL)
> > >
> > > So (I think) It would look something like this:
> > >
> > > if ((!$email) || ($email=="") ||
> (!eregi("^[_\.0-9a-z-]+@([DdOoMmAaIiNn1]
> > ||
> > > (or statement???) [DdOoMmAaIiNn2-]+\.)+[a-z]{2,3}$",$email))) $stop =
> > > ""._ERRORINVEMAIL."";
> > >
> > >
> > > Of course, this doesn't work, but you get the point.
> > >
> > >
> > > Thanks!
> > > P.S.
> > > Thanks for the Awesome List!
> > >
> > > Clayton Dukes
> > > CCNA, CCDA, CCDP, CCNP
> > > Download Free Essays, Term Papers and Cisco Training from
> > http://www.gdd.net
> > >
> > >
> > >
> > >
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how to determine size of gz-handler output

2001-06-30 Thread Richard Lynch

>I'd like to know how small my content gets when i use
>ob_gzhandler.
>so far i tried
>$cont=ob_get_contents();
>$length=strlen($cont);
>echo "\n";
>
>but it outputs
>
>
>while apache says in its logfile:
>217.81.41.121 - - [29/Jun/2001:12:43:59 +0200] "GET / HTTP/1.1" 200 2028

[WILD GUESS ALERT!]

I'm guessing the gzip part happens "in place" as the data is being streamed
to the browser, not before you call ob_get_contents.

If so, you now have one data point.  Your 17280-character string gets turned
into 2028 (?) bytes???  To see if this is maybe a correct thesis, snag the
HTML output, and run gzip on it, and see if it's 17,280 bytes before and
2028 after.

So maybe there's no real way to know what the compressed size is...  Unless
you want to try to match up your log file entries with your ob_get_contents
measurement above.

Does gz-handler not provide any facility for measuring its performance or
anything?...  You'd think it would...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP & ImageMagick

2001-06-30 Thread Richard Lynch

> In PHP I try to run a shell command with the following source code:
>
> $fotonaam = 'convert -font arial -pointsize 20 -gravity center -fill
> white -draw "text 5,5 VERKOCHT" image.jpg image2.jpg';
> exec($fotonaam);
>
> PHP runs the program but the -draw "text 5,5 VERKOCHT" is not executed
> (there is no VERKOCHT in the image2.jpg). I tried everything but I can't
> solve the problem. Could somebody explain to me how it's possible that the
> program (convert) runs but there (seams to be) a problem with -draw "text
> 5,5 VERKOCHT". If I run the same command troughs telnet/ssh as root or
> nobody it works fine
>
> Is it something with the " and the combinative with the exec function (I
> also tried \")?
>
> Or is it because I run PHP in safe mode and the convert program tries to
run
> a external program what is not in the . path (you now, the basic safe mode
> restriction)?

Probably.  Or maybe that program/lib just isn't in PHP's PATH.  Try running
it as nobody, but set your $PATH to "" first.

Also, try using the optional parameters to http://php.net/exec so you can
get some feedback from the OS about what error is happening, if any.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ADD a user in linux using PHP

2001-06-30 Thread Charles Williams

ADD a user in linux using PHPsure, I use a small C program I wrote and set to setuid 
root.  that way I can hide it and it all works good with an exec call from php.  I 
wouldn't advise setting setuid adduser to root.  It's way too dangerous.

chuck

  - Original Message - 
  From: Bruno Freire 
  To: '[EMAIL PROTECTED]' 
  Cc: '[EMAIL PROTECTED]' 
  Sent: Thursday, June 28, 2001 4:30 PM
  Subject: [PHP] ADD a user in linux using PHP


  Hi! I'm Bruno, from brazil 

  Somebody knows how to create a new user in LINUX (not http server) using PHP? 

  Something like useradd and passwd 

  Thanks, 

  Bruno. 




Re: [PHP] Please Help......

2001-06-30 Thread Julia A. Case

This could be difficult or not even possible...  first you would need to 
add entries to the DNS zone file (and update the serial number) and then 
reload the DNS database, and this is only if you run your own DNS and not 
have your provider do it for you, like many of us do.

Then you would have to update the /etc/httpd/conf/httpd.conf file with the 
correct info for the sub-domain and then restart apache

And if you intend to have the new user upload content for the new 
sub-domain you would need to add a user and set a password, and as I 
stated in a previous message running passwd from php isn't possible as it 
requires you to enter a password, you can't supply one on the command 
line, and it needs to run as root to change the password of another user.

Julia

Quoting Man He ([EMAIL PROTECTED]):
> Hi all,
> 
>Can anybody give me a guideline or idea on how to write a PHP scriot 
> which is used to create a domain or sub-domain and a default page and a same 
> time. My OS is Red Hat Linux 6.1.
> 
>For example, in my program, when i press "activate' button, the script 
> will create me a sub-domain try.php.com and a default page index.php is 
> created for that sub-domain. Thanks for advice..
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

 PGP signature


Re: [PHP] passwd in php....

2001-06-30 Thread Julia A. Case

I don't think this is going to work, passwd requires you to input the 
passwword, not just pass it as an option on the command line.

On top of that, you have to be root to change a password other than yours.

Julia

Quoting Bruno Freire ([EMAIL PROTECTED]):
> Hi...
> 
> My name is Bruno.
> 
> Somebody Knows how to use passwd in php?
> I mean, create linux users on my httpd server using a php page.
> 
> I already try the EXEC(), but i had no sucess..
> 
> Any help will be needed
> 
> Thanks everyone

-- 
[  Julia Anne Case  ] [Ships are safe inside the harbor,   ]
[Programmer at large] [  but is that what ships are really for.]  
[   Admining Linux  ] [   To thine own self be true.   ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
  

 PGP signature


Re: [PHP] Problems upgrading APACHE/PHP/Mysql on remote server

2001-06-30 Thread teo

Hi M!
On Thu, 28 Jun 2001, M wrote:

> Complete msg subject is "what can developer do when server provider
> upgrades any of Apache/PHP/Mysql softwares to newer version and this
> causes crash on already working transactions?"
> I am posting this also into MySql discussion list.

MySQL transation are known to be unstable (discl: I've never used them,
for this stuff Postgres is the way to go).

What sais your contract w/ them? Doesn't it specify a version of the
software? If not, they are right.

Before deploying, try to reproduce the same platform on a test box,
and test on it. You'll find most of the problems. 

Also, check the changelogs of PHP releases, to see what nasty known
bug was fixed in the next revision they don't have and might relate
to your problems.

etc.

ciao

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Convert

2001-06-30 Thread teo

Hi Roman!
On Fri, 29 Jun 2001, Roman wrote:

> Have you some program for convert Microsoft Access Database (*.mdb) to the
> MySQL database ?
> 
Search on MySQL site : dbf2mysql or mssql2mysql
on windows you can move your data from Access to a MS-SQL, or to export it as
DBF.

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Auto submit form

2001-06-30 Thread David

How do I autoload a selection from a drop down menu form based on the
selection without having to click a submit button?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Week Number

2001-06-30 Thread Delbono

You can use Date_Calc class

http://www.phpinsider.com/php/code/Date_Calc/



- Original Message - 
From: "Don Read" <[EMAIL PROTECTED]>
To: "Matt "TrollBoy" Wiseman" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, June 29, 2001 10:19 PM
Subject: RE: [PHP] Week Number


> 
> On 28-Jun-01 Matt \"TrollBoy\" Wiseman wrote:
> > Does know of anyway to get PHP to return the week number?  
> > As in there are 52 weeks in a year and this is week x?
> 
> don't bet on it.
> 
> > If there is no internal feature, perhaps something built into PHPLib?
> 
> date('z') / 7;
> strftime('%U %V %W');
> 
> Regards,
> -- 
> Don Read   [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to 
>steal the neighbor's newspaper, that's the time to do it.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] makeing a post

2001-06-30 Thread Eric

Hi 
How do you make a posting is group PHP
>From Eric



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.262 / Virus Database: 132 - Release Date: 12-Jun-01


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] trying to get started in PHP

2001-06-30 Thread Eric

Hi
I Installed PHP configered as per instructions, and a simple PHP file saved
as *.HTML would not work from a PWS (personnel web server) on windows 98.

Is there a Tutorial to get started somewhere all the tutorials find is PHP
theory NOT how to get started, from a PWS or
has anybody got  a sample file I could put on a web site to try out.


>From Eric




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Creating domain and default page

2001-06-30 Thread E K L

It's understood that when creating new domain, the user has to be root. But, 
the problem is the user of script is nobody when program is running if i'm 
not mistaken. So, how to solve this kind of permission stuff?


>From: "scott [gts]" <[EMAIL PROTECTED]>
>To: "php" <[EMAIL PROTECTED]>
>Subject: RE: [PHP] Creating domain and default page
>Date: Thu, 28 Jun 2001 16:19:29 -0400
>
>1) read apache and named docs so you know what changes
>   need to be made, and where to make them
>2) update 'httpd.conf' and the domain's 'zone' file
>3) restart both 'named' and 'apache'
>4) copy an 'index.php' into the subdomain's newly created directory.
>
>there are probably better ways to do it, but that's
>how i add subdomains to my machine when i do it
>manually... it's a start
>
> > -Original Message-
> > From: E K L [mailto:[EMAIL PROTECTED]]
> > Subject: [PHP] Creating domain and default page
> >
> >
> > Hi all,
> >
> >Can anybody give me a guideline or idea on how to write a PHP scriot
> > which is used to create a domain or sub-domain and a default page and a 
>same
> > time. My OS is Red Hat Linux 6.1.
> >
> >For example, in my program, when i press "activate' button, the 
>script
> > will create me a sub-domain try.php.com and a default page index.php is
> > created for that sub-domain. Thanks for advice..
> > 
>_
> > Get Your Private, Free E-mail from MSN Hotmail at 
>http://www.hotmail.com.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Adding 1 to a whole number

2001-06-30 Thread Richard Kurth

Way is this doing this Starting with 1000 all I what to do is increse
this number by one the first time I run it it adds  1 to the number 10001
second time it 10001002
Shouldn't it just add 1 to the number 1000,1001,1002,1003













Best regards,
 Richard  
mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question on Commercial Offerings

2001-06-30 Thread teo

Hi Thomas!
On Fri, 29 Jun 2001, Thomas Deliduka wrote:

> I don't know quite how to word that subject but here's what we want to do.
> 
> We have a shopping cart softwre (like a million others out there) which
> based in windows NT with a COM+ object to guard the source code.
> 
> We mainly offer this product to our hosting customers as an add-on solution
> to their hosting.
> 
> Well, we want to migrate this to PHP/MySQL and I don't know how to protect
> the source code. My boss is suggesting to make a DSO but I really am not a C
> programmer to do all that. I want to make it all in PHP but somehow protect
> the code. Any ideas?
> 

buy the PHP Encoder from Zend.
otherwise, have a well written licence


-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how to determine size of gz-handler output

2001-06-30 Thread teo

Hi Sebastian!
On Fri, 29 Jun 2001, Sebastian Stadtlich wrote:

> Hi all
> 
> I'd like to know how small my content gets when i use 
> ob_gzhandler.
> so far i tried 
> $cont=ob_get_contents();
> $length=strlen($cont);
try using
$length = ob_get_length(); 
instead.

> echo "\n";
> 
> but it outputs 
> 

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP and Windows XP

2001-06-30 Thread David Price

Windows XP is the combination of the two lines.  

-Original Message-
From: Young C. Fan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 5:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP and Windows XP


""elias"" <[EMAIL PROTECTED]> wrote in message
9heq8k$e6$[EMAIL PROTECTED]">news:9heq8k$e6$[EMAIL PROTECTED]...
> Why not?
> if it works with WinME and PWS, I suppose it will with XP too.

I was under the impression that XP is the next in line after Win 2000, not
the 95/98/Me line.

Young






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Week Number

2001-06-30 Thread Hugh Bothwell

How about this?

$today = getdate();
$week = (int) ($today["yday"] / 7);

Note: I'm not sure whether $today["yday"] begins with 0 or 1.

""Matt "TrollBoy" Wiseman"" <[EMAIL PROTECTED]> wrote in message
009801c10009$2a68c720$[EMAIL PROTECTED]">news:009801c10009$2a68c720$[EMAIL PROTECTED]...
> Does know of anyway to get PHP to return the week number?
> As in there are 52 weeks in a year and this is week x?
> If there is no internal feature, perhaps something built into PHPLib?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] extract data from html

2001-06-30 Thread Hugh Bothwell

> > > 1. Open the html file in read only mode
> > > 2. Start reading the html file till I encounter a  tag (I don't
know
> > > how to do this)
> > > 3. Grab that data after the  tag (and then what?)
> >
> > See  and
> >  plus the chapter for
> > whatever DBMS you want to drop the file contents into.
>
> Thanks.  One thing just reading the manual without the idea of how the
> function works is of no use.  Some examples would help.  In fact I did use
> fopen, fgets, fgetss but the problems is that the html tag that I am
> looking is .  Now this is easy but if  or  colspan="7"> would give a problem.

(grimace) The PHP manual is actually very well written; I can usually find
exactly what I need in < 10s.  I think your complaint just covers sloppy
thinking.

I'd think you should be able to find screen-scraper code around; if not, try
this:

- search for ''.  Save (this character position + 1).
- search for the first trailing ''.  Again, case-insensitive!
- store everything between the two; strip all HTML tags, add slashes, and
store it.
- increment your file position by 5 characters and repeat.

I'd give you actual code, but I think you could use some manual practice
(smirk).



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Function No Longer works

2001-06-30 Thread Hugh Bothwell

Look for 'allow_url_fopen' in your config file.

""Black S."" <[EMAIL PROTECTED]> wrote in message
9hi6hi$2s9$[EMAIL PROTECTED]">news:9hi6hi$2s9$[EMAIL PROTECTED]...
> I have found the problem with my previous post and PHP functions no longer
> working. It seems the code:
>
> include("http://www.domain.com/path/to/file.txt";);
>
> no longer works? If I type in a complete directory path then it works
great,
> but no Internet include, any one know why?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how to flip an image using GD?

2001-06-30 Thread Hugh Bothwell

I don't see any function for this in GD; it looks like you'll have to either
find a third-party library or do it pixel-by-pixel, something like



(obviously, a library would be faster, but would essentially do the same
thing).

""Noah Spitzer-Williams"" <[EMAIL PROTECTED]> wrote in message
9hi9v6$hn$[EMAIL PROTECTED]">news:9hi9v6$hn$[EMAIL PROTECTED]...
> how would i flip an image horizontally using the GD library in PHP?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] win 98 + php4 + pws4

2001-06-30 Thread Hugh Bothwell

I really suggest you get rid of PWS and install Apache, which is a much
better server all 'round.

"cmoehle" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Mein system win98se php4 pws4

ich habe den pws4 installiert und die auf den Seiten beschriebenen
Einstellungen durchgeführt.
Jedoch funktioniert bei mir kein Test mit der erstellten phptest.php
datei.

Wie muss bei pws4 + php4 die php.ini konfiguriert werden und wie die
registry und wo muss ich meine php-skripts ablegen damit sie laufen.

Die FAQ gibt nur die Konfig für php3 + pws3 wieder


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] newbie help!

2001-06-30 Thread Hugh Bothwell

> I wrote a script to display all file in a directory. Here is my script
(snip)
> This is working fine. But it displays all files in 1 single page. Here is
> what i wanna do, but i don't know how to do it.
> I wanna display 15 files names at once, and have prev. and next buttons
and
> the end, when i click on next, it will display the next 15 files.

If you have to do it all in PHP, I would pass a start-file index to the
page; something like this:

 0 );// should 'prev' be active?
$next = false;// should 'next' be
active?
$ignore = array(".", "..");// files to skip
$i = 0;
while ($fname = readdir($dir)) {
if (in_array($fname, $ignore))
continue;

if ($i >= $ind) {
if ($i < $ind + 15) {
echo "\n  $fname";
}
else {
$next = true;// more files; make 'next'
active
break;
}
}
$i++;
}
closedir($dir);

$prev_pre = ( $prev ? '' : '' );
$prev_post = ( $prev ? '' : '' );
$next_pre = ( $next ? '' : '' );
$next_post = ( $next ? '' : '' );
echo "\n$prev_pre <>
$next_post";
?>

This will skip '.' and '..' without counting them, will enable/disable the
'prev' and 'next' links as needed, will ignore all files past $ind+16 (it
has to read one past the end to know if 'next' should be enabled), and will
automatically stop when it runs out of files.  It will work for all
browsers, at a cost of increased server load.

Personally, I would consider writing all the filenames into a JavaScript
array, and do the paging on the client.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >