php-general Digest 26 Mar 2004 17:09:53 -0000 Issue 2669

Topics (messages 181542 through 181565):

Re: Methods for creating HTML with PHP
        181542 by: electroteque

Imap functions (imap_fetchstructure)
        181543 by: Daryl Meese

Re: an if statement
        181544 by: David Robley

Re: Local sysadmin DFW needed
        181545 by: David Robley
        181551 by: Roger Spears

Re: PHP and GD
        181546 by: Patrik Fomin

Re: Header Redirect & POST
        181547 by: Ford, Mike               [LSS]

Re: $_POST not working with str_replace
        181548 by: Ford, Mike               [LSS]

curl problem
        181549 by: Hodicska Gergely

Re: question about M. Lemos's HTML forms generation and validation
        181550 by: dr. zoidberg

Re: Ereg problems
        181552 by: Jeff McKeon

PHP 4.3.5 Released
        181553 by: Ilia Alshanetsky

problem with archives zip
        181554 by: German

saving as .XLS
        181555 by: jon
        181557 by: Daniel Purdy
        181565 by: Justin Patrin

sprintf troubles
        181556 by: Chris Thomas

Connection with MS-SQL
        181558 by: edwardspl.ita.org.mo

Can't to insert data ( via variable ) into MS-SQL
        181559 by: edwardspl.ita.org.mo

check for special characters...
        181560 by: Chris Mach
        181564 by: John W. Holmes

multi-dim array from text file
        181561 by: Larry Pisani

Apache 2 w/ PHP database sessions
        181562 by: Christopher Ditty
        181563 by: Chris Shiflett

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]


----------------------------------------------------------------------
--- Begin Message ---
I'm using this one with no problems, its actually quite fast

http://pukomuko.esu.lt/phemplate/

there is a benchmark against smarty aswell, i was actually thinking of going
the smarty path as so many php apps use it, what is the better of them ,
anyone using this class ?

> -----Original Message-----
> From: Justin French [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 26, 2004 2:11 PM
> To: Resell Domain Names
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Re: Methods for creating HTML with PHP
>
>
> On Friday, March 26, 2004, at 04:47  AM, Resell Domain Names wrote:
>
> > Why not use Smarty or another template engine? (http://smarty.php.net/)
>
> Smarty has a lot of overhead.  PHP is a perfectly good templating
> engine all by itself.
>
> What the OP may or may not have understood is that PHP and HTML can be
> mixed together:
>
> ---
> <html>
>       <body>
>       <div id='content'>
>               <?=$content?>
>       </div>
>       </body>
> </html>
> ---
>
> As for Smarty, well, anything it can do, PHP can do better and faster,
> without the overhead :)
>
> ---
> <table>
> {section name=mysec loop=$name}
> {strip}
>     <tr>
>        <td>{$name[mysec]}</td>
>     </tr>
> {/strip}
> {/section}
> </table>
> ---
>
> Could just as easily be:
>
> ---
> <table>
>       <? foreach($names as $n) { ?>
>               <tr>
>                       <td><?=$n?></td>
>               </tr>
>       <? } ?>
> </table>
> ---
>
> Alternating table row colours?  I just slapped this together in about 1
> minute -- I'm sure with a little more work (or a class), I could keep
> it all out of the global name space too!
>
> ---
> <?
> function alternator($val1,$val2,$name='alternator')
>       {
>       // initialise or increment the global counter
>       // called ${$name}_counter
>       if(!isset($GLOBALS["{$name}_counter"]))
>               { $GLOBALS["{$name}_counter"] = 1; }
>       else
>               { $GLOBALS["{$name}_counter"]++; }
>
>       // set ${name} in the global space to either
>       // $val1 or $val2, depending on the odd/even
>       // state of the counter
>       if(is_int($GLOBALS["{$name}_counter"] / 2))
>               { $GLOBALS[$name] = $val1; }
>       else
>               { $GLOBALS[$name] = $val2; }
>       }
> $names = array('Fred','Jane','Bob','Kate','Hank','Nicole');
> ?>
>
> <table>
>       <? foreach($names as $n) : ?>
>       <? alternator('#ccc','#eee',"bgcolor") ?>
>               <tr bgcolor='<?=$bgcolor?>'>
>                       <td><?=$n?></td>
>               </tr>
>       <? endforeach; ?>
> </table>
>
>
> And when you hit a wall in Smarty, you can't do much other than request
> a new feature... in PHP, just code it!  You also don't have to learn
> YET ANOTHER syntax/language, you don't have to compile templates
>
> Smarty's forte (and it's downfall) is that it limits what you can do.
> On one hand, you're not letting untrusted on unskilled template
> designers loose with the full features of PHP, but on the other hand,
> when a skilled template designer with PHP experience hits a
> "limitation" as to what Smarty is capable of, they're stuck... whereas
> PHP-based templates are only limited by the skills of the programmer
> and PHP itself.
>
>
> If your "template designer" is in fact a reasonably skilled and trusted
> PHP programmer, then Smarty is *overkill* and *very limiting*.  If your
> "template designer" only knows HTML, then perhaps the full power of PHP
> is a little unsafe -- which is where Smarty wins.
>
> Eeek -- sorry for the long post and for straying off topic, but I think
> Smarty is used in situation where PHP and some well-built functions
> will do just fine.
>
>
> ---
> Justin French
> http://indent.com.au
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Ok, here it goes

