php-general Digest 18 Dec 2001 10:26:41 -0000 Issue 1059

Topics (messages 78009 through 78050):

Re: mySQL INSERT question
        78009 by: Philip Hallstrom
        78018 by: Mike Krisher

Re: electronic postcard recommendation?
        78010 by: Philip Hallstrom
        78012 by: steph.philedom2k.com

Newsgroups????
        78011 by: Eddie Shipman
        78014 by: Jack Dempsey
        78016 by: Fred

TN3270 socket
        78013 by: brendan
        78017 by: Fred

Displaying html
        78015 by: Steve Osborne
        78021 by: Fred

Re: How deep can I go with embedded if s.
        78019 by: Charles Williams

Re: PHP 4.10: any way to override register_globals = OFF
        78020 by: Charles Williams
        78023 by: Jack Dempsey
        78024 by: Michael Jurgens
        78031 by: David

php dir listing
        78022 by: Jeremiah Jester
        78026 by: Bas van Rooijen

Re: telnet or ssh in PHP (Curl?)
        78025 by: Sterling Hughes

Cookie Name=Value Pairs
        78027 by: Zach Curtis
        78030 by: Bas van Rooijen

Re: Returning html code-PROB SOLVED
        78028 by: Steve Osborne
        78029 by: Kevin Stone

array in sessions
        78032 by: Gregor Jaksa
        78033 by: Nick Winfield
        78034 by: Phillip Oertel

php in free()
        78035 by: Rick
        78043 by: Niklas Lampén
        78045 by: Jan Maska
        78046 by: Andrey Hristov

Re: $PHPSESSID on PHP 4.1.0
        78036 by: Tom Rogers
        78044 by: Morten Winkler Jřrgensen
        78047 by: Andrey Hristov

Re: php dir listing a couple of solutions
        78037 by: php

Error handling
        78038 by: Yoel Benitez Fonseca

Serious Problems (Apache/PHP/Sessions)
        78039 by: lee

htaccess problems
        78040 by: Jeremiah Jester
        78041 by: Jack Dempsey

Ftp PORT problem
        78042 by: Conrad Strydom

Parse error: parse error in/test/put_file.php on line 14???
        78048 by: Alex Elderson
        78049 by: Andrey Hristov

Parsing syntax to add a HTML line break
        78050 by: steph.philedom2k.com

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 ---
Maybe I'm reading your question wrong, but what you are asking isn't
possible and more importantly doesn't make sense.

I think you're thinking of a database table as you'd think about say an
excel worksheet (in that it's ordered).   tables aren't ordered in that
way.  Think about a table as um... a pond.  And each fish in that pond is
a row (or tuple or record).  The fish can swim anywhere they want in that
pond so there is no "beginning" or "end".  However, if you've tattoed each
fish with the number indicating it's insertion into the pond (ie the first
fish into the pond got 1, the second gets 2, etc.) then when you select
your fish you can order it by those numbers.

Heh... how's that for a wacky analogy.

Depending on the physical order of rows in a database table is going to
get you into trouble down the road.

good luck!

On Mon, 17 Dec 2001, Mike Krisher wrote:

> I suppose this is more of a SQL question, but how do I insert a row into a
> table right before the very last row in the table. I am sure there is a way
> to insert a row other than just at the beginning or end of a table but I
> can't find the syntax on the mySQL site. Anyone know?
>
> » Michael Krisher
>   [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 Message ---
--- Begin Message ---
I figured out my question was a little illogical, I figured out how to get
what I needed with an insert and update statement. Thanks for those that
responded.

» Michael Krisher
  [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Check www.zend.com and php.resourceindex.com and you'll probably find
something...



On Mon, 17 Dec 2001, Brian Tully wrote:

> hi there :)
>
> i've been asked to implement an electronic postcard app for a client's
> website, and was wondering if anyone can recommend an existing
> implementation, be it open source or commercial -- preferably PHP!.
>
> I found a couple of CGI scripts that do a minimal job, but i'm not to keen
> on doing the CGI thing ever since moving over to PHP for some time now. I'd
> like to avoid the Internal Server Errors if at all possible ;).
>
> anyways, any experience and/or recommendations would be much appreciated.
>
> regards,
> brian
>
>
> --
> 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 Message ---
--- Begin Message ---
hotscripts.com should have something.

