OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 24 Feb 2004 17:39:10 -0000 Issue 2609

php-general-digest-helplists.php.net
Date: Tue Feb 24 2004 - 11:39:10 CST


php-general Digest 24 Feb 2004 17:39:10 -0000 Issue 2609

Topics (messages 178639 through 178735):

Re: beginners question
        178639 by: John Nichel
        178647 by: André Cerqueira
        178662 by: Jason Merrique

Scroll en barra de mensajes del explorer
        178640 by: William Morales (INCOS)
        178651 by: André Cerqueira

Re: Send mail with attached
        178641 by: Manuel Lemos
        178645 by: John Taylor-Johnston
        178658 by: francesco.automationsoft.biz

Re: enum('part1','...')
        178642 by: John Taylor-Johnston
        178644 by: John Taylor-Johnston
        178646 by: Jason Wong
        178648 by: Cody Phanekham
        178649 by: John Taylor-Johnston

Re: Php and GpG
        178643 by: Manuel Lemos

Please dont request for receipts
        178650 by: Nitin Mehta
        178654 by: André Cerqueira

session timeout?
        178652 by: Jake McHenry
        178686 by: Catalin Trifu

Re: Cannot send mail after upgrading to OS X v10.3
        178653 by: David Bourne

where is my uploaded file ?
        178655 by: adwinwijaya
        178656 by: Jason Wong
        178659 by: André Cerqueira
        178680 by: Ford, Mike [LSS]
        178682 by: Jakes

Re: XSLT in php v5 beta 4
        178657 by: Lucian Cozma

Re: confirm subscribe to php-generallists.php.net
        178660 by: David Robley

Re: PHP Alternative to IFRAME?
        178661 by: Jason Merrique
        178733 by: Justin Patrin

XML Tool Needed
        178663 by: Nick Wilson
        178666 by: Jay Blanchard

Storing Arrays?
        178664 by: Nick Wilson
        178667 by: Jay Blanchard
        178668 by: Nick Wilson
        178669 by: Chris Hayes
        178695 by: Jakes
        178696 by: Jakes

Re: Record Counts
        178665 by: Jay Blanchard

newbie question
        178670 by: wannes
        178672 by: Chris Hayes

Your request is being processed
        178671 by: michael.fdo.unn.ac.uk

Accessing SMB (Samba perhaps) resources
        178673 by: Howard Miller
        178674 by: Howard Miller
        178708 by: Adam Voigt
        178714 by: Howard Miller

Encrypted Zip Files
        178675 by: Howard Miller
        178678 by: Michael Nolan

Re: Finding out the local path to a file.
        178676 by: Simon Fredriksson
        178684 by: Stuart
        178720 by: Michal Migurski
        178721 by: Michal Migurski

Re: GZIP Question
        178677 by: Richard Davey

Re: Security Question
        178679 by: Ford, Mike [LSS]

regexp appears to be faulty!?
        178681 by: Henry Grech-Cini
        178699 by: Ford, Mike [LSS]
        178706 by: Henry Grech-Cini
        178713 by: Henry Grech-Cini
        178716 by: Jome
        178724 by: Sven
        178730 by: Adam Bregenzer

Re: regexp appears to be faulty (DONT actually think so)
        178683 by: Henry Grech-Cini
        178702 by: Sven
        178704 by: Henry Grech-Cini
        178715 by: Sven

About php and mysql
        178685 by: edwardspl.ita.org.mo
        178687 by: Matt Matijevich
        178690 by: Jakes
        178701 by: edwardspl.ita.org.mo
        178705 by: Jason Wong

Working with MS-SQL
        178688 by: edwardspl.ita.org.mo
        178689 by: Jay Blanchard
        178691 by: Ben Ramsey
        178692 by: edwardspl.ita.org.mo
        178693 by: Jakes
        178698 by: Matt Matijevich
        178707 by: Adam Voigt
        178719 by: edwardspl.ita.org.mo

session expired -> how to know if the session is new or old
        178694 by: Catalin Trifu
        178697 by: Jakes
        178700 by: Seba
        178717 by: Catalin Trifu
        178723 by: Stuart
        178727 by: Catalin Trifu
        178728 by: Catalin Trifu
        178729 by: Stuart

Major problems trying to use load data local infile
        178703 by: Victor Spång Arthursson

MySQL update
        178709 by: Matthew Oatham
        178710 by: Jay Blanchard
        178711 by: Howard Miller
        178712 by: Howard Miller

Re: saving form data - calling another script from PHP?
        178718 by: Charlie Fiskeaux II

session: permission denied (13)
        178722 by: bill
        178726 by: Richard Davey

Multiple Socket Read and Writes?
        178725 by: Dev

Re: [PEAR] Re: PEAR DB 1.6.0 has been released
        178731 by: Justin Patrin

Re: PEAR::MAIL Problem
        178732 by: Justin Patrin

reg split address
        178734 by: Terry Romine

Parsing large log files with PHP
        178735 by: Pablo Gosse

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


Steve wrote:

> I have this code
>
> $var=$_POST['Stock']; in one page
>
> further down in the code, if certain conditions are met, I want the user
> to click on a link that will take them to a form to fill in some info. I
> need to have the data that is in $var passed along to that new url.
>
> So I have
>
> $var=$_POST['Stock']; in one page
> .
> .
> .
> echo '<a href="input.php?Stock">Click to add</a>'
>
> input.php is the form page. How do I get the Stock from the fisrt page
> to the second using the ? syntax?
>

echo ( '<a href="input.php?Stock=' . $var . '">Click to add</a>' );

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

to avoid other issues followed by other threads about the same stuff of
every 2 weeks:

echo '<a href="input.php?Stock='. urlencode($var) .'">Click to add</a>'

John Nichel wrote:

> Steve wrote:
>
>> I have this code
>>
>> $var=$_POST['Stock']; in one page
>>
>> further down in the code, if certain conditions are met, I want the
>> user to click on a link that will take them to a form to fill in some
>> info. I need to have the data that is in $var passed along to that new
>> url.
>>
>> So I have
>>
>> $var=$_POST['Stock']; in one page
>> .
>> .
>> .
>> echo '<a href="input.php?Stock">Click to add</a>'
>>
>> input.php is the form page. How do I get the Stock from the fisrt
>> page to the second using the ? syntax?
>>
>
> echo ( '<a href="input.php?Stock=' . $var . '">Click to add</a>' );
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAOuW9axdA/5C8vH8RArskAKCqgJMqBprdh2EeD/BgyFQ3lNpIBACg3xlt
iAeH+Pd1pU/An9UiuxoIqVs=
=yRUT
-----END PGP SIGNATURE-----

attached mail follows:


So you don't want the form data to be encoded in the url?
Something like this would probably do it:

<form action="input.php" method="post" enctype="multipart/form-data"
name="form">

<input name="Stock" type="hidden" value="$var">
<input name="button" type="submit" value="Click to add">

</form>

That'll just display a button that when pressed will pass $var to
input.php

> -----Original Message-----
> From: Steve [mailto:gaowpze02sneakemail.com]
> Sent: 24 February 2004 05:16
> To: php-generallists.php.net
> Subject: [PHP] beginners question
>
> I have this code
>
> $var=$_POST['Stock']; in one page
>
> further down in the code, if certain conditions are met, I
> want the user to click on a link that will take them to a
> form to fill in some info.
> I need to have the data that is in $var passed along to that new url.
>
> So I have
>
> $var=$_POST['Stock']; in one page
> .
> .
> .
> echo '<a href="input.php?Stock">Click to add</a>'
>
> input.php is the form page. How do I get the Stock from the
> fisrt page to the second using the ? syntax?
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Saludos