When I began developing in PHP a call to the imap_fetchstructure function on
an email with attachments created a 'parts' array that was indexed
numerically.  Meaning I could say:

if (count($message->parts) > 0)
   for ($x = 0; $x < count($message_parts); $x++)
      // do some processing

Then I upgraded PHP.  I'm not sure which upgrade changed it's workings but
it definately changed by 4.3.4.

Now, from what I understand the parts array is indexed with things like 0,
0.1, 0.1.1, 0.2.  Worse yet, the count($message->parts) call doesn't even
seem to return accurate information.  In particular it behaves as though a
parts array exists on messages without attachments.

Enough background,  is this new code "broken" or is this the way it should
have behaved the whole time?

If it is not-broken or has not been fixed:

1. How can I get an accurate count of the parts array, determine if
attachments are present, and determine what the valid array indexes are?

2. Do you know of any email classes/applications that work with these
changes?

TIA,

Daryl Meese

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (Andy B) wrote in
news:[EMAIL PROTECTED]: 

>> although that'll generally "work", why not use
>>
>> if(empty($name) || empty($comments))
>> { dosomething(); }
>>
>> -- 
>> ---John Holmes...
> 
> 
> because for some odd reason on any of the versions of php i am writing
> for (4.0.6-4.1.3) it always fails
> 

Are $name and $comment being passed from a form? In which case you may need 
to use $_GET or $_POST

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (Frank Tudor) wrote in
news:[EMAIL PROTECTED]: 

> Hi folks,
> 
> Sorry for the inturruption.
> 
> I'm looking for a part time sysadmin in the DFW area.
> 

Just out of curiosity, where the hell is DFW? I gather it's not near 
Ridgehaven.

--- End Message ---
--- Begin Message --- David Robley wrote:
[EMAIL PROTECTED] (Frank Tudor) wrote in
news:[EMAIL PROTECTED]:



Hi folks,

Sorry for the inturruption.

I'm looking for a part time sysadmin in the DFW area.



Just out of curiosity, where the hell is DFW? I gather it's not near Ridgehaven.

I'm going to guess DFW is just south of BFE
--- End Message ---
--- Begin Message ---
After uploading the picture, so the program should first upload the picture,
then
open it, cut it in like 6 pieces and save all the pieces and remove the
original uploaded file.

