php-general Digest 13 Jan 2001 14:02:18 -0000 Issue 452

Topics (messages 34331 through 34359):

Re: Dir Help PLEASE
        34331 by: nospam

Re: mixing HTML and PHP code
        34332 by: Tim Zickus
        34334 by: Tim Zickus
        34336 by: Alexander Wagner
        34338 by: Alexander Wagner
        34342 by: Tim Zickus
        34345 by: Cal Evans
        34346 by: Jade Ohlhauser

APC bugfix release 1.0.2
        34333 by: Daniel Cowgill

Re: regex
        34335 by: Cynic
        34341 by: Cynic

session cookie authentication
        34337 by: Gabe Anzelini

Re: where does "MAKE INSTALL" put PHP things?
        34339 by: Richard Lynch

Re: Problem with Exec()
        34340 by: Richard Lynch
        34343 by: Sterling Hughes

backdoor in InterBase
        34344 by: Cynic

session_start() doesn't reset session.cookie_lifetime?
        34347 by: Chris Carbaugh

ereg works in .php, not in .inc
        34348 by: Ted Goranson

Problem building php 3.0.18
        34349 by: Michael A. Peters

Months...Problem..
        34350 by: Dhaval Desai
        34351 by: Hrishi
        34352 by: Hrishi

Comparing Memory Variables
        34353 by: RealGM Webmaster
        34354 by: Rasmus Lerdorf

Refreshing Window
        34355 by: Mark Lo

Put data in a odbc connect
        34356 by: Diego Pérez Rández

TRY AGAIN mysql php4.04 and  safe_mode
        34357 by: andreas \(.work\)

Mandrake 7.2 and ImageTTfText
        34358 by: Gabriele Fain

Send Authorization: base64 Header
        34359 by: Marcio Ghiraldelli

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


<?

$value = substr($HTTP_HOST,0,strpos($HTTP_HOST,"."));

if ($value == "sub") { include("sub/index.php"); }
if ($value == "blabla") { include("blabla/index.php"); }
if ($value == "andsoon") { include("andsoon/index.php"); }

print "and so on .. there are more options for this";
print "remember that dns must set on * for www ..";

?>

--
If it can be dreamt, it can be build

"Chris" <[EMAIL PROTECTED]> wrote in message
001f01c07c3b$fc965840$8a1412d1@chris">news:001f01c07c3b$fc965840$8a1412d1@chris...
2 things, first how do I give something the filepath of a folder that
proceeded it?

Also, how can I set up subdomains like sub.domain.com?







> why bother with creating your own syntax?
> why not just explain some _super_basic_ php syntax to the "html dude" and
> have him do the code himself?

Cause we like it better that way. :)   Any time you're mixing code and HTML
you're asking for trouble, IMHO.  Or at least working a lot harder than you
need to be.

But it doesn't really matter...it's just great that PHP is powerful/flexible
enough to let everyone do their own thing The One True Way (tm) (for them).

- Tim
  http://www.phptemplates.org





> that's why I didn't implement one of those keyword things in binarycloud.
> ergh.

Pretty soon we're going to have to start limiting you to only mentioning
binarycloud 2 times per hour or less. :-) :-)

- Tim





Alex Black wrote:
> >> part of the point was for _PHP_ to be embedded html, in my opinion your
> >
> > It was created that way. It still is possible. Is can be quite handy,
> > sometimes (or often, depends on what you do). That doesn't mean you have
> > to use it.
>
> I'm not implying that there are rules etched in stone somewhere, but I am
> trying to prove a point, because I see many people making the "echo"
> mistake, which makes their otherwise great code much less useful.

I have to admit that I generally prefer echo because it doesn't break the 
indentation of the PHP-code, and, uhm, I just don't like your way. It seems 
to be the other way around with you. EOT?
BTW, this doesn't mean I _like_ echo.

> > Code that uses templates tends to be very reusable, at least it is VERY
> > easy to change the design.
> > And if the design is done by a designer who doesn't know PHP, it may also
> > be done faster.
>
> The code I have to maintain (single-handedly when it comes to html) for
> even very large stuff inside of binarycloud is pretty simple.

Seems like we just have different needs here.

> Maybe if you have a badang-crap html editor :) Try using emacs, BBEdit,
> HomeSite, or any of the other quality editors out there.

lol, ever seen a designer using emacs?

> my system does loops with php code.
>
> it is very important to note that that code need not be embeddedin the same
> file as the markup.
>
> for example, I need a "style" for an individual record coming out of a
> database. so I make that html, put a little function "tag" around it"
>
> <? fucntion hello($stuff) { ?>
> <font color="#999999"><b><?=$stuff?></b></font>
> <? } ?>

This is extremely ugly PHP with some readable HTML embedded. Since I tend to 
find HTML ugly as well...
Never mind.