Se podrá con PHP poner un scroll en la barra de mensajes del explorer,
alguien lo ha hecho?

Lo he checado con JavaScrip, pero PHP lo hace?

Espero alguien me ayude.

William Morales
Tabasco, México

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

php is server side
scroll bar on explorer message bar (what is that?) is client side
conclusion: no, you can not use php for that

i think ppl would prefer if you posted in english

php es el lado del servidor
barra de mensajes del explorer (cuál es ése?) es el lado del cliente
conclusión: no, usted no puede utilizar el php para ése

pienso que la gente preferiría si usted fijó en inglés

William Morales wrote:

> Saludos
>
>
>
>
>
> Se podrá con PHP poner un scroll en la barra de mensajes del explorer,
> alguien lo ha hecho?
>
>
>
> Lo he checado con JavaScrip, pero PHP lo hace?
>
>
>
> Espero alguien me ayude.
>
>
>
> William Morales
>
> Tabasco, México
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAOuhVaxdA/5C8vH8RAjsaAKC1nKNyLtxqzRg+Jl86YskexkmIZwCg0b2n
lxl3BG9miJExfKQLFqyO3gU=
=Cgb6
-----END PGP SIGNATURE-----

attached mail follows:


Hello,

On 02/23/2004 04:15 PM, francescoautomationsoft.biz wrote:
> Hi all,
> is possible to send an email, with mail() function, with an attached?
> I see on www.php.net but there isn't nothing about this.
> If someone have the solution please send the solution.

You may want to try this class that provides a ready to use solution for
sending messages with attachments and other complex structure types of
messages.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

attached mail follows:


I know I have something in here that did it. [Shake, shake, rattle, bump]

This is how I send an image in a postcard maker I fashioned once:

http://www.CollegeSherbrooke.qc.ca/languesmodernes/jtjohnston/0postcard0/send_mail.phps
http://www.CollegeSherbrooke.qc.ca/languesmodernes/jtjohnston/0postcard0/

John

attached mail follows:


Thank you Karl for answer.
Frank
francescoautomationsoft.biz
www.automationsoft.biz

----- Original Message -----
From: "Karl Timmermann" <timmerkcomcast.net>
To: <francescoautomationsoft.biz>
Sent: Monday, February 23, 2004 8:30 PM
Subject: Re: [PHP] Send mail with attached

> Check out phpmailer at http://phpmailer.sourceforge.net/
>
> It's great!
>
>
> On Feb 23, 2004, at 12:15 PM, <francescoautomationsoft.biz> wrote:
>
> > Hi all,
> > is possible to send an email, with mail() function, with an attached?
> > I see on www.php.net but there isn't nothing about this.
> > If someone have the solution please send the solution.
> > Thanks in advance.
> > Frank
> > francescoautomationsoft.biz
> > www.automationsoft.biz
>
>

attached mail follows:


Chris,

>It's not obvious what language You mean,

Sorry. Let me explain. It's a MySQL field. I want to use PHP to read the parts of the array of the MySQL field district:

district enum('part1','part2','part3','part4')

How do I get the array from my $table?

John

 wrote:

> It's not obvious what language You mean, but I think this will work for you:
>
> $aDistrict = array('part1','part2','part3','part4');
> foreach($aDistrict as $sDistrict)
> {
> echo '<a href="page.htm#',$sDistrict,'">',$sDistrict,"</a>\n";
> }
>
> Note: I'm using single quotes for some of the string chunks to eliminate the
> multiple backslashes for the double quotes. I'm also using commas to echo
> the 5 parts in sequence, rather than concatenate them then echo the result.
>
> > -----Original Message-----
> > From: John Taylor-Johnston [mailto:taylorjocollegesherbrooke.qc.ca]
> > Sent: Monday, February 23, 2004 7:58 PM
> > To: php-generallists.php.net
> > Cc: John Taylor-Johnston
> > Subject: [PHP] enum('part1','...')
> >
> >
> > Basically I have an enum field. I would like to extract the parts
> > of the field to create some html.
> >
> > district enum('part1','part2','part3','part4')
> >
> > while (district??)
> > {
> > echo "<a href=\"page.htm#".district[0]."\">".district[0]."</a>
> > }
> >
> > <a href="page.htm#part1">part1</a>
> > <a href="page.htm#part2">part2</a>
> > <a href="page.htm#part3">part3</a>
> > <a href="page.htm#part4">part4</a>
> >
> > Can I even do this? How?
> >
> > J
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law or broken."

  ' ' ' Collège de Sherbrooke
 ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke
          http://compcanlit.ca/
          819-569-2064

attached mail follows:


Jason,
Sigh ... What would I look for in the archives Jason?

Don't see anything here that would give me a hint where to start Jason:

http://www.php.net/manual-lookup.php?pattern=enum

I know you want to be helpful, and not send me back to the Dark Lords of Perl.

> On Tuesday 24 February 2004 11:57, John Taylor-Johnston wrote:
> > Basically I have an enum field. I would like to extract the parts of the
> > field to create some html.
> > Can I even do this?
> yes
> > How?
> archives
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general

attached mail follows:


On Tuesday 24 February 2004 13:45, John Taylor-Johnston wrote:

> Sigh ... What would I look for in the archives Jason?

I had assumed you meant MySQL's enum field type which your other post
confirms. How about the obvious "mysql enum" ?

> Don't see anything here that would give me a hint where to start Jason:
>
> http://www.php.net/manual-lookup.php?pattern=enum

Hello? That's the manual you're looking at.

> I know you want to be helpful, and not send me back to the Dark Lords of
> Perl.

That's why there's a link to the archives in my signature.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
"The chain which can be yanked is not the eternal chain."
                -- G. Fitch
*/

attached mail follows:


>-----Original Message-----
>From: John Taylor-Johnston [mailto:taylorjocollegesherbrooke.qc.ca]
>Jason,
>Sigh ... What would I look for in the archives Jason?
>
>Don't see anything here that would give me a hint where to start Jason:
>
>http://www.php.net/manual-lookup.php?pattern=enum

umm that would be the online manual... jason was referring to the archive list: http://marc.theaimsgroup.com/?l=php-general

i did a search on "enum mysql" and found this:

http://marc.theaimsgroup.com/?l=php-general&m=106933918806372&w=2

*************************************************************************************
This e-mail, including any attachments to it, may contain confidential and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or take any action
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the original e-mail.

The information contained within this e-mail may be solely the opinion of the sender and may not necessarily
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's anti-virus systems.

For more information, visit our website at www.salmat.com.au.
*************************************************************************************

attached mail follows:


Hmm.
http://marc.theaimsgroup.com/?l=php-general&m=106933918806372&w=2

> -----Original Message-----
> From: Alan Lord [mailto:lord_alanhotmail.com]

Lord?! Wasn't one of those perl dark lords was it? :)
I'll try the code.

Jason Wong wrote:

> On Tuesday 24 February 2004 13:45, John Taylor-Johnston wrote:
>
> > Sigh ... What would I look for in the archives Jason?
>
> I had assumed you meant MySQL's enum field type which your other post
> confirms. How about the obvious "mysql enum" ?
>
> > Don't see anything here that would give me a hint where to start Jason:
> >
> > http://www.php.net/manual-lookup.php?pattern=enum
>
> Hello? That's the manual you're looking at.
>
> > I know you want to be helpful, and not send me back to the Dark Lords of
> > Perl.
>
> That's why there's a link to the archives in my signature.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> "The chain which can be yanked is not the eternal chain."
> -- G. Fitch
> */

--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law or broken."

  ' ' ' Collège de Sherbrooke
 ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke
          http://compcanlit.ca/
          819-569-2064

attached mail follows:


Hello,