regards
patrick
"- Edwin -" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hi,
>
> On Thu, 25 Mar 2004 02:03:26 +0100
> [EMAIL PROTECTED] (Patrik Fomin) wrote:
>
> > Hi,
> >
> > Is there anyway to split a picture with PHP (GD) ?
> >
> > Im uploading lots of pictures and i want to split them in 6
> > pieces to make em load faster, is there anyway to do this in
> > PHP ?
>
> You mean, split them using PHP? *Before* uploading? Then, no.
> (Unless of course you have PHP installed on the client then there
> must be a way...)
>
> --
>
> - E -

--- End Message ---
--- Begin Message ---
On 25 March 2004 20:17, Chris Thomas wrote:

> I am not sure if this was designed like this, or if its just
> something im doing wrong.
> 
> Im posting some data to a processing page, where i handle it then use
> Header('Location: other.php') to direct me to another page.
> 
> The problem that im running into is that the posted data is available
> in other.php.
> I would like to get it so that in other.php $_POST  should be
> an empty array

At a guess, you're using Apache and it's doing an "internal redirect" because you've 
used a relative pathname (so the file must be in the same document root!); in this 
case, Apache just does a silent internal substitution of the redirect page, and all 
data associated with the context will remain intact -- there is no round-trip back to 
your browser.

If you use an absolute URL in the Location: header, Apache will return the redirect to 
your browser -- and because your browser now knows it's a genuine new request, the 
POST data is not resent.

The trick is to look at the URL appearing in your browser's address bar -- if it stays 
as the originally requested address, Apache did an internal redirect; if it changes to 
the redirect address, it was an external redirect which round-tripped to your browser.

Cheers!

Mike

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

--- End Message ---
--- Begin Message ---
On 24 March 2004 22:28, PHP Email List wrote:

> And ? #2 are there any settings within PHP that would limit
> my ability to
> visually display the contents of a POST variable on a .rtf document as
> opposed to being displayed on the browser?