> That is an intentionally simplistic example, but you can obviously see that
> if a php coder tells the html coder "that bit of html is going to be looped
> for as many records as we get out of the database - they html coder should
> think accordingly.
>
> After all, we really aren't talking about "rocket science".

Believe me, if you don't completely seperate logic and markup, most designers 
won't be able to edit your design freely without quite a bit of learning.
I'm sure designers become more comfortable with "pure" HTML as it is found in 
templates.
Well, our code runs a few sites now, all of which have completely different 
layouts. I mean, it would't be easy for a designer to change not only the 
look but also number and position of navbars on a site with your system, 
would it? Without touching your codebase (so that all your sites run the same 
code, they would become unmaintainable otherwise).
Well, even if it wouldn't be that much of a problem, it still is easier with 
templates. As you admitted, doing it with templates is cleaner, on the HTML 
part. This can be important, if when you change layout often and have to work 
with designers.
Of course, execution times are pretty slow (or worse, depending on 
complexity).
As I said, a world of tradeoffs. Can we agree on that?

Wagner

-- 
One maniac alone can do what 20 together cannot




Alex Black wrote:
> Speaking as a not-pot-smoking mac-using only partially hippie web designer:
>
> why bother with creating your own syntax?
>
> why not just explain some _super_basic_ php syntax to the "html dude" and
> have him do the code himself?
>
> also, dreamweaver nicely ignores <? ?>

Actually, we (still) use this approach as well. But it certainly isn't as 
flexible as templates are. We (or our designers, to be exact) had more 
problems with this technique. With templates, changes on the layouts just ran 
smoother.

regards
Wagner

-- 
One maniac alone can do what 20 together cannot




> Well, even if it wouldn't be that much of a problem, it still is easier
with > templates. As you admitted, doing it with templates is cleaner, on
the HTML
> part. This can be important, if when you change layout often and have to
> work with designers.

Amen. :)  Some of the HTML folks I deal with aren't even designers...they're
just business people that read "HTML for Dummies", which is probably
adequate for what they need to maintain, but I'm not going to try to teach
them PHP and hope that they don't mess up my code in the process.

> Of course, execution times are pretty slow (or worse, depending on
> complexity).

There are things that can be done to speed things up though...cacheing files
at the page level, or even cacheing templated components at the sub-page
level where possible can overcome much of the overhead of using templates.

- Tim





HAR!  :)

cal

-----Original Message-----
From: Tim Zickus [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 6:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mixing HTML and PHP code


> that's why I didn't implement one of those keyword things in binarycloud.
> ergh.

Pretty soon we're going to have to start limiting you to only mentioning
binarycloud 2 times per hour or less. :-) :-)

- Tim


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






thanks

I haven't thought about sharing the code, but it would be easy because our
code is as abstract as possible. In fact there a few files which contain
most of the "HTML replacements" that can be used on basically any site
without modification.

I'm too busy at the moment, I think I'll package my implementation for
anyone who is interested.

BTW in general I always name functions in this sort of style:
category_specific_morespecific() meaning that ideally all my HTML
replacement functions would be named something like html_tr() and
html_head(). The reason I didn't do that was to make these functions we use
all the time shorter to type and the code easier to read.

Also a lot of my functions are flexible such as blockquote( $text = '' )
where if you specify some text it is enclosed in blockquote tags or if you
don't it just opens the tag. ex, the following are the same:

blockquote('print this text');

blockquote(); echo 'print this text'; x('blockquote');