On 02/23/2004 10:35 AM, Paul Marinas wrote:
> Those anyone know hoh to use php with gpg. I've tryed gpgext, but doesn't
> seems to work maybe my php is not compiled with some kind of support.

Not exactly with GPG, but here you can find a solution with PGP:

http://www.phpclasses.org/browse/package/39.html

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

attached mail follows:


Dear All,

I hereby request you all; please dont attach the request for receipts when submitting any queries or solutions to the list.

It's hell of a task, to send or deny these requests, for someone like me, who's subscribed to a number of lists like this one and many others.

Regards
Nitin

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Agreed hehe

I would also like to ask why are there so many threads starting with "Re:"
Is that a bug on this newsgroup or people dont care about posting inside
the thread they replying to?

Nitin Mehta wrote:
> Dear All,
>
> I hereby request you all; please dont attach the request for receipts when submitting any queries or solutions to the list.
>
> It's hell of a task, to send or deny these requests, for someone like me, who's subscribed to a number of lists like this one and many others.
>
> Regards
> Nitin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAOu3AaxdA/5C8vH8RAr2TAKCE6nIPktJNmEVUcG7WKUsskPK5iQCg3nTV
QAmAKPzXj8benb4qRD6k6dk=
=8lB0
-----END PGP SIGNATURE-----

attached mail follows:


How can I make my site auto log out a user like I've seen on many sites? Right now, the users session never expires unless manually logging out or the browser is closed. Also, should I change anything to cover any security issues? I havn't changed much from the default, only enough to get it running for my site.

Here is what I have in my php.ini file:

[Session]
session.save_handler = files
session.save_path = /var/www/sessions
session.use_cookies = 1
session.name = NittanyTravelSessionCookie
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
session.referer_check =
session.entropy_length = 0
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 1
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

Thanks,
Jake

attached mail follows:


        Hi,

    You have to make the code yourself,

    After session_start you should check the session for some
variable you use to check if the user is logged in

eg:
    <?php
        session_start();
        if( !isset($_SESSION['logged_in']) || $_SESSION['logged_in'] = 0) {
            //u'r busted go to login
        } else {
            //u'r the good guy, come in
        }
    ?>

C.

"Jake McHenry" <linuxnittanytravel.com> wrote in message
news:005e01c3fa9b$d5f4c910$7fa1e518JS...
How can I make my site auto log out a user like I've seen on many sites?
Right now, the users session never expires unless manually logging out or
the browser is closed. Also, should I change anything to cover any security
issues? I havn't changed much from the default, only enough to get it
running for my site.

Here is what I have in my php.ini file:

[Session]
session.save_handler = files
session.save_path = /var/www/sessions
session.use_cookies = 1
session.name = NittanyTravelSessionCookie
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
session.referer_check session.entropy_length = 0
session.entropy_file ;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 1
url_rewriter.tags = "a=href,area=href,frame=src,input=src,formúkeentry"

Thanks,
Jake

attached mail follows:


 From gohaku

> I stand corrected.
> Now I don't remember what I did to fix this.
> I waited 5 minutes between sending test emails to myself.

Starting postfix with postfix enabler seemed to start sendmail as well.

attached mail follows:


Hello php-general,

  Right now I am trying to create a form that upload the file.
  The form it self:

  <form name="forms2" action="upload.php" method="post" enctype="multipart/form-data">
        <input type="hidden" name="MAX_FILE_SIZE" value="64000">
        <input name="image" type="file">
        <input type="submit" name="submit">
  </form>

  and the upload.php itself contain the code that I took from chapter
  18 of php manual:

  <?php

        $uploaddir = 'C:/Program Files/Apache Group/Apache2/htdocs/test/' ;
        $uploadfile = $uploaddir . $_FILES['userfile']['name'];
        
        print "<pre>";
        if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
                print "File is valid, and was successfully uploaded. ";
                print "Here's some more debugging info:\n";
                print_r($_FILES);
        } else {
                print "Possible file upload attack! Here's some debugging info:\n";
                print_r($_FILES);
        }
        print "</pre>" ;
  ?>

But, I always got:

Possible file upload attack! Here's some debugging info:
Array
(
    [image] => Array
        (
            [name] => templates.txt
            [type] => text/plain
            [tmp_name] => C:\WINDOWS\TEMP\php471.tmp
            [error] => 0
            [size] => 2048
        )

)

and when I look up at C:/Program Files/Apache
Group/Apache2/htdocs/test/ (the target directory) .. I never found
the file that I uploaded ...

can someone tell me y this happen ?

thank you

--
Best regards,
 adwinwijaya mailto:adwinwijayayahoo.com.au

attached mail follows:


On Tuesday 24 February 2004 14:58, adwinwijaya wrote:

[snip]

> and when I look up at C:/Program Files/Apache
> Group/Apache2/htdocs/test/ (the target directory) .. I never found
> the file that I uploaded ...
>
> can someone tell me y this happen ?

Maybe. But you can find out for yourself -- turn on full error reporting then
see what the error is.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
One of the most overlooked advantages to computers is... If they do
foul up, there's no law against whacking them around a little.
                -- Joe Martin
*/

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> bool move_uploaded_file ( string filename, string destination)
>
> If filename is not a valid upload file, then no action will occur,
and > move_uploaded_file() will return FALSE.
>
> If filename is a valid upload file, but cannot be moved for some
> reason, no action will occur, and move_uploaded_file() will return
> FALSE. Additionally, a warning will be issued."

i would echo $_FILES['userfile']['tmp_name'] and check if that folder
from that path exists
if it doesnt exist, check php.ini, maybe temp dir for upload is set wrong...

Adwinwijaya wrote:
> Hello php-general,
>
> Right now I am trying to create a form that upload the file.
> The form it self:
>
> <form name="forms2" action="upload.php" method="post" enctype="multipart/form-data">
> <input type="hidden" name="MAX_FILE_SIZE" value="64000">
> <input name="image" type="file">
> <input type="submit" name="submit">
> </form>
>
> and the upload.php itself contain the code that I took from chapter
> 18 of php manual:
>
> <?php
>
> $uploaddir = 'C:/Program Files/Apache Group/Apache2/htdocs/test/' ;
> $uploadfile = $uploaddir . $_FILES['userfile']['name'];
>
> print "<pre>";
> if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
> print "File is valid, and was successfully uploaded. ";
> print "Here's some more debugging info:\n";
> print_r($_FILES);
> } else {
> print "Possible file upload attack! Here's some debugging info:\n";
> print_r($_FILES);
> }
> print "</pre>" ;
> ?>
>
>
> But, I always got:
>
> Possible file upload attack! Here's some debugging info:
> Array
> (
> [image] => Array
> (
> [name] => templates.txt
> [type] => text/plain
> [tmp_name] => C:\WINDOWS\TEMP\php471.tmp
> [error] => 0
> [size] => 2048
> )
>
> )
>
> and when I look up at C:/Program Files/Apache
> Group/Apache2/htdocs/test/ (the target directory) .. I never found
> the file that I uploaded ...
>
> can someone tell me y this happen ?
>
> thank you
>
> --
> Best regards,
> adwinwijaya mailto:adwinwijayayahoo.com.au
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAOwPZaxdA/5C8vH8RAjrsAKDTeIJ/2IzExUiX8qwbZiQIDSMYYQCfT63J
ZwVkqmvuiOAshWqpHGRx6xM=
=5pB5
-----END PGP SIGNATURE-----

attached mail follows:


On 24 February 2004 06:58, adwinwijaya wrote:

> <input name="image" type="file">

> $uploadfile = $uploaddir . $_FILES['userfile']['name'];