Yes -- take a look at the variables_order directive 
(http://uk.php.net/manual/en/configuration.directives.php#ini.variables-order) -- it's 
not immediately clear from its description that this is a relevant setting, but on the 
"Predefined variables" page 
(http://uk.php.net/manual/en/language.variables.predefined.php), the last sentence in 
the first section (just above the "PHP Superglobals" heading) says:

   "If certain variables in variables_order are not set, their appropriate PHP 
predefined arrays are also left empty."

It's clear from this that if your variables_order setting does not include "P", the 
$_POST array will not be populated in your scripts.

HTH

Cheers!

Mike

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

--- End Message ---
--- Begin Message ---
Hi!

I try to compile PHP 4.3.4 with curl support on Debian Woody 3.0.
I downloaded the http://curl.haxx.se/download/curl-7.11.1.tar.bz2, and 
compiled it.
./configure was succesfull.
But make generate an error:
usr/src/install/php-4.3.4/ext/curl/curl.c: In function `curl_free_post':
/usr/src/install/php-4.3.4/ext/curl/curl.c:563: warning: passing arg 1 of 
`curl_formfree' from incompatible pointer type
/usr/src/install/php-4.3.4/ext/curl/curl.c: In function `alloc_curl_handle':
/usr/src/install/php-4.3.4/ext/curl/curl.c:603: sizeof applied to an 
incomplete type
/usr/src/install/php-4.3.4/ext/curl/curl.c: In function `zif_curl_setopt':
/usr/src/install/php-4.3.4/ext/curl/curl.c:838: duplicate case value
/usr/src/install/php-4.3.4/ext/curl/curl.c:695: this is the first entry for 
that value
/usr/src/install/php-4.3.4/ext/curl/curl.c:883: warning: passing arg 1 of 
`curl_formadd' from incompatible pointer type
/usr/src/install/php-4.3.4/ext/curl/curl.c:883: warning: passing arg 2 of 
`curl_formadd' from incompatible pointer type
/usr/src/install/php-4.3.4/ext/curl/curl.c:891: warning: passing arg 1 of 
`curl_formadd' from incompatible pointer type
/usr/src/install/php-4.3.4/ext/curl/curl.c:891: warning: passing arg 2 of 
`curl_formadd' from incompatible pointer type
make: *** [ext/curl/curl.lo] Error 1

The problem is that HttpPost structure is not definied. Maybe I'm trying to 
use not the 
proper version of curl?

Thx in advance,
Felho

--- End Message ---
--- Begin Message --- Manuel Lemos wrote:
Hello,

On 03/25/2004 10:19 PM, Dr. Zoidberg wrote:

I'm creating registration service with this great form script for creating forms within Smarty.

Question is how can I validate 'username' against allready registered users in MySQL so that someone cannot register him self if there is another user with that username.


You can always use the ValidateServerFunction parameter to specify the name of a callback function that will make a database query to see if ise there any user name with the value passed to that function. If there is a record with that user name return 0 and the class will set the respective input field as invalid.

I'm trying to create that for a few hours. Can you PLS give me an example?

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Curt Zirzow [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 25, 2004 6:55 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Ereg problems
> 
> 
> On Thu, 25 Mar 2004 18:31:02 -0500, Jeff McKeon 
> <[EMAIL PROTECTED]> 
> wrote:
> 
> > Having some problems with ereg()
> >
> > [begin code]
> >
> > $string="Credit adjusted: $-1.32 to $48.68"
> >
> > ereg("([\\$(\\$-)][0-9]+\.[0-9]+)",$data[2],$found);
> >                             
> > While(list($index,$hits)=each($found))
> >     {
> >             echo "$index , $hits<br>";
> >     }
> > [end code]
> 
> you assigned $string but used $data[2]?
> 

        whoops, that was a leftover from the actual app that was parsing
a field pulled from a database query.  Forgot to correct that when I
posted.

> 
> I would suggest using pcre instead of Posix:
> 
> preg_match_all('($-?[0-9]+\.[0-9]+)', $string, $found); 
> print_r($found);
> 

That produces:

Array ( [0] => Array ( ) ) 0 , Array

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

--- End Message ---
--- Begin Message ---
PHP Development Team is proud to announce the release of PHP 4.3.5. This is
primarily a bug fix release, without any new features or additions.PHP 4.3.5
is by far the most stable release of PHP to date and it is recommended that
all users upgrade to this release whenever possible.

The major fixes include:
- Fixed INI leak between Apache virtual hosts.
- Fixed crashes inside fgetcsv() and make the function binary safe.
- Fixed compilation with early versions of GCC 3.0.
- Fixed a bug that prevented feof() from working correctly with sockets.
- Improved the matching algorithm inside the get_browser() function.
- Fixed resolving of open_basedir on Win32 systems.
- Fixed incorrect errors for non-existent directories when safe_mode is 
enabled.
- Bundled OpenSSL dlls on Win32 upgraded to 0.9.7c
- Updated bundled PostgreSQL library to version 7.4 in Windows distribution.
- Bundled PCRE library upgraded to 4.5
- Synchronized bundled GD library with GD 2.0.17
- A number of fixes for 64bit systems.

Aside from the above mentioned fixes, this release resolves over 140 various
bugs and implementational problems.

Enjoy,

PHP Development Team.

--- End Message ---
--- Begin Message ---
Hello, the problem that I have is that I need to decompress archives zip under php. 
that for this one is used libreria that is due to install it in the servant but the 
problem which I have is that I cannot install in that servant.  If somebody knows a 
way different to decompress a file please zip under php they write like doing it.  
Thank you very much

--- End Message ---
--- Begin Message ---
Hi, I am looking for some information about the way of saving the result of
my php script (html table) with .XLS (ms excel) format. Do you know where
could I get info about this?
Thanks,

--- End Message ---
--- Begin Message ---
[snip]
Hi, I am looking for some information about the way of saving the result
of my php script (html table) with .XLS (ms excel) format. Do you know
where could I get info about this? Thanks,
[/snip]

Take a look at the write excel class, there is a php version of it,
however most of the documentation is in perl
http://search.cpan.org/src/JMCNAMARA/Spreadsheet-WriteExcel-0.37/WriteEx
cel/doc/WriteExcel.html

HTH!

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

--- End Message ---
--- Begin Message --- Jon wrote:

Hi, I am looking for some information about the way of saving the result of
my php script (html table) with .XLS (ms excel) format. Do you know where
could I get info about this?
Thanks,

http://pear.php.net/package/Spreadsheet_Excel_Writer


--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
Hey,
Im trying to use sprintf to format a number and left pad it with spaces, but
it doesnt want to add the spaces
I can pad it with anyother char using   sprintf("%'_8.2f, $val)  which will
left-pad the number with underscores

Has anyone had any luck padding with spaces??
or is there a better way to do this??

Chris

--- End Message ---
--- Begin Message ---
Dear All,

Except for "--with-mssql" options ( configure command ) , which any
other options ( configure commands ) must be compiled with php also,
then the php will be good for working with MS-SQL ?

BTW, "--with-mssql" is better than "--with-sybase" ?

Thank for your help !

Edward.

--- End Message ---
--- Begin Message ---
Dear All,

There is a sample that can't to insert any data ( via variable ) in
MS-SQL :

insert.php:
<form action="save.php" method="post">
<table border="0" align=center>
<input type="text" size="20" name="name" maxlength="8" value="<? echo
$GBName ?>"><br>
Job<input type=text" size="16" name="job"><br>
Subject<input type="text" size="30" name="subject"><br>
<input type="submit" value="SubMit">
</center>
</table>
</form>

save.php:
<a href=view.php">Search data</a>
</body>
</html>
<?
$date=date('Y-m-d H:i:s');
$link = mssql_pconnect("sql","sa","1234");
mssql_select_db("phpbook",$link);
$str = " INSERT INTO staff (name,job,subject)
VALUES('$name','$job','$date','$subject',)";
mssql_query($str,$link);
?>

After insert data by using save.php, I found no any data from the
Database system ( MS-SQL ), but I sure the Database System is no problem
!

So, how can I fix this kind of problem ( Sorry, I'm not familar with php
) ?
Many thank for your help !

Edward.

--- End Message ---
--- Begin Message ---
How would I check if a variable has special characters in it like [EMAIL PROTECTED] 
etc ?

and give an error if it contains one of them.

--- End Message ---
--- Begin Message --- Chris Mach wrote:
How would I check if a variable has special characters in it like [EMAIL PROTECTED] etc ?

and give an error if it contains one of them.

if(preg_match('/[^a-z0-9]/i',$value)) { echo "special characters present!"; }

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hi,

I need to do some text file manipulation of a text file from an html
interface.  I have a file with multiple lines where each line has 2 fields
each (a mac address and an associated vlan).  Here's an example of rht text
file:

/tmp/TEST:
====================
a1b2.c3d4.e5cc VLAN3
a1b2.c3d4.e5dd VLAN4
a1b2.c3d4.e5ee IS
a1b2.c3d4.e5ff VLAN6
a1b2.c3d4.e5a1 VLAN7
a1b2.c3d4.e5b2 VLAN8
a1b2.c3d4.e5c3 Printer
a1b2.c3d4.e5d4 Guest
a1b2.c3d4.e5e5 IS
a1b2.c3d4.e5f6 VLAN6
a1b2.c3d4.e5a2 VLAN2
a1b2.c3d4.e5a3 VLAN4
====================

Being an admin and not a developer of any kind, I'm having trouble reading
in the file and being able to output specific lines and fields of a php
array.  This is what I have so far:

====================================================
<HTML>
<HEAD>
<TITLE>MAC address Listing</TITLE>
</HEAD>

<BODY>

<?php

$CnfRec=array();
$CnfRec=file("/tmp/TEST");

foreach ($CnfRec as $line) {
         $CnfRec=explode(" ",$line);


echo "LINE: ";
print_r($line);
echo "  CnfRec: ";
print_r($CnfRec);
echo "<P>";


};

?>







</BODY>
</HTML>
====================================================


What I want to eventually do is read in the "records" and fields of this
file, present it as a form, allow admins to modify the second field and
write that back to the text file (while backing up the original file).

As a reference, I handle it in a completely different way, but this is how
I'd kinds like things to look visually ( just one "submit" button would be
preferable):

==========================================================================
<HTML>
<HEAD>
<TITLE>MAC address listing</TITLE>
</HEAD>

<BODY>

<?php

echo "<table border='1' align=center>\n";

echo "<tr BGCOLOR='#99CCFF'><th width=150>MAC Address</th><th
width=150>VLAN</th></tr>";

$res = system("/bin/sort -k 1 /tmp/TEST | /bin/awk '{ print \"<tr
align='center'><td>\"$1\"</td><td><FORM METHOD=POST
ACTION='/cgi-bin/change_mac-vlan_list.sh'><SELECT NAME='VLAN'> <OPTION
SELECTED VALUE='\"$2\"'>\"$2\"</OPTION> <OPTION
VALUE='VLAN0002'>VLAN2</OPTION> <OPTION VALUE='VLAN0003'>VLAN3</OPTION>
<OPTION VALUE='VLAN0004'>VLAN4</OPTION> <OPTION VALUE='IS'>IS</OPTION>
<OPTION VALUE='VLAN0006'>VLAN6</OPTION> <OPTION
VALUE='VLAN0007'>VLAN7</OPTION> <OPTION VALUE='VLAN0008'>VLAN8</OPTION>
<OPTION VALUE='Printer_VLAN'>Printers</OPTION> <OPTION
VALUE='Guest'>Guest</OPTION></SELECT><INPUT TYPE='SUBMIT'
VALUE='Change'></FORM></td></tr>\" }' ");

?>


</BODY>
</HTML>

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

TIA,

Larry

--- End Message ---
--- Begin Message ---
I recently upgraded to apache 2.0 from 1.23.x on my server. Previously,
I had sessions working using the database to store session information.
I recently noticed that this is no longer working as it did. The
sessions are still working, however, the session information is not
being transfered via the url. I have verified that everything is setup
correctly.

I have a development server setup with the same settings before I
upgraded apache and it is working fine. The only difference is the
version of Apache.

Does anyone know of a fix for this? Did I set something up wrong? Below
is a copy of the sessions section from my php.ini file.

Thanks
Chris

ps....The settings and instructions I used were obtained from the Web
Database Applications book from O'reilly.

[Session]
 ; Handler used to store/retrieve data.
 #session.save_handler = files
 session.save_handler = user
 
 ; Argument passed to save_handler.  In the case of files, this is the
path
 ; where data files are stored. Note: Windows users have to change
this
 ; variable in order to use PHP's session functions.
 ; As of PHP 4.0.1, you can define the path as:
 ;       session.save_path = "N;/path"
 ; where N is an integer.  Instead of storing all the session files in
 ; /path, what this will do is use subdirectories N-levels deep, and
 ; store the session data in those directories.  This is useful if you
 ; or your OS have problems with lots of files in one directory, and
is
 ; a more efficient layout for servers that handle lots of sessions.
 ; NOTE 1: PHP will not create this directory structure automatically.
 ;               You can use the script in the ext/session dir for that
purpose.
 ; NOTE 2: See the section on garbage collection below if you choose
to
 ;               use subdirectories for session storage
 #session.save_path = /tmp
 session.save_path = mdas_users
 
 ; Whether to use cookies.
 #session.use_cookies = 1
 session.use_cookies = 0
 
 ; This option enables administrators to make their users invulnerable
to
 ; attacks which involve passing session ids in URLs; defaults to 0.
 ; session.use_only_cookies = 1
 
 ; Name of the session (used as cookie name).
 #session.name = PHPSESSID
 session.name = USID
 
 ; Initialize session on request startup.
 session.auto_start = 0
 
 ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
 session.cookie_lifetime = 0
 
 ; The path for which the cookie is valid.
 session.cookie_path = /
 
 ; The domain for which the cookie is valid.
 session.cookie_domain =
 
 ; Handler used to serialize data.  php is the standard serializer of
PHP.
 session.serialize_handler = php
 
 ; Define the probability that the 'garbage collection' process is
started
 ; on every session initialization.
 ; The probability is calculated by using gc_probability/gc_divisor,
 ; e.g. 1/100 means there is a 1% chance that the GC process starts
 ; on each request.
 
 session.gc_probability = 1
 session.gc_divisor      = 100
 
 ; After this number of seconds, stored data will be seen as 'garbage'
and
 ; cleaned up by the garbage collection process.
 session.gc_maxlifetime = 1440
 
 ; NOTE: If you are using the subdirectory option for storing session
files
 ;         (see session.save_path above), then garbage collection does
*not*
 ;         happen automatically.  You will need to do your own garbage
 ;         collection through a shell script, cron entry, or some other
method.
 ;         For example, the following script would is the equivalent of
 ;         setting session.gc_maxlifetime to 1440 (1440 seconds = 24
minutes):
 ;                cd /path/to/sessions; find -cmin +24 | xargs rm
 
 ; PHP 4.2 and less have an undocumented feature/bug that allows you
to
 ; to initialize a session variable in the global scope, albeit
register_globals
 ; is disabled.  PHP 4.3 and later will warn you, if this feature is
used.
 ; You can disable the feature and the warning seperately. At this
time,
 ; the warning is only displayed, if bug_compat_42 is enabled.
 
 session.bug_compat_42 = 1
 session.bug_compat_warn = 1
 
 ; Check HTTP Referer to invalidate externally stored URLs containing
ids.
 ; HTTP_REFERER has to contain this substring for the session to be
 ; considered as valid.
 session.referer_check =
 
 ; How many bytes to read from the file.
 session.entropy_length = 0
 
 ; Specified here to create the session id.
 session.entropy_file =
 
 ;session.entropy_length = 16
 
 ;session.entropy_file = /dev/urandom
 
 ; Set to {nocache,private,public,} to determine HTTP caching aspects
 ; or leave this empty to avoid sending anti-caching headers.
 session.cache_limiter = nocache
 
 ; Document expires after n minutes.
 #session.cache_expire = 180
 session.cache_expire = 60
 
 ; trans sid support is disabled by default.
 ; Use of trans sid may risk your users security.
 ; Use this option with caution.
 ; - User may send URL contains active session ID
 ;   to other person via. email/irc/etc.
 ; - URL that contains active session ID may be stored
 ;   in publically accessible computer.
 ; - User may access your site with the same session ID
 ;   always using URL stored in browser's history or bookmarks.
 session.use_trans_sid = 0
 
 ; The URL rewriter will look for URLs in a defined set of HTML tags.
 ; form/fieldset are special; if you include them here, the rewriter
will
 ; add a hidden <input> field with the info which is otherwise
appended
 ; to URLs.  If you want XHTML conformity, remove the form entry.
 ; Note that all valid entries require a "=", even if no value
follows.
 url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=,fieldset="
 
 

------------------------------------------------------------------------------
03/26/2004, 10:10:26 AM
This e-mail and any attachments represent the views and opinions of only the sender 
and are not necessarily those of Memphis Light, Gas & Water Division, and no such 
inference should be made.
==============================================================================

--- End Message ---
--- Begin Message ---
--- Christopher Ditty <[EMAIL PROTECTED]> wrote:
> I recently upgraded to apache 2.0 from 1.23.x on my server.

1.3.x you mean? :-)

> The sessions are still working, however, the session information is
> not being transfered via the url.

[snip]

>  session.use_trans_sid = 0

There's your answer. Hope that helps.

Chris

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

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

--- End Message ---

Reply via email to