OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Fri Apr 26 2002 - 20:24:38 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 27 Apr 2002 01:24:38 -0000 Issue 1310

    Topics (messages 94727 through 94845):

    PHPlib sessions without a DB?
            94727 by: Alan McKay
            94729 by: Matt Williams
            94730 by: Maxim Derkachev
            94731 by: Alan McKay
            94732 by: Maxim Derkachev

    Re: Callin PHP gurus...figure this out
            94728 by: Michael Virnstein

    Re: good php hosting environments
            94733 by: Mark Harwood

    Re: Load Balancing and PHP Sessions
            94734 by: J Smith

    Tools for stress-testing?
            94735 by: Brian McGarvie
            94737 by: Miguel Cruz

    Re: Array function to delete
            94736 by: Liam Gibbs

    Re: mail() Returned mail: Data format error (
            94738 by: Miguel Cruz

    sessions
            94739 by: Fifield, Mike
            94740 by: Miguel Cruz
            94741 by: Jan Peuker

    Code Troubles
            94742 by: Randum Ian
            94743 by: Erik Price
            94744 by: Randum Ian
            94745 by: Miguel Cruz
            94746 by: Chris Wesley
            94747 by: Miguel Cruz
            94748 by: Miguel Cruz
            94749 by: Chris Wesley

    Mail responders
            94750 by: Dennis Gearon
            94751 by: Miguel Cruz
            94755 by: Dennis Gearon
            94756 by: JSheble
            94757 by: Miguel Cruz
            94758 by: Richard Emery
            94760 by: Jason Wong
            94777 by: Steve

    passing vars. betn. php and javascript
            94752 by: Pushkar Pradhan
            94759 by: Jason Wong
            94761 by: Pushkar Pradhan
            94764 by: Jason Wong
            94767 by: Leotta, Natalie (NCI/IMS)
            94771 by: Kevin Stone
            94773 by: Pushkar Pradhan
            94778 by: Pushkar Pradhan
            94779 by: Kevin Stone
            94780 by: Erik Price
            94784 by: Pushkar Pradhan

    MySQL results
            94753 by: Nookie
            94754 by: Julie Meloni

    good php editor for the mac
            94762 by: Tom Beidler
            94766 by: Jackson Miller
            94774 by: Richard Baskett
            94775 by: Erik Price
            94776 by: Kevin Stone
            94782 by: Jess Planck
            94821 by: Jim Jagielski
            94844 by: Tom Beidler

    auto_increment
            94763 by: webmaster

    fsockopen
            94765 by: wm
            94769 by: Vail, Warren

    passing authorization code
            94768 by: wm
            94770 by: Mark Gallagher
            94772 by: John Holmes

    Re: Why is imageTTFtext function useless?(again)
            94781 by: Jim

    Microsoft Word & PHP
            94783 by: Vladislav Kulchitski
            94790 by: Miguel Cruz

    Variables not set
            94785 by: Liam Gibbs
            94786 by: Pushkar Pradhan
            94787 by: Rasmus Lerdorf
            94788 by: Steve Bradwell
            94789 by: Steve Bradwell
            94800 by: Miguel Cruz
            94804 by: Erik Price

    Sessions with register_globals = off
            94791 by: Padraig Kitterick
            94794 by: John Holmes
            94796 by: Erik Price

    web application development question
            94792 by: Erik Price
            94793 by: Jason Wong
            94795 by: Richard Baskett
            94797 by: John Holmes
            94798 by: Julio Nobrega Trabalhando
            94799 by: Richard Baskett
            94801 by: Erik Price
            94802 by: Miguel Cruz
            94803 by: SP
            94805 by: Miguel Cruz
            94806 by: Richard Baskett
            94807 by: Michael Kimsal
            94808 by: Stuart Dallas
            94841 by: SP
            94845 by: Justin French

    Safe mode
            94809 by: Ashley M. Kirchner
            94810 by: CC Zona
            94811 by: Rasmus Lerdorf
            94818 by: Ashley M. Kirchner
            94825 by: CC Zona

    getting session data
            94812 by: Deval Parikh
            94813 by: Rasmus Lerdorf
            94814 by: Javier
            94816 by: Sascha Schumann

    session_register() twice?
            94815 by: Javier
            94817 by: Sascha Schumann
            94819 by: Javier

    Counter ?
            94820 by: CMS
            94831 by: Richard Emery
            94832 by: Liam MacKenzie

    help needed with headers
            94822 by: Vins

    Opening manual - .bz2
            94823 by: r
            94826 by: Miguel Cruz
            94827 by: Donna Robinson
            94828 by: Donna Robinson
            94833 by: Philip Olson

    Question on the ~= Operator ...
            94824 by: Red Wingate
            94836 by: Kevin Stone

    avoiding creation of multiple sessions
            94829 by: Javier
            94830 by: Javier

    BBS system
            94834 by: r
            94835 by: Philip Hallstrom
            94837 by: John Hughes

    I have a real stumper!!
            94838 by: Vins

    Translation Request--Altavista Babelfish can't do it
            94839 by: Vins
            94840 by: Hugh Bothwell

    Variables not working
            94842 by: baldey_uk
            94843 by: Rasmus Lerdorf

    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:


    Folks,

    I was going through PHPlib for the first time to assess whether or not I
    can use it on a current project, and it looks pretty clear to me that you
    need a DB in order to use the session management.

    My environment will be a Windows NT 4.0 SP5 box running Apache
    and PHP. I have no DB on the box, and am not allowed to introduce one,
    nor am I allowed to rely on an external DB of any sort.

    Is there a way to use PHPlib sessions in this environment?

    thanks,
    -Alan

    attached mail follows:


    On Friday 26 April 2002 2:25 pm, Alan McKay wrote:

    > Folks,
    >
    > I was going through PHPlib for the first time to assess whether or not I
    > can use it on a current project, and it looks pretty clear to me that you
    > need a DB in order to use the session management.
    >
    > My environment will be a Windows NT 4.0 SP5 box running Apache
    > and PHP.  I have no DB on the box, and am not allowed to introduce one,
    > nor am I allowed to rely on an external DB of any sort.
    >
    > Is there a way to use PHPlib sessions in this environment?

    Hi Alan

    I think this is primarily due to the fact that the phplib sessions were
    around before php built in sessions.

    In the current CVS for phplib there are some files that allow you to utilise
    php's built in sessions. This enables you to use file storage for sessions.

    I've been using the session4 stuff with phplib for a while and works well,
    but this is using db storage. I wouldn't imagine there will be a problem just
    using a different session container.

    As for the default distribution of phplib I don't know if this can use files
    for session storage I haven't had the need to find out.

    HTH

    matt

    attached mail follows:


    MW> I've been using the session4 stuff with phplib for a while and works well,
    MW> but this is using db storage. I wouldn't imagine there will be a problem just
    MW> using a different session container.

    Session4 without Session4_custom uses native php containers, e.g.
    files or mm.

    MW> As for the default distribution of phplib I don't know if this can use files
    MW> for session storage I haven't had the need to find out.

    -- 
    Best regards,
    Maxim Derkachev mailto:max.derkachevbooks.ru
    System administrator & programmer,
    Symbol-Plus Publishing Ltd.
    phone: +7 (812) 324-53-53
    www.books.ru, www.symbol.ru 
    

    attached mail follows:


    > Session4 without Session4_custom uses native php containers, e.g. > files or mm.

    Where is this "session4"?

    I pulled "php-lib-stable" out of CVS yesterday and do not see this anywhere. Is this part of the "bleeding edge" in "php-lib" (without the "stable") in CVS?

    thanks, -Alan

    attached mail follows:


    Hello Alan,

    Friday, April 26, 2002, 5:57:29 PM, you wrote:

    AM> Where is this "session4"? AM> I pulled "php-lib-stable" out of CVS yesterday and do not see this anywhere. AM> Is this part of the "bleeding edge" in "php-lib" (without the "stable") in CVS?

    Yes, it is not in -stable yet, as I know.

    -- 
    Best regards,
    Maxim Derkachev mailto:max.derkachevbooks.ru
    System administrator & programmer,
    Symbol-Plus Publishing Ltd.
    phone: +7 (812) 324-53-53
    www.books.ru, www.symbol.ru 
    

    attached mail follows:


    nice one! didn't notice this function yet!

    Regards Michael

    "John Holmes" <holmes072000charter.net> schrieb im Newsbeitrag news:000101c1ed33$e2f13c60$b402a8c0mango... > Use wordwrap() to wrap the text to 75 characters and str_replace() to > replace " with ' > > www.php.net/wordwrap > www.php.net/str_replace > > ---John Holmes... > > > -----Original Message----- > > From: r [mailto:rjumac.com] > > Sent: Friday, April 26, 2002 3:08 PM > > To: php-generallists.php.net > > Subject: [PHP] Callin PHP gurus...figure this out > > > > Greetings All, > > (Special greetings go out to Steve for excellient previous help - > Thanks > > again dude) > > Calling all PHP gurus, have broked my head over this but cant seem to > > figure > > this out in c,perl or java servlets. > > Am new to PHP so dont even know the common functions leave alone the > > answer > > to this problem. > > Heres the setup: > > I have a form with just one TEXTAREA > > Data from this form is entered directly into the database > > > > BUT... > > > > everytime a user presses the ENTER or RETURN key on the keyboard, when > the > > PHP script validates the form > > I want it to add <br> it should also add a <br> if the line is > > sayyyyy....75 > > charactors long & if there is no <br> or enter key pressed.. > > If it finds any " it should convert it to ' > > > > Any ideas? > > > > Any help appreciated. > > Have a great day. > > -Ryan A. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Try www.xcalibre.co.uk

    "Hamish" <hamishhamishprice.co.uk> wrote in message news:20020426075853.9531.qmailmail.theinternetone.net... > Hello, > I'm looking for a really good, professional hosting environment in the uk > that supports php (not in safe mode)), mysql and offers the use of a secure > server and mail server. I'm looking for a client of mine who needs to rely > on their site being up, and so needs a hoster who has enough redundancy in > all systems. We have a budget of between £200 and £400 a year, but don't > want to get stuck with bandwidth charges, database usage, etc etc.. > It would be good if the hoster also offered a remote control panel as well > as ftp access to the server. > Does any one have any suggested companies, or companies that they've had > good experiences using? > > cheers > Hamish

    attached mail follows:


    A better way to set this up might be to use a reverse proxy in front of www1.test.com and www2.test.com. Users would go to www.test.com and the reverse proxy would forward communications between the front-end and the servers in the back, thereby balancing the load. Cookies should still work fine, regardless of the server that actually sets them. (I'm not sure if PHP's built-in sessions would work...)

    Since I'm assuming you're using Apache here, you'd most likely want to look into using Squid, which is a kick-ass proxy. Setting up the re-director is a bit of a hastle, since you basically have to write one from scratch, but it isn't too difficult. (There are lots of pre-made ones that can handle things like round-robins, randomness, all that jazz.)

    J

    Baumann Reto wrote:

    > Is it possible to have sessions (via cookie) on a load balanced > environment? Therefore having > www1.test.com > and www2.test.com > > and share the same sessions? The systems can access the same file-system, > but it seems that the session is not passed. Could this have something to > do with session.cookie_domain? > > Thanks for any help > > Reto

    attached mail follows:


    Just wondering what the best tool/utility is to stress test PHP/IIS 5 combination obviously on win2k server?

    ======================================================== Brian M McGarvie, eCommerce Co-ordinator/Consultant ======================================================== [ www.mcgarvie.net | www.lennox-mckinlay.co.uk] ========================================================

    attached mail follows:


    On Fri, 26 Apr 2002, Brian McGarvie wrote: > Just wondering what the best tool/utility is to stress test PHP/IIS 5 > combination obviously on win2k server?

    The old standard is ab (apache bench) which comes with Apache. It just sends out HTTP requests so it can be used to choke any web server.

    miguel

    attached mail follows:


    > But PHP builtins will do exactly this, around 3 > times faster, too. :)

    Yup. This one with array_diff was the winner. Thanks to all for your suggestions and Lars for the working one.

    Liam

    __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/

    attached mail follows:


    On Fri, 26 Apr 2002, SeanW wrote: > Using this command > > mail( > > $mailrow[email], > $subject, > $spamstr, > "From: memydomain\r\n > Content-type: text/html; charset=us-ascii\r\n > Contenet-Transfer-Encoding: 7bit\r\n > MIME-Version: 1.0n" > ); > > I get bounces only from some servers with this message ,

    Perhaps not all hosts can understand the Contenet-Transfer-Encoding header. It's a very special feature only supported by a few operating systems with FlexiSpell(tm).

    miguel

    attached mail follows:


    Is there a way to return the total number of sessions currently registered on a server?

    attached mail follows:


    On Fri, 26 Apr 2002, Fifield, Mike wrote: > Is there a way to return the total number of sessions currently registered > on a server?

    You could count the files in the session store directory.

    miguel

    attached mail follows:


    If you use files you might get the contens of the folder where sessions stored and just count.

    Jan ----- Original Message ----- From: "Fifield, Mike" <Mike.Fifieldschwab.com> To: <php-generallists.php.net> Sent: Friday, April 26, 2002 5:57 PM Subject: [PHP] sessions

    > Is there a way to return the total number of sessions currently registered > on a server? > > >

    attached mail follows:


    Hi all, Im having trouble with this code, can anyone help?

    ---
    

    <?php // db.php

    $dbhost = "localhost"; $dbuser = "dancepo_db"; $dbpass = "database";

    function dbConnect($db="dancepo_db") { global $dbhost, $dbuser, $dbpass; $dbcnx = mysql_connect($dbhost, $dbuser, $dbpass) or die("The site database appears to be down.");

    if ($db!="" and !mysql_select_db($db)) die("The site database is unavailable."); return $dbcnx; } ?>

    ---

    Cheers, Ian. --- Randum Ian DJ / Reviewer / Webmaster, DancePortal (UK) Limited iandanceportal.co.uk http://www.danceportal.co.uk DancePortal.co.uk - Global dance music media

    attached mail follows:


    On Friday, April 26, 2002, at 12:20 PM, Randum Ian wrote:

    > Hi all, Im having trouble with this code, can anyone help? > > --- > > <?php // db.php > > $dbhost = "localhost"; > $dbuser = "dancepo_db"; > $dbpass = "database"; > > function dbConnect($db="dancepo_db") { > global $dbhost, $dbuser, $dbpass; > > $dbcnx = mysql_connect($dbhost, $dbuser, $dbpass) > or die("The site database appears to be down."); > > if ($db!="" and !mysql_select_db($db)) > die("The site database is unavailable."); > > return $dbcnx; > } > ?>

    Well, you've simply defined a few variables and then a function. Do you expect it to do something?

    Show us the context in which this function is used.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    The trouble I got with it is the code is chucking back the "The site database is unavailable." error and it is indeed available. I have used other scripts at the same time and they are pumping it back. It is not a way of coding I have used before and wondered if it was the code?

    I am simply finding different ways of logging onto a mySQL db.

    ----- Original Message ----- From: "Erik Price" <priceehhbrown.com> To: "Randum Ian" <iandanceportal.co.uk> Cc: "PHP" <php-generallists.php.net> Sent: Friday, April 26, 2002 5:21 PM Subject: Re: [PHP] Code Troubles

    > > On Friday, April 26, 2002, at 12:20 PM, Randum Ian wrote: > > > Hi all, Im having trouble with this code, can anyone help? > > > > --- > > > > <?php // db.php > > > > $dbhost = "localhost"; > > $dbuser = "dancepo_db"; > > $dbpass = "database"; > > > > function dbConnect($db="dancepo_db") { > > global $dbhost, $dbuser, $dbpass; > > > > $dbcnx = mysql_connect($dbhost, $dbuser, $dbpass) > > or die("The site database appears to be down."); > > > > if ($db!="" and !mysql_select_db($db)) > > die("The site database is unavailable."); > > > > return $dbcnx; > > } > > ?> > > Well, you've simply defined a few variables and then a function. Do you > expect it to do something? > > Show us the context in which this function is used. > > > Erik > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com > > >

    attached mail follows:


    It helps to say what sort of trouble you're having; i.e., provide symptoms, exact text of error messages, etc.

    miguel

    On Fri, 26 Apr 2002, Randum Ian wrote: > Hi all, Im having trouble with this code, can anyone help? > > --- > > <?php // db.php > > $dbhost = "localhost"; > $dbuser = "dancepo_db"; > $dbpass = "database"; > > function dbConnect($db="dancepo_db") { > global $dbhost, $dbuser, $dbpass; > > $dbcnx = mysql_connect($dbhost, $dbuser, $dbpass) > or die("The site database appears to be down."); > > if ($db!="" and !mysql_select_db($db)) > die("The site database is unavailable."); > > return $dbcnx; > } > ?> > > --- > > Cheers, Ian. > --- > Randum Ian > DJ / Reviewer / Webmaster, DancePortal (UK) Limited > iandanceportal.co.uk > http://www.danceportal.co.uk > DancePortal.co.uk - Global dance music media > > >

    attached mail follows:


    > if ($db!="" and !mysql_select_db($db)) > die("The site database is unavailable.");

    you probably want an "or" before that die().

    g.luck, ~Chris /"\ \ / Microsoft Security Specialist: X The moron in Oxymoron. / \ http://www.thebackrow.net

    On Fri, 26 Apr 2002, Randum Ian wrote:

    > Hi all, Im having trouble with this code, can anyone help? > > --- > > <?php // db.php > > $dbhost = "localhost"; > $dbuser = "dancepo_db"; > $dbpass = "database"; > > function dbConnect($db="dancepo_db") { > global $dbhost, $dbuser, $dbpass; > > $dbcnx = mysql_connect($dbhost, $dbuser, $dbpass) > or die("The site database appears to be down."); > > if ($db!="" and !mysql_select_db($db)) > die("The site database is unavailable."); > > return $dbcnx; > } > ?> > > --- > > Cheers, Ian. > --- > Randum Ian > DJ / Reviewer / Webmaster, DancePortal (UK) Limited > iandanceportal.co.uk > http://www.danceportal.co.uk > DancePortal.co.uk - Global dance music media > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Why not take the off mysql_select_db($db) so that you can see which particular error is being returned? Or print mysql_error().

    miguel

    On Fri, 26 Apr 2002, Randum Ian wrote:

    > The trouble I got with it is the code is chucking back the "The site > database is unavailable." error and it is indeed available. I have used > other scripts at the same time and they are pumping it back. It is not a way > of coding I have used before and wondered if it was the code? > > I am simply finding different ways of logging onto a mySQL db. > > ----- Original Message ----- > From: "Erik Price" <priceehhbrown.com> > To: "Randum Ian" <iandanceportal.co.uk> > Cc: "PHP" <php-generallists.php.net> > Sent: Friday, April 26, 2002 5:21 PM > Subject: Re: [PHP] Code Troubles > > > > > > On Friday, April 26, 2002, at 12:20 PM, Randum Ian wrote: > > > > > Hi all, Im having trouble with this code, can anyone help? > > > > > > --- > > > > > > <?php // db.php > > > > > > $dbhost = "localhost"; > > > $dbuser = "dancepo_db"; > > > $dbpass = "database"; > > > > > > function dbConnect($db="dancepo_db") { > > > global $dbhost, $dbuser, $dbpass; > > > > > > $dbcnx = mysql_connect($dbhost, $dbuser, $dbpass) > > > or die("The site database appears to be down."); > > > > > > if ($db!="" and !mysql_select_db($db)) > > > die("The site database is unavailable."); > > > > > > return $dbcnx; > > > } > > > ?> > > > > Well, you've simply defined a few variables and then a function. Do you > > expect it to do something? > > > > Show us the context in which this function is used. > > > > > > Erik > > > > > > > > ---- > > > > Erik Price > > Web Developer Temp > > Media Lab, H.H. Brown > > priceehhbrown.com > > > > > > > > >

    attached mail follows:


    On Fri, 26 Apr 2002, Chris Wesley wrote: >> if ($db!="" and !mysql_select_db($db)) >> die("The site database is unavailable."); > > you probably want an "or" before that die().

    How would that work?

    miguel

    attached mail follows:


    if( $db ){ mysql_select_db($db) or die("The site database is unavailable."); }

    To debug, use print( mysql_error ) instead of die to figure out what's going on. It's not that far of a leap in logic.

    ~Chris /"\ \ / Microsoft Security Specialist: X The moron in Oxymoron. / \ http://www.thebackrow.net

    On Fri, 26 Apr 2002, Miguel Cruz wrote:

    > On Fri, 26 Apr 2002, Chris Wesley wrote: > >> if ($db!="" and !mysql_select_db($db)) > >> die("The site database is unavailable."); > > > > you probably want an "or" before that die(). > > How would that work? > > miguel > >

    attached mail follows:


    All these lists that have addresses to subscribe, unsubscribe, etc, how do they work? Are they using a cron job to poll the mail inbox through sendmail? Does all mail not to a specific address at the site go to a 'catchall' address, which is then polled?

    -- 
    

    If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/

    attached mail follows:


    On Fri, 26 Apr 2002, Dennis Gearon wrote: > All these lists that have addresses to subscribe, unsubscribe, etc, how > do they work? Are they using a cron job to poll the mail inbox through > sendmail? Does all mail not to a specific address at the site go to a > 'catchall' address, which is then polled?

    Usually the mail is delivered directly to a program rather than to a mailbox. The program receives the incoming message as input and handles it as it pleases.

    miguel

    attached mail follows:


    How is that done on the box?

    Miguel Cruz wrote: > > On Fri, 26 Apr 2002, Dennis Gearon wrote: > > All these lists that have addresses to subscribe, unsubscribe, etc, how > > do they work? Are they using a cron job to poll the mail inbox through > > sendmail? Does all mail not to a specific address at the site go to a > > 'catchall' address, which is then polled? > > Usually the mail is delivered directly to a program rather than to a > mailbox. The program receives the incoming message as input and handles it > as it pleases. > > miguel

    -- 
    

    If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/

    attached mail follows:


    How would you set this up via PHP? I've wanted to do this, but I always thought it was something specific to SendMail, and in a hosted environment, mucking about with SendMail generally isn't allowed...

    I'd like to send an email to something like admindomain.com but have a PHP script get the mail and operate on it...

    At 11:56 AM 4/26/2002 -0500, you wrote: >On Fri, 26 Apr 2002, Dennis Gearon wrote: > > All these lists that have addresses to subscribe, unsubscribe, etc, how > > do they work? Are they using a cron job to poll the mail inbox through > > sendmail? Does all mail not to a specific address at the site go to a > > 'catchall' address, which is then polled? > >Usually the mail is delivered directly to a program rather than to a >mailbox. The program receives the incoming message as input and handles it >as it pleases. > >miguel > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    1) Make sure you have built the CGI versions of PHP.

    2) Create a PHP script file that begings with a bangpath invocation of the PHP CGI binary. So, if your standalone PHP were located in /usr/local/bin/php, your PHP file would start with:

    #!/usr/local/bin/php -q

    3) In your script, use fopen, etc., to read from "php://stdin". The incoming message will be there.

    4) Do anything you like with the data. Store it in databases, create a reply and mail() it out, etc.

    5) You'll have to convince sendmail to deliver mail for one or more addresses to your PHP script file. With qmail it's a matter of creating a .qmail file with |/path/name but I wouldn't know how to do that particular thing with sendmail as I never use it.

    Good luck!

    miguel

    On Fri, 26 Apr 2002, JSheble wrote:

    > How would you set this up via PHP? I've wanted to do this, but I always > thought it was something specific to SendMail, and in a hosted environment, > mucking about with SendMail generally isn't allowed... > > I'd like to send an email to something like admindomain.com but have a > PHP script get the mail and operate on it... > > At 11:56 AM 4/26/2002 -0500, you wrote: > >On Fri, 26 Apr 2002, Dennis Gearon wrote: > > > All these lists that have addresses to subscribe, unsubscribe, etc, how > > > do they work? Are they using a cron job to poll the mail inbox through > > > sendmail? Does all mail not to a specific address at the site go to a > > > 'catchall' address, which is then polled? > > > >Usually the mail is delivered directly to a program rather than to a > >mailbox. The program receives the incoming message as input and handles it > >as it pleases. > > > >miguel > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    You must have control over the Message Transfer Agent (MTA), such as SendMail. Or, if your host uses qmail MTA, you set it up using the dot-qmail files in your user directory.

    ----- Original Message ----- From: Dennis Gearon <gearondcvc.net> To: <php-generallists.php.net> Sent: Friday, April 26, 2002 12:05 PM Subject: Re: [PHP] Mail responders

    How is that done on the box?

    Miguel Cruz wrote: > > On Fri, 26 Apr 2002, Dennis Gearon wrote: > > All these lists that have addresses to subscribe, unsubscribe, etc, how > > do they work? Are they using a cron job to poll the mail inbox through > > sendmail? Does all mail not to a specific address at the site go to a > > 'catchall' address, which is then polled? > > Usually the mail is delivered directly to a program rather than to a > mailbox. The program receives the incoming message as input and handles it > as it pleases. > > miguel

    --
    

    If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/

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

    attached mail follows:


    On Saturday 27 April 2002 01:13, JSheble wrote: > How would you set this up via PHP? I've wanted to do this, but I always > thought it was something specific to SendMail, and in a hosted environment, > mucking about with SendMail generally isn't allowed... > > I'd like to send an email to something like admindomain.com but have a > PHP script get the mail and operate on it... > > At 11:56 AM 4/26/2002 -0500, you wrote: > >On Fri, 26 Apr 2002, Dennis Gearon wrote: > > > All these lists that have addresses to subscribe, unsubscribe, etc, how > > > do they work? Are they using a cron job to poll the mail inbox through > > > sendmail? Does all mail not to a specific address at the site go to a > > > 'catchall' address, which is then polled? > > > >Usually the mail is delivered directly to a program rather than to a > >mailbox. The program receives the incoming message as input and handles it > >as it pleases.

    What are you actually trying to do? If you're trying to make a mailing-list type program then you're better off using an existing mailing list program.

    Otherwise with sendmail you can use procmail. It's clunky but doable.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* "The whole world is about three drinks behind." -- Humphrey Bogart */

    attached mail follows:


    <snip> < I'd like to send an email to something like admindomain.com but have a < PHP script get the mail and operate on it... <snip>

    You might want to reference an article from the May issue of Sysadmin Magazine ( http://www.sysadminmag.com/ ) title 'Using Email to Perform UNIX System Monitoring and Control' by Bob Dilworth. On the down side of your question, the article describes how Perl and Sendmail is used to execute commands, not PHP. This should give you some ideas on how to approach it though.

    -Steve

    attached mail follows:


    I need to pass an array from php to javascript, change the ordering of the elements in javasc.. pass this reordered array back to php script? Is it possible to do this and if so can anyone send me the basic code, I've never written javascript? Thanks,

    -Pushkar S. Pradhan

    attached mail follows:


    On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote: > I need to pass an array from php to javascript, > change the ordering of the elements in javasc.. > pass this reordered array back to php script? > Is it possible to do this and if so can anyone send me the basic code, > I've never written javascript? Thanks,

    How is the array reordered?

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Maturity is only a short break in adolescence. -- Jules Feiffer */

    attached mail follows:


    In my php I had 4 buttons, up, down, top and bottom: After detecting which element and which button was clicked I changed the element position by using array_slice, shift, unshift, array_merge etc.. I'm not sure what I'll do it JS > On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote: > > I need to pass an array from php to javascript, > > change the ordering of the elements in javasc.. > > pass this reordered array back to php script? > > Is it possible to do this and if so can anyone send me the basic code, > > I've never written javascript? Thanks, > > How is the array reordered? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Maturity is only a short break in adolescence. > -- Jules Feiffer > */ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -Pushkar S. Pradhan

    attached mail follows:


    On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote: > In my php I had 4 buttons, up, down, top and bottom: > After detecting which element and which button was clicked I changed the > element position by > using array_slice, shift, unshift, array_merge etc.. > I'm not sure what I'll do it JS

    Well, depending on how you were reordering the array I was going to suggest you use php. Since you already have a version in php and you want to do it in javascript then ...

    > > > I've never written javascript? Thanks,

    I suggest you learn some javascript then think about how to "pass an array" to it from php :)

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* The profession of book writing makes horse racing seem like a solid, stable business. -- John Steinbeck [Horse racing *is* a stable business ...] */

    attached mail follows:


    Is there any reason that you have to use JS to redo the array? I did something like this once and had the buttons monitored by JS, then when you click it set a hidden var (with a name like sort) and submitted the page. Then my PHP read in everything and redrew the graph based on what we were sorting by. It wasn't as difficult as it sounds - the only problem was they decided that it wasn't pertinent to that graph, so we aren't using it anymore. I don't know if I have any of the code left.

    -Natalie

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Friday, April 26, 2002 1:46 PM To: php-generallists.php.net Subject: Re: [PHP] passing vars. betn. php and javascript

    On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote: > In my php I had 4 buttons, up, down, top and bottom: > After detecting which element and which button was clicked I changed > the element position by using array_slice, shift, unshift, array_merge > etc.. I'm not sure what I'll do it JS

    Well, depending on how you were reordering the array I was going to suggest you use php. Since you already have a version in php and you want to do it in javascript then ...

    > > > I've never written javascript? Thanks,

    I suggest you learn some javascript then think about how to "pass an array" to it from php :)

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* The profession of book writing makes horse racing seem like a solid, stable business. -- John Steinbeck [Horse racing *is* a stable business ...] */

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

    attached mail follows:


    This sounds susspiciously like a Javascript question to me. :)

    I wrote a PHP/Javascript system a while back that prints out an event calendar on a client page. The Javascript is copy&paste so you can have the calendar show up on any web page anywhere in the world. It works like this..

    The Javascript on the client's page redirects to the PHP script on my server with display_dates and clientid in the URL string. Then the PHP script parses $_GET and extracts the requested data from the database. Then the PHP script does a redirect back to the originating Javascript (known by $HTTP_REFERER) with the compressed data (again in the URL string). The Javascript does some simple parsing and generates the calendar table based on the extracted values.

    This sounds a lot like what you want to do. But how you parse the data in Javascript is obviously not a PHP question. Are you're certain this reordering isn't something that can be done in PHP? I guess my real question is what is the Javascript for?

    -Kevin

    ----- Original Message ----- From: "Pushkar Pradhan" <pushkarERC.MsState.Edu> To: <php-generallists.php.net> Sent: Friday, April 26, 2002 11:23 AM Subject: Re: [PHP] passing vars. betn. php and javascript

    > In my php I had 4 buttons, up, down, top and bottom: > After detecting which element and which button was clicked I changed the > element position by > using array_slice, shift, unshift, array_merge etc.. > I'm not sure what I'll do it JS

    > > On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote: > > > I need to pass an array from php to javascript, > > > change the ordering of the elements in javasc.. > > > pass this reordered array back to php script? > > > Is it possible to do this and if so can anyone send me the basic code, > > > I've never written javascript? Thanks, > > > > How is the array reordered? > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > /* > > Maturity is only a short break in adolescence. > > -- Jules Feiffer > > */ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -Pushkar S. Pradhan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Actually I was frustrated trying to redirect to a new page and not being able to pass the array along to the new page usign header(), I won't get the array in my new page. Also I thought JS would be faster since the client can submit after doing as many reorderings as he/she wants.

    > Is there any reason that you have to use JS to redo the array? I did > something like this once and had the buttons monitored by JS, then when you > click it set a hidden var (with a name like sort) and submitted the page. > Then my PHP read in everything and redrew the graph based on what we were > sorting by. It wasn't as difficult as it sounds - the only problem was they > decided that it wasn't pertinent to that graph, so we aren't using it > anymore. I don't know if I have any of the code left. > > -Natalie > > -----Original Message----- > From: Jason Wong [mailto:php-generalgremlins.com.hk] > Sent: Friday, April 26, 2002 1:46 PM > To: php-generallists.php.net > Subject: Re: [PHP] passing vars. betn. php and javascript > > > On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote: > > In my php I had 4 buttons, up, down, top and bottom: > > After detecting which element and which button was clicked I changed > > the element position by using array_slice, shift, unshift, array_merge > > etc.. I'm not sure what I'll do it JS > > Well, depending on how you were reordering the array I was going to suggest > you use php. Since you already have a version in php and you want to do it > in > javascript then ... > > > > > I've never written javascript? Thanks, > > I suggest you learn some javascript then think about how to "pass an array" > to it from php :) > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > The profession of book writing makes horse racing seem like a solid, stable > business. > -- John Steinbeck > [Horse racing *is* a stable business ...] > */ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -Pushkar S. Pradhan

    attached mail follows:


    Believe me I certainly don't want to ask a JS ques. here, I am reading tutorials on the web! I already accomplished reordering using PHP, I gave up on php since I wasn't able to pass arrays betn. pages using header(). In PHP when user moves each element and submits up, down, top or bottom there is server-client communication while in JS there will be server-client comm. only at the end when a Done button is pressed. i.e. SPEED :-)

    > This sounds susspiciously like a Javascript question to me. :) > > I wrote a PHP/Javascript system a while back that prints out an event > calendar on a client page. The Javascript is copy&paste so you can have the > calendar show up on any web page anywhere in the world. It works like > this.. > > The Javascript on the client's page redirects to the PHP script on my server > with display_dates and clientid in the URL string. Then the PHP script > parses $_GET and extracts the requested data from the database. Then the > PHP script does a redirect back to the originating Javascript (known by > $HTTP_REFERER) with the compressed data (again in the URL string). The > Javascript does some simple parsing and generates the calendar table based > on the extracted values. > > This sounds a lot like what you want to do. But how you parse the data in > Javascript is obviously not a PHP question. Are you're certain this > reordering isn't something that can be done in PHP? I guess my real > question is what is the Javascript for? > > -Kevin > > ----- Original Message ----- > From: "Pushkar Pradhan" <pushkarERC.MsState.Edu> > To: <php-generallists.php.net> > Sent: Friday, April 26, 2002 11:23 AM > Subject: Re: [PHP] passing vars. betn. php and javascript > > > > In my php I had 4 buttons, up, down, top and bottom: > > After detecting which element and which button was clicked I changed the > > element position by > > using array_slice, shift, unshift, array_merge etc.. > > I'm not sure what I'll do it JS > > > > On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote: > > > > I need to pass an array from php to javascript, > > > > change the ordering of the elements in javasc.. > > > > pass this reordered array back to php script? > > > > Is it possible to do this and if so can anyone send me the basic code, > > > > I've never written javascript? Thanks, > > > > > > How is the array reordered? > > > > > > -- > > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > > Open Source Software Systems Integrators > > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > > > /* > > > Maturity is only a short break in adolescence. > > > -- Jules Feiffer > > > */ > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -Pushkar S. Pradhan > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > >

    -Pushkar S. Pradhan

    attached mail follows:


    Okay I'm beginning to understand. I don't think you have to use Javascript in this situation you jsut have to be a little clever about how you build your URL string. You can send an array through the URL by splitting up each value like this..

    $url = 'http://www.domain.com/index.php?myarray[]='.$myarray[0]; for ($i=1; $i<count($myarray); $i++) { $url .= '&myarray[]='.$myarray[$i]; } header("Location: $url");

    You will get $_GET[myarray] on the other side. OR you can do a single comma or semicolon delimited string and then explode(',' $myarray) on the other end to reconstitue the array. Hope that helps.

    -Kevin

    ----- Original Message ----- From: "Pushkar Pradhan" <pushkarERC.MsState.Edu> To: "Leotta, Natalie (NCI/IMS)" <LeottaNims.nci.nih.gov> Cc: <php-generallists.php.net> Sent: Friday, April 26, 2002 12:10 PM Subject: RE: [PHP] passing vars. betn. php and javascript

    > Actually I was frustrated trying to redirect to a new page and not being > able to pass the array along to the new page usign header(), I won't get > the array in my new page. Also I thought JS would be faster since the > client can submit after doing as many reorderings as he/she wants. > > > Is there any reason that you have to use JS to redo the array? I did > > something like this once and had the buttons monitored by JS, then when you > > click it set a hidden var (with a name like sort) and submitted the page. > > Then my PHP read in everything and redrew the graph based on what we were > > sorting by. It wasn't as difficult as it sounds - the only problem was they > > decided that it wasn't pertinent to that graph, so we aren't using it > > anymore. I don't know if I have any of the code left. > > > > -Natalie > > > > -----Original Message----- > > From: Jason Wong [mailto:php-generalgremlins.com.hk] > > Sent: Friday, April 26, 2002 1:46 PM > > To: php-generallists.php.net > > Subject: Re: [PHP] passing vars. betn. php and javascript > > > > > > On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote: > > > In my php I had 4 buttons, up, down, top and bottom: > > > After detecting which element and which button was clicked I changed > > > the element position by using array_slice, shift, unshift, array_merge > > > etc.. I'm not sure what I'll do it JS > > > > Well, depending on how you were reordering the array I was going to suggest > > you use php. Since you already have a version in php and you want to do it > > in > > javascript then ... > > > > > > > I've never written javascript? Thanks, > > > > I suggest you learn some javascript then think about how to "pass an array" > > to it from php :) > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > /* > > The profession of book writing makes horse racing seem like a solid, stable > > business. > > -- John Steinbeck > > [Horse racing *is* a stable business ...] > > */ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -Pushkar S. Pradhan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    On Friday, April 26, 2002, at 02:15 PM, Pushkar Pradhan wrote:

    > Believe me I certainly don't want to ask a JS ques. here, I am reading > tutorials on the web! > I already accomplished reordering using PHP, I gave up on php since I > wasn't able to pass arrays betn. pages using header().

    If your arrays are not huge, why can you not simply use the GET method?

    $array = array('mutant', 'zombie', 'psychic'); $temp_array = array(); foreach ($array as $freak) { $temparray[] = 'freaks[]=' . $freak; } $headerstring = implode('&', $temparray);

    header('Location: http://www.domain.com/page.php?' . $headerstring);

    The above code creates a querystring that should look like

    freaks[]=mutant&freaks[]=zombie&freaks[]=psychic

    Then, in your "receiving" PHP page, just do something like

    foreach ($_GET['freaks'] as $freak) { print $freak; }

    Or whatever processing you need to do.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Great! It works fine. Thanks to Kevin, Erik, Miguel and all others who responded to this query since yesterday. I have $QUERY_STRING in my php 4.0.6.

    On Fri, 26 Apr 2002, Kevin Stone wrote:

    > Okay I'm beginning to understand. I don't think you have to use Javascript > in this situation you jsut have to be a little clever about how you build > your URL string. You can send an array through the URL by splitting up each > value like this.. > > $url = 'http://www.domain.com/index.php?myarray[]='.$myarray[0]; > for ($i=1; $i<count($myarray); $i++) > { > $url .= '&myarray[]='.$myarray[$i]; > } > header("Location: $url"); > > You will get $_GET[myarray] on the other side. OR you can do a single comma > or semicolon delimited string and then explode(',' $myarray) on the other > end to reconstitue the array. Hope that helps. > > -Kevin > > ----- Original Message ----- > From: "Pushkar Pradhan" <pushkarERC.MsState.Edu> > To: "Leotta, Natalie (NCI/IMS)" <LeottaNims.nci.nih.gov> > Cc: <php-generallists.php.net> > Sent: Friday, April 26, 2002 12:10 PM > Subject: RE: [PHP] passing vars. betn. php and javascript > > > > Actually I was frustrated trying to redirect to a new page and not being > > able to pass the array along to the new page usign header(), I won't get > > the array in my new page. Also I thought JS would be faster since the > > client can submit after doing as many reorderings as he/she wants. > > > > > Is there any reason that you have to use JS to redo the array? I did > > > something like this once and had the buttons monitored by JS, then when > you > > > click it set a hidden var (with a name like sort) and submitted the > page. > > > Then my PHP read in everything and redrew the graph based on what we > were > > > sorting by. It wasn't as difficult as it sounds - the only problem was > they > > > decided that it wasn't pertinent to that graph, so we aren't using it > > > anymore. I don't know if I have any of the code left. > > > > > > -Natalie > > > > > > -----Original Message----- > > > From: Jason Wong [mailto:php-generalgremlins.com.hk] > > > Sent: Friday, April 26, 2002 1:46 PM > > > To: php-generallists.php.net > > > Subject: Re: [PHP] passing vars. betn. php and javascript > > > > > > > > > On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote: > > > > In my php I had 4 buttons, up, down, top and bottom: > > > > After detecting which element and which button was clicked I changed > > > > the element position by using array_slice, shift, unshift, array_merge > > > > etc.. I'm not sure what I'll do it JS > > > > > > Well, depending on how you were reordering the array I was going to > suggest > > > you use php. Since you already have a version in php and you want to do > it > > > in > > > javascript then ... > > > > > > > > > I've never written javascript? Thanks, > > > > > > I suggest you learn some javascript then think about how to "pass an > array" > > > to it from php :) > > > > > > -- > > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > > Open Source Software Systems Integrators > > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > > > /* > > > The profession of book writing makes horse racing seem like a solid, > stable > > > business. > > > -- John Steinbeck > > > [Horse racing *is* a stable business ...] > > > */ > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -Pushkar S. Pradhan > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -Pushkar S. Pradhan

    attached mail follows:


    Hello, I have a question: does anyone know how to divide MySQL results to pages and display on a website in "1 2 3 4" form?

    Greetings, Simon Kosok http://www.shakira-online.net

    attached mail follows:


    N> Hello, I have a question: does anyone know how to divide MySQL results to N> pages and display on a website in "1 2 3 4" form?

    Use LIMIT within your SELECT statement: http://www.mysql.com/doc/S/E/SELECT.html

    - Julie

    --> Julie Meloni --> juliethickbook.com --> www.thickbook.com

    Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20

    attached mail follows:


    Could someone suggest a good php editor for the mac? I'm currently using Dreamweaver because I like the site management and a wysiwyg html editor. But otherwise it's a bummer because it doesn't support php.

    attached mail follows:


    There is a PHP plugin for Dreamweaver from AlphaSigma. http://www.alphasigma.com

    -Jackson

    On Fri, 2002-04-26 at 13:33, Tom Beidler wrote: > Could someone suggest a good php editor for the mac? I'm currently using > Dreamweaver because I like the site management and a wysiwyg html editor. > But otherwise it's a bummer because it doesn't support php. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I would definitely use the Dreamweaver/BBEdit combination. Dreamweaver for your wysiwyg layout and then BBEdit for your hard core coding. BBEdit is the best programmers program out there. And Dreamweaver.. Well I hear they will be coming out with a new OS X version soon that will rock your socks :) So look for it.. And my guess is that php will definitely be supported a little more then it already is.. We'll see.. :)

    Cheers!

    Rick

    "When a man won't listen to his conscience, it's usually because he doesn't want advice from a total stranger." - Lindsey Stewart

    > From: Tom Beidler <tomorbittechservices.com> > Date: Fri, 26 Apr 2002 10:33:43 -0700 > To: php list <php-generallists.php.net> > Subject: [PHP] good php editor for the mac > > Could someone suggest a good php editor for the mac? I'm currently using > Dreamweaver because I like the site management and a wysiwyg html editor. > But otherwise it's a bummer because it doesn't support php. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On Friday, April 26, 2002, at 01:33 PM, Tom Beidler wrote:

    > Could someone suggest a good php editor for the mac? I'm currently using > Dreamweaver because I like the site management and a wysiwyg html > editor. > But otherwise it's a bummer because it doesn't support php.

    The ultimate Mac editor is BBEdit. I use it night and day. 6.5.2 has syntax coloring for PHP, Perl, Python, JavaScript, HTML, XML, about a dozen other languages too. Runs native in OS X.

    Also you can use emacs if you have OS X, it's already installed. But I prefer BBEdit.

    BBEdit is only $79 if you "upgrade" to it from BBEdit Lite, which is the free version available at BareBones.com. I asked the BareBones folks how they verify that someone actually has BBEdit Lite since this is free, and they said they don't -- you just tell them you want the discount for the upgrade.

    There is also a full version demo of BBEdit that has all of the features, which works for 25 days or something like that. Check it out, I did and promptly ordered my copy within a few days.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    I'm told, BBEdit for MacOSX is solid, although I haven't used it. I used to work in BBEdit on OS9. It was the best PERL editors I've ever used. The Mac's seamless integration with the interpretor is something that I really miss. But at the time the Mac did not support PHP so I was forced to Windows/Homesite.. which in all honesty I really like as well even if it is a bit clumsey by comparison.

    Oh sorry. So much for long drawn out answers to simple questions eh? :)

    -Kevin

    ----- Original Message ----- From: "Tom Beidler" <tomorbittechservices.com> To: "php list" <php-generallists.php.net> Sent: Friday, April 26, 2002 11:33 AM Subject: [PHP] good php editor for the mac

    > Could someone suggest a good php editor for the mac? I'm currently using > Dreamweaver because I like the site management and a wysiwyg html editor. > But otherwise it's a bummer because it doesn't support php. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    BBEdit is by far one of the best basic text editors I have ever seen on any platform. I use 6.1 (waiting on for an upgrade), and it runs OK on 10.1.4. It would be great to see some tight PHP environment to work in, but I have yet to see it.

    All BBEdit needs is some sort of ProjectBuilder style integration with PHP to make it great.

    In fact with MacOS 10.x you can put most production applications (Apache, PHP, MySQL, etc..) on your local machine and make it quite powerful for testing and development.

    jess.

    On Friday, April 26, 2002, at 12:33 PM, Tom Beidler wrote:

    > Could someone suggest a good php editor for the mac? I'm currently using > Dreamweaver because I like the site management and a wysiwyg html > editor. > But otherwise it's a bummer because it doesn't support php. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    At 12:14 PM -0600 4/26/02, Kevin Stone wrote: >I'm told, BBEdit for MacOSX is solid, although I haven't used it. I used to >work in BBEdit on OS9. It was the best PERL editors I've ever used. The >Mac's seamless integration with the interpretor is something that I really >miss.

    I was a diehard BBEdit fan and switched to Alpha for a bit... but BBEdit has *clearly* taken the lead and it's been my preferred editor for over a year again (no intent of ever switching again). OS X integration is very nice (% bbedit file will open up file in BBEdit for example).

    -- 
    ===========================================================================
       Jim Jagielski   [|]   jimjaguNET.com   [|]   http://www.jaguNET.com/
          "A society that will trade a little liberty for a little order
                 will lose both and deserve neither" - T.Jefferson
    

    attached mail follows:


    BBedit it is. I've been holding off on switching for awhile but I just started using it today and I'm already kicking myself for not switching earlier. There was no problem/learning curve that I was afraid of and I've found a number of improvements over the workflow from Dreamweaver. Thanks for all the input to all that replied.

    attached mail follows:


    I'm using PHP v.4.0.6. and PostgreSQL 7.2. Does any one know the equivilant of auto_increment for postgresSQL? For example when creating a table:

    $query = "CREATE table $tablename (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, firstname TEXT, lastname TEXT, emailaddress TEXT, )";

    this works fine in MySQL, but I keep getting errors with PostgreSQL.

    thanks for any help, -Elkan

    attached mail follows:


    this might be a stupid question, but what the hell...

    can a web page be called and diplayed using the fsockopen and fputs/fgets functions?

    so instead of just using a normal href call i use a script and fsockopen (not header(Location: ....) ) etc.?

    thanks.

    attached mail follows:


    I haven't tried this, but why don't you just use fopen with a URL, especially if you don't what to have to deal with the http header.

    I would think that if you do the fsockopen to port 80, you will need to use the handshake protocol required by that server which involves the get/put http headers. fopen should handle all that for you.

    http://www.php.net/manual/en/function.fopen.php

    Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658

    -----Original Message----- From: wm [mailto:webmasterblanktv.com] Sent: Friday, April 26, 2002 10:50 AM To: php-generallists.php.net Subject: [PHP] fsockopen

    this might be a stupid question, but what the hell...

    can a web page be called and diplayed using the fsockopen and fputs/fgets functions?

    so instead of just using a normal href call i use a script and fsockopen (not header(Location: ....) ) etc.?

    thanks.

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

    attached mail follows:


    hi,

    .htaccess file requires user and pass.

    anybody know how to pass this info with a script so that the user is allowed into the directory? not in the url either. not user:passdomain.com.

    needs to be transparent.

    the reason i want to do this is so that somebody can't path directly to a .mov file, but so they can click on a link and a script can "fetch" the file from the protected directory by passing the user and pass. the file needs to be embedded in the web page.....

    thanks.

    attached mail follows:


    <delurk>

    wm wrote:

    > .htaccess file requires user and pass. > > anybody know how to pass this info with a script so that the user is > allowed into the directory? not in the url either. not > user:passdomain.com. > > needs to be transparent. > > the reason i want to do this is so that somebody can't path directly to > a .mov file, but so they can click on a link and a script can "fetch" > the file from the protected directory by passing the user and pass. the > file needs to be > embedded in the web page.....

    You could try saving a cookie?

    </delurk>

    -- 
    Mark Gallagher
    

    attached mail follows:


    Place the .mov files outside of your web folders, and write a PHP file that'll control the outputting of them.

    You would link to the .php file just like you would a .mov file, but you have the PHP check for a session or something to verify that the user should be able to view the .mov file. If they are allowed, then send the appropriate .mov headers with header() and then output the data.

    ---John Holmes...

    > -----Original Message----- > From: wm [mailto:webmasterblanktv.com] > Sent: Friday, April 26, 2002 11:01 AM > To: php-generallists.php.net > Subject: [PHP] passing authorization code > > hi, > > .htaccess file requires user and pass. > > anybody know how to pass this info with a script so that the user is > allowed into the directory? not in the url either. not > user:passdomain.com. > > needs to be transparent. > > the reason i want to do this is so that somebody can't path directly to > a .mov file, but so they can click on a link and a script can "fetch" > the file from the protected directory by passing the user and pass. the > file needs to be > embedded in the web page..... > > thanks. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Your problem doesn't have anything to do with PHP. The error says that libgd doesn't offer freetype support, so you need to get a more current version of gd.

    Regards,

    Jim Heffner

    >No idea, check your config.log and see why it is failing. > >On Thu, 25 Apr 2002, zhaoxd wrote: > >> >> Whatever I tried ,it is also useless,why? >> >> This time I compile it with freetype-1.3.1.when I used the test >>code , it also said "libgd was not built with FreeType font >>support in /usr/local/apache/htdocs/test.php on line 14". >> >> Would you mind tell me how you do this? I just wanna support >>FreeType font in my gd so as to use gd function like ImageTTFText >>,etc. >> >> Thank you >> >>zhaoxd >> >> > It works fine. Spell Header() right, or remove the header altogether so >> > you can see the error message. I predict you will see a message telling >> > you it couldn't open the font file. >> > >> > -Rasmus >> > >> > On Thu, 25 Apr 2002, zhaoxd wrote: >> > >> > > hello,all: >> > > >> > > I have already installed gd-1.8.4 in php-4.1.2 with some >>libraries,such as libpng >>-1.2.0,freetype-1.3,zlib-1.1.4,freetype2,in my apache server which >>version is 1.3.24,and "phpinfo()" display php can support such >>soft,as follow: >> > > GD Support---------------------------enabled >> > > GD Version---------------------------1.6.2 or higher >> > > FreeType Support---------------------enabled >> > > FreeType Linkage---------------------with freetype >> > > JPG Support--------------------------enabled >> > > PNG Support--------------------------enabled >> > > WBMP Support-------------------------enabled >> > > >> > > But when I used the function related with ttf,like >>ImageTTFText or ImageTTFBox,I found it useless,in other words,no >>pictures were displayed in my IE. >> > > I don't understand why,is gd-1.8.4 can not support these functions? >> > > >> > > ps:my test code >> > > <? >> > > //define the type of inputting picture; >> > > Heder("content-type:image/png"); >> > > //create picture >> > > $pic=imagecreate(240,30); >> > > //define color >> > > $black=imagecolorallocate($pic,0,0,0); >> > > $white=imagecolorallocate($pic,255,255,255); >> > > //define font copied from windows2000 >> > > $font="fonts/simhei.ttf"; >> > > //define characters to output >> > > $str = >>chr(0xE8).chr(0xB5).chr(0x9B).chr(0xE8).chr(0xBF).chr(0xAA).chr(0xE7).chr(0xBD).chr(0 >> > > x91)." www.ccidnet.com"; >> > > //write ttf in picture >> > > imageTTFText($pic,20,0,10,20,$white,$font,$str); >> > > //create png picture >> > > imagepng($pic); >> > > //release the memory occupied by the picture >> > > imagedestroy($pic); >> > > ?> >> > > >> > > Can anybody give a reply? >> > > >> > > Thank you >> > > >>zhaoxd >> > > >> > > >> > >> > >> > -- >> > PHP General Mailing List (http://www.php.net/) >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> > >> > >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi,

    Can anybody help me with this problem? Basically, I have thousands of MS Word documents. What I need to do is to design an interface that will let you submit more of them into the database, and it should index all these documents, like extract keywords. Is this possible at all via PHP? Also it should index or like re-index existing docs.

    I would be greatful for some advise or tutorial that does that.

    Thank you, Vlad http://vladik.tripod.com

    attached mail follows:


    On Fri, 26 Apr 2002, Vladislav Kulchitski wrote: > Can anybody help me with this problem? Basically, I have thousands of MS > Word documents. What I need to do is to design an interface that will > let you submit more of them into the database, and it should index all > these documents, like extract keywords. Is this possible at all via PHP? > Also it should index or like re-index existing docs.

    For submission:

    http://www.php.net/manual/en/features.file-upload.php

    For indexing and searching:

    http://mnogosearch.ru

    together with:

    http://www.gnu.org/directory/catdoc.html

    miguel

    attached mail follows:


    I have a problem with my variables not being set. I have a file I use for constants and functions, structured like so:

    $this = "this"; $that = "that"; . . . function this() { $h = $this; $i = $that; }

    function that() { }

    Now, when I run this(), $this isn't set (even though it's above it in the same file). I can pretty much guess (when running a function, it won't parse through the whole file, just skips to that function), but I was wondering if there is another solution. I'd hate to separate the variable settings and the functions, but will if I have to.

    __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/

    attached mail follows:


    On Fri, 26 Apr 2002, Liam Gibbs wrote: Shouldn't you be using GLOBAL to access $this, $that inside functions? > I have a problem with my variables not being set. I > have a file I use for constants and functions, > structured like so: > > $this = "this"; > $that = "that"; > . > . > . > function this() { GLOBAL $this; GLOBAL $that; > $h = $this; > $i = $that; > } > > function that() { > } > > Now, when I run this(), $this isn't set (even though > it's above it in the same file). I can pretty much > guess (when running a function, it won't parse through > the whole file, just skips to that function), but I > was wondering if there is another solution. I'd hate > to separate the variable settings and the functions, > but will if I have to. > > __________________________________________________ > Do You Yahoo!? > Yahoo! Games - play chess, backgammon, pool and more > http://games.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -Pushkar S. Pradhan

    attached mail follows:


    Please read http://www.php.net/manual/en/language.variables.scope.php

    On Fri, 26 Apr 2002, Liam Gibbs wrote:

    > I have a problem with my variables not being set. I > have a file I use for constants and functions, > structured like so: > > $this = "this"; > $that = "that"; > . > . > . > function this() { > $h = $this; > $i = $that; > } > > function that() { > } > > Now, when I run this(), $this isn't set (even though > it's above it in the same file). I can pretty much > guess (when running a function, it won't parse through > the whole file, just skips to that function), but I > was wondering if there is another solution. I'd hate > to separate the variable settings and the functions, > but will if I have to. > > __________________________________________________ > Do You Yahoo!? > Yahoo! Games - play chess, backgammon, pool and more > http://games.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I'm pretty new to php but I think your this() function you need to say:

    $h = $$this; $i = $$that;

    which means the value of the var.

    Sorry if I'm wrong. -Steve

    -----Original Message----- From: Liam Gibbs [mailto:liamgibbsyahoo.com] Sent: Friday, April 26, 2002 3:13 PM To: php-generallists.php.net Subject: [PHP] Variables not set

    I have a problem with my variables not being set. I have a file I use for constants and functions, structured like so:

    $this = "this"; $that = "that"; . . . function this() { $h = $this; $i = $that; }

    function that() { }

    Now, when I run this(), $this isn't set (even though it's above it in the same file). I can pretty much guess (when running a function, it won't parse through the whole file, just skips to that function), but I was wondering if there is another solution. I'd hate to separate the variable settings and the functions, but will if I have to.

    __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/

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

    attached mail follows:


    Ha, Sorry wrong instance here, ya global or pass the vars to the function.

    -----Original Message----- From: Steve Bradwell [mailto:SteveBcompxnet.com] Sent: Friday, April 26, 2002 3:13 PM To: 'Liam Gibbs'; php-generallists.php.net Subject: RE: [PHP] Variables not set

    I'm pretty new to php but I think your this() function you need to say:

    $h = $$this; $i = $$that;

    which means the value of the var.

    Sorry if I'm wrong. -Steve

    -----Original Message----- From: Liam Gibbs [mailto:liamgibbsyahoo.com] Sent: Friday, April 26, 2002 3:13 PM To: php-generallists.php.net Subject: [PHP] Variables not set

    I have a problem with my variables not being set. I have a file I use for constants and functions, structured like so:

    $this = "this"; $that = "that"; . . . function this() { $h = $this; $i = $that; }

    function that() { }

    Now, when I run this(), $this isn't set (even though it's above it in the same file). I can pretty much guess (when running a function, it won't parse through the whole file, just skips to that function), but I was wondering if there is another solution. I'd hate to separate the variable settings and the functions, but will if I have to.

    __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/

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

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

    attached mail follows:


    On Fri, 26 Apr 2002, Liam Gibbs wrote: > I have a problem with my variables not being set. I have a file I use > for constants and functions, structured like so: > > $this = "this"; > $that = "that"; > . > . > . > function this() { > $h = $this; > $i = $that; > } > > function that() { > } > > Now, when I run this(), $this isn't set (even though it's above it in > the same file). I can pretty much guess (when running a function, it > won't parse through the whole file, just skips to that function), but I > was wondering if there is another solution. I'd hate to separate the > variable settings and the functions, but will if I have to.

    (the following lesson applies to most programming languages these days)

    Each variable has what's called "scope", which defines the context in which it is visible.

    There is something called "global scope" which refers to all variables created outside of any function or object. Variables with global scope are then available anywhere outside of a function or object.

    Also, each function has its own "local scope". Variables created inside a function have scope local to that function and cannot be seen or referenced outside of that function. This is very good for programming, because it means you can re-use variables like $file and $str without having to worry that you are messing things up elsewhere in your program. Without scoping, writing a program of any serious size becomes a major pain: You have to keep making up longer and longer variable names, and your variables' contents keep getting changed behind your back.

    Your $this and $that are created with global scope. This is why they are not accessible within the functions this() and that(). When you referred to $this inside function this(), you created an entirely new variable $this with scope local to function this().

    Obviously you need ways to move data in and out of functions. The preferred method is to pass them into functions as arguments and receive the results as the function's return value.

    For instance, try running this simple program:

    <?

    $this = "hello"; $that = my_function($this); print $that;

    function my_function($str) { print $str; return "I just said '$str'"; }

    ?>

    The other way to get variables into a function is to import them from the global scope. You do this with the keyword global, as follows:

    <?

    $this = "hello"; my_function();

    function my_function(); { global $this; print $this; }

    ?>

    (in both examples I changed the variable and function names around to eliminate the human confusion caused by using 'this' and 'that' for both).

    miguel

    attached mail follows:


    On Friday, April 26, 2002, at 04:12 PM, Miguel Cruz wrote:

    > There is something called "global scope" which refers to all variables > created outside of any function or object. Variables with global scope > are > then available anywhere outside of a function or object.

    Is there a difference between the concept of "scope" and the concept of "namespace"? I see "scope" used in PHP and "namespace" used in Python, and while the rules are slightly different between the two of them (such as variables in the global namespace being accessible to a function definition in Python, but not in PHP), they seem to be comparable. Is this the case?

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Am in need of help or I will loose my sanity!!! Im runnin Php 4.1.2 with Apache 1.3.22 on Win32 with register_globals set to off. My script is as follows:

    <?

    session_start();

    $myVar = "Something";

    $HTTP_SESSION_VARS["mySessionVar"] = $myVar;

    ?>

    If I check the cookie, its completely empty. Now if I change this to:

    <?

    session_start();

    $myVar = "Something";

    session_register("myVar");

    ?>

    the cookie now contains: myVar|s:9:"Something";

    This is annoying as everyhwhere I read about sessions, Im told that if register_globals is off, I shouldnt use session_register(), all I need to do is:

    $HTTP_SESSION_VARS["myVar"] = $myVar;

    or

    $_SESSION["myVar"] = $myVar;

    but neither work :(

    Finally, if I want to change the value of $HTTP_SESSION_VARS["myVar"] and carry that change over to the next page it doesnt work. For example, i have registered the session variable $myVar as above and can read it using $HTTP_SESSION_VARS["myVar"]. If I do:

    $HTTP_SESSION_VARS["myVar"] = "Some other text";

    then $HTTP_SESSION_VARS["myVar"] contains that text, but only for this page! How do I use sessions then with register_globals = off???!!!

    attached mail follows:


    Make sure you are using session_start() on each page and you should be using $_SESSION["var"] = "value";, not $HTTP_SESSION_VARS...

    ---John Holmes...

    > -----Original Message----- > From: Padraig Kitterick [mailto:padraigkitterickoceanfree.net] > Sent: Friday, April 26, 2002 12:16 PM > To: php-generallists.php.net > Subject: [PHP] Sessions with register_globals = off > > Am in need of help or I will loose my sanity!!! Im runnin Php 4.1.2 with > Apache 1.3.22 on Win32 with register_globals set to off. My script is as > follows: > > <? > > session_start(); > > $myVar = "Something"; > > $HTTP_SESSION_VARS["mySessionVar"] = $myVar; > > ?> > > If I check the cookie, its completely empty. Now if I change this to: > > <? > > session_start(); > > $myVar = "Something"; > > session_register("myVar"); > > ?> > > the cookie now contains: > myVar|s:9:"Something"; > > This is annoying as everyhwhere I read about sessions, Im told that if > register_globals is off, I shouldnt use session_register(), all I need to > do > is: > > $HTTP_SESSION_VARS["myVar"] = $myVar; > > or > > $_SESSION["myVar"] = $myVar; > > but neither work :( > > > > Finally, if I want to change the value of $HTTP_SESSION_VARS["myVar"] and > carry that change over to the next page it doesnt work. For example, i > have > registered the session variable $myVar as above and can read it using > $HTTP_SESSION_VARS["myVar"]. If I do: > > > > $HTTP_SESSION_VARS["myVar"] = "Some other text"; > > > > then $HTTP_SESSION_VARS["myVar"] contains that text, but only for this > page! How do I use sessions then with register_globals = off???!!! > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    On Friday, April 26, 2002, at 03:16 PM, Padraig Kitterick wrote:

    > This is annoying as everyhwhere I read about sessions, Im told that if > register_globals is off, I shouldnt use session_register(), all I need > to do > is: > > $HTTP_SESSION_VARS["myVar"] = $myVar;

    This is not what the documentation says.

    http://www.php.net/manual/en/ref.session.php

    You should use

    $_SESSION['myVar'] = $myVar;

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    For those of you who write web applications (in any language), what do you recommend as the best way to store arbitrary atomic data for the web application? in other words, data that doesn't really need to be stored in a relational database, as it does not really relate to anything?

    In the app I am working on (PHP/MySQL), there are several instances of this. One of them is: a multiplier of 1.5 is applied to any "materials cost" of posters ordered through my app. That is, although the "materials cost" to my employer is, say $0.076 per square inch, 0.114 is the amount that we charge per square inch (0.076 * 1.5). However, this multiplier could change at some point in the future, so I am hesitant to leave the number hard-coded into my page. I would rather have it stored in the database, where my employer can easily update or change it to another multiplier. But it seems awkward to create a table that simply maintains the multiplier:

    mysql> SELECT * FROM material_multiplier; +------------+ | multiplier | +------------+ | 1.50 | +------------+ 1 row in set (0.00 sec)

    I suppose I could store a table with two columns, one being VARNAME the other being VALUE, and pull this kind of standalone data out of it, but was curious what other people do when they need to store something like this.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    On Saturday 27 April 2002 03:50, Erik Price wrote: > For those of you who write web applications (in any language), what do > you recommend as the best way to store arbitrary atomic data for the web > application? in other words, data that doesn't really need to be stored > in a relational database, as it does not really relate to anything?

    Stick it in an include file?

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* WYSIWYG: What You See Is What You Get. */

    attached mail follows:


    I usually have an info.inc file that has all these variables that I might need to change. Then include it in the files that use those variables and if I ever need to change one of them I just change it in the include file and it updates everything that way..

    Rick

    Beauty of whatever kind, in its supreme development, invariably excites the sensitive soul to tears. - Edgar Allan Poe

    > From: Erik Price <priceehhbrown.com> > Date: Fri, 26 Apr 2002 15:50:08 -0400 > To: php-generallists.php.net > Subject: [PHP] web application development question > > For those of you who write web applications (in any language), what do > you recommend as the best way to store arbitrary atomic data for the web > application? in other words, data that doesn't really need to be stored > in a relational database, as it does not really relate to anything? > > In the app I am working on (PHP/MySQL), there are several instances of > this. One of them is: > a multiplier of 1.5 is applied to any "materials cost" of posters > ordered through my app. That is, although the "materials cost" to my > employer is, say $0.076 per square inch, 0.114 is the amount that we > charge per square inch (0.076 * 1.5). However, this multiplier could > change at some point in the future, so I am hesitant to leave the number > hard-coded into my page. I would rather have it stored in the database, > where my employer can easily update or change it to another multiplier. > But it seems awkward to create a table that simply maintains the > multiplier: > > mysql> SELECT * FROM material_multiplier; > +------------+ > | multiplier | > +------------+ > | 1.50 | > +------------+ > 1 row in set (0.00 sec) > > I suppose I could store a table with two columns, one being VARNAME the > other being VALUE, and pull this kind of standalone data out of it, but > was curious what other people do when they need to store something like > this. > > > Erik > > > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Agreed, this is how I would recommend you do it. I would be careful naming your include files with an .inc extension, though, since .inc isn't parsed by PHP and will be shown as plain text when pulled up in a web browser. I normally name them something like config.inc.php or database.inc.php, etc.

    I've gotten into the habit, from working with GeekLog, to put everything into a $_CONF array.

    $_CONF["database"] = "MySQL"; $_CONF["multiplier"] = 1.5;

    etc...

    ---John Holmes...

    > -----Original Message----- > From: Richard Baskett [mailto:rickbaskettcase.com] > Sent: Friday, April 26, 2002 1:01 PM > To: Erik Price; PHP General > Subject: Re: [PHP] web application development question > > I usually have an info.inc file that has all these variables that I might > need to change. Then include it in the files that use those variables and > if I ever need to change one of them I just change it in the include file > and it updates everything that way.. > > Rick > > Beauty of whatever kind, in its supreme development, invariably excites > the > sensitive soul to tears. - Edgar Allan Poe > > > From: Erik Price <priceehhbrown.com> > > Date: Fri, 26 Apr 2002 15:50:08 -0400 > > To: php-generallists.php.net > > Subject: [PHP] web application development question > > > > For those of you who write web applications (in any language), what do > > you recommend as the best way to store arbitrary atomic data for the web > > application? in other words, data that doesn't really need to be stored > > in a relational database, as it does not really relate to anything? > > > > In the app I am working on (PHP/MySQL), there are several instances of > > this. One of them is: > > a multiplier of 1.5 is applied to any "materials cost" of posters > > ordered through my app. That is, although the "materials cost" to my > > employer is, say $0.076 per square inch, 0.114 is the amount that we > > charge per square inch (0.076 * 1.5). However, this multiplier could > > change at some point in the future, so I am hesitant to leave the number > > hard-coded into my page. I would rather have it stored in the database, > > where my employer can easily update or change it to another multiplier. > > But it seems awkward to create a table that simply maintains the > > multiplier: > > > > mysql> SELECT * FROM material_multiplier; > > +------------+ > > | multiplier | > > +------------+ > > | 1.50 | > > +------------+ > > 1 row in set (0.00 sec) > > > > I suppose I could store a table with two columns, one being VARNAME the > > other being VALUE, and pull this kind of standalone data out of it, but > > was curious what other people do when they need to store something like > > this. > > > > > > Erik > > > > > > > > > > > > ---- > > > > Erik Price > > Web Developer Temp > > Media Lab, H.H. Brown > > priceehhbrown.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I let them in a database and a nice administration page so people can change. There are a lot of more information that you can store, such as last time of change, and previous values (so peopel can "rollback" them), who changed, description of the value, related to other values, and there always someones inspired by your app, such as especific to a client, to a part of the webiste, to users, merchants (or vendors), etc....

    --
    

    Julio Nobrega.

    Um dia eu chego lá: http://sourceforge.net/projects/toca

    Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884

    "Erik Price" <priceehhbrown.com> wrote in message news:D028796E-594E-11D6-9DE7-0050E4857868hhbrown.com... > For those of you who write web applications (in any language), what do > you recommend as the best way to store arbitrary atomic data for the web > application? in other words, data that doesn't really need to be stored > in a relational database, as it does not really relate to anything? > > In the app I am working on (PHP/MySQL), there are several instances of > this. One of them is: > a multiplier of 1.5 is applied to any "materials cost" of posters > ordered through my app. That is, although the "materials cost" to my > employer is, say $0.076 per square inch, 0.114 is the amount that we > charge per square inch (0.076 * 1.5). However, this multiplier could > change at some point in the future, so I am hesitant to leave the number > hard-coded into my page. I would rather have it stored in the database, > where my employer can easily update or change it to another multiplier. > But it seems awkward to create a table that simply maintains the > multiplier: > > mysql> SELECT * FROM material_multiplier; > +------------+ > | multiplier | > +------------+ > | 1.50 | > +------------+ > 1 row in set (0.00 sec) > > I suppose I could store a table with two columns, one being VARNAME the > other being VALUE, and pull this kind of standalone data out of it, but > was curious what other people do when they need to store something like > this. > > > Erik > > > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com >

    attached mail follows:


    By the way.. You can include a little script in your .htaccess file or your httpd.conf file so that it will not show .inc files just like it does for .ht files. That's a great idea for the $_CONF array.. That will help me keep some of my variables straight and where they come from :)

    Cheers!

    Rick

    "What's in a name? That which we call a rose by any other name would smell as sweet." - Shakespeare

    > From: "John Holmes" <holmes072000charter.net> > Organization: U.S. Army > Reply-To: <holmes072000charter.net> > Date: Fri, 26 Apr 2002 16:11:26 -0700 > To: "'Richard Baskett'" <rickbaskettcase.com>, "'Erik Price'" > <priceehhbrown.com>, "'PHP General'" <php-generallists.php.net> > Subject: RE: [PHP] web application development question > > Agreed, this is how I would recommend you do it. I would be careful > naming your include files with an .inc extension, though, since .inc > isn't parsed by PHP and will be shown as plain text when pulled up in a > web browser. I normally name them something like config.inc.php or > database.inc.php, etc. > > I've gotten into the habit, from working with GeekLog, to put everything > into a $_CONF array. > > $_CONF["database"] = "MySQL"; > $_CONF["multiplier"] = 1.5; > > etc... > > ---John Holmes... > >> -----Original Message----- >> From: Richard Baskett [mailto:rickbaskettcase.com] >> Sent: Friday, April 26, 2002 1:01 PM >> To: Erik Price; PHP General >> Subject: Re: [PHP] web application development question >> >> I usually have an info.inc file that has all these variables that I > might >> need to change. Then include it in the files that use those variables > and >> if I ever need to change one of them I just change it in the include > file >> and it updates everything that way.. >> >> Rick >> >> Beauty of whatever kind, in its supreme development, invariably > excites >> the >> sensitive soul to tears. - Edgar Allan Poe >> >>> From: Erik Price <priceehhbrown.com> >>> Date: Fri, 26 Apr 2002 15:50:08 -0400 >>> To: php-generallists.php.net >>> Subject: [PHP] web application development question >>> >>> For those of you who write web applications (in any language), what > do >>> you recommend as the best way to store arbitrary atomic data for the > web >>> application? in other words, data that doesn't really need to be > stored >>> in a relational database, as it does not really relate to anything? >>> >>> In the app I am working on (PHP/MySQL), there are several instances > of >>> this. One of them is: >>> a multiplier of 1.5 is applied to any "materials cost" of posters >>> ordered through my app. That is, although the "materials cost" to > my >>> employer is, say $0.076 per square inch, 0.114 is the amount that we >>> charge per square inch (0.076 * 1.5). However, this multiplier > could >>> change at some point in the future, so I am hesitant to leave the > number >>> hard-coded into my page. I would rather have it stored in the > database, >>> where my employer can easily update or change it to another > multiplier. >>> But it seems awkward to create a table that simply maintains the >>> multiplier: >>> >>> mysql> SELECT * FROM material_multiplier; >>> +------------+ >>> | multiplier | >>> +------------+ >>> | 1.50 | >>> +------------+ >>> 1 row in set (0.00 sec) >>> >>> I suppose I could store a table with two columns, one being VARNAME > the >>> other being VALUE, and pull this kind of standalone data out of it, > but >>> was curious what other people do when they need to store something > like >>> this. >>> >>> >>> Erik >>> >>> >>> >>> >>> >>> ---- >>> >>> Erik Price >>> Web Developer Temp >>> Media Lab, H.H. Brown >>> priceehhbrown.com >>> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > > >

    attached mail follows:


    On Friday, April 26, 2002, at 03:58 PM, Jason Wong wrote:

    >> For those of you who write web applications (in any language), what do >> you recommend as the best way to store arbitrary atomic data for the >> web >> application? in other words, data that doesn't really need to be >> stored >> in a relational database, as it does not really relate to anything? > > Stick it in an include file?

    I'm sorry, I meant to be more clear --

    although include files are great for storing data that will probably not change (but are now in a convenient include file in case they have to change), I was thinking of making this data updateable from within the application. So that my employer, who does not know a thing about PHP or MySQL, can change this information from the "administration" section of the site. Which is why I was thinking of using the database...

    ... well, I may just keep it in an include file, and if anyone ever needs to change the data, I'll explain in the documentation where the data should be changed. Thanks for the tips guys

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    On Fri, 26 Apr 2002, Erik Price wrote: > although include files are great for storing data that will probably not > change (but are now in a convenient include file in case they have to > change), I was thinking of making this data updateable from within the > application. So that my employer, who does not know a thing about PHP > or MySQL, can change this information from the "administration" section > of the site. Which is why I was thinking of using the database...

    I think using the database is a fine idea - even if you just serialize a giant array of configuration parameters and stuff them in a TEXT field (less work to set up, but you'll have to use your PHP admin tool to make changes, thereby forsaking your ability to don your wizard robes and pop open a MySQL CLI session to make changes in front of awed management).

    miguel

    attached mail follows:


    How about storing it in a database like you said with variable and value but when you change a value then you write over your config.inc.php file with a new one. So you get to change the value easily in a database and by using a file you make your app faster without any database access everytime.

    -----Original Message----- From: Erik Price [mailto:priceehhbrown.com] Sent: April 26, 2002 4:15 PM To: php-generallists.php.net Subject: Re: [PHP] web application development question

    On Friday, April 26, 2002, at 03:58 PM, Jason Wong wrote:

    >> For those of you who write web applications (in any language), what do >> you recommend as the best way to store arbitrary atomic data for the >> web >> application? in other words, data that doesn't really need to be >> stored >> in a relational database, as it does not really relate to anything? > > Stick it in an include file?

    I'm sorry, I meant to be more clear --

    although include files are great for storing data that will probably not change (but are now in a convenient include file in case they have to change), I was thinking of making this data updateable from within the application. So that my employer, who does not know a thing about PHP or MySQL, can change this information from the "administration" section of the site. Which is why I was thinking of using the database...

    ... well, I may just keep it in an include file, and if anyone ever needs to change the data, I'll explain in the documentation where the data should be changed. Thanks for the tips guys

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

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

    attached mail follows:


    On Fri, 26 Apr 2002, SP wrote: > How about storing it in a database like you said with variable and value but > when you change a value then you write over your config.inc.php file with a > new one. So you get to change the value easily in a database and by using a > file you make your app faster without any database access everytime.

    What would be the point of using the database then?

    miguel

    attached mail follows:


    You can still have it updateable by a client. Fopen that file read it, change the appropriate values and close it.. Voila! All done :)

    Rick

    "A good head and good heart are always a formidable combination. But when you add to that a literate tongue or pen, then you have something very special" - Nelson Mandela

    > From: Erik Price <priceehhbrown.com> > Date: Fri, 26 Apr 2002 16:14:43 -0400 > To: php-generallists.php.net > Subject: Re: [PHP] web application development question > > > On Friday, April 26, 2002, at 03:58 PM, Jason Wong wrote: > >>> For those of you who write web applications (in any language), what do >>> you recommend as the best way to store arbitrary atomic data for the >>> web >>> application? in other words, data that doesn't really need to be >&g