> Array
> (
> [image] => Array

Hint: "image"!="userfile"

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: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


var_dump($_FILES);

"Mike Ford" <M.Fordleedsmet.ac.uk> wrote in message
news:0EEFC4D3CBE8A142868E396381B77A53D1255Dlis-exchange3.lmu.ac.uk...
> On 24 February 2004 06:58, adwinwijaya wrote:
>
> > <input name="image" type="file">
>
> > $uploadfile = $uploaddir . $_FILES['userfile']['name'];
>
> > Array
> > (
> > [image] => Array
>
> Hint: "image"!="userfile"
>
> 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: m.fordleedsmet.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Try:

http://slides.bitflux.ch/
http://slides.bitflux.ch/phpug2004_1/

You could also get the CVS version and check out the source code. It was the
best way for me to find undocumented features.
There are also samples and articles, but unfortunately you have to "dig" for
them all over the net (google), as there is no working doc for domxml.
Hopefullt this will be fixed soon.

Lucian

"Ryan C. Creasey" <ryanp11.com> wrote in message
news:20040223210132.47871.qmailpb1.pair.com...
>
> Steve Dieke wrote:
> | I am guesing that I have installed something incorrectly. I am trying
to
> | use the function xslt_create(). I installed php v5 Beta 4 successfully.
> | but when I try to use the function xslt_create() I get the following
> | error:
> |
> | Fatal Error: Call to undefined function xslt_create()
>
> I too am having difficulty getting this up on our development boxes. I've
> installed php5a5 via FreeBSD ports, and get the same error. My
> configuration options are here:
>
> http://hastur.p11.com/phpinfo.php
>
> From my understanding, I know that there are major changes to XML/XSL in
> php5, but is there anywhere documenting their changes explicitly? I've
> just read a bunch of lip service saying that it's changing, but I have no
> idea how it'll affect my xml/xhtml apps when php5 goes release. I'd love
> to get a head start on it now, but have to get this working right.
>
> Are the XSL functions used with php4/sablotron going to be supported in
the
> php5/libxml implementations? Or am I going to have to re-code a bunch of
> my xsl functions?
>
> --
> Ryan C. Creasey
> Network Engineer
> p11creative, inc.

attached mail follows:


In article
<4410.203.45.31.27.1077597369.squirrelwebmail.cybertechaustralia.org>,
phpcybertechaustralia.org says...
> > Hi! This is the ezmlm program. I'm managing the
> > php-generallists.php.net mailing list.
> >
> > I'm working for my owner, who can be reached
> > at php-general-ownerlists.php.net.
> >
> > To confirm that you would like
> >
> > phpcybertechaustralia.org
> >
> > added to the php-general mailing list, please send
> > an empty reply to this address:
> >
> > php-general-sc.1077597199.idagngcpadkjjlhmindi-php=cybertechaustralia.orglists.php.net

How embarrassing :-)

--
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

attached mail follows:


You could do it this way:

Put the content of the file into a variable:

<?php

$fp = fopen("$filename", "r");
$content = "<!-- Insert Start -->";
if($fp) {
  while(! feof($fp)) {
    $content .= fread($fp, 1024);
  }
}
?>

Insert the variable into a div tag:

<div id="content">

<?php
echo $content;
?>

</div>

Then create a style sheet that defines the properties of the content
DIV:

<style type="text/css">
<!--
#content {
        height: 100px;
        width: 100px;
        float: left
}
-->
</style>

The above collection of code would include the contents of the specified
file/url into a box to the left of the screen, with any other text
wrapping around it. You could do pretty much what you want with the DIV
though, CSS Rocks :)

Does that answer the question?

Cheers,

Jason

> -----Original Message-----
> From: Nicole [mailto:ndiratojenkinslaw.org]
> Sent: 23 February 2004 18:26
> To: php-generallists.php.net
> Subject: Re: [PHP] PHP Alternative to IFRAME?
>
> Your right I was mixing up what I wanted.
>
> What I wanted to know I guess was if I use an include and
> include a file can I format where that file will display.
>
> So what I have is a little box with some info in it. I want
> it to display to the right of the body text and have the body
> text wrap around it.
>
> Nicole
>
> "Richard Davey" <richlaunchcode.co.uk> wrote in message
> news:1394868728.20040223172526launchcode.co.uk...
> > Hello Nicole,
> >
> > Monday, February 23, 2004, 5:21:11 PM, you wrote:
> >
> > N> Is there a PHP alternative to an IFRAME? Here's what I mean.
> >
> > No, of course not. PHP is a server-side language. IFRAME's (and
> > anything related to page construction/display) is client-side.
> >
> > N> Is there a way to include a file in my php document that will be
> positioned
> > N> where I want it, like an IFRAME? I want to have it aligned right
> > N> with
> text
> > N> wrapping around it and I know IFRAME is not compatible with
> > N> Netscape browsers.
> >
> > You're mixing technologies. If Netscape won't display
> something, there
> > is nothing PHP can do about it. You need to think of another layout
> > technique that it can display.
> >
> > --
> > Best regards,
> > Richard Davey
> > http://www.phpcommunity.org/wiki/296.html
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Nicole wrote:

> I'm not having much luck explaining what I want here ... a drawback of
> emailing. I know how to include files, I just wanted to include it in such
> a way that my body text still wrapped around it.
>
> I think I need to tackle this using HTML.
>
> "Robert Sossomon" <robertgcnorris.com> wrote in message
> news:061601c3fa42$aa0a67a0$6601010aroot2...
>
>>Just place
>>
>><?php
>> include "box_info.php";
>>?>
>>
>>In your web page in the location where the little box is. Word wrap
>>typically only happens with images though, so you may have to turn your
>>text into an image, in which case you could just use a javascript
>>commands to change the image as needed. If you are including the text
>>into a table it would be something like:
>>
>><table border=0>
>><tr><td>some text that keeps running and running</td></tr>
>><tr><td><?php
>> include "box_info.php";
>>?>
>></td></tr>
>>
>>HTH,
>>Robert

I think this is what you're looking for:

echo '<div style="float: right;">';
include('someFile.php');
echo '</div>
<div>';
//more content here that goes ot the left and bottom of the above div
echo '</div>';

--
--
paperCrane <Justin Patrin>

attached mail follows:


Hi all,

I'm looking for a tool that will parse an xml doc into somthing like an
associative array for me. Basically somthing to make life simple when
dealing with Amazon XML docs.

I have been all thru hotscripts and even tried doing it myself but my
time is limited and the tools out there are waaaaaay beyond what I
actually need.

Anyone have any recommendations or ideas?

Many thanks...

--
Nick W

attached mail follows:


[snip]
I'm looking for a tool that will parse an xml doc into somthing like an
associative array for me. Basically somthing to make life simple when
dealing with Amazon XML docs.

I have been all thru hotscripts and even tried doing it myself but my
time is limited and the tools out there are waaaaaay beyond what I
actually need.

Anyone have any recommendations or ideas?
[/snip]

Have you looked at the built in XML functions? http://us4.php.net/xml

attached mail follows:


Hi all,