Steph

-----Original Message-----
From: LaserJetter [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 17, 2001 2:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: electronic postcard recommendation?


I've just been sending some from totl.net. I'm not sure how they do it
though and I think they've written the code themselves.



"Brian Tully" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi there :)
>
> i've been asked to implement an electronic postcard app for a client's
> website, and was wondering if anyone can recommend an existing
> implementation, be it open source or commercial -- preferably PHP!.
>
> I found a couple of CGI scripts that do a minimal job, but i'm not to keen
> on doing the CGI thing ever since moving over to PHP for some time now.
I'd
> like to avoid the Internal Server Errors if at all possible ;).
>
> anyways, any experience and/or recommendations would be much appreciated.
>
> regards,
> brian
>



--
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 Message ---
--- Begin Message ---
Just signed up for the mailing list because I couldn't 
access the newsgroups, what's going on there?



__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--- End Message ---
--- Begin Message ---
a preventative measure against spam....AFAIK you don't actually have to sign
up for the e-mail list, you just need to give an e-mail address to prove
you're not a spammer.....

jack

-----Original Message-----
From: Eddie Shipman [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 17, 2001 5:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newsgroups????


Just signed up for the mailing list because I couldn't
access the newsgroups, what's going on there?



__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.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]


--- End Message ---
--- Begin Message ---
Seems to be working fine from here.

Fred

Eddie Shipman <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Just signed up for the mailing list because I couldn't
> access the newsgroups, what's going on there?
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for all of
> your unique holiday gifts! Buy at http://shopping.yahoo.com
> or bid at http://auctions.yahoo.com


--- End Message ---
--- Begin Message ---
does anyone know of how or where I can find info on, accessing a IBM 
mainframe which uses the TN3270 protocol via a socket?
TN3270 isnt ordinary telnet so I assume the existing telnet socket info 
isnt helpful
ta
brendan

--- End Message ---
--- Begin Message ---
http://www.faqs.org/rfcs/rfc1576.html

Google Search took 0.3 seconds.

Fred

Brendan <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> does anyone know of how or where I can find info on, accessing a IBM
> mainframe which uses the TN3270 protocol via a socket?
> TN3270 isnt ordinary telnet so I assume the existing telnet socket info
> isnt helpful
> ta
> brendan
>


--- End Message ---
--- Begin Message ---
Does anyone know of an easy way to store html code in a mysql database, and
then retreive it, in such a way that it can display the page as if it were a
standard html page?  Would using php be of benefit to me?

Steve Osborne
[EMAIL PROTECTED]

<?php
/* Happy Holidays */
mysql_select_db('North_Pole');
mysql_query('SELECT reindeer FROM stable WHERE nose_color="red"');
?>*

*(borrowed from Paul)

--- End Message ---
--- Begin Message ---
It depends on how you have magic quotes set up in your php.ini file.  Mine
are set up as follows:
magic_quotes_gpc On On
magic_quotes_runtime Off Off
which I believe is the default, because I certainly never changed them.

I have never had a problem simply inserting or selecting html without the
need for using any of the escape functions.  In other words, I do it just
like I would any other data and it works well.

Fred

Steve Osborne <[EMAIL PROTECTED]> wrote in message
000f01c18753$e8d086e0$[EMAIL PROTECTED]">news:000f01c18753$e8d086e0$[EMAIL PROTECTED]...
> Does anyone know of an easy way to store html code in a mysql database,
and
> then retreive it, in such a way that it can display the page as if it were
a
> standard html page?  Would using php be of benefit to me?
>
> Steve Osborne
> [EMAIL PROTECTED]
>
> <?php
> /* Happy Holidays */
> mysql_select_db('North_Pole');
> mysql_query('SELECT reindeer FROM stable WHERE nose_color="red"');
> ?>*
>
> *(borrowed from Paul)
>


--- End Message ---
--- Begin Message ---
Mehmet,

If you can keep the scope ({and}) correct then you will have no problems.
However, it will get kinda slow after going deep enough.

chuck

----- Original Message -----
From: "Mehmet Kamil ERISEN" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 10:07 PM
Subject: [PHP] How deep can I go with embedded if s.