Let me show you an example from our site, go to
http://bandwidthplace.com/speedtest.html and run a test so you get to the
results screen. (this example will only work for a few more days because we
are debuting an all new speed test, I'm really excited about it)

Anyway look at the explanations below the results box, those are printed by:

$content = (function that grabs the text from our database);
while(list($title, $text) = each($content)) {
    main_title1($title, BLUE2);
    blockquote($text);
    }

that's it.

............. Jade Ohlhauser
[website architect]........... http://bandwidthplace.com


----- Original Message -----
From: "Kulkarni, Vikram" <[EMAIL PROTECTED]>
To: "'Jade Ohlhauser'" <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 2:52 PM
Subject: RE: [PHP] mixing HTML and PHP code


> Hello Jade:
>
> I like your idea of using functions instead of HTML.  It must simplify the
> work tremendously.  Is there any place you have published these functions?
> I would love to take a look at them.  I am a newbie PHP programmer and am
> trying to learn from masters :-)
>
> Thanks,
>
> Vikram Kulkarni
>
> -----Original Message-----
> From: Jade Ohlhauser [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 11, 2001 9:41 PM
> To: PHP List
> Subject: Re: [PHP] mixing HTML and PHP code
>
>
> ****** Please Note: This message came from the INTERNET. ******
>
> > You _actually_ print() or echo() everything you want to send to the
> > browser?
>
> Absolutely. We've replaced every HTML tag we use often with PHP functions.
> We separate content, style, layout, and logic so using 100% PHP is the
best
> for us.
>
> > if you have ever worked in a fast paced production environment, where
html
> > is changed sometimes 5 times a day, digging through hundreds of lines
of:
> >
> > echo "<input type=\"text\" name=\"hello\" size=\"20\" value=\"$value\">"
> >
> > starts to make you insane.
> >
> > speaking as an html author, and a lover of php, _please_:
> >
> > <input type="text" name="hello" size="20" value="<?=$value?>">
> >
> > it makes the code useable.
>
> IMHO even better is:
> input_text('hello', 20, $value);
>
> that's how that would appear on our site. We order the parameters
logically
> and include a catch all final parameter that will add text to the HTML
tag.
>
> > echo "<html>";
> > echo "<head>";
> > echo "<title>$title</title>";
> > echo "<link rel='stylesheet' type='text/css'
> > href='resources/css/$css.css'>";
> > echo "<script src='/resources/js/base_lib.js'
> > language='javascript'></script>";
> > echo "</head>";
> > echo "<body bgcolor='#EEEEEE' text='#000000' link='#003366'
> alink='#CCCCCC'
> > vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0'
> > marginheight='0'>";
> > echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'
> > bgcolor="#000000">";
> > echo "<tr>";
> > echo "<td valign='top'><img
> src='resources/images/binarycloud/tmpl/fire.jpg'
> > alt='' width='466' height='161' border='0'></td>";
> > echo "</tr>";
> > echo "</table>";
> >
> > it introduces a whole world of unnecessary complexity.
> >
> > to prove my point:
> >
> > get one of your friends that knows html but not PHP to look at the
above,
> > then this:
> >
> > <html>
> > <head>
> > <title><?=$title?></title>
> > <link rel="stylesheet" type="text/css"
href="resources/css/<?=$css?>.css">
> > <script src="/resources/js/base_lib.js" language="javascript"></script>
> > </head>
> > <body bgcolor="#EEEEEE" text="#000000" link="#003366" alink="#CCCCCC"
> > vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0"
> > marginheight="0">
> > <table border="0" cellpadding="0" cellspacing="0" width="100%"
> > bgcolor="#000000">
> > <tr>
> > <td valign="top"><img src="resources/images/binarycloud/tmpl/fire.jpg"
> > alt="" width="466" height="161" border="0"></td>
> > </tr>
> > </table>
>
> On our site that would more like:
>
> (comments)
>
> (include files)
>
> (page specific variables)
>
> html();
>
> head($title);
> head_css('stylesheet.css');
> head_script('script.js);
> x('head');
>
> body($style)
> table(0, 0, 0, '100%', '', BLACK);
> tr('top'); td(); image('fire.jpg'); x('td'); x('tr');
> x('table');
>
> x('body');
> x('html');
>
> Well it would be a bit different because we have other logic and comments
> throughout, but you get the "jist" of it.
>
> BTW "image()" calls "img()" but adds the appropriate image directory to
the
> path. img() is a function that creates the img HTML tag along with
> automatically finding out and adding the width and height parameters. I
> can't imagine going back to manually editing those every time I change the
> image dimensions.
>
> We have many people who contribute to this site. Some of them are content
> editors with no technical expertise. Simply saying "saty away from code in
> (these) tags" is not enough. 1.they don't have the HTML know how 2. I'm
not
> risking even that much access. They don't go anywhere near an editor or FT
P
> program, they do everything through interfaces we (the tech team) builds.
>
> ............. Jade Ohlhauser
> [website architect]........... http://bandwidthplace.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]
>
>
>
****************************************************************************
*
> This message may contain privileged and confidential information. If you
> think, for any reason, that this message may have been addressed to you in
> error, you must not disseminate or copy this message, or use its content
> as the basis for taking any action. Further, we would ask you to notify
> us immediately by return e-mail, telephone or facsimile.
>
****************************************************************************
*





This version fixes at least one show-stopper bug:

* default values for class member data would cause the webserver to
abort

And there is a possible fix for the BC math library problems that some
people have reported.

APC now compiles on Solaris 8.

Due to the severity of the class-related bug fixed in this version, APC
v1.0 is now deprecated. We encourage you to download the new version
from http://apc.communityconnect.com/download.html

Thanks!

Dan





try this:

$s = file( 'mylisting.txt' );
$r = "\\1\t\\2\t\\3" ;
$p = '~^(.*)\040+(?=\d)(\d+-\d+)(?<=\d)\040+(.*)$~Ui' ;

you might want to limit the possible appearance of the phone 
numbers more strictly.

At 00:44 13.1. 2001, Jerry Lake wrote the following:
-------------------------------------------------------------- 
>Bolgrihn Michael        555-5566        142 Hillyer St  Oxford
>Bollenbach Gary V       555-5078        315 Freedom Rd  Oxford
>Bonaguidi Daniel        555-5155        N4663 10th Av   Montello
>Bonnett Agatha & John   555-5363        547 Fawn Ct     Oxford
>Bonnett Bernard & Norma 555-4360        116 E Ormsby St Oxford
>Bonnett Bob & Eleanor   555-5627        527 Fern Av     Oxford
>
>Here is a sample from the listing there are numbers in the address
>as well. 
>$NewString = ereg_replace("([[:alpha:]]+) ", "\\1".",", $test);
>that works to an extent, except that it adds the comma after
>every word that is followed by one space and not just the first occurance
>
>Jerry Lake 
>
>-----Original Message-----
>From: Cynic [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 12, 2001 3:41 PM
>To: Jerry Lake; [EMAIL PROTECTED]
>Subject: RE: [PHP] regex
>
>
>looks like you need to find all the spaces _before_ the _first_ 
>digit on the row, and _after_ the _last_ digit on the row. 
>does that fit your data? are there no other numbers than the 
>telephone ones?
>
>At 00:29 13.1. 2001, Jerry Lake wrote the following:
>-------------------------------------------------------------- 
>>I have a small phone directory
>>bust the name listings are combined
>>for example
>>Schwartz Bob & Amelia   555-1212        Oxford
>>Scirkin Bill    555-1213        Brooks
>>
>>I need to add a tab or a comma after the
>>lastname so I can have as a separate field
>>when I dump it into MySQL and there is about
>>3500 records and I'd hate to have to do it by hand
>>any ideas?
>>
>>Jerry Lake            - [EMAIL PROTECTED]
>>
>>-----Original Message-----
>>From: Cynic [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, January 12, 2001 3:25 PM
>>To: Jerry Lake; [EMAIL PROTECTED]
>>Subject: RE: [PHP] regex
>>
>>
>>depends. is the set of strings preceeding the space limited 
>>and known, or is it something like [^abc]{3,12} ?
>>
>>
>>At 00:13 13.1. 2001, Jerry Lake wrote the following:
>>-------------------------------------------------------------- 
>>>and how would I go about that?
>>>
>>>Jerry Lake
>>>
>>>-----Original Message-----
>>>From: Cynic [mailto:[EMAIL PROTECTED]]
>>>Sent: Friday, January 12, 2001 3:10 PM
>>>To: Jerry Lake; [EMAIL PROTECTED]
>>>Subject: Re: [PHP] regex
>>>
>>>
>>>yes
>>>
>>>At 23:54 12.1. 2001, Jerry Lake wrote the following:
>>>-------------------------------------------------------------- 
>>>>is it possible with regex to
>>>>change one or more text characters
>>>>followed by a space into the same
>>>>characters followed by a tab?
>>>>
>>>>Jerry Lake 
>>>>
>>>>
>>>>-- 
>>>>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]
>>>------end of quote------ 
>>>
>>>
>>>
>>>____________________________________________________________
>>>Cynic:
>>>
>>>A member of a group of ancient Greek philosophers who taught
>>>that virtue constitutes happiness and that self control is
>>>the essential part of virtue.
>>>
>>>[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]
>>------end of quote------ 
>>
>>
>>
>>____________________________________________________________
>>Cynic:
>>
>>A member of a group of ancient Greek philosophers who taught
>>that virtue constitutes happiness and that self control is
>>the essential part of virtue.
>>
>>[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]
>------end of quote------ 
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>[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]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






Oh, of course: 

$result = preg_replace( $p , $r , $s ) ;
But you have probably already figured that.

At 01:28 13.1. 2001, Cynic wrote the following:
-------------------------------------------------------------- 
>try this:
>
>$s = file( 'mylisting.txt' );
>$r = "\\1\t\\2\t\\3" ;
>$p = '~^(.*)\040+(?=\d)(\d+-\d+)(?<=\d)\040+(.*)$~Ui' ;
>
>you might want to limit the possible appearance of the phone 
>numbers more strictly.
>
>At 00:44 13.1. 2001, Jerry Lake wrote the following:
>-------------------------------------------------------------- 
>>Bolgrihn Michael        555-5566        142 Hillyer St  Oxford
>>Bollenbach Gary V       555-5078        315 Freedom Rd  Oxford
>>Bonaguidi Daniel        555-5155        N4663 10th Av   Montello
>>Bonnett Agatha & John   555-5363        547 Fawn Ct     Oxford
>>Bonnett Bernard & Norma 555-4360        116 E Ormsby St Oxford
>>Bonnett Bob & Eleanor   555-5627        527 Fern Av     Oxford
>>
>>Here is a sample from the listing there are numbers in the address
>>as well. 
>>$NewString = ereg_replace("([[:alpha:]]+) ", "\\1".",", $test);
>>that works to an extent, except that it adds the comma after
>>every word that is followed by one space and not just the first occurance
>>
>>Jerry Lake 
>>
>>-----Original Message-----
>>From: Cynic [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, January 12, 2001 3:41 PM
>>To: Jerry Lake; [EMAIL PROTECTED]
>>Subject: RE: [PHP] regex
>>
>>
>>looks like you need to find all the spaces _before_ the _first_ 
>>digit on the row, and _after_ the _last_ digit on the row. 
>>does that fit your data? are there no other numbers than the 
>>telephone ones?
>>
>>At 00:29 13.1. 2001, Jerry Lake wrote the following:
>>-------------------------------------------------------------- 
>>>I have a small phone directory
>>>bust the name listings are combined
>>>for example
>>>Schwartz Bob & Amelia   555-1212        Oxford
>>>Scirkin Bill    555-1213        Brooks
>>>
>>>I need to add a tab or a comma after the
>>>lastname so I can have as a separate field
>>>when I dump it into MySQL and there is about
>>>3500 records and I'd hate to have to do it by hand
>>>any ideas?
>>>
>>>Jerry Lake            - [EMAIL PROTECTED]
>>>
>>>-----Original Message-----
>>>From: Cynic [mailto:[EMAIL PROTECTED]]
>>>Sent: Friday, January 12, 2001 3:25 PM
>>>To: Jerry Lake; [EMAIL PROTECTED]
>>>Subject: RE: [PHP] regex
>>>
>>>
>>>depends. is the set of strings preceeding the space limited 
>>>and known, or is it something like [^abc]{3,12} ?
>>>
>>>
>>>At 00:13 13.1. 2001, Jerry Lake wrote the following:
>>>-------------------------------------------------------------- 
>>>>and how would I go about that?
>>>>
>>>>Jerry Lake
>>>>
>>>>-----Original Message-----
>>>>From: Cynic [mailto:[EMAIL PROTECTED]]
>>>>Sent: Friday, January 12, 2001 3:10 PM
>>>>To: Jerry Lake; [EMAIL PROTECTED]
>>>>Subject: Re: [PHP] regex
>>>>
>>>>
>>>>yes
>>>>
>>>>At 23:54 12.1. 2001, Jerry Lake wrote the following:
>>>>-------------------------------------------------------------- 
>>>>>is it possible with regex to
>>>>>change one or more text characters
>>>>>followed by a space into the same
>>>>>characters followed by a tab?
>>>>>
>>>>>Jerry Lake 
>>>>>
>>>>>
>>>>>-- 
>>>>>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]
>>>>------end of quote------ 
>>>>
>>>>
>>>>
>>>>____________________________________________________________
>>>>Cynic:
>>>>
>>>>A member of a group of ancient Greek philosophers who taught
>>>>that virtue constitutes happiness and that self control is
>>>>the essential part of virtue.
>>>>
>>>>[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]
>>>------end of quote------ 
>>>
>>>
>>>
>>>____________________________________________________________
>>>Cynic:
>>>
>>>A member of a group of ancient Greek philosophers who taught
>>>that virtue constitutes happiness and that self control is
>>>the essential part of virtue.
>>>
>>>[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]
>>------end of quote------ 
>>
>>
>>
>>____________________________________________________________
>>Cynic:
>>
>>A member of a group of ancient Greek philosophers who taught
>>that virtue constitutes happiness and that self control is
>>the essential part of virtue.
>>
>>[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]
>------end of quote------ 
>
>
>
>____________________________________________________________
>Cynic:
>
>A member of a group of ancient Greek philosophers who taught
>that virtue constitutes happiness and that self control is
>the essential part of virtue.
>
>[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]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]







is it possible to write a script that can screen scrape a site that uses
session cookies for authentication? the reasoning for this is so that i can
add check boxes to a list so i can reset more then one port on my isp router
at a time. thanks





It tells you as it does it...

The default is, I think, the modules directory in your apache directory for
the .so, and /usr/local/lib/ for the php.ini

You can alter it using --with-prefix or somesuch.

./configure --help | less


----- Original Message -----
From: Derek Sivers <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Thursday, January 11, 2001 8:08 PM
Subject: [PHP] where does "MAKE INSTALL" put PHP things?


> When you do a standard PHP4 "apxs" configure...
>
> ./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr/local/mysql
>
> .... where does it put files when you do a 'MAKE INSTALL' ??
>
> (Or - how would I find out?)
>
> --
>
> I have a Linux box that's having C-compiler problems.
>
> But since it's the EXACT same server/setup as another box I've already
> successfully put PHP on, I think I'll just take the binaries from the
other
> server over to this one.  If I knew where!
>
> Any help appreciated.
>
> Thanks!
>
>
>
> [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]
>





First, make sure that sendmail is something the iUSR_machinename can run --
Just because you logged in as you can run it doesn't mean that the user that
Apache/PHP is running as can run it.

Next, forget about that goofy DOS backslash thing.  Just use "/" for your
paths.

Finally, add the optional arguments to exec()
exec("d:/sendmail/sendmail.exe -t -messagefile=d:/sendmail/msg.txt",
$results, $error);
while (list(,$line) = each($results)){
    echo $line, "<BR>\n";
}
if ($error){
    echo "OS Error $error.  Usually path/permissions.<BR>\n":
}


----- Original Message -----
From: Jon Haworth <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, January 12, 2001 10:13 AM
Subject: [PHP] Problem with Exec()


> Hello list,
>
> I'm having a problem with Exec and Sendmail, on PHP-4 running under Apache
> 1.3.14 on Windows NT.
>
> When I go to a DOS prompt and enter
>
> d:\sendmail\sendmail -t -messagefile=d:\sendmail\msg.txt
>
> it works fine. When I have any of the lines
>
> exec ("d:\sendmail\sendmail.exe -t -messagefile=d:\sendmail\msg.txt");
> exec ("d:\\sendmail\\sendmail.exe -t -messagefile=d:\\sendmail\\msg.txt");
> $foo = exec ("d:\sendmail\sendmail.exe -t
> -messagefile=d:\sendmail\msg.txt");
> $foo = exec ("d:\\sendmail\\sendmail.exe -t
> -messagefile=d:\\sendmail\\msg.txt");
>
> all that happens is my PHP script times out. If I remove this line,
> everything works fine. I'm sure I'm missing something simple but I'm
*very*
> tired. Any ideas?
>
>
> Cheers
> Jon
>
>
>
> --
> 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]
>





It should also be noted that the system interaction functions (namely,
passthru(), exec(), system() and popen()) are broken/incorrectly implemented,
actually, its windows that's incorrectly implemented, but be that as it may, the
functions do not work with windows).

To the original poster:

        Use PHP's built-in mail() function instead, don't fork out to sendmail,
actually, better yet, use linux :-).

-Sterling

Richard Lynch wrote:
> 
> First, make sure that sendmail is something the iUSR_machinename can run --
> Just because you logged in as you can run it doesn't mean that the user that
> Apache/PHP is running as can run it.
> 
> Next, forget about that goofy DOS backslash thing.  Just use "/" for your
> paths.
> 
> Finally, add the optional arguments to exec()
> exec("d:/sendmail/sendmail.exe -t -messagefile=d:/sendmail/msg.txt",
> $results, $error);
> while (list(,$line) = each($results)){
>     echo $line, "<BR>\n";
> }
> if ($error){
>     echo "OS Error $error.  Usually path/permissions.<BR>\n":
> }
> 
> ----- Original Message -----
> From: Jon Haworth <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Sent: Friday, January 12, 2001 10:13 AM
> Subject: [PHP] Problem with Exec()
> 
> > Hello list,
> >
> > I'm having a problem with Exec and Sendmail, on PHP-4 running under Apache
> > 1.3.14 on Windows NT.
> >
> > When I go to a DOS prompt and enter
> >
> > d:\sendmail\sendmail -t -messagefile=d:\sendmail\msg.txt
> >
> > it works fine. When I have any of the lines
> >
> > exec ("d:\sendmail\sendmail.exe -t -messagefile=d:\sendmail\msg.txt");
> > exec ("d:\\sendmail\\sendmail.exe -t -messagefile=d:\\sendmail\\msg.txt");
> > $foo = exec ("d:\sendmail\sendmail.exe -t
> > -messagefile=d:\sendmail\msg.txt");
> > $foo = exec ("d:\\sendmail\\sendmail.exe -t
> > -messagefile=d:\\sendmail\\msg.txt");
> >
> > all that happens is my PHP script times out. If I remove this line,
> > everything works fine. I'm sure I'm missing something simple but I'm
> *very*
> > tired. Any ideas?
> >
> >
> > Cheers
> > Jon
> >
> >
> >
> > --
> > 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]




* Borland Interbase Server Contains Backdoor Account 
http://www.windowsitsecurity.com/articles/index.cfm?articleID=16566

fixes for Windows, Linux, Solaris, HP-UX and SCO available at
http://www.borland.com/interbase/downloads/patches.html



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]







Let's say session.cookie_lifetime = 30; this of course kills the session
30 seconds after it was created.  

Is there a way to have every session_start() 'renew' the life of the
clients cookie?

Meaning the session would expire 30 seconds after the LAST
session_start() call.

My goal is to have my sessions expire after 5 minutes of inactivity.

Also, will PHP clean up the session files on it's own?  

Thanks,

Chris

-- 
"What's the Constitution between friends?"  - TIMOTHY J. CAMPBELL -
Response to President Cleveland, who refused to support a bill because
it was unconstitutional





Friends--

I have a script that processes another script for display. I change 
all variables named similar to "$Help1x1" to Help:

The following line accomplishes this readily when used in a .php 
suffixed script when called directly from browser.

$content = ereg_replace ("[\$]Help[0-9]x[a-z]? =", 
"<STRONG>Help:</STRONG>", $content);

However, if I instead call a .php script that includes an .inc with 
this command, it doesn't work. If important, the entire script is 
below.  Sometimes, the last two str_replace lines also fail from .inc.

Is this something simple that I'm missing?

Best, Ted

<?php

$fp = fopen("/usr/local/apache/php/Level1Questions.inc", "r");
$content = fread($fp, 100000);
$content = str_replace ("//", "", $content);
$content = str_replace ("<?php", "", $content);
$content = str_replace ("?>", "", $content);
$content = str_replace ("**", "<BR><BR>", $content);
$content = str_replace ("Question:", "<STRONG>Question:</STRONG>", $content);
$content = str_replace ("Answer:", "<STRONG>Answer:</STRONG>", $content);
$content = str_replace ("Answers:", "<STRONG>Answers:</STRONG>", $content);
$content = str_replace ("@@@", "</STRONG></P>", $content);
$content = str_replace ("@@", "<P align=center><STRONG>", $content);
$content = str_replace ("++++++", "<HR>", $content);
$content = ereg_replace ("[\$]Help[0-9]x[a-z]? =", 
"<STRONG>Help:</STRONG>", $content);
$content = ereg_replace ("[\$]BigHelp[0-9]x[0-9] =", 
"<STRONG>TEXT:</STRONG>", $content);

echo "$content";

?>
_____________
Ted Goranson
Fusecap and Sirius-Beta, Virginia Beach USA
757/426-6704
[EMAIL PROTECTED]
Symmetry Conference: http://www.isis-s.unsw.edu.au




Howdy-

I'm having a slight problem when attempting to build php 3.0.18

First of all I'd like to say the rpm spec file I inherited for this is a
mess- I may clean it up (likely start from scratch...), but the spec
file I'm using isn't the issue.

mod_php builds just dandy- but I get bad linking errors when attempting
to build the calendar.so and crypt.so modules.

here's the problem:
cd dl
./setup

make 'CFLAGS=-I/usr/include/apache -I. -I../' calendar.so crypt.so
gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o
calendar/calendar.o calendar/calendar.c
gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o calendar/dow.o
calendar/dow.c
gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o
calendar/french.o calendar/french.c
gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o
calendar/gregor.o calendar/gregor.c
gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o
calendar/jewish.o calendar/jewish.c
gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o
calendar/julian.o calendar/julian.c
gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o
calendar/easter.o calendar/easter.c
ld -o calendar.so calendar/calendar.o calendar/dow.o calendar/french.o
calendar/gregor.o calendar/jewish.o calendar/julian.o calendar/easter.o
ld: warning: cannot find entry symbol _start; defaulting to 08048080
calendar/calendar.o: In function `cal_jdtogreg':
calendar/calendar.o(.text+0x29): undefined reference to `getParameters'
calendar/calendar.o(.text+0x42): undefined reference to
`convert_to_long'
yada (more errors of same)

This spec file is known to build php-3.0.16 no problem.
The spec file build 3.0.18 if I comment out the attempts to build
calendar.so and crypt.so- including all the other *so modules (mysql.so,
pgsql.so, gd.so, yada yada)

Issue happens on both glibc 2.2 (red hat 7.0) and glibc 2.1.3 (rh 6.2)
Compiler on both is gcc 2.95.3, ld on RH7 is gnu ld 2.10.90 (not sure on
rh6)

Anyone know what the issue is?

my spec file can be viewed at http://24.5.29.77/SPECS/mod_php3.spec if
anyone cares to take a look. (NOTE- in that spec file, I currently have
the problem areas commented out so it would build.)
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer




Hiee!


I am having a problem with months...count in a mysql
database..

See what I want is 

1st column  will have the current date..
2nd column will add 7 to the current date and store
it.


This will be for all the 12 months..
So I want the things to happen automatically..I mean
one script which will check the months and
automatically show output in html page where one
columns as :
Date when entry was made.


Second Column
Date when it expires = [Date when entry was made + 7]

I really got confused..with this one..Coz When I get
current date for the month of January as 30, the
expire date becomes... 37.
LOL [not logical,,perhaps bad programming on my part];



Help me out please..


Thanx!
Dhaval Desai

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




try using the date_* functions in mysql

its somewhere in the manual reference section, date and time functions.
-------------------------------------------
Yeah, there are more important things in life than money, but they won't go
out with you if you don't have any.
----- Original Message -----
From: "Dhaval Desai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 13, 2001 12:41 PM
Subject: [PHP] Months...Problem..


> Hiee!
>
>
> I am having a problem with months...count in a mysql
> database..
>
> See what I want is
>
> 1st column  will have the current date..
> 2nd column will add 7 to the current date and store
> it.
>
>
> This will be for all the 12 months..
> So I want the things to happen automatically..I mean
> one script which will check the months and
> automatically show output in html page where one
> columns as :
> Date when entry was made.
>
>
> Second Column
> Date when it expires = [Date when entry was made + 7]
>
> I really got confused..with this one..Coz When I get
> current date for the month of January as 30, the
> expire date becomes... 37.
> LOL [not logical,,perhaps bad programming on my part];
>
>
>
> Help me out please..
>
>
> Thanx!
> Dhaval Desai
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with 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]
>
>





ok, here

DATE_ADD(date,INTERVAL expr type)


and here

http://www.mysql.com/doc/D/a/Date_and_time_functions.html

-------------------------------------------
Yeah, there are more important things in life than money, but they won't go
out with you if you don't have any.
----- Original Message -----
From: "Dhaval Desai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 13, 2001 12:41 PM
Subject: [PHP] Months...Problem..


> Hiee!
>
>
> I am having a problem with months...count in a mysql
> database..
>
> See what I want is
>
> 1st column  will have the current date..
> 2nd column will add 7 to the current date and store
> it.
>
>
> This will be for all the 12 months..
> So I want the things to happen automatically..I mean
> one script which will check the months and
> automatically show output in html page where one
> columns as :
> Date when entry was made.
>
>
> Second Column
> Date when it expires = [Date when entry was made + 7]
>
> I really got confused..with this one..Coz When I get
> current date for the month of January as 30, the
> expire date becomes... 37.
> LOL [not logical,,perhaps bad programming on my part];
>
>
>
> Help me out please..
>
>
> Thanx!
> Dhaval Desai
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with 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]
>
>





Hi Everyone,

I am having a little trouble getting a memory variable and a session variable to 
compare correctly

I have an if statement as below:

if ($id=='{$SESSION["id"]}') {
    echo "working";
}

ID is a memory variable that is equal to five, and the session variable id is also 
equal to five.

When I do through the check again $id is set to be the characters {$SESSION["id"]} 
rather than the five that it was previously assigned to.

Basically what it is doing is assigning the characters proceeding the = sign to the 
variable $id rather than doing the comparison.

Does anyone know how I can get around this.  I tried two = signs and the working 
message does not display, but one = sign displays the message but does it also changes 
the value of $id.

Has anyone got any idea how I can get around this problem?

Thanks,
Michael.






On Sat, 13 Jan 2001, RealGM Webmaster wrote:

> Hi Everyone,
>
> I am having a little trouble getting a memory variable and a session variable to 
>compare correctly
>
> I have an if statement as below:
>
> if ($id=='{$SESSION["id"]}') {

if($id == $SESSION['id']) {

-Rasmus





Hi,

     I would like to know the method to refresh one window when closing
another windows.

Thank you

Mark Lo






    Hi to all:

    I want to put data in a database that i access by a odbc connect. I
can obtain data of the odbc connect, but i can't put data in it.

    How i can do it?.

    Thanks.

    Best Regards,

                                        Diego





hi list,

sorry, but we cant manage

a Load Data Infile


cause we always get:
Can't get stat of '/tmp/phpNNAQSM' (Errcode: 2)

OUR Code is working fine in different project where safe_mode = OFF



=============================

heres the line where we try to move the file to a webfolder in our directory

move_uploaded_file ($textfile, "/home/sites/site2/web/Tango/tmp/mySql.txt");
chmod("/home/sites/site2/web/Hafele/tmp/mySql.txt", 0644);

=============================



any ideas for us ?



is there a way that we can set the upload_tmp_dir  path in a .htaccess file
?


its also not working if we edit php.ini

upload_tmp_dir = .




thank you



andreas



















Hello,
I have installed an mandrake 7.2 with apache.
I write a simple script in PHP that use the ImageTTFtext function.
With the normal libphp4.so it tell me that not found the function.
So i recompile the PHP with the gd support but I receive a segmentation
fault when I run the script.
I try with php 4.0.3pl1 and 4.0.4.
Did Someone can help me ?

This are che configure options that I use to rebuild the php.
./configure --with-apxs=/usr/sbin/apxs --with-gd --with-ttf --enable-ftp
--enable-dbase --without-mysql --without-pgsql
--with-config-file-path=/etc/httpd/conf

Thanks.
--
Gabriele Fain

Fineware snc - Vendita computer, produzione software e Hardware
EMail: mailto:[EMAIL PROTECTED]  http://www.fineware.it
Via Matteotti, 66 - 34071 Cormons (GO).
TEL +39-0481-630810        FAX: +39-0481-630132






    Hello!
    I am workingn with a compiled software, but I need to integrate it
with a PHP code.
    I need to send an Authorization: user/pass header to the software
listening a HTTP/1.0 protocol. I already know that the user/pass must be
base64 encoded, but how's the sintax? user/pass, user:pass?
    Anybody knows it?
    Thanks in advance,
    Marcio



Reply via email to