If I wanted to store an array for future use in a MySQL TEXT Column
(dont ask, it's complicated... hehe!) how would I go about it?

I thought of just putting the results of print_r($myarray); into the
text field and using eval() to get at it later... is that the right way
to go?

Many thanks

--
Nick W

attached mail follows:


[snip]
If I wanted to store an array for future use in a MySQL TEXT Column
(dont ask, it's complicated... hehe!) how would I go about it?

I thought of just putting the results of print_r($myarray); into the
text field and using eval() to get at it later... is that the right way
to go?
[/snip]

Yes, that is certainly one right way to go.

attached mail follows:


* and then Jay Blanchard declared....
> [snip]
> If I wanted to store an array for future use in a MySQL TEXT Column
> (dont ask, it's complicated... hehe!) how would I go about it?
>
> I thought of just putting the results of print_r($myarray); into the
> text field and using eval() to get at it later... is that the right way
> to go?
> [/snip]
>
> Yes, that is certainly one right way to go.

Actually, serialize() would be better suited I think, but thanks...

--
Nick W

attached mail follows:


At 11:10 24-2-04, you wrote:
>Hi all,
>
>If I wanted to store an array for future use in a MySQL TEXT Column
>(dont ask, it's complicated... hehe!) how would I go about it?

you could consider serialize()

attached mail follows:


depending how long you want to keep it, wrap the array in a object and
then serialize the object in a session variable.

"Nick Wilson" <nickstylesheet.org> wrote in message
news:20040224112234.GA13904stylesheet.org...
>
> * and then Jay Blanchard declared....
> > [snip]
> > If I wanted to store an array for future use in a MySQL TEXT Column
> > (dont ask, it's complicated... hehe!) how would I go about it?
> >
> > I thought of just putting the results of print_r($myarray); into the
> > text field and using eval() to get at it later... is that the right way
> > to go?
> > [/snip]
> >
> > Yes, that is certainly one right way to go.
>
> Actually, serialize() would be better suited I think, but thanks...
>
>
> --
> Nick W

attached mail follows:


rather just serialize() it. didnt read your question properly

"Jakes" <sunsoffunhotmail.com> wrote in message
news:20040224140631.54553.qmailpb1.pair.com...
> depending how long you want to keep it, wrap the array in a object and
> then serialize the object in a session variable.
>
> "Nick Wilson" <nickstylesheet.org> wrote in message
> news:20040224112234.GA13904stylesheet.org...
> >
> > * and then Jay Blanchard declared....
> > > [snip]
> > > If I wanted to store an array for future use in a MySQL TEXT Column
> > > (dont ask, it's complicated... hehe!) how would I go about it?
> > >
> > > I thought of just putting the results of print_r($myarray); into the
> > > text field and using eval() to get at it later... is that the right
way
> > > to go?
> > > [/snip]
> > >
> > > Yes, that is certainly one right way to go.
> >
> > Actually, serialize() would be better suited I think, but thanks...
> >
> >
> > --
> > Nick W

attached mail follows:


[snip]
I did RTFM...I always RTFM first. That was the example in the F Book!.
Mark Roberts, Roberts Computing Systems
Webmaster Services $29.50/mo

$reccount = mysql_query("select count(*) from mytable where user =
'testuser');

I try this from mysql and get the correct response ( 1 ).

However, when I put this in an php script, $reccount returns a value of
'Resource id #5'.
[/snip]

Perhaps you did not UTFM or CTFM. But I digress...

$recount at this point is only a handle or resource, you have to do
something with it. You need to change your query a little though...

$reccount = mysql_query("select count(*) AS recordCount from mytable
where user =
'testuser');

recordCount gives you another handle.

Now you can do ...

$arrRecCount = mysql_fetch_array($reccount);
echo $arrRecCount['recordCount'];

or you can do it differently

$getUser = mysql_query("select * from mytable where user = 'testuser');
$recCount = mysql_num_rows($getUser);
echo $recCount;

HTH!

attached mail follows:


hi -

i don't know much about php, but somehow i managed to install a simple
php-guestbook on my website:
http://www.maanzand.be/guestbookk/readbook.php

unfortunately, i cannot get it to work
everything seems fine, but i can't manage to write to the guestbook.txt
file
(permissions are read&write, so i don't think that is causing the
problem)
readbook.php & addbook.php seem to work fine, but when i fill in a
message and hit the submit-button, nothing happens...

if anyone of you php-breathing maestro's could take a look at the
guestbook and check if there's sth out of the ordinary, i would be
eternally grateful...

maybe there are some features on the side of the server that i need to
activate or something, so i've put the info.php file on the site too,
if that helps you any further...
http://www.maanzand.be/info.php

thanx a billion,
wannes -

-------------------------------------------------------------
Just because I have a short attention span doesn't mean that I...

http://www.maanzand.be - under constant construction

wannes.daemenartefact.be
016 28 48 42 - 0486 21 32 92

attached mail follows:


could it be that this is an old script that requires register_globals to be
turned ON or so?
if you can read Dutch, read http://www.phpfreakz.nl/artikelen.php?aid=88

At 12:25 24-2-04, you wrote:
>hi -
>
>i don't know much about php, but somehow i managed to install a simple
>php-guestbook on my website:
>http://www.maanzand.be/guestbookk/readbook.php
>
>unfortunately, i cannot get it to work
>everything seems fine, but i can't manage to write to the guestbook.txt file
>(permissions are read&write, so i don't think that is causing the problem)
>readbook.php & addbook.php seem to work fine, but when i fill in a message
>and hit the submit-button, nothing happens...
>
>if anyone of you php-breathing maestro's could take a look at the
>guestbook and check if there's sth out of the ordinary, i would be
>eternally grateful...
>
>maybe there are some features on the side of the server that i need to
>activate or something, so i've put the info.php file on the site too, if
>that helps you any further...
>http://www.maanzand.be/info.php
>
>thanx a billion,
>wannes -
>
>
>-------------------------------------------------------------
>Just because I have a short attention span doesn't mean that I...
>
>http://www.maanzand.be - under constant construction
>
>wannes.daemenartefact.be
>016 28 48 42 - 0486 21 32 92

attached mail follows:


You are bad

attached mail follows:


Hi,

I want to be able to manipulate files that are on my samba file server from
my PHP application. These shares are not normally mounted on my web server
and it would be inconvenient and yet another administative maintenance task
to do so.

So... I want to be able to present a form to the user where they can type a
URL (eg, //my.sambaserver/myshare/some/directory), a username and a
password and for PHP to be able to manipulate the files therein.

Maybe this is easy, but I can't see how to do it!! Any help appreciated.

Thanks!!

attached mail follows:


Hi,

I want to be able to manipulate files that are on my samba file server from
my PHP application. These shares are not normally mounted on my web server
and it would be inconvenient and yet another administative maintenance task
to do so.

So... I want to be able to present a form to the user where they can type a
URL (eg, //my.sambaserver/myshare/some/directory), a username and a
password and for PHP to be able to manipulate the files therein.

Maybe this is easy, but I can't see how to do it!! Any help appreciated.

Thanks!!

attached mail follows:


Why can't you just mount the share on-the-fly when they enter the
username and pass?

On Tue, 2004-02-24 at 06:11, Howard Miller wrote:
> Hi,
>
> I want to be able to manipulate files that are on my samba file server from
> my PHP application. These shares are not normally mounted on my web server
> and it would be inconvenient and yet another administative maintenance task
> to do so.
>
> So... I want to be able to present a form to the user where they can type a
> URL (eg, //my.sambaserver/myshare/some/directory), a username and a
> password and for PHP to be able to manipulate the files therein.
>
> Maybe this is easy, but I can't see how to do it!! Any help appreciated.
>
> Thanks!!
--

Adam Voigt
adamkotisprop.com

attached mail follows:


Well, mainly because PHP doesn't (I think) have a mount function. It would
mean executing an external command. I always regard that as living a bit
dangerously - it can be difficult to write robust code that will recover
from a problem that way.

Adam Voigt wrote:

> Why can't you just mount the share on-the-fly when they enter the
> username and pass?
>
>
> On Tue, 2004-02-24 at 06:11, Howard Miller wrote:
>> Hi,
>>
>> I want to be able to manipulate files that are on my samba file server
>> from my PHP application. These shares are not normally mounted on my web
>> server and it would be inconvenient and yet another administative
>> maintenance task to do so.
>>
>> So... I want to be able to present a form to the user where they can type
>> a URL (eg, //my.sambaserver/myshare/some/directory), a username and a
>> password and for PHP to be able to manipulate the files therein.
>>
>> Maybe this is easy, but I can't see how to do it!! Any help appreciated.
>>
>> Thanks!!

attached mail follows:


Hi (again),

I need to unzip (in/from PHP) files that have been zipped using pkzip on a
windows machine using a password.

Has anybody any thoughts on how to do this. I was just going to call a
command line program (if I can find one!), but thought I would ask if there
is something cleverer.

Thanks!!

attached mail follows:


Howard Miller wrote:
> Hi (again),
>
> I need to unzip (in/from PHP) files that have been zipped using pkzip on a
> windows machine using a password.
>
> Has anybody any thoughts on how to do this. I was just going to call a
> command line program (if I can find one!), but thought I would ask if there
> is something cleverer.
>
> Thanks!!
>

A command line program is probably your best option. The unzip command
under unix (and other operating systems) can take a password as an argument.

HTH,

Mike

attached mail follows:


Sadly, none of your tips works.

__FILE__ shows the script filename, not to the path of the current dir.
Where can I find out more about this kind of constants? Can't see it
anywhere in the manual.

The problem is this:

DocumentRoot (/): D:/Web/htdocs/
Users (/~xxxxx/): D:/Web/users/
Stuff1 (/s1/): E:/Stuff1 # Alias in apache
Stuff2 (/s2/): D:/Stuff2 # Alias in apache

So when I surf to /s1/, the script in D:/Web/htdocs/list/lister.php is
executed. Just aswell as it is when surfing to /s2/ or any other folder
without any other indexfile. When surfing there, the only variable that
is of any use to get the folder is $_SERVER['REQUEST_URI'], but it
doesn't reveal the local path that I want.

Any ideas on how to solve it?

//Simon

attached mail follows:


Simon Fredriksson wrote:
> Sadly, none of your tips works.
>
> __FILE__ shows the script filename, not to the path of the current dir.
> Where can I find out more about this kind of constants? Can't see it
> anywhere in the manual.
>
> The problem is this:
>
> DocumentRoot (/): D:/Web/htdocs/
> Users (/~xxxxx/): D:/Web/users/
> Stuff1 (/s1/): E:/Stuff1 # Alias in apache
> Stuff2 (/s2/): D:/Stuff2 # Alias in apache
>
> So when I surf to /s1/, the script in D:/Web/htdocs/list/lister.php is
> executed. Just aswell as it is when surfing to /s2/ or any other folder
> without any other indexfile. When surfing there, the only variable that
> is of any use to get the folder is $_SERVER['REQUEST_URI'], but it
> doesn't reveal the local path that I want.
>
> Any ideas on how to solve it?

If you're running PHP as an Apache module, this may solve it:
http://php.net/apache_lookup_uri

Pass it $_SERVER['REQUEST_URI'] and what you want should be in the
filename part of the returned object (untested).

If you're not running PHP as an Apache module then I don't think there's
any way to do it. Actually, now that I've typed that, doesn't the Apache
404 handler pass the requested URI to the 404 file? You might be able to
use that.

--
Stuart

attached mail follows:


>__FILE__ shows the script filename, not to the path of the current dir.
>Where can I find out more about this kind of constants? Can't see it
>anywhere in the manual.

Yeah, that's what it does. The point is that your current dir (upon
execution) will be the location of your DirectoryIndex script. The
difference between REQUEST_URI and SCRIPT_NAME will give you a relative
path from the location of __FILE__ to the directory in the request, /if/
REQUEST_URI is a subdirectory or dirname(SCRIPT_NAME). Use chdir() to get
there as in my previous mail, and you're set.

In your example, it's harder to do because there isn't a foolproof way for
PHP to know what filesystem directory your Alias maps to, unless you tell
it explicitly, which doesn't scale well as you add more directories.

The easy solution would be to have your lister.php script in a parent
of the directory whose contents you want listed.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html

attached mail follows:


>If you're running PHP as an Apache module, this may solve it:
>http://php.net/apache_lookup_uri

Neat - I learn something new everyday!

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html

attached mail follows:


Hello Karl,

Tuesday, February 24, 2004, 5:11:40 AM, you wrote:

KT> I am using fsockopen with fputs to send some headers to a HTTP server,
KT> and I say I accept gzip encoding. The data gets returned and I put it
KT> in a variable. However, whichever gzip command I try using in PHP to
KT> decompress it (or is it deflate, or both?) returns an error. Is it
KT> because the server send it back as hex possibly? (I sniffed the stream
KT> and it was hex it looked like, I think).

It will have sent it back as binary because that's the only possible
way it can come back (assuming the server is sending it back
correctly), hexidecimal characters are just a means to view that data,
not the data type itself.

I don't know enough about the gzip feature of servers to give you any
suggestions, but it does occur to me that they probably encode each
element on the page, not the whole thing at once, so I dare say you're
being sent a stream of encoded data rather than one big gzip file. I
might be wrong, but it makes sense if it does work like this. Perhaps
someone else can confirm.

--
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

attached mail follows:


On 20 February 2004 22:29, Ed Lazor wrote:

> PHP include statements default to the current directory. If
> the path to
> my PHP files is /home/osmosis/public_html, why would users visiting my
> site occasionally get an error that the include file wasn't found in
> /home/budguy/public_html?
>
> It's like PHP is somehow confused and running my script with
> the account
> settings (and permissions, possibly) for another user on my host
> provider's server. If that's true, wouldn't this quality as
> a security
> issue?
>
> They use open_basedir for security. Isn't that part of PHP? They're
> running the latest version of PHP (4.3.4).

This looks like http://bugs.php.net/bug.php?id=25753 to me, which has only
recently been marked as fixed and I don't believe has made it into an
official release yet.

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: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Hi All,

function extractFieldsets($subject)
{
   $regexp="/<fieldset([^>]*)>[^(<\/fieldset>)]*/i";
   $replacement;
   $matches=array();

   preg_match_all($regexp, $subject, $matches);

   return ($matches);
}

$result=extractFieldsets('test<fieldset attribute="hello">content of
hello</fieldset><em>blah</em><fieldset
attribute="goodbye">goodbye</fieldset>');
echo "<br/>";
foreach($result as $key=>$string)
{
   echo "(".$key.")="."<br/>";
   foreach($string as $subkey=>$subres)
    echo " (".$subkey.")=[".htmlspecialchars($subres)."]<br/>";
   echo "<br/>";
}

And it produced;

(0)=
(0)=[<fieldset attribute="hello">con]
(1)=[<fieldset attribute="goodbye">goo]

(1)=
(0)=[ attribute="hello"]
(1)=[ attribute="goodbye"]

Why did it get three letters after the end of the "fieldset" tag????

"con" and "goo".

Any pointers?

attached mail follows:


On 24 February 2004 12:40, Henry Grech-Cini wrote:

> Hi All,
>
> function extractFieldsets($subject)
> {
> $regexp="/<fieldset([^>]*)>[^(<\/fieldset>)]*/i";

This: [^(<\/fieldset>)]
will match any *single* character except the ones listed -- i.e. any character that isn't one of: ()<>/defilst

So this: [^(<\/fieldset>)]*
will match any run of characters that is not in that set.

>
> And it produced;
>
> (0)=
> (0)=[<fieldset attribute="hello">con]
> (1)=[<fieldset attribute="goodbye">goo]
>
> Why did it get three letters after the end of the "fieldset" tag????

By coincidence, the 4th letter in each case is one of the set listed above, and so ends the match: "t" in "content" and "d" in "goodbye". If the second example had ahppened to be, say, "au revoir", you'd have got 4 characters ("au r").

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: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
 

attached mail follows:


Thanks for that Mike,

I was getting lost.

Is there anyway to say

Any characters excluding the sequence </fieldset>

so I could do something like

/<fieldset([^>]*)>(.* whilst not <\/fieldset>)<\/fieldset>/i

Or alternatively is there a switch to say get the smallest sequence

Thanks

Henry

"Mike Ford" <M.Fordleedsmet.ac.uk> wrote in message
news:0EEFC4D3CBE8A142868E396381B77A53D1255Flis-exchange3.lmu.ac.uk...
> On 24 February 2004 12:40, Henry Grech-Cini wrote:
>
> > Hi All,
> >
> > function extractFieldsets($subject)
> > {
> > $regexp="/<fieldset([^>]*)>[^(<\/fieldset>)]*/i";
>
> This: [^(<\/fieldset>)]
> will match any *single* character except the ones listed -- i.e. any
character that isn't one of: ()<>/defilst
>
> So this: [^(<\/fieldset>)]*
> will match any run of characters that is not in that set.
>
> >
> > And it produced;
> >
> > (0)=
> > (0)=[<fieldset attribute="hello">con]
> > (1)=[<fieldset attribute="goodbye">goo]
> >
> > Why did it get three letters after the end of the "fieldset" tag????
>
> By coincidence, the 4th letter in each case is one of the set listed
above, and so ends the match: "t" in "content" and "d" in "goodbye". If the
second example had ahppened to be, say, "au revoir", you'd have got 4
characters ("au r").
>
> 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: m.fordleedsmet.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>

attached mail follows:


I came accross this link

<a href="
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html
">
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html </a>

Do we all agree or should I keep trying?

Henry

attached mail follows:


"Henry Grech-Cini" <henryteacake.force9.co.uk> skrev i meddelandet
news:20040224153359.45706.qmailpb1.pair.com...
> Thanks for that Mike,
>
> I was getting lost.
>
> Is there anyway to say
>
> Any characters excluding the sequence </fieldset>
>
> so I could do something like
>
> /<fieldset([^>]*)>(.* whilst not <\/fieldset>)<\/fieldset>/i
>
> Or alternatively is there a switch to say get the smallest sequence
>

? is what you're looking for. i.e.: .*? instead of just .*

/j

attached mail follows:


Henry Grech-Cini schrieb:

> I came accross this link
>
> <a href="
> http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html
> ">
> http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html </a>
>
> Do we all agree or should I keep trying?
>
> Henry

hi henry,

this could be an interesting discussion. i think there can be a solution
for every problem. it's only a question of the logic.

the main problem in this example are white spaces in every kind (space,
tab, newline, carriage return, ...) and there are solutions in regex. a
little example: '/( |\t|\n|\r)*/' checks optional white spaces
you can also give '\s*' a try (any whitespace char). maybe it also works
with '\r\n'?

just some thoughts.

hth SVEN

ps: it surely is possible to ignore everything between
'<script></script>', isn't it?

attached mail follows:


On Tue, 2004-02-24 at 10:49, Henry Grech-Cini wrote:
> http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html
>
> Do we all agree or should I keep trying?

The important thing to keep in mind here is to use the right tool for
the job. If you are parsing an HTML document looking for tags,
attributes, etc. I do recommend using domxml/simplexml/some XML parsing
tool to get your job done quickly and cleanly. However, if you have a
very specific need to extract some text from a string then you can
probably get away with regular expressions. The big catch with regexp
is that it has a very low reuse value. Generally regexps are difficult
to read and rarely will you just copy and pate a regular expression from
one piece of code to another. If your regexp is growing beyond one line
and is taking a long time to process then it is time to move on.

Additionally, regular expressions are not good at providing context. It
just so happens that HTML documents are just text documents so if you
can parse the text to get what you need great. However, if you want to
move through the elements and attributes, you want something more
powerful, like XPath or XQuery. (ie. you want to find the third fieldset
child of the body element that has an attribute set to "foo")

As a side note, that article has a link to a similar one that lists a
regexp based XML parser as the only PHP solution. :)

--
Adam Bregenzer
adambregenzer.net
http://adam.bregenzer.net/

attached mail follows:


Hi All,

I don't actually think regexp is fault. But if anyone could explain this or
give me some example code that will extract the attributes and data between
a "fieldset" tag pair I would be appreciated.

Henry

"Henry Grech-Cini" <henryteacake.force9.co.uk> wrote in message
news:20040224124017.75521.qmailpb1.pair.com...
> Hi All,
>
> function extractFieldsets($subject)
> {
> $regexp="/<fieldset([^>]*)>[^(<\/fieldset>)]*/i";
> $replacement;
> $matches=array();
>
> preg_match_all($regexp, $subject, $matches);
>
> return ($matches);
> }
>
> $result=extractFieldsets('test<fieldset attribute="hello">content of
> hello</fieldset><em>blah</em><fieldset
> attribute="goodbye">goodbye</fieldset>');
> echo "<br/>";
> foreach($result as $key=>$string)
> {
> echo "(".$key.")="."<br/>";
> foreach($string as $subkey=>$subres)
> echo " (".$subkey.")=[".htmlspecialchars($subres)."]<br/>";
> echo "<br/>";
> }
>
> And it produced;
>
> (0)=
> (0)=[<fieldset attribute="hello">con]
> (1)=[<fieldset attribute="goodbye">goo]
>
> (1)=
> (0)=[ attribute="hello"]
> (1)=[ attribute="goodbye"]
>
> Why did it get three letters after the end of the "fieldset" tag????
>
> "con" and "goo".
>
> Any pointers?

attached mail follows:


Henry Grech-Cini schrieb:
...
>> $regexp="/<fieldset([^>]*)>[^(<\/fieldset>)]*/i";
...
>>$result=extractFieldsets('test<fieldset attribute="hello">content of
>>hello</fieldset><em>blah</em><fieldset
>>attribute="goodbye">goodbye</fieldset>');
...
>>And it produced;
>>(0)=
>>(0)=[<fieldset attribute="hello">con]
>>(1)=[<fieldset attribute="goodbye">goo]
>>(1)=
>>(0)=[ attribute="hello"]
>>(1)=[ attribute="goodbye"]

hi,

as it is defined in regex-spec: a '^' inside a char-group '[...]'
defines all chars, that aren't allowed, and not a string!

so the first 't' of 'content' and the 'd' of 'goodbye' don't match your
regex anymore.

a start for a solution could be:

<?php
     $rx = '/<fieldset[^>]*>(.*)<\/fieldset>/i';
?>

if you want to take care of your fieldset-attribs in your result, you
can set your brackets again: ([^>]*)

some probs i can think of are nested fieldsets inside fieldsets (don't
know by head, if this is allowed by w3). and another prob: is that you
don't catch multiple fieldsets after another. i think there is a switch,
that catches only the least result.

hth SVEN

attached mail follows:


Thanks Sven,

You are quite right with your "some probs" comment.

Do you know what the the switch is that catches only the least result?

I now get

(0)=
(0)=[<fieldset attribute="hello"><legend>hello legend</legend>content of
hello</fieldset><em>blah</em><fieldset
attribute="goodbye">goodbye</fieldset>]

(1)=
(0)=[ attribute="hello"]

(2)=
(0)=[<legend>hello legend</legend>content of
hello</fieldset><em>blah</em><fieldset attribute="goodbye">goodbye]

as we can see the second fieldset is included in that which is between the
fieldset tags!

:-(

Thanks everyone for you help including Mike (with the post out of chain).

Henry

"Sven" <sveniegmx.li> wrote in message news:403B67FB.3090806gmx.li...
> Henry Grech-Cini schrieb:
> ...
> >> $regexp="/<fieldset([^>]*)>[^(<\/fieldset>)]*/i";
> ...
> >>$result=extractFieldsets('test<fieldset attribute="hello">content of
> >>hello</fieldset><em>blah</em><fieldset
> >>attribute="goodbye">goodbye</fieldset>');
> ...
> >>And it produced;
> >>(0)=
> >>(0)=[<fieldset attribute="hello">con]
> >>(1)=[<fieldset attribute="goodbye">goo]
> >>(1)=
> >>(0)=[ attribute="hello"]
> >>(1)=[ attribute="goodbye"]
>
> hi,
>
> as it is defined in regex-spec: a '^' inside a char-group '[...]'
> defines all chars, that aren't allowed, and not a string!
>
> so the first 't' of 'content' and the 'd' of 'goodbye' don't match your
> regex anymore.
>
> a start for a solution could be:
>
> <?php
> $rx = '/<fieldset[^>]*>(.*)<\/fieldset>/i';
> ?>
>
> if you want to take care of your fieldset-attribs in your result, you
> can set your brackets again: ([^>]*)
>
> some probs i can think of are nested fieldsets inside fieldsets (don't
> know by head, if this is allowed by w3). and another prob: is that you
> don't catch multiple fieldsets after another. i think there is a switch,
> that catches only the least result.
>
> hth SVEN

attached mail follows:


Henry Grech-Cini schrieb:

> Thanks Sven,
>
> You are quite right with your "some probs" comment.

hi,

think i found it. try this:

<?php
     $rx = '/<fieldset.*>(.*)<\/fieldset>/iU';
?>

the '/U' stands for 'ungreedy'. also note the change in the attribs-regex.

hth SVEN

attached mail follows:


Hello,

I want to know how to control php program connect to MySQL Database
System ( another computer machine ) ?

Thank a lots.

Ed.

attached mail follows:


<snip>
I want to know how to control php program connect to MySQL Database
System ( another computer machine ) ?
</snip>

http://www.php.net/manual/en/function.mysql-connect.php
http://www.php.net/manual/en/function.mysql-pconnect.php

attached mail follows:


mysql_connect("IP", "username", "password");

<edwardsplita.org.mo> wrote in message news:403B552A.C81D93E1ita.org.mo...
> Hello,
>
> I want to know how to control php program connect to MySQL Database
> System ( another computer machine ) ?
>
> Thank a lots.
>
> Ed.
>
>

attached mail follows:


Does older than php 4.2.2 support with this function ?

Matt Matijevich wrote:

> <snip>
> I want to know how to control php program connect to MySQL Database
> System ( another computer machine ) ?
> </snip>
>
> http://www.php.net/manual/en/function.mysql-connect.php
> http://www.php.net/manual/en/function.mysql-pconnect.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


On Tuesday 24 February 2004 22:47, edwardsplita.org.mo wrote:
> Does older than php 4.2.2 support with this function ?

As has already been suggested, could you try reading the manual? Please?

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A great empire, like a great cake, is most easily diminished at the edges.
                -- B. Franklin
*/

attached mail follows:


Hello,

How can we connect to MS-SQL Server ?
What tools ( where can we download ) must be installed ?

Thank a lots.

PS : the php programs under Linux / Unix...

Ed.

attached mail follows:


[snip]
How can we connect to MS-SQL Server ?
What tools ( where can we download ) must be installed ?

Thank a lots.

PS : the php programs under Linux / Unix...
[/snip]

I usually connect to my servers using cables, but YMMV. Might I suggest
that you read some manuals and books? The questions that you are asking
are way too general in nature and are sure to get you flamed (I am
resisting it very much myself). Please visit the php web site, the mysql
web site the m$ sql server web site and your local bookstore on online
resource.

attached mail follows:


As Jay said, check through the manual. The answers you're looking for
may be found right here:

http://www.php.net/mssql

Jay Blanchard wrote:
> [snip]
> How can we connect to MS-SQL Server ?
> What tools ( where can we download ) must be installed ?
>
> Thank a lots.
>
> PS : the php programs under Linux / Unix...
> [/snip]
>
> I usually connect to my servers using cables, but YMMV. Might I suggest
> that you read some manuals and books? The questions that you are asking
> are way too general in nature and are sure to get you flamed (I am
> resisting it very much myself). Please visit the php web site, the mysql
> web site the m$ sql server web site and your local bookstore on online
> resource.

--
Regards,
  Ben Ramsey
  http://benramsey.com
  http://www.phpcommunity.org/wiki/People/BenRamsey

attached mail follows:


I know there is a package for Linux / Unix :

php-mysql

But, I want to know is there any tools similar with "php-mssql" for php
connect with MS-SQL ?

Any other can help ?

Thank for your help !

Ed.

Jay Blanchard wrote:

> [snip]
> How can we connect to MS-SQL Server ?
> What tools ( where can we download ) must be installed ?
>
> Thank a lots.
>
> PS : the php programs under Linux / Unix...
> [/snip]
>
> I usually connect to my servers using cables, but YMMV. Might I suggest
> that you read some manuals and books? The questions that you are asking
> are way too general in nature and are sure to get you flamed (I am
> resisting it very much myself). Please visit the php web site, the mysql
> web site the m$ sql server web site and your local bookstore on online
> resource.

attached mail follows:


Make sure you have the dll or so loaded.

mssql_connect("IP#", "username", "password");

<edwardsplita.org.mo> wrote in message news:403B574C.91195582ita.org.mo...
> Hello,
>
> How can we connect to MS-SQL Server ?
> What tools ( where can we download ) must be installed ?
>
> Thank a lots.
>
> PS : the php programs under Linux / Unix...
>
> Ed.

attached mail follows:


<snip>
But, I want to know is there any tools similar with "php-mssql" for
php
connect with MS-SQL ?

Any other can help ?
</snip>

1. look at the manual http://php.net/mssql
2. try google
3. search the list archives

attached mail follows:


http://www.freetds.org

Enjoy.

On Tue, 2004-02-24 at 08:53, edwardsplita.org.mo wrote:
> Hello,
>
> How can we connect to MS-SQL Server ?
> What tools ( where can we download ) must be installed ?
>
> Thank a lots.
>
> PS : the php programs under Linux / Unix...
>
> Ed.
--

Adam Voigt
adamkotisprop.com

attached mail follows:


The tool named "freetds" ?

Adam Voigt wrote:

> http://www.freetds.org
>
> Enjoy.
>
> On Tue, 2004-02-24 at 08:53, edwardsplita.org.mo wrote:
> > Hello,
> >
> > How can we connect to MS-SQL Server ?
> > What tools ( where can we download ) must be installed ?
> >
> > Thank a lots.
> >
> > PS : the php programs under Linux / Unix...
> >
> > Ed.
> --
>
> Adam Voigt
> adamkotisprop.com

attached mail follows:


            Hi,

    Here is the problem:

    The session gc runs and deletes the session data. This is good,
but calling session_start in PHP obviously creates a new session.

    How can I know if the session was created after an old one was
deleted because gc has invalidated it or it is a completely fresh session,
from let's say a fresh browser window.

    I googled for it and looked in the docs but I found nothing on this
matter.

Thanks in advance,
Catalin

attached mail follows:


What do you need this for.? You session is only suppose to last for one
browser session

"Catalin Trifu" <catalinisp-software.de> wrote in message
news:20040224140514.49641.qmailpb1.pair.com...
> Hi,
>
> Here is the problem:
>
> The session gc runs and deletes the session data. This is good,
> but call