> Hello All,
> Is anybody aware of any limitations of php on embedded if
> ..else statements?
> For example:
>
>   if ($a>$b) {
>         if ($c>$d) {
>             this();
>            } else {
>              if ($gg==$dd) {
>                  echo 'ladooo';
>                            } else {
>                  echo 'baboooo';
>                    }
>             that();
>            }
>         if ($e<$f) {
>            tthis();
>           } else {
>            tthat();
>            }
>    else {
>     echo "Oooops";
>
>         }
>
> would this work,
>
>
> =====
> Mehmet Erisen
> http://www.erisen.com
>
> __________________________________________________
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for all of
> your unique holiday gifts! Buy at http://shopping.yahoo.com
> or bid at http://auctions.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]
>

--- End Message ---
--- Begin Message ---
Jack

$_GET is automatically global to all scopes.  No need to globalize.

chuck

----- Original Message -----
From: "Jack Dempsey" <[EMAIL PROTECTED]>
To: "Michael Jurgens" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 10:49 PM
Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF


> a quick and inelegant hack
> 4.1 includes an array that has all of the data sent to the script...(or
use
> the different ones like $_GET etc if need be) then write a globalize
function
> that extracts the vars and declares them global...then use this snippet in
an
> auto_prepend file to magically register the vars....
> there's probably a much easier way, including asking your hosting provider
to
> change one little config var...
>
> jack
>
> Michael Jurgens wrote:
>
> > Hi,
> > Now that register_globals is (or will be) OFF by default (just like
> > error_reporting) I'm facing a huge rewrite of existing code if my
hosting
> > provider decides that he wants to upgrade his php (and believe me, he
will
> > use default settings)
> >
> > Is there any way to override register_globals and error_reporing runtime
in
> > your PHP script?
> > (there is no way that I can use .htaccess to override :-((
> >
> > Any help would be much appreciated!
> >
> > --
> > 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 Message ---
--- Begin Message ---
i understand that, but if he extracts inside a function, those variables
will be in that scope.
if his auto_prepend file is simply 'extract($_GET)' then that'd be fine as
well

jack

-----Original Message-----
From: Charles Williams
[mailto:[EMAIL PROTECTED]]
Sent: Monday, December 17, 2001 5:59 PM
To: Jack Dempsey; Michael Jurgens
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF


Jack

$_GET is automatically global to all scopes.  No need to globalize.

chuck

----- Original Message -----
From: "Jack Dempsey" <[EMAIL PROTECTED]>
To: "Michael Jurgens" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 10:49 PM
Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF


> a quick and inelegant hack
> 4.1 includes an array that has all of the data sent to the script...(or
use
> the different ones like $_GET etc if need be) then write a globalize
function
> that extracts the vars and declares them global...then use this snippet in
an
> auto_prepend file to magically register the vars....
> there's probably a much easier way, including asking your hosting provider
to
> change one little config var...
>
> jack
>
> Michael Jurgens wrote:
>
> > Hi,
> > Now that register_globals is (or will be) OFF by default (just like
> > error_reporting) I'm facing a huge rewrite of existing code if my
hosting
> > provider decides that he wants to upgrade his php (and believe me, he
will
> > use default settings)
> >
> > Is there any way to override register_globals and error_reporing runtime
in
> > your PHP script?
> > (there is no way that I can use .htaccess to override :-((
> >
> > Any help would be much appreciated!
> >
> > --
> > 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 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 Message ---
--- Begin Message ---
Hey Guys,
Thanks a lot, I allways use some config files that I include in every page,
and with
"extract ($_REQUEST);" added to one of those files, almost all of my
problems are history.
I'm now working on getting $PHP_SELF etc back working, but that should work
out.

Amazing this newsgroup, thank you all,
Greetz,
Michael

"Richard Heyes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >     for all in $_GET
> >     {
> >     $[varname] = $_GET[varname]
> >     }
> >
> > Could anyone give me some pointers in actually programming this?
>
> extract($_GET);
>
> --
> Richard Heyes
> "If you have any trouble sounding condescending,
> find a Unix user to show you how it's done." - Scott Adams


--- End Message ---
--- Begin Message ---
 you can do this to get what u want:

foreach($_GET as $key => $val){
        $$key = $val;
}

this is what u want to do, right? :)
>for all in $_GET 
>{ 
>$[varname] = $_GET[varname] 
>} 
--- End Message ---
--- Begin Message ---
Anyone have a php directory listing script that creates clickable links for
all items in folder list?

JJ

--- End Message ---
--- Begin Message ---


scripts like this are widely available.

check: sourceforge.net/projects/phpfilemanager/ 

bvr.

On Mon, 17 Dec 2001 14:55:48 -0800, Jeremiah Jester wrote:

>Anyone have a php directory listing script that creates clickable links for
>all items in folder list?
>
>JJ



--- End Message ---
--- Begin Message ---
> 
> Hi Bas!
> 
> SSH is possible but complicated.
>
    Not really, just create a tunnel...

    -Sterling
--- End Message ---
--- Begin Message ---
What is the syntax to set multiple name=value pairs in a cookie?

Thanks.


Zach Curtis
POPULUS

--- End Message ---
--- Begin Message ---

I don't know!

But if you're only accesing the cookie from PHP you could use 
serialize()/unserialize() 
or *sessions*, they both work even on full objects.

bvr.


On Mon, 17 Dec 2001 16:30:28 -0700, Zach Curtis wrote:

>What is the syntax to set multiple name=value pairs in a cookie?
>
>Thanks.
>
>
>Zach Curtis
>POPULUS


--- End Message ---
--- Begin Message ---
<snip>

> Does anyone know of an easy way to store html code in a mysql database,
and
> then retreive it, in such a way that it can display the page as if it were
a
> standard html page?  Would using php be of benefit to me?
<snip>

Figured it out.  I completely forgot about two php functions that escape
problem characters in databases and unescape them when retrieved.

Problem solved.

Steve Osborne
[EMAIL PROTECTED]

<?php
/* Happy Holidays */
mysql_select_db('North_Pole');
 mysql_query('SELECT reindeer FROM stable WHERE nose_color="red"');
?>






--- End Message ---
--- Begin Message ---
Ahh.. I was about to reply but nevermind.  The two functions you're talking
about are addslashes() and stripslashes().  Yes those are very handy.  :)

> <snip>
>
> > Does anyone know of an easy way to store html code in a mysql database,
> and
> > then retreive it, in such a way that it can display the page as if it
were
> a
> > standard html page?  Would using php be of benefit to me?
> <snip>
>
> Figured it out.  I completely forgot about two php functions that escape
> problem characters in databases and unescape them when retrieved.
>
> Problem solved.
>
> Steve Osborne
> [EMAIL PROTECTED]
>
> <?php
> /* Happy Holidays */
> mysql_select_db('North_Pole');
>  mysql_query('SELECT reindeer FROM stable WHERE nose_color="red"');
> ?>
>
>
>
>
>
>
>
> --
> 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 Message ---
--- Begin Message ---
Hello,

is it possible to register array in session .. something like that:
session_register("ex_array[field1]");
session_register("ex_array[field2]");

this example of course doesnt work :), so if anyone knows a solution, plz
tell

thx


--- End Message ---
--- Begin Message ---
On Tue, 18 Dec 2001, Gregor Jaksa wrote:

> Hello,
>
> is it possible to register array in session .. something like that:
> session_register("ex_array[field1]");
> session_register("ex_array[field2]");
>
> this example of course doesnt work :), so if anyone knows a solution, plz
> tell

Why not just store the whole array, like this ::

<?php
session_start();
session_register("sports");
$sports = array("tennis", "soccer", "hockey", "basketball");
?>

Cheers,

Nick Winfield - [ http://www.pi0.org/ ]


--- End Message ---
--- Begin Message ---
Gregor Jaksa wrote:

> Hello,
> 
> is it possible to register array in session .. something like that:
> session_register("ex_array[field1]");
> session_register("ex_array[field2]");


!!!!
session_register("ex_array")

--- End Message ---
--- Begin Message ---
I'm running a script that times out durring a certian action.

Fatal error: Maximum execution time of 30 seconds exceeded in
/usr/local/web/htdocs/mail/functions.php on line 1200

The error logs say: php in free(): warning: recursive call.

The offending lines of code, and here's what really gets me, is a simple
while():

while(!feof($socket)){
     $data .= fgets($socket, 1024);
}

Which is just reading data from an SMTP socket. I haven't been able to find
any information about this php in free() error. Any ideas?

Thanks!

dan


--- End Message ---
--- Begin Message ---
Your code runs more than 30 seconds.
Try using set_time_limit(n) function.


Niklas


-----Original Message-----
From: Rick [mailto:[EMAIL PROTECTED]] 
Sent: 18. joulukuuta 2001 2:46
To: [EMAIL PROTECTED]
Subject: [PHP] php in free()


I'm running a script that times out durring a certian action.

Fatal error: Maximum execution time of 30 seconds exceeded in
/usr/local/web/htdocs/mail/functions.php on line 1200

The error logs say: php in free(): warning: recursive call.

The offending lines of code, and here's what really gets me, is a simple
while():

while(!feof($socket)){
     $data .= fgets($socket, 1024);
}

Which is just reading data from an SMTP socket. I haven't been able to
find any information about this php in free() error. Any ideas?

Thanks!

dan



-- 
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 Message ---
--- Begin Message ---
I'm not sure which way you create the connection, but I suppose that you use
FSockOpen..

This is a buggy function, as far as I know..
Zend promised to take care of it in the 4.0.4 release of PHP, but since that
nothing has changed, apparently.
I had the same problem some week ago. In the end I had to use PERL script
via PHP function exec().

And here's the bug:
After calling a socket, PHP interpreter simply keeps all data in memory,
doesn;t close connection, keeps trying to read, and finaly stucks.. which
can lead to an extreme overload on your server (tried it on Apache and IIS).


--- End Message ---
--- Begin Message ---
This is because the reading from socket is blocked_read by default. So there is 
fuinction socket_set_blocking() and also
socket_set_timeout().
I had the same problem so as workaround set_time_limit(0) but the script works for 40 
!! seconds. My aim was to get some header so I
didn't read from the socket until feof($fp) but stopped somewhere before the end of 
data and close()-ing socket after that. After
this intervention the time which the scripts uses is 4!!! seconds.


Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS

----- Original Message -----
From: "Jan Maska" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 18, 2001 11:07 AM
Subject: Re: [PHP] php in free()


> I'm not sure which way you create the connection, but I suppose that you use
> FSockOpen..
>
> This is a buggy function, as far as I know..
> Zend promised to take care of it in the 4.0.4 release of PHP, but since that
> nothing has changed, apparently.
> I had the same problem some week ago. In the end I had to use PERL script
> via PHP function exec().
>
> And here's the bug:
> After calling a socket, PHP interpreter simply keeps all data in memory,
> doesn;t close connection, keeps trying to read, and finaly stucks.. which
> can lead to an extreme overload on your server (tried it on Apache and IIS).
>
>
>
> --
> 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 Message ---
--- Begin Message ---
Hi
One way is <?echo session_id()?> or if cookies aren't used try <?=SID?>
$PHPSESSID seems to only get set if it comes back as a cookie

Tom

At 04:39 AM 18/12/01, Julio Nobrega Trabalhando wrote:
>   Hi All,
>
>   I have a few scripts using $PHPSESSID to softly disable cookies
>requirement on some pages. I just installed PHP 4.1.0 and I am porting some
>lines to adapt to the new version.
>
>   If I do this:
>
><?php
>echo $PHPSESSID;
>?>
>
>    It doesn't show nothing at all. Did something changed, does this var now
>have a new name, some new way to access it?
>
>   Thanks for any help,
>
>--
>
>Julio Nobrega.
>
>Um dia eu chego lá:
>http://sourceforge.net/projects/toca
>
>
>
>--
>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 Message ---
--- Begin Message ---

JNT>   If I do this:

JNT> <?php
JNT> echo $PHPSESSID;

I've encountered the same when instaling the Mandrake Linux 8.1 with a
precompiled php - also 4.1.0.

Sessions just doesn't seem to work no matter how I access them.
I installed Redhat 7.1 on my server again, and left the problem for my
ISP.

Kind regards,
    Morten Winkler


--- End Message ---
--- Begin Message ---
First 
<?php
  var_dump($PHPSESSID);
  var_dump(phpversion());
?>
NULL
string(5) "4.0.4"

So I think that the problem is that you haven't started any session. Before session 
starting PHPSESSID is NULL. That is my opinion.
PHPSESSID by default is get as GET parameter. Do you have any GET parameter when 
starting on a console?


Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS



--- End Message ---
--- Begin Message ---
Hello Jeremiah,

There is a variety of options to list files in a directory.
This will list sort files by date.

<?

$dir = opendir(".");
while($file=readdir($dir)){
if(!eregi("^(.|..)$",$file)){
$time = filemtime($file);
$data[$time] = "<a
href=\"{server}/$file\">$file</a><br/>".date( "F d
Y H:i:s",$time)."
";
}
}
krsort($data);
while(list($key,$val) = each($data)){
echo $val;
}

?>

This one gets a tag out of a document
<?
        $dir = opendir(".");
        while($f = readdir($dir))
        {
                if(eregi(".html$", $f)){

                        $file = join("", file($f));

                         $date=date("m/d/y ", filemtime($f));

                        eregi("<title>(.*)</title>", $file, $title_array);

                        $fd="$date<a href='$sd'>$title_array[1]</a><br\>";
                        echo $fd;



                }

        }

        ?>

        The actual script is very small- this is the basic snippet
        from the manual  for readdir.
        
<?php
$handle = opendir('.'); 
while (false !== ($file = readdir($handle))) { 
    if ($file != "." && $file != "..") { 
        echo "$file\n"; 
    } 
}
closedir($handle); 
?>


Hope this helps.
I am just starting out in this- anybody know how to combine a list by
date with the parser, so that a script will display titles of html
files sorted by latest document first? i can't seem to get the two
arrays to work together,silly as it sounds. Someone help!

        
Thank's to Dina for sharing this with me- and she says it ways guys on
the #php irc channel that helped her out...

There are some sample scripts in the php manual and the comments in
the online documentation.
Sorry guys, i keep these snippets in one file, so i don't know who
wrote what. Don't get all upset now, it's not like i am using this for
my benefit ;0

Monday, December 17, 2001, 5:55:48 PM, you wrote:

JJ> Anyone have a php directory listing script that creates clickable links for
JJ> all items in folder list?

JJ> JJ





-- 
Best regards,
 php                            mailto:[EMAIL PROTECTED]

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

  There is in PHP some way to handle errors like in other languages,
  I mean, something like this:

  .
  .
  .
  try to do
    ...
  if error then do ...
  .
  .
  .

  I'm tired of reciving warnings :-(

-- 
Yoel Benitez Fonseca


--- End Message ---
--- Begin Message ---
Ive been trying to get IMP 3.0 RC3 (web-based IMAP client) to work under
php / apache / imap2000 c-client. 
 
When I install php 4.0.6 or 4.1.0 with apache 1.3.20 or 1.3.22 using
dso/apxs everything works except for one major problem:
 
After one is logged in (a session is opened) for a while (and other
users open sessions), when you click on a page that relies on sessions
the page never loads, it just stalls continuosly before timing out to
"cannot display page" after about 3 - 4 minutes. If you close your
session (close your browser) or clear the /tmp/sessions folder on the
server, everything is fine the links work again temporarily.
 
I might think this is something to do with IMP, but Ive tried other IMAP
webmail clients, and Ive had the same problem. Ive tried 5 different
platform/browser combinations. I have this problem with 4.0.6/4.1.0 and
apache 1.3.20+
 
So next I tried compiling php into apache with -activate-module=php..
and when I do this, Apache segfaults 11 when an imap connection is
opened! 
 
Ahhh! Does anyone have IMP or any other imap software running under a
current version of php apache with a moderate load?
 
 
Thanks,
Lee    
--- End Message ---
--- Begin Message ---
I cant seem to get my htaccess file to work. Can anyone help? Heres what i
have now:

AuthUserFile /var/www/html/private/ .htpasswd
AuthGroupFile /dev/null
AuthName PrivateDomain
AuthType Basic

<Limit GET>
require valid-user
</Limit>

I then type 'htpasswd -c .htpasswd myusername' and then set password.
Everything seems to be in order but i'm not prompted for user name and
passwd when i try to access protected area via the web? Both htaccess and
htpasswd files are in 'private' directory. Permission on secure folder is
755. Is that right? What about permissions for htaccess and htpasswd files?
Do I have to enable htaccess ability through apache first through
httpd.conf? Can anyone help?

Thansk,
JJ

--- End Message ---
--- Begin Message ---
i don't think you want that space inbetween private/ and .htpasswd

-----Original Message-----
From: Jeremiah Jester [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 12:38 AM
To: Php-General
Subject: [PHP] htaccess problems


I cant seem to get my htaccess file to work. Can anyone help? Heres what i
have now:

AuthUserFile /var/www/html/private/ .htpasswd
AuthGroupFile /dev/null
AuthName PrivateDomain
AuthType Basic

<Limit GET>
require valid-user
</Limit>

I then type 'htpasswd -c .htpasswd myusername' and then set password.
Everything seems to be in order but i'm not prompted for user name and
passwd when i try to access protected area via the web? Both htaccess and
htpasswd files are in 'private' directory. Permission on secure folder is
755. Is that right? What about permissions for htaccess and htpasswd files?
Do I have to enable htaccess ability through apache first through
httpd.conf? Can anyone help?

Thansk,
JJ


-- 
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 Message ---
--- Begin Message ---
Damn , i hate ftp'ing twas the simplest thing in development but noe i'm
trying to deploy!! Pleez help!

Getting an WARNING! ftp_put! PORT command succesfull on ....

also the file doesn't seem to be uploading!!


--- End Message ---
--- Begin Message ---
Hi,

What do i wrong? I get this err:

Parse error: parse error in /test/put_file.php on line 14

--------put_file.php begin---------
<?php
  if ($submit) {
    include('include.php');
 $pos = strrpos($file, "\");
    if ($pos === FALSE) {
      $pos = strrpos($file, "/");
   if ($pos === FALSE) {
     $pos = 0;
   }
    }
    $name = substr($file, $pos + 1);
    $applicationn = substr($file, strrpos($file, "."));

    $fd = fopen($file, "r") or die("can't open the file");
    $file_bin = fread($fd, filesize($file));
    fclose($fd);
    $file_bin = mysql_escape_string($file_bin);

    $sql = "INSERT INTO files (id, name, description, file, application)
VALUES ('', '$name', '$description', '$file_bin', '$application')";
    $result = mysql_query ($sql) or die('fout');
  }
?>
--------put_file.php end---------


--------include.php begin---------
<?php
$conn = mysql_connect("localhost","user","password");

mysql_select_db("test", $conn);
?>
--------include.php end---------


--- End Message ---
--- Begin Message ---
The problem is here
$pos = strrpos($file, "\");
must be
$pos = strrpos($file, "\\");

Regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS

    
    
----- Original Message ----- 
From: "Alex Elderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 18, 2001 11:26 AM
Subject: [PHP] Parse error: parse error in/test/put_file.php on line 14???


> Hi,
> 
> What do i wrong? I get this err:
> 
> Parse error: parse error in /test/put_file.php on line 14
> 
> --------put_file.php begin---------
> <?php
>   if ($submit) {
>     include('include.php');
>  $pos = strrpos($file, "\");
>     if ($pos === FALSE) {
>       $pos = strrpos($file, "/");
>    if ($pos === FALSE) {
>      $pos = 0;
>    }
>     }
>     $name = substr($file, $pos + 1);
>     $applicationn = substr($file, strrpos($file, "."));
> 
>     $fd = fopen($file, "r") or die("can't open the file");
>     $file_bin = fread($fd, filesize($file));
>     fclose($fd);
>     $file_bin = mysql_escape_string($file_bin);
> 
>     $sql = "INSERT INTO files (id, name, description, file, application)
> VALUES ('', '$name', '$description', '$file_bin', '$application')";
>     $result = mysql_query ($sql) or die('fout');
>   }
> ?>
> --------put_file.php end---------
> 
> 
> --------include.php begin---------
> <?php
> $conn = mysql_connect("localhost","user","password");
> 
> mysql_select_db("test", $conn);
> ?>
> --------include.php end---------
> 
> 
> 
> -- 
> 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 Message ---
--- Begin Message ---
I have a form to be used for data submission and to be added to MySQL. How do I parse 
the syntax so that it automatically inserts a HTML line break whenever a carriage 
return is present??

Thanks.

Another PHP newbie,
Steph
--- End Message ---

Reply via email to