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: Thu Feb 08 2001 - 22:28:08 CST

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

    php-general Digest 9 Feb 2001 04:28:08 -0000 Issue 501

    Topics (messages 38776 through 38894):

    Re: gif support
            38776 by: Chris Lee

    Re: radiobutton
            38777 by: Jon Haworth
            38778 by: Reuben D Budiardja
            38816 by: James, Yz

    Re: splitting a class across separate files?
            38779 by: Christian Reiniger
            38780 by: Monte Ohrt

    include("blah.php?var=this"); doesn't work?!
            38781 by: John Vanderbeck
            38782 by: Rasmus Lerdorf
            38785 by: John Vanderbeck
            38786 by: Brian V Bonini
            38787 by: thor
            38790 by: Rasmus Lerdorf

    Re: Super SQL problem! Please advise!
            38783 by: Sandeep Hundal
            38789 by: Steve Werby

    Passing files to a browser
            38784 by: Rob Root
            38803 by: Christian Reiniger
            38804 by: Javier Muniz
            38815 by: Rob Root

    Should this work?
            38788 by: szii.sziisoft.com
            38890 by: Richard Lynch

    Testing CONNECTION Speed
            38791 by: Matias Banzas
            38799 by: Adam Knight

    Getting MIME-type of file
            38792 by: Tobias Talltorp
            38801 by: James, Yz
            38805 by: Tobias Talltorp
            38814 by: James, Yz

    Re: PHP as Scripting Language
            38793 by: Bill Rausch

    Re: Events in HTML with PHP
            38794 by: Foley, John
            38834 by: Toby Butzon

    Regex Matching
            38795 by: Andrew Rush

    Re: movies manipulation??
            38796 by: Andy Clarke

    Quick Directory Question
            38797 by: Andy Clarke
            38802 by: James, Yz

    PHP auth... a little help :)
            38798 by: Brandon Orther
            38812 by: Chris Lee

    XSLT
            38800 by: Chris Lee

    Any image drawing tutorials anywhere?
            38806 by: John Guynn

    PHP not sending email
            38807 by: Paulson, Joseph V. \"Jay\"
            38891 by: Richard Lynch

    interoperating with perl
            38808 by: Britton
            38892 by: Richard Lynch

    Form posted?
            38809 by: rodrigo
            38811 by: Steve Werby

    Re: can i install apache php-module AND php-cgi on the same windows-apache?
            38810 by: Alex Akilov

    security help
            38813 by: thor
            38817 by: James, Yz
            38819 by: James, Yz
            38820 by: thor
            38822 by: Ben Peter
            38841 by: James, Yz
            38851 by: Chris
            38856 by: thor

    Re: Mail-Encryption
            38818 by: Rodolfo Gonzalez Gonzalez
            38858 by: Richard Lynch

    ereg_replace with assoc array?
            38821 by: Jaxon
            38867 by: Jaxon

    Cron + PHP
            38823 by: GAYTAN BAHAMONDEZ DANIEL EDUARDO
            38830 by: Joe Stump
            38838 by: Website4S.aol.com

    [Newbie] PHP Variables
            38824 by: Steve Haemelinck
            38826 by: Joe Stump
            38835 by: Philip Olson
            38837 by: James, Yz

    Insert Data AS400
            38825 by: Karl J. Stubsjoen
            38893 by: Richard Lynch

    To The Hacker: CodeBoy
            38827 by: rswfire
            38829 by: James Moore
            38833 by: rswfire
            38836 by: James, Yz
            38840 by: Philip Olson
            38843 by: Matt McClanahan
            38847 by: James, Yz
            38848 by: Chad Day
            38850 by: James, Yz
            38852 by: Philip Olson
            38860 by: Jonathan Sharp
            38862 by: Jonathan Sharp
            38868 by: Chris Lee

    Re: How to make PHP work in all sub-directories?
            38828 by: Toby Butzon

    ftp_fput
            38831 by: Marisol Díaz E.
            38842 by: James, Yz

    Re: Generic cloner?
            38832 by: Toby Butzon

    fopen warning error message
            38839 by: Ade Smith
            38869 by: Chris Lee

    installing PHP 4.0.4pl1 on Redhat 6.2
            38844 by: Scott Mebberson
            38853 by: Michael Hall

    Re: PHP && mySQL
            38845 by: Chris Hayes

    script doesn't work in netscape
            38846 by: Erik Boles
            38849 by: Scott Brown

    preg_match() vs. preg_match_all()
            38854 by: CC Zona

    Dynamic Drop-down list
            38855 by: Todd Cary
            38857 by: DanO
            38859 by: Nathan Cook
            38863 by: Todd Cary
            38864 by: DanO
            38865 by: DanO
            38866 by: Jason Murray

    Web Based Project Management Tools
            38861 by: Nathan Cook
            38884 by: David Robley

    Mysql connection problems
            38870 by: Felipe Lopes
            38888 by: Richard Lynch

    Searching HTML file for <tr> tags
            38871 by: Tyler Longren
            38872 by: Mukul Sabharwal
            38874 by: Tyler Longren

    Re: Files only available via HTTPS
            38873 by: Daniel Tryba
            38875 by: Aaron Tuller
            38877 by: Christopher Allen
            38878 by: Jason Brooke

    indexing text
            38876 by: Robert Mena
            38881 by: Steve Werby
            38883 by: David Robley

    PHP4.0.4pl1 with Apache 1.3.17/SSL and Frontpage ...
            38879 by: The Hermit Hacker
            38880 by: Larry Rosenman
            38885 by: The Hermit Hacker

    echo vs print
            38882 by: Todd Cary

    Wierd OCI Problem... [Urgent, and please help]
            38886 by: Chien-Pin Wang

    Re: PHP function using a WML variable from a select list as to access the right data in a MYSQL database
            38887 by: Richard Lynch

    Re: Php (&mysql) & different char-sets
            38889 by: Richard Lynch

    Re: test for undefined variables & renaming variables
            38894 by: Ankur Verma

    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:


    the 'gif' format is owned and controled by compuserve, it is a copyrighted
    format, it is not an open format. This is why your finding no 'gif' support
    in php. old old versions of gd do have 'gif' support built-in (this was
    before all the lawsuits) I would not recommend this older version of gd,

    - its old
    - its using illegal file formats, opening the door for you to be liable.

    stick to png or jpeg. its your only option if you want to be legal.

    --
    

    Chris Lee Mediawaveonline.com leemediawaveonline.com

    "Pablo Martin De Natale" <denaiwcc.com> wrote in message news:3A82C719.F10316F8iwcc.com... > Hello! I've installed php4 like apache module, with enable gd. But I > have't got gif support. > How can I install php with gif support? > > Thanks > Pablo > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    I think if($radio1) is what you're after.

    HTH Jon

    -----Original Message----- From: Miguel Loureiro [mailto:m.loureirodistrim2.pt] Sent: 08 February 2001 16:39 To: php-gen Subject: [PHP] radiobutton

    Hello, I have sometging like this: <input type="Radio" name="radio1" value=<? echo $opt1 ?>">Opt1

    how I know if some user choose some radiobutton??? I tried if($opt1) , but without success....

    T.Y.

    Miguel Loureiro <m.loureirodistrim2.pt >

    attached mail follows:


    Try this:

    if($radio1 == $opt1) { do whatever.... }

    rdb

    At 04:39 PM 2/8/01 +0000, Miguel Loureiro wrote: >Hello, >I have sometging like this: ><input type="Radio" name="radio1" value=<? echo $opt1 ?>">Opt1 > >how I know if some user choose some radiobutton??? >I tried if($opt1) , but without success.... > >T.Y. > >Miguel Loureiro <m.loureirodistrim2.pt >

    attached mail follows:


    If someone's updating a form, and I want their last settings to appear in a the correct radio button, I use this:

    <input type"Radio" name="I_like" <? if ($I_like == "PHP") { echo "CHECKED" } ?>> <input type"Radio" name="I_like" <? if ($I_like == "ASP") { echo "CHECKED" } ?>>

    So, on a form with a Radio button asking which you prefer, the one that they've voted for before is the default button to be checked.

    Oh, and I know that's probably messy :)

    If you want to get the results, you'd print

    The user liked <? echo "$I_like"; ?>!

    James.

    Hello, I have sometging like this: <input type="Radio" name="radio1" value=<? echo $opt1 ?>">Opt1

    how I know if some user choose some radiobutton??? I tried if($opt1) , but without success....

    T.Y.

    Miguel Loureiro <m.loureirodistrim2.pt >

    attached mail follows:


    On Thursday 08 February 2001 17:13, Chris Lee wrote: > Its called inheritance. > rarley.php > <?php > > class rarley_used > {

    > ?>

    > main_class.php > <?php > > include_once('rarley.php'); > > class main_class extends rarley_used

    Other way round (rarely_used extends main_class) :)

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match.

    - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him.

    attached mail follows:


    I guess my problem is that the condition happens within a function of the class. I'll have to figure out a way around that.

    Chris Lee wrote: > > Its called inheritance. > rarley.php > <?php > > class rarley_used > { > function one() > { > > } > > function two() > { > > } > } > ?> > > main_class.php > <?php > > include_once('rarley.php'); > > class main_class extends rarley_used > { > function three() > { > > } > > function four() > { > > } > } > ?> > > -- > > Chris Lee > Mediawaveonline.com > leemediawaveonline.com > > "Monte Ohrt" <monteispi.net> wrote in message > news:3A82BF83.8E84D16ispi.net... > > I have a class with many functions. About 80% of these functions are > > rarely used, so I'd like to split them out to a separate file and > > include them only if a certain condition applies. This way the PHP > > compiling is kept to a minimum. How do I make the included functions > > members of the current class? > > > > Example: > > > > > > myclass.php > > ----------- > > > > <?php > > > > class MyClass { > > > > function func1() { > > if($foo) { > > include_once("myclass2.php"); > > $this->func2(); // this doesn't work, it won't find func2! > > } > > } > > > > } > > > > ?> > > > > myclass2.php > > ------------ > > > > <?php > > > > // I need these functions to be > > // members of MyClass... how? > > function func2() { > > // do something > > } > > > > } > > > > ?> > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    --
    Monte Ohrt <monteispi.net>
    http://www.ispi.net/
    

    attached mail follows:


    I need to be able to do:

    <? if (isset($asin)) { include("book_reviews.php?asin=$asin"); } else { include("book_reviews.php"); }?>

    This is embeded in one of my sites pages..However, the call with the var added on won't work, it seems like its looking for a file with that whole name. Does anyone know how I can do this?

    - John Vanderbeck - Admin, GameDesign

    attached mail follows:


    Uh, why? Adding ?asin$asin makes absolutely no sense in an include since included files share the same namespace as the parent file. You can simply do:

    $asin = 123; include 'book_reviews.php';

    And the $asin variable will be accessible to you book_reviews.php script.

    -Rasmus

    On Thu, 8 Feb 2001, John Vanderbeck wrote:

    > I need to be able to do: > > <? > if (isset($asin)) > { > include("book_reviews.php?asin=$asin"); > } > else > { > include("book_reviews.php"); > }?> > > This is embeded in one of my sites pages..However, the call with the var > added on won't work, it seems like its looking for a file with that whole > name. Does anyone know how I can do this? > > - John Vanderbeck > - Admin, GameDesign > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Thanks everyone who responded. I got it fixed now. I didn't realize that the included file resided in the same scope. Once I knew that it was easy to take care of.

    Thanks!

    - John Vanderbeck - Admin, GameDesign

    ----- Original Message ----- From: "John Vanderbeck" <agathorncfl.rr.com> To: <php-generallists.php.net> Sent: Thursday, February 08, 2001 12:27 PM Subject: [PHP] include("blah.php?var=this"); doesn't work?!

    > I need to be able to do: > > <? > if (isset($asin)) > { > include("book_reviews.php?asin=$asin"); > } > else > { > include("book_reviews.php"); > }?> > > This is embeded in one of my sites pages..However, the call with the var > added on won't work, it seems like its looking for a file with that whole > name. Does anyone know how I can do this? > > - John Vanderbeck > - Admin, GameDesign > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Adding ?asin=$asin doesn't make much sense but do it like this:

    include('book_reviews.php?asin=' . $asin);

    -Brian ************

    > -----Original Message----- > From: John Vanderbeck [mailto:agathorncfl.rr.com] > Sent: Thursday, February 08, 2001 12:27 PM > To: php-generallists.php.net > Subject: [PHP] include("blah.php?var=this"); doesn't work?! > > > I need to be able to do: > > <? > if (isset($asin)) > { > include("book_reviews.php?asin=$asin"); > } > else > { > include("book_reviews.php"); > }?> > > This is embeded in one of my sites pages..However, the call with the var > added on won't work, it seems like its looking for a file with that whole > name. Does anyone know how I can do this? > > - John Vanderbeck > - Admin, GameDesign > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    You don't need to go through these hoops.

    Any include page you use will automatically use any variable that has been set in the master page.

    Thus, all you need to do is include the book_reviews.php page, and the $asin variable will work in that one IF it has been set in the master file. If it hasn't, it won't, very simple.

    >From the look of it, it appears the book_reviews.php page also checks to see if the $asin variable is passed, and that check will also work when it's an include page.

    So, basically you could replace your code with this:

    <? include("book_reviews.php"); ?>

    and you don't have to worry about the $asin variable, since the book_reviews.php page handles that. If it's set, book_reviews.php will see it and use it. If it's not set, book_reviews.php will also see that and work without it (since you've already told it how to handle that).

    ---------- Original Message ---------------------------------- From: "John Vanderbeck" <agathorncfl.rr.com> Date: Thu, 8 Feb 2001 12:27:20 -0500

    >I need to be able to do: > ><? >if (isset($asin)) >{ > include("book_reviews.php?asin=$asin"); >} >else >{ > include("book_reviews.php"); >}?> > >This is embeded in one of my sites pages..However, the call with the var >added on won't work, it seems like its looking for a file with that whole >name. Does anyone know how I can do this? > >- John Vanderbeck >- Admin, GameDesign > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    > Adding ?asin=$asin doesn't make much sense but > do it like this: > > include('book_reviews.php?asin=' . $asin);

    Which makes just as little sense. Included files share the same namespace as the file doing the including. You don't pass arguments to included files.

    -Rasmus

    attached mail follows:


    thanks for the tip steve. i read up on left joins, and got this: SELECT diary.id, diary.thedate, diary.topic, diary.entry FROM diary LEFT JOIN comments ON diary.id = comments.id;

    but it only joins the two tables. What I need is only 1 column from the second table, counted. Something like this, but that doesn't work :( SELECT diary.id, diary.thedate, diary.topic, diary.entry FROM diary LEFT JOIN comments.id ON diary.id = comments.id COUNT(comments.id) GROUP BY comments.id;

    Any ideas how that could work??

    Thanks all

    /sunny

    > > diary.month='$month' AND diary.id = comments.id GROUP BY > comments.id > > ORDER BY diary.id DESC "

    --- Steve Werby <steve247computing.com> wrote: > "Sandeep Hundal" <sandeep_wdeyahoo.com> wrote: > > SELECT diary.id, diary.thedate, diary.topic, diary.entry, > > count(comments.id) AS comments FROM diary, comments WHERE > > diary.month='$month' AND diary.id = comments.id GROUP BY > comments.id > > ORDER BY diary.id DESC " > > > > Basically what I've done is made a diary table, and allowed > people to > > comment on each diary entry, with the comments stored in a > seperate > > comments table. What i'm doing there is getting the diary entry, > plus > > the number of comments posted for that entry. > > > > Now the problem is that this query only displays entries from the > > diary table when a comment is added for that entry, otherwise it > > comes up with a blank, because (diary.id = comments.id) isn't > true. > > > > Now, is there a way to make sure that it displays all diary > entries > > anyway? because if i remove that check (diary.id = comments.id) - > > then all the numbers come up messed up. > > Take a look at the LEFT JOIN syntax. It will allow you to return > all > records from diary and the records from comments that match based > on a > common field between the two tables (in this case "id"). This > query doesn't > give you exactly what you want, but it demonstrates LEFT JOIN > usage. You > had been doing a STRAIGHT JOIN (using alternate syntax where you > didn't > actually use those words). > > SELECT diary.entry, comments.id > FROM diary > LEFT JOIN comments ON comments.id = diary.id > WHERE where_clause; > > See the MySQL documentation for more details. Hopefully you can > figure it > out on your own with a few minutes of research, trial and error. > > -- > Steve Werby > COO > 24-7 Computer Services, LLC > Tel: 804.817.2470 > http://www.247computing.com/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

    attached mail follows:


    "Sandeep Hundal" <sandeep_wdeyahoo.com> wrote: > thanks for the tip steve. i read up on left joins, and got this: > SELECT diary.id, diary.thedate, diary.topic, diary.entry > FROM diary > LEFT JOIN comments > ON diary.id = comments.id; > > but it only joins the two tables.

    Right. It took care of your main problem though.

    > What I need is only 1 column from > the second table, counted. Something like this, but that doesn't work > :( > SELECT diary.id, diary.thedate, diary.topic, diary.entry > FROM diary > LEFT JOIN comments.id > ON diary.id = comments.id > COUNT(comments.id) > GROUP BY comments.id;

    The order of your statement is a little off. Try this:

    SELECT diary.id, diary.thedate, diary.topic, diary.entry, COUNT(comments.id) FROM diary LEFT JOIN comments.id ON diary.id = comments.id GROUP BY comments.id;

    If that doesn't work you might want to look at running two queries and saving their results as temporary tables and then running a query to join the two temporary tables to get what you want.

    Also, for SQL questions like this you'll get better [or more or quicker] responses on the mysql mailing list. Sign up at www.mysql.com.

    --
    Steve Werby
    COO
    24-7 Computer Services, LLC
    Tel: 804.817.2470
    http://www.247computing.com/
    

    attached mail follows:


    HI,

    I am having problems passing files through to a browser. First I tried:

    <?php $fp = fopen("test.pdf", "r"); header("content-type: application/pdf"); fpassthru($fp); fclose($fp); ?>

    And got an Acrobat instance with no file displayed. Then I tried:

    <?php $fp = fopen("test.txt", "r"); header("content-type: text/plain"); fpassthru($fp); fclose($fp); ?>

    And got: Hello, World <br> <b>Warning</b>: 1 is not a valid File-Handle resource in <b>/home/robr/public_html/php/getpdf.php</b> on line <b>5</b><br>

    Help!!

    rr

    attached mail follows:


    On Thursday 08 February 2001 18:43, Rob Root wrote:

    > <?php > $fp = fopen("test.txt", "r"); > header("content-type: text/plain"); > fpassthru($fp); > fclose($fp); > ?> > > And got: > Hello, World > <br> > <b>Warning</b>: 1 is not a valid File-Handle resource in > <b>/home/robr/public_html/php/getpdf.php</b> on line <b>5</b><br>

    That most likely means the fopen () failed.

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match.

    - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him.

    attached mail follows:


    Actually, if you read the manual entry for fpassthru, it states that the filehandle will be closed by fpassthru upon reading. So you're trying to close your filehandle twice... get rid of the fclose($fp) at the end and you should be fine.

    -jm

    -----Original Message----- From: Christian Reiniger [mailto:creinigmayn.de] Sent: Thursday, February 08, 2001 11:19 AM To: php-generallists.php.net Subject: Re: [PHP] Passing files to a browser

    On Thursday 08 February 2001 18:43, Rob Root wrote:

    > <?php > $fp = fopen("test.txt", "r"); > header("content-type: text/plain"); > fpassthru($fp); > fclose($fp); > ?> > > And got: > Hello, World > <br> > <b>Warning</b>: 1 is not a valid File-Handle resource in > <b>/home/robr/public_html/php/getpdf.php</b> on line <b>5</b><br>

    That most likely means the fopen () failed.

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match.

    - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him.

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    HI,

    Getting rid of the fclose makes the error go away with the .txt file, but I am still getting a blank display with

    Javier Muniz wrote:

    > Actually, if you read the manual entry for fpassthru, it states that the > filehandle will be closed by fpassthru upon reading. > So you're trying to close your filehandle twice... get rid of the > fclose($fp) at the end and you should be fine. > > -jm > > -----Original Message----- > From: Christian Reiniger [mailto:creinigmayn.de] > Sent: Thursday, February 08, 2001 11:19 AM > To: php-generallists.php.net > Subject: Re: [PHP] Passing files to a browser > > On Thursday 08 February 2001 18:43, Rob Root wrote: > > > <?php > > $fp = fopen("test.txt", "r"); > > header("content-type: text/plain"); > > fpassthru($fp); > > fclose($fp); > > ?> > > > > And got: > > Hello, World > > <br> > > <b>Warning</b>: 1 is not a valid File-Handle resource in > > <b>/home/robr/public_html/php/getpdf.php</b> on line <b>5</b><br> > > That most likely means the fopen () failed. > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > This is JohnC IMHO, I compaired tri-word groupings here and in his plan > and got a good match. > > - /. posting discussing the likelihood that an AC post that claimed to > be > posted by John Carmack during his honeymoon (and having the login info > at > home) was actually from him. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    foreach($some2DArray as &$refToArrayRow) { }

    It won't even parse with an error of <b>Parse error</b>: parse error, expecting `T_VARIABLE' or `'$'' in <b>./myFile.php</b> on line <b>473</b><br>

    Can you not use a reference within a foreach loop? With the & removed, it works fine but then when I update the $refToArrayRow it's (obviously) not updating the original $some2DArray....

    -Szii

    attached mail follows:


    > foreach($some2DArray as &$refToArrayRow) > { > } > > It won't even parse with an error of > <b>Parse error</b>: parse error, expecting `T_VARIABLE' or `'$'' in > <b>./myFile.php</b> on line <b>473</b><br> > > > Can you not use a reference within a foreach loop? With the & removed, > it works fine but then when I update the $refToArrayRow it's (obviously) > not updating the original $some2DArray....

    Maybe try with the & on the $some2DArray instead...

    I mean, you want a reference to the 2D Array so you can munge it, right?

    So, like, then you are doing the assignment of &$some2DArray to a new variable not unlike: $arrayRow = &$some2DArray[0];

    Or am I the one that is thinking backwards?

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    Is there any way to do this?? i mean.. test the connection speed of a client machine???

    Thanks

    Matias mbanzascirculoasegurador.com

    attached mail follows:


    Only with the assistance of JavaScript.

    1) Make a session 2) Log the start time (server) 3) Send a large graphic (200K) 4) <BODY onLoad='document.location="your/script.php"'> 5) Log finish time when the user comes back (check for a session, blah blah). 6) Do the math (200 * 1024 / ($stop-$start) = bytes per second).

    No, it's not transparent to the user and no it's not microtime accurate, but it *does* work.

    Though it could just as easily be done in JavaScript on the client side and have it send the result back as an argument, but I'll not assume JavaScript knowledge as mine is flaky. =)

    On Thu, 8 Feb 2001, Matias Banzas wrote:

    >Is there any way to do this?? i mean.. test the connection speed of a client >machine???

    -- 
    ____________________________________________________________________________
    Adam Knight                                       <ahknightgraphitebox.com>
    AIM: AdamKnight                                                 ICQ: 3848971
    ______________________________Codito, ergo sum______________________________
     ///|||||||||||||||||||| Domino effect at work!
    

    attached mail follows:


    After a lot of searching on the mailing list and different resources I have come up with... nothing.

    My question: Can I get the MIME-type of a file using PHP? (image/gif, text/plain, application/octet-stream, ect.)

    Thanks, // Tobias

    attached mail follows:


    Yes:

    Assuming that then input variable for the file is "file":

    like: <input type="file" name="file">

    The returned results would be: $file = the name of the temporary file on the server.

    $file_name = The actual name of the file uploaded (ie pic.jpg)

    $file_size = the size of the file, in bytes.

    $file_type = the MIME type (yay) of the file.

    So, if you uploaded a Jpeg to your server, you could echo each of those variables to get info on them.

    You can also specify what files you want / don't want... Something like this might do it:

    $allowed_types = array("image/gif","image/pjpeg","image/jpeg");

    if (!in_array($file_type/* Our type of file */,$allowed_types) { echo "You uploaded $file_name. Unfortunately, we don't allow files with the MIME type, $file_type."; } else { echo "You uploaded $file_name, which has a MIME type of $file_type. Your file was $file_size. Thanks :)"; }

    Of course, you will have to do more extensive checking, and write some code to unlink invalid file types, together with auto-rename if you expect, for example, a lot of people to be uploading membership details: If they include a pic, out of two people uploading a picture, say "tobias.jpg", one of them is going to be disappointed; One file will overwrite the other if put into the same directory :)

    Also, you'll probably want to set a maximum files size.

    $max_file_size = "102400"; /* in bytes (100Kb in this example) */

    if ($file_size > $max_file_size) { echo "Your file's too big!"; }

    Hope this helps.

    James.

    > After a lot of searching on the mailing list and different resources I have > come up with... nothing. > > My question: > Can I get the MIME-type of a file using PHP? > (image/gif, text/plain, application/octet-stream, ect.) > > Thanks, > // Tobias > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Oops, I forgot to mention the most important part... I need to get the MIME-type (or something that can identify the file-extension) from a file ALREADY on the server, not posted through a form. I.e. How do I get the MIME-type of "tobias.zip" in my folder?

    I already know how to get the MIME-type from a form... Thanks for the nice snippets though. They might come in handy in the future.

    // Tobias

    ""James, Yz"" <liljimbtconnect.com> wrote in message news:95uqe5$473$1toye.p.sourceforge.net... > Yes: > > Assuming that then input variable for the file is "file": > > like: <input type="file" name="file"> > > The returned results would be: > $file = the name of the temporary file on the server. > > $file_name = The actual name of the file uploaded (ie pic.jpg) > > $file_size = the size of the file, in bytes. > > $file_type = the MIME type (yay) of the file. > > So, if you uploaded a Jpeg to your server, you could echo each of those > variables to get info on them. > > You can also specify what files you want / don't want... Something like this > might do it: > > $allowed_types = array("image/gif","image/pjpeg","image/jpeg"); > > if (!in_array($file_type/* Our type of file */,$allowed_types) { > echo "You uploaded $file_name. Unfortunately, we don't allow files with > the MIME type, $file_type."; > } else { > echo "You uploaded $file_name, which has a MIME type of $file_type. > Your file was $file_size. Thanks :)"; > } > > Of course, you will have to do more extensive checking, and write some code > to unlink invalid file types, together with auto-rename if you expect, for > example, a lot of people to be uploading membership details: If they > include a pic, out of two people uploading a picture, say "tobias.jpg", one > of them is going to be disappointed; One file will overwrite the other if > put into the same directory :) > > Also, you'll probably want to set a maximum files size. > > $max_file_size = "102400"; /* in bytes (100Kb in this example) */ > > if ($file_size > $max_file_size) { > echo "Your file's too big!"; > } > > Hope this helps. > > James. > > > > After a lot of searching on the mailing list and different resources I > have > > come up with... nothing. > > > > My question: > > Can I get the MIME-type of a file using PHP? > > (image/gif, text/plain, application/octet-stream, ect.) > > > > Thanks, > > // Tobias > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    > Oops, I forgot to mention the most important part... > I need to get the MIME-type (or something that can identify the > file-extension) from a file ALREADY on the server, not posted through a > form. > I.e. How do I get the MIME-type of "tobias.zip" in my folder? > > I already know how to get the MIME-type from a form... > Thanks for the nice snippets though. They might come in handy in the future.

    Just knocked this together. It doesn't confirm whether or not the files are actually valid MIME types (like .zip). For instance, you could upload a text files, rename it to .zip and it will list it (if you change the following $required_types variable I've put in here:

    __________________________

    <html> <head> <title>Looking MIME types?</title> </head> <body>

    Here is a listing of the directory I want to be looking in and all of the files in it. If the files are listed below, they're the ones I want to know.

    <ul> <?

    $directory = "/path/to/directory/"; $dir = opendir($directory);

    /* Change to the types you want */ $required_types = array(".gif",".jpg");

    while($MIMEfile = readdir($dir)) {

    $extension = strrchr($MIMEfile,'.');

    if(($MIMEfile != ".") && ($MIMEfile != "..") && (in_array($extension,$required_types))) { $filetype = filetype($MIMEfile); echo "<li>$MIMEfile"; }

    }

    ?> </ul> </body> </html>

    ________________________

    Note that this probably isn't the best way to go about things, but I've had a quick root through the file() functions, and could find nothing (though I didn't look too hard) quick and easy.

    Have fun. James.

    attached mail follows:


    "#!/usr/local/bin/php -q" doesn't quite do it for me. Here's what I get before and after adding the -q.

    $ cat xxx.php #!/usr/local/bin/php <?php echo "hello world\n"; ?> $ xxx.php X-Powered-By: PHP/4.0RC2 Set-Cookie: PHPSESSID=d74e5e80abcf1d2898588b595dc751d5 Expires: Thu, 8 Feb 2001 17:39:17 GMT Cache-Control: public, max-age=60 Last-Modified: Thu, 8 Feb 2001 17:38:13 GMT Content-type: text/html

    hello world $ cat xxx.php #!/usr/local/bin/php -q <?php echo "hello world\n"; ?> $ xxx.php <br> <b>Warning</b>: Cannot send session cookie - headers already sent in <b>Unknown</b> on line <b>0</b><br> <br> <b>Warning</b>: Cannot send session cache limiter - headers already sent in <b>Unknown</b> on line <b>0</b><br>

    hello world

    Any ideas on what I've got configured wrong?

    Thanks.

    ---
     Bill Rausch, Software Development, Unix, Mac, Windows
     Numerical Applications, Inc.  509-943-0861   billnumerical.com
    

    attached mail follows:


    Javascript to call another page (or at least URL) that is a php file . . . I have JavaScript OnChange examples, if you need it.

    > -----Original Message----- > From: Francesco Rossi [SMTP:inforsitin.it] > Sent: Thursday, February 08, 2001 5:17 AM > To: php-generallists.php.net > Subject: Events in HTML with PHP > > Hi, > How i can use the event OnChange of a tag <Select> for run a php script ? > Es. <select name="myname" size="1" onchange="HOW?"> > Thank. > >

    attached mail follows:


    Nope, this won't work. PHP is stricly server side; only JavaScript and other client side languages are capable of being called based on an event (as opposed to an HTTP request).

    --toby

    Francesco Rossi wrote: > > Hi, > How i can use the event OnChange of a tag <Select> for run a php script ? > Es. <select name="myname" size="1" onchange="HOW?"> > Thank. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    in Perl, i do thusly:

    $adtext = "This is a {test} john.smith\mail.mainetoday.com"; $email = $1 if($adtext=~/(\{.*\})/); print "email = $email\n\n";

    and i get back "email = "test".

    i then do thusly in PHP:

    $f=fopen($test_name, "r"); while(!feof($f)) { $line=fgets($f, 4096); preg_match_all("/(\{.*\})/", $line, $holes); }

    after this $holes contains the number of elements i expect to get back, but has no values. any ideas what i am doing wrong?

    :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: ************************************************************************** "Crippled but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter ************************************************************************** The views expressed herein are not necessarily those of my employer, but they let me have them anyway.

    attached mail follows:


    >> i'm working on a web site where users will be able to upload movies. >> the problem is that i want to dinamicly create a movie preview. >> is it possibile, even with some external programs in other languages, to >> exetract a picture from o movie?

    Suggest maybe looking at Macromedia Director/Shockwave.

    I haven't tried this on the web, but you may be able to create a Shockwave movie with a placeholder Quicktime on the stage and dynamically link the actual movie that you want at runtime.

    Your preview page with a still image will actually be a page with a Shockwave embedded in it showing the first frame of the movie paused.

    No guarantees that this will work, but I hope this helps and/or prompts other ideas.

    Andy Clarke

    ------------------------------------------------ Andy Clarke 78 West Kensington Court, Edith Villas, London, England W14 9AB

    phone: 44 (0)20 7602 3382 mobile: 07947 418177

    Freelance Lingo/PHP Programmer

    andykinonet.com ------------------------------------------------

    attached mail follows:


    I can use "$DOCUMENT_ROOT/includes/" to refer to my includes folder if it is at the top of my web directory. This works consistently no matter where about in the site I call it from.

    Is there a similar easy way to refer to a folder that is placed outside the web tree (above the web directory) for security? The only way I seem able to do it is using "../../../includes/", for example, which naturally depends on how deep in the website I am.

    FTFM me if I have missed something built in and obvious.

    Andy Clarke

    ------------------------------------------------ Andy Clarke 78 West Kensington Court, Edith Villas, London, England W14 9AB

    phone: 44 (0)20 7602 3382 mobile: 07947 418177

    Freelance Lingo/PHP Programmer

    andykinonet.com ------------------------------------------------

    attached mail follows:


    You're missing something simple, I think.

    /* Use these variables in each of the pages you need them, or stick them in a config include */ $files_above_root = "/home/pages/www"; $files_below_root = "/home/pages";

    /* reference includes similar to this method */ include("$files_above_root/somethingallshouldsee.php");

    include($files_below_root/secret.inc"); or in another subdirectory below the www root: include("$files_below_root/secret_files/topsecret.inc");

    Zap. That should do it :)

    James.

    > I can use "$DOCUMENT_ROOT/includes/" to refer to my includes folder if it > is at the top of my web directory. This works consistently no matter where > about in the site I call it from. > > Is there a similar easy way to refer to a folder that is placed outside the > web tree (above the web directory) for security? The only way I seem able > to do it is using "../../../includes/", for example, which naturally > depends on how deep in the website I am. > > FTFM me if I have missed something built in and obvious. > > > Andy Clarke > > > > > ------------------------------------------------ > Andy Clarke > 78 West Kensington Court, Edith Villas, > London, England W14 9AB > > phone: 44 (0)20 7602 3382 > mobile: 07947 418177 > > Freelance Lingo/PHP Programmer > > andykinonet.com > ------------------------------------------------ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Hello,

    Does anyone have a tutorial on using encrypted passwords for user AUTH? Flat file or Database

    Thank you,

    -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager brandonwebintellects.com 800-994-6364 www.webintellects.com --------------------------------------------

    attached mail follows:


    This is the file I include, works for me. cookie.egn just sets the session variable 'SessionID' and database.egn just has my fetch_db_value functions. Email me if you have any more questions.

    http://www.php.net/manual/en/features.http-auth.php

    <? include_once('cookie.egn'); include_once('database.egn');

    function bad_passwd() { echo "You have entered an invalid password.<br>\n"; exit(); }

    if ( isset($PHP_AUTH_USER) AND isset($PHP_AUTH_PW) AND $peop_r = fetch_db_value('people_manager', "WHERE username = '$PHP_AUTH_USER' AND password = '$PHP_AUTH_PW' ") ) $SessionID = $peop_r['peopleID']; else { Header("WWW-Authenticate: Basic realm='$SERVER_NAME' "); Header("HTTP/1.0 401 Unauthorized"); bad_passwd(); } ?>

    --
    

    Chris Lee Mediawaveonline.com leemediawaveonline.com

    ""Brandon Orther"" <brandonwebintellects.com> wrote in message news:CKEMJEADMOCEHPHJKLPAMEEJCGAA.brandonwebintellects.com... > Hello, > > Does anyone have a tutorial on using encrypted passwords for user AUTH? Flat > file or Database > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > brandonwebintellects.com > 800-994-6364 > www.webintellects.com > -------------------------------------------- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    sablotron seems to be converting <br/> to <br> is this normal? its not valid XHTML.

    index.xsl <?xml version='1.0' encoding='utf-8'?> <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:output method='html' indent='yes' encoding='utf-8' />

    <xsl:template match='/menu'> <xsl:for-each select='category'> <xsl:value-of select='level'/> <a href='{link}'><xsl:value-of select='name'/> </a> <br/> </xsl:for-each> </xsl:template>

    </xsl:stylesheet>

    --
    

    Chris Lee Mediawaveonline.com leemediawaveonline.com

    attached mail follows:


    I am rapidly coming to the conclusion that I need to be able to draw a fairly simple image (.gif or .jpg doesn't matter) with PHP to get Netscape to display it correctly. Can anyone point me to a tutorial?

    Thanks in advance,

    John Guynn

    This email brought to you by RFCs 821 and 1225.

    attached mail follows:


    Hello everyone- I'm having a small problem with PHP not sending email anywhere using the mail() function. Here are my settings for sending mail in the php.ini file (PHP version 4.03pl1 - OS Solaris)

    [mail function] SMTP = localhost ;for win32 only sendmail_from = melocalhost.com ;for win32 only sendmail_path = /usr/lib/sendmail -t ;for unix only, may supply arguments as well (default is 'sendmail -t -i')

    Thanks for any help... Jay

    attached mail follows:


    > sendmail_path = /usr/lib/sendmail -t > ;for unix only, may supply arguments as well (default is 'sendmail -t -i')

    Those apostrophes on the default setting are not just for show.

    sendmail_path = 'usr/lib/sendmail -t'

    Actually, I use " not ', but either should work.

    An .ini file delimits on a space unless it's inside a quote after the first non-space after the =

    In other words, your sendmail was never getting the -t part.

    I think that means you have a bunch of mail clogged up in there somewhere maybe...

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    I have some web agent type stuff to do for which there are some handy perl modules. I can just wrap them in scripts and system() them of course, but I though I'd check if there is some more elegant approach to integrating with perl before I do that?

    Thanks, Britton

    attached mail follows:


    > I have some web agent type stuff to do for which there are some handy perl > modules. I can just wrap them in scripts and system() them of course, but > I though I'd check if there is some more elegant approach to integrating > with perl before I do that?

    http://php.net/virtual may or may not match your definition of more elegant.

    Apache 2.0 was once rumored to be maybe having "stacked handlers" such that you could send a page through PHP and then Perl (or vice versa) but that's not an option yet, and I have no knowledge if that feature has survived this far...

    fhttpd has "stacked handlers" I think, but it's a bit extreme to switch from Apache to fhttpd for what you need, I think. Probably major bonus points for elegance, though :-)

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    Is there a function that can tell me whether a form was posted?

    Thank you.

    -- 
    ************************************
    Ivan R. Quintero E.* (507)228-3477	
    Aptdo 1263	   * (507)228-9105
    Balboa, Ancon	   * 640-0370
    Republic of Panama * 
    ************************************
    

    attached mail follows:


    "rodrigo" <rodrigoshreve.net> wrote: > Is there a function that can tell me whether a form was posted?

    There's an Apache environment variable. $REQUEST_METHOD. Returns "GET" or "POST".

    Do <?php phpinfo(); ?> in your script for more good stuff.

    --
    Steve Werby
    COO
    24-7 Computer Services, LLC
    Tel: 804.817.2470
    http://www.247computing.com/
    

    attached mail follows:


    Sebastian,

    I see no reason why you couldn't. I believe at one time I had CGI, Apache and Servlet all serving up PHP using different extensions in Apache on Win32. However, it's been a while so don't hold me to it.

    Alex

    attached mail follows:


    Should this be possible? I know this isn't an issue with php, but since I used php to do this, I figured maybe someone here has encountered the same thing, and knows how to help. Is this something that can be fixed by making some changes on the linux server?

    By using this:

    <? echo "<pre>"; include("/home/someuser/www/admin/.htaccess"); echo "</pre>"; ?>

    I can see what .htpasswd file is used, and then I can simply change the code to display that particular password file, then take the encrypted password, and decrypt it to gain access to that protected area.

    I have a feeling this is a permissions issue on the Linux server... Can anyone point me in the right direction with this?

    attached mail follows:


    Make sure that the .htpasswd file is BELOW the public files root. That way, it can't be accessed through a browser, unless the person who has written the file to try and read the .htpasswd has uploaded their file to the server it resides on, and has permission to access that low level directory. They can't read files in a directory route, unless they're in the directory: So a URL reference won't work. If you've uploaded the .htpasswd to /www/admin They could do an include for:

    <? include(http://www.yoursite.com/admin/.htpasswd); ?>

    ..................So:

    /home/myfiles/.htpasswd

    Rather than

    /home/myfiles/publicwwwfiles/.htpasswd

    Hope that's of some use to you. James.

    ""Thor M. Steindorsson"" <thornetwood.net> wrote in message news:CGEILHNPHENDKFJOEGFKKEKGCOAA.thornetwood.net... > Should this be possible? > I know this isn't an issue with php, but since I used php to do this, I > figured maybe someone here has encountered the same thing, and knows how to > help. > Is this something that can be fixed by making some changes on the linux > server? > > By using this: > > <? > echo "<pre>"; > include("/home/someuser/www/admin/.htaccess"); > echo "</pre>"; > ?> > > I can see what .htpasswd file is used, and then I can simply change the code > to display that particular password file, then take the encrypted password, > and decrypt it to gain access to that protected area. > > I have a feeling this is a permissions issue on the Linux server... > Can anyone point me in the right direction with this? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    In addition,

    (if using .htaccess) They would only be able to read the .htpasswd from public directory if they had first authorised themselves. The browser will prompt them to identify before it allows files from a protected directory to be included.

    J.

    > Make sure that the .htpasswd file is BELOW the public files root. That way, > it can't be accessed through a browser, unless the person who has written > the file to try and read the .htpasswd has uploaded their file to the server > it resides on, and has permission to access that low level directory. They > can't read files in a directory route, unless they're in the directory: So > a URL reference won't work. If you've uploaded the .htpasswd to /www/admin > They could do an include for: > > <? > include(http://www.yoursite.com/admin/.htpasswd); > ?> > > ..................So: > > /home/myfiles/.htpasswd > > Rather than > > /home/myfiles/publicwwwfiles/.htpasswd > > Hope that's of some use to you. > James. > > ""Thor M. Steindorsson"" <thornetwood.net> wrote in message > news:CGEILHNPHENDKFJOEGFKKEKGCOAA.thornetwood.net... > > Should this be possible? > > I know this isn't an issue with php, but since I used php to do this, I > > figured maybe someone here has encountered the same thing, and knows how > to > > help. > > Is this something that can be fixed by making some changes on the linux > > server? > > > > By using this: > > > > <? > > echo "<pre>"; > > include("/home/someuser/www/admin/.htaccess"); > > echo "</pre>"; > > ?> > > > > I can see what .htpasswd file is used, and then I can simply change the > code > > to display that particular password file, then take the encrypted > password, > > and decrypt it to gain access to that protected area. > > > > I have a feeling this is a permissions issue on the Linux server... > > Can anyone point me in the right direction with this? > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    well, that doesn't really apply, since I can also use /etc/httpd/conf/httpd.conf as an include file and it displays perfectly...

    -----Original Message----- From: James, Yz [mailto:liljimbtconnect.com] Sent: Thursday, February 08, 2001 1:54 PM To: php-generallists.php.net Subject: Re: [PHP] security help

    In addition,

    (if using .htaccess) They would only be able to read the .htpasswd from public directory if they had first authorised themselves. The browser will prompt them to identify before it allows files from a protected directory to be included.

    J.

    > Make sure that the .htpasswd file is BELOW the public files root. That way, > it can't be accessed through a browser, unless the person who has written > the file to try and read the .htpasswd has uploaded their file to the server > it resides on, and has permission to access that low level directory. They > can't read files in a directory route, unless they're in the directory: So > a URL reference won't work. If you've uploaded the .htpasswd to /www/admin > They could do an include for: > > <? > include(http://www.yoursite.com/admin/.htpasswd); > ?> > > ..................So: > > /home/myfiles/.htpasswd > > Rather than > > /home/myfiles/publicwwwfiles/.htpasswd > > Hope that's of some use to you. > James. > > ""Thor M. Steindorsson"" <thornetwood.net> wrote in message > news:CGEILHNPHENDKFJOEGFKKEKGCOAA.thornetwood.net... > > Should this be possible? > > I know this isn't an issue with php, but since I used php to do this, I > > figured maybe someone here has encountered the same thing, and knows how > to > > help. > > Is this something that can be fixed by making some changes on the linux > > server? > > > > By using this: > > > > <? > > echo "<pre>"; > > include("/home/someuser/www/admin/.htaccess"); > > echo "</pre>"; > > ?> > > > > I can see what .htpasswd file is used, and then I can simply change the > code > > to display that particular password file, then take the encrypted > password, > > and decrypt it to gain access to that protected area. > > > > I have a feeling this is a permissions issue on the Linux server... > > Can anyone point me in the right direction with this? > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    "James, Yz" wrote: > > In addition, > > (if using .htaccess) They would only be able to read the .htpasswd from > public directory if they had first authorised themselves. The browser will > prompt them to identify before it allows files from a protected directory to > be included. >

    James,

    are you sure about this? Afaik, no user authentication applies to PHP include() calls. This would require PHP to integrate much closer with Apache than I think it does (and makes sense).

    Cheers, Ben

    > J. > > > Make sure that the .htpasswd file is BELOW the public files root. That > way, > > it can't be accessed through a browser, unless the person who has written > > the file to try and read the .htpasswd has uploaded their file to the > server > > it resides on, and has permission to access that low level directory. > They > > can't read files in a directory route, unless they're in the directory: > So > > a URL reference won't work. If you've uploaded the .htpasswd to > /www/admin > > They could do an include for: > > > > <? > > include(http://www.yoursite.com/admin/.htpasswd); > > ?> > > > > ..................So: > > > > /home/myfiles/.htpasswd > > > > Rather than > > > > /home/myfiles/publicwwwfiles/.htpasswd > > > > Hope that's of some use to you. > > James. > > > > ""Thor M. Steindorsson"" <thornetwood.net> wrote in message > > news:CGEILHNPHENDKFJOEGFKKEKGCOAA.thornetwood.net... > > > Should this be possible? > > > I know this isn't an issue with php, but since I used php to do this, I > > > figured maybe someone here has encountered the same thing, and knows how > > to > > > help. > > > Is this something that can be fixed by making some changes on the linux > > > server? > > > > > > By using this: > > > > > > <? > > > echo "<pre>"; > > > include("/home/someuser/www/admin/.htaccess"); > > > echo "</pre>"; > > > ?> > > > > > > I can see what .htpasswd file is used, and then I can simply change the > > code > > > to display that particular password file, then take the encrypted > > password, > > > and decrypt it to gain access to that protected area. > > > > > > I have a feeling this is a permissions issue on the Linux server... > > > Can anyone point me in the right direction with this? > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > > For additional commands, e-mail: php-general-helplists.php.net > > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    > > In addition, > > > > (if using .htaccess) They would only be able to read the .htpasswd from > > public directory if they had first authorised themselves. The browser will > > prompt them to identify before it allows files from a protected directory to > > be included. > > > > James, > > are you sure about this? Afaik, no user authentication applies to PHP > include() calls. This would require PHP to integrate much closer with > Apache than I think it does (and makes sense).

    Hi Ben,

    I'm not positive, (btw, what does Afaik mean?), but I'd assume any request to files that are inside a directory that has an htaccess file would be ignored by anything until the username and password have been included (I've used a PHP include on files before, which refer to files such as jpegs and gifs that reside in a protected directory, and I've run into the problem of having to authenticate before the images are displayed).

    There's a good chance I'm wrong, but I'll be sure to double check tomorrow morning.

    On another note, I seem to have problems with opendir() and readdir() (which one of the two I'm not sure). A simple script I've written will list all files in a directory I specify on one server, yet the same script (with the document root changed accordingly) will return nothing with the other. Both servers are running the same version of PHP (4.02). It's probably something simple I've missed, though I'm sure that the CHMOD settings are the same, and I'm getting no script errors. Any ideas?

    James.

    attached mail follows:


    If you include a file as a link, so the browser sees: www.myserver.com/sercuredir/image.jpg. Than yes, you will be asked for a user and pass.

    If you include the file in the code, like including another script file, or reading the raw image data and outputting it, then .htaccess will be ignored.

    Basicaly, if you don't have safe mode php on, then using include, the code and read any file that the webserver id has permission for.

    > > > In addition, > > > > > > (if using .htaccess) They would only be able to read the .htpasswd from > > > public directory if they had first authorised themselves. The browser > will > > > prompt them to identify before it allows files from a protected > directory to > > > be included. > > > > > > > James, > > > > are you sure about this? Afaik, no user authentication applies to PHP > > include() calls. This would require PHP to integrate much closer with > > Apache than I think it does (and makes sense). > > Hi Ben, > > I'm not positive, (btw, what does Afaik mean?), but I'd assume any request > to files that are inside a directory that has an htaccess file would be > ignored by anything until the username and password have been included (I've > used a PHP include on files before, which refer to files such as jpegs and > gifs that reside in a protected directory, and I've run into the problem of > having to authenticate before the images are displayed). > > There's a good chance I'm wrong, but I'll be sure to double check tomorrow > morning. > > On another note, I seem to have problems with opendir() and readdir() (which > one of the two I'm not sure). A simple script I've written will list all > files in a directory I specify on one server, yet the same script (with the > document root changed accordingly) will return nothing with the other. > Both servers are running the same version of PHP (4.02). It's probably > something simple I've missed, though I'm sure that the CHMOD settings are > the same, and I'm getting no script errors. Any ideas? > > James. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    SAFE MODE!!

    That's exactly what I was looking for... It did the trick. Thanks Chris.

    -----Original Message----- From: Chris [mailto:php_listibcnetwork.net] Sent: Thursday, February 08, 2001 4:18 PM To: php Subject: Re: [PHP] security help

    If you include a file as a link, so the browser sees: www.myserver.com/sercuredir/image.jpg. Than yes, you will be asked for a user and pass.

    If you include the file in the code, like including another script file, or reading the raw image data and outputting it, then .htaccess will be ignored.

    Basicaly, if you don't have safe mode php on, then using include, the code and read any file that the webserver id has permission for.

    > > > In addition, > > > > > > (if using .htaccess) They would only be able to read the .htpasswd from > > > public directory if they had first authorised themselves. The browser > will > > > prompt them to identify before it allows files from a protected > directory to > > > be included. > > > > > > > James, > > > > are you sure about this? Afaik, no user authentication applies to PHP > > include() calls. This would require PHP to integrate much closer with > > Apache than I think it does (and makes sense). > > Hi Ben, > > I'm not positive, (btw, what does Afaik mean?), but I'd assume any request > to files that are inside a directory that has an htaccess file would be > ignored by anything until the username and password have been included (I've > used a PHP include on files before, which refer to files such as jpegs and > gifs that reside in a protected directory, and I've run into the problem of > having to authenticate before the images are displayed). > > There's a good chance I'm wrong, but I'll be sure to double check tomorrow > morning. > > On another note, I seem to have problems with opendir() and readdir() (which > one of the two I'm not sure). A simple script I've written will list all > files in a directory I specify on one server, yet the same script (with the > document root changed accordingly) will return nothing with the other. > Both servers are running the same version of PHP (4.02). It's probably > something simple I've missed, though I'm sure that the CHMOD settings are > the same, and I'm getting no script errors. Any ideas? > > James. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    On Thu, 8 Feb 2001, Richard Lynch wrote:

    > You can find a long-winded post from me a year or two ago about my trials > and tribulations (and a *lot* of help from others to get me going).

    I found a pgp class and took parts of it to work with gpg, but it doesn't work in safe-mode. I'm using this pipe to pass the data to encrypt to gpg:

    $comm = "echo '$data' | $this->gpg-commmand"; $fd = popen("$comm","r");

    if (!$fd) { return -2; }

    $encrypted = ""; while (!feof($fd)) { $encrypted .= fgets($fd,4096); }

    pclose($fd);

    This returns echoes the part after the | in safe-mode. How could this work in this mode?.

    Thank you. Rodolfo.

    attached mail follows:


    I don't know...

    Never used safe mode.

    I *think* you would have to have all the files under your web-tree, but that might make gpg rather unsuitable. If your private key-ring file is in your web-tree, it's maybe just a little too exposed...

    Maybe you can create a custome keyring for just the web-usage of public keys only...

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: Rodolfo Gonzalez Gonzalez <rodolfoequinoxe.g-networks.net>
    To: Richard Lynch <richardzend.com>
    Cc: <php-generallists.php.net>
    Sent: Wednesday, February 07, 2001 3:42 PM
    Subject: Re: [PHP] Mail-Encryption
    

    > On Thu, 8 Feb 2001, Richard Lynch wrote: > > > You can find a long-winded post from me a year or two ago about my trials > > and tribulations (and a *lot* of help from others to get me going). > > I found a pgp class and took parts of it to work with gpg, but it doesn't > work in safe-mode. I'm using this pipe to pass the data to encrypt to gpg: > > $comm = "echo '$data' | $this->gpg-commmand"; > $fd = popen("$comm","r"); > > if (!$fd) { > return -2; > } > > $encrypted = ""; > while (!feof($fd)) { > $encrypted .= fgets($fd,4096); > } > > pclose($fd); > > This returns echoes the part after the | in safe-mode. How could this work > in this mode?. > > Thank you. > Rodolfo. > >

    attached mail follows:


    Hi

    Can I do this????

    $string = file.tpl;

    while (list($pattern, $replacement) = each($array)) { ereg_replace ($pattern, $replacement, $string); }

    echo $string;

    note some assumptions below:

    $array contains an assoc array:

    first foo second bar third rab fourth oof

    file.tpl is this:

    some html {first} more html {second} even more html {third} lots more html {fourth}

    This seems like a slow way to do this... any advice is welcome!

    tia! jaxon

    attached mail follows:


    Thanks for the feedback! From the docs it appears that I can do this:

    $string = file.tpl; //html mixed with {placeholders}

    $array = fetch_mysql_array($result, MYSQL_ASSOC); //array of field => values

    echo strtr($string, $array); //passing only 2 arguments means 2nd is array

    one thing - I want to use special {} characters in my file.tpl. Does anyone know if there is some way I can tell strtr to only evaluate items in {} tag for replacing?

    regards, jaxon

    On 2/8/01 5:49 PM, "Brad S. Jackson" <bjacksonMcLeodUSA.com> wrote:

    > > > See the documentation for strtr and preg_replace. > > http://www.php.net/manual/en/html/function.strtr.html > http://www.php.net/manual/en/html/function.preg-replace.html > > > "Jaxon" <jaxonsalamander.net> wrote: > Hi > > Can I do this???? > > $string = file.tpl; > > while (list($pattern, $replacement) = each($array)) { > ereg_replace ($pattern, $replacement, $string); > } > > echo $string; > > > > note some assumptions below: > > $array contains an assoc array: > > first foo > second bar > third rab > fourth oof > > file.tpl is this: > > some html {first} > more html {second} > even more html {third} > lots more html {fourth} > > This seems like a slow way to do this... > any advice is welcome! > > tia! > jaxon > > >

    attached mail follows:


    How can i make a crontab run a php file??? should i add something like this in the file:

    path/to/file.php ????

    Thanks in advance...

    attached mail follows:


    #!/path/to/php -q <?

    mail('userfoo.com','foo','foo');

    ?>

    chmod +x foo.php

    0 0 * * * /path/to/foo.php > /dev/null

    --Joe

    On Thu, Feb 08, 2001 at 07:36:57PM -0300, GAYTAN BAHAMONDEZ DANIEL EDUARDO wrote: > How can i make a crontab run a php file??? > should i add something like this in the file: > > path/to/file.php ???? > > > Thanks in advance... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- 
    

    ------------------------------------------------------------------------------- Joe Stump, PHP Hacker, joestump98yahoo.com -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V -------------------------------------------------------------------------------

    attached mail follows:


    Hi,

    Yes just make the path lead to the file on your server.

    Regards Adrian

    attached mail follows:


    I thought you can pass variables in PHP as in CGI.

    http://www.xy.com/index.php?contents=HOME

    contents should be available as variable, but it does not seem to work. Doe anyone has an idea why not?

    attached mail follows:


    That should work just fine.

    Make sure that HOME doesn't have any spaces and is urlencode()'d

    --Joe

    On Thu, Feb 08, 2001 at 09:49:18PM +0100, Steve Haemelinck wrote: > I thought you can pass variables in PHP as in CGI. > > http://www.xy.com/index.php?contents=HOME > > contents should be available as variable, but it does not seem to work. Doe > anyone has an idea why not? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- 
    

    ------------------------------------------------------------------------------- Joe Stump, PHP Hacker, joestump98yahoo.com -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V -------------------------------------------------------------------------------

    attached mail follows:


    If register_globals is turned off, that will not work. See :

    http://www.php.net/manual/en/configuration.php#ini.register-globals

    Check phpinfo()

    <?php

    phpinfo()

    ?>

    For details on your settings, perhaps it is off. Try :

    <?php

    echo $HTTP_GET_VARS["contents"]

    ?>

    And it should display : HOME : for you.

    Regards,

    Philip Olson http://www.cornado.com/

    On Thu, 8 Feb 2001, Steve Haemelinck wrote:

    > I thought you can pass variables in PHP as in CGI. > > http://www.xy.com/index.php?contents=HOME > > contents should be available as variable, but it does not seem to work. Doe > anyone has an idea why not? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    // Index.php file.

    // Page header

    <?

    if ($contents == "HOME") { include("home.inc"); } else { include("someothercontent.inc");

    ?>

    // Page footer

    ... Difficult to tell what's going wrong with just a url.

    James.

    > I thought you can pass variables in PHP as in CGI. > > http://www.xy.com/index.php?contents=HOME > > contents should be available as variable, but it does not seem to work. Doe > anyone has an idea why not?

    attached mail follows:


    Help! (if you can).

    I'm having troubles inserting records into our AS400. I've tried just about every combination I can think of when trying to insert a record, but nothing is working. Here is the most recent error I keep getting:

    Warning: SQL error: [IBM][CLI Driver][AS] SQL7008N REXX variable "WBO230P " contains inconsistent data. SQLSTATE=55019 , SQL state 55019 in SQLExecute

    And here is the SQL command: INSERT INTO WEBTEST.wbo230p (WOSTS, WOORD, WOCUS, WOST, WSNAM, WSAD1, WSAD2, WSADX, WSAD3, WSSTA, WSZIP, WOPO, WODTTM, WONORD, WINVDT, WPHONE, WEMAIL, WSBSTA, WSAMT) VALUES ('1',0000000001,000001,0001,'t ','t ','t ','t ','t ','t ','t ','t ',00000000000001,'t ','t ','t ','t ','t ','t ')

    Any Ideas why this isn't working?

    Thanks! Karl

    attached mail follows:


    > I'm having troubles inserting records into our AS400. I've tried just about > every combination I can think of when trying to insert a record, but nothing > is working. Here is the most recent error I keep getting: > > Warning: SQL error: [IBM][CLI Driver][AS] SQL7008N REXX variable "WBO230P " > contains inconsistent data. SQLSTATE=55019 , SQL state 55019 in SQLExecute > > And here is the SQL command: > INSERT INTO WEBTEST.wbo230p (WOSTS, WOORD, WOCUS, WOST, WSNAM, WSAD1, WSAD2, > WSADX, WSAD3, WSSTA, WSZIP, WOPO, WODTTM, WONORD, WINVDT, WPHONE, WEMAIL, > WSBSTA, WSAMT) VALUES ('1',0000000001,000001,0001,'t ','t ','t ','t ','t > ','t ','t ','t ',00000000000001,'t ','t ','t ','t ','t ','t ')

    Like, unless AS400/IBM/CLI/AS SQL is way different from SQL92, you either don't need WEBTEST, or there should be no .wbo230p, or you aren't telling us that you are doing something funky like trying to insert into one database (WEBTEST) even though you are connected to another...

    But, even so, WEBTEST.wbo230p maybe be fine, and it's just one of those columns whose data it doesn't like.

    The question, of course, is which one.

    The leading 0's on WOORD and WOCUS and [mumble] look pretty darned suspicious to me. If those are integer, they should just be 1, not 000001. If they are *not* integer, you need apostrophes on them just like the others.

    If that doesn't help, just start throwing out columns. Or throw them all out and build it up 1 column at a time) until you find out which one it doesn't like.

    I dunno why SQL engines are so darned non-specific in their error messages. My favorite: syntax error near ',' Thanks guys! Like what non-trivial SQL statement *doesn't* have a bazillion commas in it?!

    PS Am I to assume you actually have a working PHP<->AS400 connection? If you could build a PHP/AS400 page, you would probably get much traffic. People keep asking about AS400, and I've never even seen one.

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    Today I noticed an entry in my database with the username "codeboy" and the password "hacked" in one of the authorization tables I have created. I am shocked that someone could be so malicious and insensitive! I am programming locally; I realize there may be some security vulnerabilities during this time, but when I go live with my network this will not be the case. If any further attempts are made to hack into my system I will clearly take the time to retaliate against you. Let this be your only warning.

    ===== ===================================== [ rswfire ]

    http://rswfire.swifte.net/ http://profiles.yahoo.com/rswfire

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

    __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

    attached mail follows:


    > > Today I noticed an entry in my database with the > username "codeboy" and the password "hacked" in > one of the authorization tables I have created. > I am shocked that someone could be so malicious > and insensitive! I am programming locally; I > realize there may be some security > vulnerabilities during this time, but when I go > live with my network this will not be the case. > If any further attempts are made to hack into my > system I will clearly take the time to retaliate > against you. Let this be your only warning. >

    This is not the place to take these issues up. Please email privatly and complain to the appropriate authrities, the PHP-General list is not the place for this.

    James

    --
    James Moore
    PHP QA Team
    jmoorephp.net
    

    attached mail follows:


    Whatever, James.

    The hackers name is Jonathan Sharp. He is a regular member of this mailing list. I do believe that people here would like to know they have a hacker on their hands, don't you think? It would appear the friendly Jonathan has another side to himself...

    Codeboy: Jonathan Sharp Director of Technology - Imprev Inc. Renwick Development Group - Flyerware webdevflyerware.com

    --- James Moore <jamesphpuk.org> wrote: > > > > > Today I noticed an entry in my database with > the > > username "codeboy" and the password "hacked" > in > > one of the authorization tables I have > created. > > I am shocked that someone could be so > malicious > > and insensitive! I am programming locally; I > > realize there may be some security > > vulnerabilities during this time, but when I > go > > live with my network this will not be the > case. > > If any further attempts are made to hack into > my > > system I will clearly take the time to > retaliate > > against you. Let this be your only warning. > > > > This is not the place to take these issues up. > Please email privatly and > complain to the appropriate authrities, the > PHP-General list is not the > place for this. > > James > -- > James Moore > PHP QA Team > jmoorephp.net >

    ===== ===================================== [ rswfire ]

    http://rswfire.swifte.net/ http://profiles.yahoo.com/rswfire

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

    __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

    attached mail follows:


    Many hackers now go about their business to notify (or even test) administrators whether or not they've been up to no good. It's possible that you've mis-construed what he was up to.

    Nevertheless, your complaints should really go to the correct authorities (your server, the "hacker" and if necessary, beyond that), as opposed to questions, which might include "I've got a security problem with PHP, what can I do about it?"

    James.

    > The hackers name is Jonathan Sharp. He is a > regular member of this mailing list. I do > believe that people here would like to know they > have a hacker on their hands, don't you think? > It would appear the friendly Jonathan has another > side to himself... > > Codeboy: > Jonathan Sharp > Director of Technology - Imprev Inc. > Renwick Development Group - Flyerware > webdevflyerware.com > > > > --- James Moore <jamesphpuk.org> wrote: > > > > > > > > Today I noticed an entry in my database with > > the > > > username "codeboy" and the password "hacked" > > in > > > one of the authorization tables I have > > created. > > > I am shocked that someone could be so > > malicious > > > and insensitive! I am programming locally; I > > > realize there may be some security > > > vulnerabilities during this time, but when I > > go > > > live with my network this will not be the > > case. > > > If any further attempts are made to hack into > > my > > > system I will clearly take the time to > > retaliate > > > against you. Let this be your only warning. > > > > > > > This is not the place to take these issues up. > > Please email privatly and > > complain to the appropriate authrities, the > > PHP-General list is not the > > place for this. > > > > James > > -- > > James Moore > > PHP QA Team > > jmoorephp.net > > > > > ===== > ===================================== > [ rswfire ] > > http://rswfire.swifte.net/ > http://profiles.yahoo.com/rswfire > > ===================================== > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    > Whatever, James.

    Also, consider this word : sue

    As well as : defamation of character

    And also : Libel and Slander

    And lastly :

    Spoof

    All should be considered before posting anything anywhere. Especially a public mailing list. It's important to be careful with this sort of thing, even if it's blindingly true ...

    Regards,

    Philip

    attached mail follows:


    On Thu, Feb 08, 2001 at 03:19:52PM -0800, rswfire wrote:

    > Whatever, James. > > The hackers name is Jonathan Sharp. He is a > regular member of this mailing list. I do > believe that people here would like to know they > have a hacker on their hands, don't you think?

    http://www.tuxedo.org/~esr/jargon/html/entry/hacker.html http://www.tuxedo.org/~esr/jargon/html/entry/cracker.html

    Matt

    attached mail follows:


    > > Whatever, James. > > Also, consider this word : > > sue > > As well as : > > defamation of character > > And also : > > Libel and Slander > > And lastly : > > Spoof > > All should be considered before posting anything anywhere. Especially a > public mailing list. It's important to be careful with this sort of > thing, even if it's blindingly true ...

    True, but none of which are applicable to me, as I've not slandered, defamed or spoofed anything or anyone. As far as hacking is concerned, I wouldn't know my arse from my elbow :)

    James

    attached mail follows:


    Your momma pays full commission!

    (sorry, couldn't resist)

    >As far as hacking is concerned, I wouldn't know my arse from my elbow :) > >James

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    > Your momma pays full commission! > > (sorry, couldn't resist)

    It's OK, I get referral fees :)

    attached mail follows:


    > True, but none of which are applicable to me, as I've not slandered, defamed > or spoofed anything or anyone. As far as hacking is concerned, I wouldn't > know my arse from my elbow :)

    just a fyi, my post had nothing to do with you. or the other james (which that line you're referring too had to do with) but rather, that of the person in question ("hacker"). but anyway, let's let this thread die. it's time.

    Philip

    attached mail follows:


    Ok, I just checked my mail and found this thread... to clear this up...

    In one of your posts you posed a url to a script you were working on...and I backed up a directory and it gave me a directory listing...one folder was /admin/ it gave another listing...then showed phpMyAdmin and then it gave your full db schema...no passwords or anything...i was able to insert a record...and a user to your mysql server... password is (abc123) that's all i did...nothing else...and i'd hardly consider that a hack...more of a "browse"

    Cheers, -Jonathan aka: "Codeboy the *dangerous* hacker"

    > -----Original Message----- > From: Philip Olson [mailto:philipcornado.com] > Sent: Thursday, February 08, 2001 4:24 PM > To: James, Yz > Cc: php-generallists.php.net > Subject: Re: [PHP] To The Hacker: CodeBoy > > > > True, but none of which are applicable to me, as I've not > slandered, defamed > > or spoofed anything or anyone. As far as hacking is concerned, > I wouldn't > > know my arse from my elbow :) > > just a fyi, my post had nothing to do with you. or the other james (which > that line you're referring too had to do with) but rather, that of the > person in question ("hacker"). but anyway, let's let this thread die. > it's time. > > Philip > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > >

    attached mail follows:


    P.S. in your phpMyAdmin config.inc.php file line 13 set: $cfgServers[1]['adv_auth'] = true; then you won't have any problems...

    -codeboy

    > -----Original Message----- > From: rswfire [mailto:rswfireyahoo.com] > Sent: Thursday, February 08, 2001 3:20 PM > To: php-generallists.php.net > Cc: webdevflyerware.com; jamesphpuk.org > Subject: RE: [PHP] To The Hacker: CodeBoy > > > Whatever, James. > > The hackers name is Jonathan Sharp. He is a > regular member of this mailing list. I do > believe that people here would like to know they > have a hacker on their hands, don't you think? > It would appear the friendly Jonathan has another > side to himself... > > Codeboy: > Jonathan Sharp > Director of Technology - Imprev Inc. > Renwick Development Group - Flyerware > webdevflyerware.com > > > > --- James Moore <jamesphpuk.org> wrote: > > > > > > > > Today I noticed an entry in my database with > > the > > > username "codeboy" and the password "hacked" > > in > > > one of the authorization tables I have > > created. > > > I am shocked that someone could be so > > malicious > > > and insensitive! I am programming locally; I > > > realize there may be some security > > > vulnerabilities during this time, but when I > > go > > > live with my network this will not be the > > case. > > > If any further attempts are made to hack into > > my > > > system I will clearly take the time to > > retaliate > > > against you. Let this be your only warning. > > > > > > > This is not the place to take these issues up. > > Please email privatly and > > complain to the appropriate authrities, the > > PHP-General list is not the > > place for this. > > > > James > > -- > > James Moore > > PHP QA Team > > jmoorephp.net > > > > > ===== > ===================================== > [ rswfire ] > > http://rswfire.swifte.net/ > http://profiles.yahoo.com/rswfire > > ===================================== > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.com/ > >

    attached mail follows:


    I would have to agree with you Johnathan, more of a browse then a hack. I think to qualify this as a hack you'd need a little more security on rswfires side no? and to call it a crack I think you would have to accually do something malicous, you didnt.

    Sorry rswfire, bump you security a little higher then

    username : [blank] password: [blank]

    you leave your keys in a running auto and the doors unlocked, try talking to an insurance agency... they wont cover you...

    --
    

    Chris Lee Mediawaveonline.com leemediawaveonline.com

    ""Jonathan Sharp"" <webdevflyerware.com> wrote in message news:FNEHLKDDCOAMMJDGHJEPEEDDCCAA.webdevflyerware.com... > Ok, I just checked my mail and found this thread... to clear this up... > > In one of your posts you posed a url to a script you were working on...and I > backed up a directory and it gave me a directory listing...one folder was > /admin/ it gave another listing...then showed phpMyAdmin and then it gave > your full db schema...no passwords or anything...i was able to insert a > record...and a user to your mysql server... password is (abc123) that's all > i did...nothing else...and i'd hardly consider that a hack...more of a > "browse" > > Cheers, > -Jonathan > aka: "Codeboy the *dangerous* hacker" > > > -----Original Message----- > > From: Philip Olson [mailto:philipcornado.com] > > Sent: Thursday, February 08, 2001 4:24 PM > > To: James, Yz > > Cc: php-generallists.php.net > > Subject: Re: [PHP] To The Hacker: CodeBoy > > > > > > > True, but none of which are applicable to me, as I've not > > slandered, defamed > > > or spoofed anything or anyone. As far as hacking is concerned, > > I wouldn't > > > know my arse from my elbow :) > > > > just a fyi, my post had nothing to do with you. or the other james (which > > that line you're referring too had to do with) but rather, that of the > > person in question ("hacker"). but anyway, let's let this thread die. > > it's time. > > > > Philip > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    You might find more help on php-windows, but here's what I suspect...

    Take a look at your IIS management console and see if the subdirectory might've been configured differently from the root directory. Or, try changing the script mappings a little in the root and let them override the subdirectory. This isn't the problem if the subdir isn't listed in the IIS console tho... if it's not listed, it won't have different properties, so then you'll probably need to try php-windows.

    --toby

    SED wrote: > > Hi, > > I´m hosting a PHP-doc in sub-directorie (http://myserver/subdirectory/) on > my IIS server Win2000 but it doesn't run, though it runs in the root > (http://myserver/). > > Is there something in the PHP.ini to config (and how) or is it something > else? > > Regards, > Sumarlidi Einar Dadason > > SED - Graphic Design > > ------------------------------------------ > Phone: (+354) 4615501 > Mobile: (+354) 8960376 > Fax: (+354) 4615503 > E-mail: sedsed.is > Homepage: www.sed.is <- New Homepage! > ------------------------------------------ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Hi

    Please help me

    I don't knowk that is wrong, in this code, for ftp_fput Don't copy the archive, when copy the archive , this has other extension, and the size is 0kb.

    <? $fp = ftp_connect('192.168.57.2', 21);

    $con = ftp_login($fp, "mdiaz", "root1997");

    $destino="public_html/abyayala/ftp/ftp";

    $desti=ftp_chdir($fp,$destino);

    $archivo="C:\\abm\\Abm.gdb";

    $fpr = fopen ($archivo, "a+");

    $subir=ftp_fput($fp,$archivo,$fpr,FTP_BINARY);

    fclose($fpr);

    ftp_quit($fp);

    ?>

    Thanks.

    Marisol Díaz E.

    Marisol Díaz E. Gerente de Aplicaciones Internet Tecnopro Cía. Ltda. www.tecnopro.net Pinta 236 y Rabida Edf. Alcatel of. 301 (593-2)508-722

    attached mail follows:


    I've no idea what's wrong with this, and I'm a little tired to try and look into it, but omit any username / password / server info from anything you post anywhere that's accessible publicly! ;)

    James.

    ""Marisol Díaz E."" <mdiaztecnopro.net> wrote in message news:008301c09225$4ce07e80$6b39a8c0linuxtohogar.net... Hi

    Please help me

    I don't knowk that is wrong, in this code, for ftp_fput Don't copy the archive, when copy the archive , this has other extension, and the size is 0kb.

    <? $fp = ftp_connect('192.168.57.2', 21);

    $con = ftp_login($fp, "mdiaz", "root1997");

    $destino="public_html/abyayala/ftp/ftp";

    $destip_chdir($fp,$destino);

    $archivo="C:\\abm\\Abm.gdb";

    $fpr = fopen ($archivo, "a+");

    $subirp_fput($fp,$archivo,$fpr,FTP_BINARY);

    fclose($fpr);

    ftp_quit($fp);

    ?>

    Thanks.

    Marisol Díaz E.

    Marisol Díaz E. Gerente de Aplicaciones Internet Tecnopro Cía. Ltda. www.tecnopro.net Pinta 236 y Rabida Edf. Alcatel of. 301 (593-2)508-722

    attached mail follows:


    Umm, not sure I understand the question completely... but following the code below, why not just assign the object to a new variable? That'd give you an exact copy with a lot less code...

    --toby

    Richard Lynch wrote: > > > I'm wondering if there is an easy way to code a generic cloner at top > > level of object inheritance tree so that all descendents can follow? Or by > > nature the clone() function needs be implemented at final class > > def.? Thanks a lot! > > You could probably use something like: > > function clone($whatever){ > $clone = $whatever; > if (is_object($whatever)){ > while (list($var, $val) = each($whatever)){ > $clone->$var = clone($val); > } > } > elseif (is_array($whatever)){ > while (list($var, $val) = each($whatever)){ > $clone[$var] = clone($val); > } > } > else{ > $clone = $whatever; > } > return $clone; > } > > No promises this can be made to work, much less to do what you want, but it > might... > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Hi

    I am trying to open a file which exists remotely(code works), but there may be times when it may not exist, however when I change the url so that it purposely doesn't exist to test this situation I get an error message like the following:

    Warning: fopen("<remote_url>","r") - No error in test.php on line 5

    How can I prevent this error message appearing and let my error checking below deal with it ? Here is my code:

    if(!$file = fopen("<remote_url>", "r")): echo"could not open remote file"; else: <page code> endif;

    Many Thanks

    Ade ------------------------------------- adestormbreaker.com -------------------------------------

    attached mail follows:


    sign is your friend.

    if ($file = fopen('...', 'r')) {

    } else {

    }

    --
    

    Chris Lee Mediawaveonline.com leemediawaveonline.com

    ""Ade Smith"" <adestormbreaker.com> wrote in message news:NDBBKNBNILDDDJNONEHNKELLDMAA.adestormbreaker.com... > Hi > > I am trying to open a file which exists remotely(code works), but there may > be times when it may not exist, however when I change the url so that it > purposely doesn't exist to test this situation I get an error message like > the following: > > Warning: fopen("<remote_url>","r") - No error in test.php on line 5 > > How can I prevent this error message appearing and let my error checking > below deal with it ? > Here is my code: > > if(!$file = fopen("<remote_url>", "r")): > echo"could not open remote file"; > else: > <page code> > endif; > > > Many Thanks > > Ade > ------------------------------------- > adestormbreaker.com > ------------------------------------- > >

    attached mail follows:


    Hi Guys,

    Can you install PHP 4.0.4pl1 on Redhat 6.2 - Also, apache will be installed and configured with the installation of Redhat 6.2 so is PHP 4.0.4pl1 still compatible with Redhat 6.2 and whatever version of Apache gets installed with it??

    Does anybody know about MySQL aswell?

    Thanks Guys

    attached mail follows:


    > Can you install PHP 4.0.4pl1 on Redhat 6.2 -

    Yes

    Also, apache will be installed > and configured with the installation of Redhat 6.2 so is PHP 4.0.4pl1 still > compatible with Redhat 6.2 and whatever version of Apache gets installed > with it??

    Yes. Sort of. You need to figure out what type of install you want to do (most people install PHP as an Apache module). Then you need to decide on using rpms or compiling from source.

    I find it's best to recompile both Apache and PHP at the same time. I don't know about PHP4 rpms ... never tried them.

    If you do try an rpm and want PHP as an Apache module, look for the mod_php rpm.

    > > Does anybody know about MySQL aswell?

    Yes. MySQL will work like a champion on RedHat 6.2. MySQL rpms are good and the way to go.

    Mick

    attached mail follows:


    Hello Yui, I do not really understand your question.

    > initial condition > 1) three are many *html in my SQL ex:xxx.html,and yyy.html > 2)I have domain ex: abc (ex: http://www.abc.com) > 3)database name : aaa > 4)table name :bbb

    How is xxx.html in the SQL? > I want to try next step. > when I type in URL from brouze ,ex http://www.abc.com/xxx.html . > I can get xxx.html from my SQL. > when I type in URL from brouze ,ex http://www.abc.com/yyy.html > I can get yyy.html from my SQL. > How can I do this? > Is it posible to create it?

    If you want PHP to work in yyyy.html, you must a) tell the internet server (IIS or Apache or PWS or ?? ) that files with the name something.html (in stead of something.php) have to be worked on (parsed) by PHP. How to do that? That is different for every internet server. or b) if you have an Apache webserver you can somewhere filter URL's so that every URL is changed from http://www.abc.com/yyy.html to http://www.abc.com/file.php?id=yyy.html This is something for experienced people or c) if you want too use php it is the easiest to tell users not to use http://www.abc.com/yyy.html but http://www.abc.com/file.php?id=yyyy because then in you rphp file called file.php you have the variable $id with the value 'yyyy' and then you can buildthe page yyy from your MySQL.

    good luck, Chris

    -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------

    attached mail follows:


    When people log into the website in question, it passes the user ID and password to the login.php3 file, (included below). It works just fine in IE, but in Netscape (tested on 4.7) it gives a blank white screen. If we view source, all of the source code is there, and it shows no errors (errors flash in the source code in netscape) but it will not display in the screen.

    Any idea what the problem is? Is it in the code I have below?

    Any help greatly appreciated.

    -----------------login.php3--------------------------- <HTML><BODY>

    <?php switch ($position) { case "process": require('logon.inc'); $query = "select userid, company, active from registration where userid='$userid' and password='$password'"; $result = mysql_query($query); $row = mysql_fetch_array($result);

    //test section start

    //print ("Id entered by user is $userid<br>"); //print ("Id retrieved from database is"); //print $row["userid"]; //print ("<br>");

    //test section end

    if ($row["userid"] == $userid) { if ($row["active"] =="YES") { ?> <html><head></head><body bgcolor="#FFFFFF"> <center> <table valign=top nowrap> <tr> <td>

    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

    codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0 ,0" ID=ptac WIDTH=393 HEIGHT=272 ALIGN=top> <PARAM NAME=movie VALUE="ptacwebsite.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="ptacwebsite.swf" quality=high bgcolor=#FFFFFF loop=false WIDTH=393 HEIGHT=272 ALIGN=top TYPE="application/x-shockwave-flash"

    PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_ Version=ShockwaveFlash"> </EMBED> </OBJECT> </td>

    <td> <Center> Welcome back to the ColoradoPTAC website, <?PHP print $row['company']; ?>.<br><br> Please click <a href="registered/registered.html" target="_top">here</a> to complete the login process and begin using the site. </center> </td> </tr> <table> <?php } else { ?> <html><head></head><body bgcolor="#FFFFFF"> <center> <B> Your account has temporarily been disabled by the system administrator. If you feel this was done by mistake, please send an email to <a href="mailto:registrationcoloradoptac.org"> registrationcoloradoptac.org</a> to resolve the issue.<BR><BR> We apologize for any inconvenience this has caused. </B> </center> <?php } } else { ?> <html><head></head><body bgcolor="#FFFFFF"> <center> <B> Either you do not currently have a membership with us or you have entered an invalid Member ID/Password combination.<br><br> Please click <a href="register/register.htm" target="_top">here</a> to join<br><br>-OR-<br><br>Click <a href="index.htm">here</a> to try again. </B> </center> <?php } } ?> </BODY></HTML>

    ----------------------login.php3--------------------------------

    Erik

    attached mail follows:


    > Welcome back to the ColoradoPTAC website, <?PHP print > $row['company']; ?>.<br><br> > Please click <a href="registered/registered.html" > target="_top">here</a> to > complete the login process and begin using the site. > </center> > </td> > </tr> > <table>

    I'm thinking that should be </table>

    Netscape hates malformed tables... and IE is too happy to fix your problems for you.

    attached mail follows:


    What is the functional difference between preg_match() and preg_match_all()? I've puzzled over the manual descriptions for both, checked the list archives and faqts.com, and still can't figure out why they seem to return different results for the same pattern searches.

    TIA

    -- 
    CC
    

    attached mail follows:


    I create a Drop-down from a DB table. All works as expected *except* the default item (the one showing to the surfer) is the last in the list. Is there a way I can have the first item show?

    Todd

    /* Make a drop-down */ function make_dropdown($ddName, $itemList, $first) { if (count($itemList)) { echo("<SELECT NAME=" . $ddName . ">"); if ($first) { echo('<OPTION VALUE="**" SELECTED>' . $first); }; while (list ($key, $val) = each ($itemList)) { echo('<OPTION VALUE="' . $key . '" SELECTED>' . $val); }; echo("</SELECT>"); }; };

    --
    Todd Cary
    Ariste Software
    toddaristesoftware.com
    

    attached mail follows:


    the 'SELECTED' attribute will select an item in a dropdown list.

    by default, with no SELECTED attribute, the first item will be shown and selected.

    make sense?

    DanO

    -----Original Message----- From: Todd Cary [mailto:toddaristesoftware.com] Sent: Thursday, February 08, 2001 5:00 PM To: php-generallists.php.net Subject: [PHP] Dynamic Drop-down list

    I create a Drop-down from a DB table. All works as expected *except* the default item (the one showing to the surfer) is the last in the list. Is there a way I can have the first item show?

    Todd

    /* Make a drop-down */ function make_dropdown($ddName, $itemList, $first) { if (count($itemList)) { echo("<SELECT NAME=" . $ddName . ">"); if ($first) { echo('<OPTION VALUE="**" SELECTED>' . $first); }; while (list ($key, $val) = each ($itemList)) { echo('<OPTION VALUE="' . $key . '" SELECTED>' . $val); }; echo("</SELECT>"); }; };

    --
    Todd Cary
    Ariste Software
    toddaristesoftware.com
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Moreover, you can put SELECTED only on the item you want to show up first.

    .:: Nathan Cook [ ncookpcsedu.com ] ::. Systems & Network Administrator :: Programmer [ phone - 208.343.3110 ][ pager - 208.387.9983 ] ----- Original Message ----- From: "DanO" <danoinformano.net> To: <php-generallists.php.net> Sent: Thursday, February 08, 2001 6:05 PM Subject: RE: [PHP] Dynamic Drop-down list

    > > the 'SELECTED' attribute will select an item in a dropdown list. > > by default, with no SELECTED attribute, the first item will be shown and > selected. > > make sense? > > DanO > > > -----Original Message----- > From: Todd Cary [mailto:toddaristesoftware.com] > Sent: Thursday, February 08, 2001 5:00 PM > To: php-generallists.php.net > Subject: [PHP] Dynamic Drop-down list > > > I create a Drop-down from a DB table. All works as expected *except* > the default item (the one showing to the surfer) is the last in the > list. Is there a way I can have the first item show? > > Todd > > /* Make a drop-down */ > function make_dropdown($ddName, $itemList, $first) { > if (count($itemList)) { > echo("<SELECT NAME=" . $ddName . ">"); > if ($first) { > echo('<OPTION VALUE="**" SELECTED>' . $first); > }; > while (list ($key, $val) = each ($itemList)) { > echo('<OPTION VALUE="' . $key . '" SELECTED>' . $val); > }; > echo("</SELECT>"); > }; > }; > > > > -- > Todd Cary > Ariste Software > toddaristesoftware.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Many thanks! Works like a champ now...........

    Todd

    --
    Todd Cary
    Ariste Software
    toddaristesoftware.com
    

    attached mail follows:


    wrong.

    you can put it on any element in the list. cut'n'paste and try for yourself:

    <form> <select> <option> <option> <option selected>selected </select> </form>

    DanO

    -----Original Message----- From: Nathan Cook [mailto:securitypcsedu.com] Sent: Thursday, February 08, 2001 5:10 PM To: php-generallists.php.net; toddaristesoftware.com Subject: Re: [PHP] Dynamic Drop-down list

    Moreover, you can put SELECTED only on the item you want to show up first.

    .:: Nathan Cook [ ncookpcsedu.com ] ::. Systems & Network Administrator :: Programmer [ phone - 208.343.3110 ][ pager - 208.387.9983 ] ----- Original Message ----- From: "DanO" <danoinformano.net> To: <php-generallists.php.net> Sent: Thursday, February 08, 2001 6:05 PM Subject: RE: [PHP] Dynamic Drop-down list

    > > the 'SELECTED' attribute will select an item in a dropdown list. > > by default, with no SELECTED attribute, the first item will be shown and > selected. > > make sense? > > DanO > > > -----Original Message----- > From: Todd Cary [mailto:toddaristesoftware.com] > Sent: Thursday, February 08, 2001 5:00 PM > To: php-generallists.php.net > Subject: [PHP] Dynamic Drop-down list > > > I create a Drop-down from a DB table. All works as expected *except* > the default item (the one showing to the surfer) is the last in the > list. Is there a way I can have the first item show? > > Todd > > /* Make a drop-down */ > function make_dropdown($ddName, $itemList, $first) { > if (count($itemList)) { > echo("<SELECT NAME=" . $ddName . ">"); > if ($first) { > echo('<OPTION VALUE="**" SELECTED>' . $first); > }; > while (list ($key, $val) = each ($itemList)) { > echo('<OPTION VALUE="' . $key . '" SELECTED>' . $val); > }; > echo("</SELECT>"); > }; > }; > > > > -- > Todd Cary > Ariste Software > toddaristesoftware.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    sorry for the spam, sometime's i'm stupid ;)

    yes nathan is indeed correct that SELECTED should only be used once in an index, on the item you want to show up first.

    more clearly, if multiple instances occur, any new instance of SELECTED will supersede any previous instance.

    DanO

    -----Original Message----- From: DanO [mailto:danoinformano.net] Sent: Thursday, February 08, 2001 5:25 PM To: php-generallists.php.net Subject: RE: [PHP] Dynamic Drop-down list

    wrong.

    you can put it on any element in the list. cut'n'paste and try for yourself:

    <form> <select> <option> <option> <option selected>selected </select> </form>

    DanO

    -----Original Message----- From: Nathan Cook [mailto:securitypcsedu.com] Sent: Thursday, February 08, 2001 5:10 PM To: php-generallists.php.net; toddaristesoftware.com Subject: Re: [PHP] Dynamic Drop-down list

    Moreover, you can put SELECTED only on the item you want to show up first.

    .:: Nathan Cook [ ncookpcsedu.com ] ::. Systems & Network Administrator :: Programmer [ phone - 208.343.3110 ][ pager - 208.387.9983 ] ----- Original Message ----- From: "DanO" <danoinformano.net> To: <php-generallists.php.net> Sent: Thursday, February 08, 2001 6:05 PM Subject: RE: [PHP] Dynamic Drop-down list

    > > the 'SELECTED' attribute will select an item in a dropdown list. > > by default, with no SELECTED attribute, the first item will be shown and > selected. > > make sense? > > DanO > > > -----Original Message----- > From: Todd Cary [mailto:toddaristesoftware.com] > Sent: Thursday, February 08, 2001 5:00 PM > To: php-generallists.php.net > Subject: [PHP] Dynamic Drop-down list > > > I create a Drop-down from a DB table. All works as expected *except* > the default item (the one showing to the surfer) is the last in the > list. Is there a way I can have the first item show? > > Todd > > /* Make a drop-down */ > function make_dropdown($ddName, $itemList, $first) { > if (count($itemList)) { > echo("<SELECT NAME=" . $ddName . ">"); > if ($first) { > echo('<OPTION VALUE="**" SELECTED>' . $first); > }; > while (list ($key, $val) = each ($itemList)) { > echo('<OPTION VALUE="' . $key . '" SELECTED>' . $val); > }; > echo("</SELECT>"); > }; > }; > > > > -- > Todd Cary > Ariste Software > toddaristesoftware.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    > more clearly, if multiple instances occur, any new instance > of SELECTED will supersede any previous instance.

    In MSIE, yeah. Netscape ignores any subsequent SELECTED's.

    Jason

    attached mail follows:


    Do any of you know of a comprehensive web-based project management tool written in php?

    Thank You! .:: Nathan Cook [ ncookpcsedu.com ] ::. Systems & Network Administrator :: Programmer [ phone - 208.343.3110 ][ pager - 208.387.9983 ]

    attached mail follows:


    On Fri, 9 Feb 2001 11:46, Nathan Cook wrote: > Do any of you know of a comprehensive web-based project management tool > written in php? > > Thank You! > .:: Nathan Cook [ ncookpcsedu.com ] ::. > Systems & Network Administrator :: Programmer > [ phone - 208.343.3110 ][ pager - 208.387.9983 ]

    Keystone? http://www.stonekeep.com/keystone.php3

    It and some others are listed on the projects page of your favourite PHP mirror.

    -- 
    David Robley                        | WEBMASTER & Mail List Admin
    RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
    AusEinet                            | http://auseinet.flinders.edu.au/
                Flinders University, ADELAIDE, SOUTH AUSTRALIA
    

    attached mail follows:


    When I try to connect mysql with the following code: <? $connection = mysql_connect("localhost", "myuser", "mypassword") or die("Couldn't connect."); if ($connection) { $msg = "Success!"; } ?> <HTML> <HEAD> <TITLE>MySql Connection</TITLE> </HEAD> <BODY> <? echo "$msg"; ?> </BODY> </HTML> The following error appear: Warning: MySQL Connection Failed: Can't connect to MySQL server on 'localhost' (10061) in c:\arquivos de programas\apache group\apache\htdocs\db_connect.php on line 3 Couldn't connect. What's going on here wrong?? Thank you Felipe Lopes MailBR - O e-mail do Brasil -- http://www.mailbr.com.br Faça já o seu. É gratuito!!!

    attached mail follows:


    > Warning: MySQL Connection Failed: Can't connect to MySQL server on > 'localhost' (10061) in c:\arquivos de > programas\apache group\apache\htdocs\db_connect.php on line 3 > Couldn't connect.

    Is the MySQL deamon running? IE, is there a black MS-DOS window (maybe minimized) that has something not unlike this: C:\mysql\bin\mysqld.exe: ready for connections in it? If not, you need to open an MS-DOS window and cd to where-ever you installed MySQL and do "mysqld" and just let it sit there. It's not "hung", it's just waiting for you to do some MySQL stuff.

    Can you connect to the MySQL deamon using mysql monitor? IE, open an MS-DOS window and cd to where-ever you installed MySQL and do "mysql mysql" Then use \q to quit.

    Get MySQL up-and-running without trying to get PHP to talk to it first.

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    Hello everybody,

    Here's my code:

    <? $file = fopen("closings.html", "r");

    if (!$file) { print "Error getting file"; } else { print "Closings.html has been gotten<Br>"; if (eregi("<tr><td>Stratford</td><td>Closed</td></tr>",$file)) { print "Stratford Closed"; } else { print "Stratford Open"; } } ?>

    The file closings.html has tables with weather related closings. I want to search closings.html for this line: <tr><td>Stratford</td><td>Closed</td></tr>

    If that line is found, it prints "Stratford Closed", if it finds that line, it prints "Stratford Open". I'm not sure that the file is even open all the way. Thanks everyone!

    Regards, Tyler

    attached mail follows:


    Hi,

    You've forgot to put fread() :

    <?

    $file = fopen('closings.html', 'r');

    if (!$file) echo 'Error opening file'; else echo 'got the file<br>';

    $data = fread($file, filesize('closings.html'));

    if (eregi('<tr><td>Stratford</td><td>Closed</td></tr>', $data))

    echo 'Stratford closed';

    else

    echo 'Stratfor open';

    ?>

    --- Tyler Longren <tyler.longrenmidiowa.net> wrote: > Hello everybody, > > Here's my code: > > <? > $file = fopen("closings.html", "r"); > > if (!$file) { > print "Error getting file"; > } > else { > print "Closings.html has been gotten<Br>"; > if > (eregi("<tr><td>Stratford</td><td>Closed</td></tr>",$file)) > { > print "Stratford Closed"; > } > else { > print "Stratford Open"; > } > } > ?> > > The file closings.html has tables with weather > related closings. I want to > search closings.html for this line: > <tr><td>Stratford</td><td>Closed</td></tr> > > If that line is found, it prints "Stratford Closed", > if it finds that line, > it prints "Stratford Open". I'm not sure that the > file is even open all the > way. Thanks everyone! > > Regards, > Tyler > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribelists.php.net > For additional commands, e-mail: > php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    ===== To find out more about me : http://www.geocities.com/mimodit My bookmarks are available http://mukul.free.fr

    __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

    attached mail follows:


    Ah ha! So i see. :)

    thanks.

    -----Original Message----- From: Mukul Sabharwal [mailto:mukulsabharwalyahoo.com] Sent: Thursday, February 08, 2001 8:21 PM To: Tyler Longren; php-generallists.php.net Subject: Re: [PHP] Searching HTML file for <tr> tags

    Hi,

    You've forgot to put fread() :

    <?

    $file = fopen('closings.html', 'r');

    if (!$file) echo 'Error opening file'; else echo 'got the file<br>';

    $data = fread($file, filesize('closings.html'));

    if (eregi('<tr><td>Stratford</td><td>Closed</td></tr>', $data))

    echo 'Stratford closed';

    else

    echo 'Stratfor open';

    ?>

    --- Tyler Longren <tyler.longrenmidiowa.net> wrote: > Hello everybody, > > Here's my code: > > <? > $file = fopen("closings.html", "r"); > > if (!$file) { > print "Error getting file"; > } > else { > print "Closings.html has been gotten<Br>"; > if > (eregi("<tr><td>Stratford</td><td>Closed</td></tr>",$file)) > { > print "Stratford Closed"; > } > else { > print "Stratford Open"; > } > } > ?> > > The file closings.html has tables with weather > related closings. I want to > search closings.html for this line: > <tr><td>Stratford</td><td>Closed</td></tr> > > If that line is found, it prints "Stratford Closed", > if it finds that line, > it prints "Stratford Open". I'm not sure that the > file is even open all the > way. Thanks everyone! > > Regards, > Tyler > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribelists.php.net > For additional commands, e-mail: > php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    ===== To find out more about me : http://www.geocities.com/mimodit My bookmarks are available http://mukul.free.fr

    __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    On Thu, Feb 01, 2001 at 04:29:09PM -0800, Michael Conley wrote: > I have several PHP files that I only want users to be able to access via > HTTPS. How can I control that on an Apache 1.3.14 server running on RedHat > 7? I have openssl and mod_ssl working fine. Currently, I can access all of > the files on my site via either http or https. I want to keep certain files > (with interesting information) from being accessed via http. I realize this > isn't really a PHP question, but I have no idea how to do this.

    You could check on which port the request was made for the php file. https is usually port 443

    if ($SERVER_PORT!=443) header("Location: https://server/$PHP_SELF");

    -- 
    

    Daniel Tryba

    attached mail follows:


    HTTPS is set to "on", at least on my Apache when SSL is enabled. it's undefined when it's not.

    this is what I would do (untested code below):

    function UsingHTTPS() { $HTTPS = getenv("HTTPS");

    return ($HTTPS == "on"); }

    function UsingHTTP() // might be useful? { return !UsingHTTPS(); }

    function ChangeTransport($transport) { $vars = array("REQUEST_URI", "SERVER_NAME");

    foreach ($vars as $var) { $$var = getenv("$var"); }

    $newURL = "Location: $transport://".$SERVER_NAME.$REQUEST_URI; header($newURL); exit(); }

    and then do a:

    if (!UsingHTTPS()) { ChangeTansport("https"); }

    -aaron

    At 4:29 PM -0800 2/1/01, Michael Conley wrote: >I have several PHP files that I only want users to be able to access via >HTTPS. How can I control that on an Apache 1.3.14 server running on RedHat >7? I have openssl and mod_ssl working fine. Currently, I can access all of >the files on my site via either http or https. I want to keep certain files >(with interesting information) from being accessed via http. I realize this >isn't really a PHP question, but I have no idea how to do this. > >Thanks. > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    > On Thu, Feb 01, 2001 at 04:29:09PM -0800, Michael Conley wrote: > > I have several PHP files that I only want users to be able to access via > > HTTPS.

    One way is to place these files only where the https server can see them.

    heres an example: <IfDefine SSL> ..... ..... <VirtualHost x.x.x.x:443>

    DocumentRoot "/secure/secure_dir1" ServerName server.xxx.net .... </VirtualHost>

    Of course if your non secure server knows about /secure/ its still possible for someone to see them. In this example use diff doc_roots.

    attached mail follows:


    http://www.modssl.org/docs/2.6/ssl_reference.html#ToC22

    jason

    ----- Original Message ----- From: "Daniel Tryba" <muaddibstack.nl> To: "Michael Conley" <mconleyRentHistory.com> Cc: <php-generallists.php.net> Sent: Friday, February 09, 2001 12:24 PM Subject: Re: [PHP] Files only available via HTTPS

    > On Thu, Feb 01, 2001 at 04:29:09PM -0800, Michael Conley wrote: > > I have several PHP files that I only want users to be able to access via > > HTTPS. How can I control that on an Apache 1.3.14 server running on RedHat > > 7? I have openssl and mod_ssl working fine. Currently, I can access all of > > the files on my site via either http or https. I want to keep certain files > > (with interesting information) from being accessed via http. I realize this > > isn't really a PHP question, but I have no idea how to do this. > > You could check on which port the request was made for the php file. > https is usually port 443 > > if ($SERVER_PORT!=443) > header("Location: https://server/$PHP_SELF"); > > -- > > Daniel Tryba > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Hi, i am trying to store some digital books under mysql and give a chapter/page access using php as scripting lanaguage.

    Besides htdig is there any other solution (perhaps written in php) to index a content of a TEXT field in order to have an "altavista-like" search engine for my use ?

    I've read that the new version of mysql does "full-text-indexing" whatever that means...

    thanks.

    __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

    attached mail follows:


    "Robert Mena" <rt_menayahoo.com> wrote: > Besides htdig is there any other solution (perhaps > written in php) to index a content of a TEXT field in > order to have an "altavista-like" search engine for my > use ?

    mnoGoSearch (formerly udmsearch) will do the trick. It's written in C++, it's very powerful, highly configurable and has optional PHP or Perl front-ends. I use it to index and search internal and external sites, but you can use it to index a database directly. Search google for the URL.

    --
    Steve Werby
    COO
    24-7 Computer Services, LLC
    Tel: 804.817.2470
    http://www.247computing.com/
    

    attached mail follows:


    On Fri, 9 Feb 2001 13:45, Steve Werby wrote: > "Robert Mena" <rt_menayahoo.com> wrote: > > Besides htdig is there any other solution (perhaps > > written in php) to index a content of a TEXT field in > > order to have an "altavista-like" search engine for my > > use ? > > mnoGoSearch (formerly udmsearch) will do the trick. It's written in > C++, it's very powerful, highly configurable and has optional PHP or > Perl front-ends. I use it to index and search internal and external > sites, but you can use it to index a database directly. Search google > for the URL.

    It's http://search.mnogo.ru/

    -- 
    David Robley                        | WEBMASTER & Mail List Admin
    RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
    AusEinet                            | http://auseinet.flinders.edu.au/
                Flinders University, ADELAIDE, SOUTH AUSTRALIA
    

    attached mail follows:


    Simple ... everything compiles cleanly, but as soon as I try and run it, I get:

    pegasus# /usr/local/apache/bin/httpsd httpsd: module "mod_php4.c" is not compatible with this version of Apache. Please contact the vendor for the correct version.

    The only thing I can find on the list archives deals with a -DEPI switch, so I tried that to see if it helps, and it doesn't ...

    Help?

    Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy Systems Administrator hub.org primary: scrappyhub.org secondary: scrappy{freebsd|postgresql}.org

    attached mail follows:


    * The Hermit Hacker <scrappyhub.org> [010208 21:12]: > > Simple ... everything compiles cleanly, but as soon as I try and run it, I > get: > > pegasus# /usr/local/apache/bin/httpsd > httpsd: module "mod_php4.c" is not compatible with this version of Apache. > Please contact the vendor for the correct version. > > The only thing I can find on the list archives deals with a -DEPI switch, -DEAPI

    Are you using Ports?

    > so I tried that to see if it helps, and it doesn't ... > > Help? > > Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy > Systems Administrator hub.org > primary: scrappyhub.org secondary: scrappy{freebsd|postgresql}.org > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net

    -- 
    Larry Rosenman                     http://www.lerctr.org/~ler
    Phone: +1 972-414-9812                 E-Mail: lerlerctr.org
    US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
    

    attached mail follows:


    On Thu, 8 Feb 2001, Larry Rosenman wrote:

    > * The Hermit Hacker <scrappyhub.org> [010208 21:12]: > > > > Simple ... everything compiles cleanly, but as soon as I try and run it, I > > get: > > > > pegasus# /usr/local/apache/bin/httpsd > > httpsd: module "mod_php4.c" is not compatible with this version of Apache. > > Please contact the vendor for the correct version. > > > > The only thing I can find on the list archives deals with a -DEPI switch, > -DEAPI > > Are you using Ports?

    Nope, compiling straight from source ...

    my configure is:

    #!/bin/tcsh setenv CFLAGS "-I/usr/local/include/gd" ./configure \ --enable-force-cgi-redirect \ --disable-debug \ --with-jpeg-dir=/usr/local \ --with-tiff-dir=/usr/local \ --enable-ftp \ --without-mysql \ --with-gd \ --with-pgsql \ --with-gdbm \ --enable-track-vars \ --enable-sysvsem \ --with-apxs=/usr/local/apache/bin/apxs \ --enable-sysvshm

    Does anything look wrong with that?

    I build apache 1.3.17 as follows, just in case I screwed something up there ...

    #!/bin/sh ./configure \ --prefix=/usr/local/apache \ --with-layout=Apache \ --enable-module=auth_dbm \ --enable-module=log_agent \ --enable-module=log_referer \ --enable-module=expires \ --enable-module=headers \ --enable-module=rewrite \ --enable-suexec \ --suexec-caller=nobody \ --add-module=mod_frontpage.c \ --enable-rule=SHARED_CORE --enable-module=so

    attached mail follows:


    I have "Profession PHP Programming" and I see that echo() and print() are used alomst interchangeably. When should each one be used?

    Also, I see "<?php" and "<?" used. Is there a preference?

    And how about "};" versus "}" to end a block? I see both.

    Todd

    --
    Todd Cary
    Ariste Software
    toddaristesoftware.com
    

    attached mail follows:


    Dear all,

    My server is running RedHat6.2/Apache 1.3.14/PHP 4.0.4pl1/Oracle 8.0.5. The way I make connection from PHP to Oracle is through php's Oracle 8 extension OCIPLogon.

    Since the server was made available to the public, *EVERY ONCE A WHILE* I got error messages logged in apache's error log as found in the attachement (sorry the oracle message is in Big5 characters). The error sequence starts with ORA-00022, saying 'invalid session id; access denied', but a connection resource is returned. Then all kinds of ORA-/PLS- errors come after it. The persistent connection affects only the attached apache process, not everyone. That explains when user reload the page, the problem cannot be reproduced everytime. The only way I've found to stop it is by restarting apache.

    I use quite a lot of Oralce stored procedures and return query results by cursor variables. But I doubt this the reason to it. My guess is that somewhere between apache process and oracle connection is interrupted.

    I've been working on this issue for a while but got no clue now to move any further. When errors come, the error log got filled up pretty quick. Please help......, and thanks in advance.

    Chien-pin

    attached mail follows:


    I'm not sure I'm following the purpose, but you need to access a whole 'nother page (or, at least, a whole 'nother HTTP connection) to select HELP1 or HELP2 from your phone. It seems like you're trying to get your WAP to execute PHP somehow, and that won't happen. [This week, anyway :-)]

    Disclaimer: What I know about WAP could fit inside a WAP. :-)

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: "Kato Strandjord" <katosstud.idb.hist.no>
    Newsgroups: php.general
    Sent: Thursday, February 08, 2001 5:04 AM
    Subject: [PHP] PHP function using a WML variable from a select list as to
    access the right data in a MYSQL database
    

    > I use apache server on win2000, php4, mysql and wml which I test local on my > harddrive. > > The code under is working fine when I test it on emulators like UP SDK from > phone.com. or other, but i have fooled it to use static variables which is > not the solution i want. > My problem is. How can I use my variable: > print "<select name=\"fagkode\">"; > in this code under so that I can use its value in my php function: > $tabfag=finnMeldinger($fagnr); > I can see the WML variable if i print it out in WML, but i can not print it > out as a variable in PHP. I have fooled the php function and put a static > variable in it, instead of the dynamic WML variable, which is generated from > a select list. I have tried for a week but al kinds of tricks did not work. > At one time i got the value from WML to PHP, but it came out like this > "=so480". The sign = was impossible to remove, so i could not use it. The > correct value is "so480" with out the "=" > > <?php > // send wml headers > header("Content-type: text/vnd.wap.wml"); > echo "<?xml version=\"1.0\"?>"; > echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" > . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; > ?> > <wml> > > <card id="card1" title="Example 2"> > <p> > <?php > print "<select name=\"fagkode\">";//HELP1 > require ("funksjoner.php"); > $tabfag=finnfag(); > if (mysql_num_rows($tabfag) > 0) >

    > while ($row = mysql_fetch_array($tabfag)) >

    > print "<option value=\"$row[fagkode]\">$row[fagbeskrivelse]</option>"; > > }//while > }//if > $temp=$fagkode; > ?> > </select>Done. > <anchor title="go"> > <?php > print "go $(fagkode)";//testing if i can see the WML variable from HELP1, and i can, but i can not use it in my PHP function > ?> > <go href="#dato"/> > </anchor> > </p> > </card> > > <card id="dato" title="dato"> > <p><select name="dato">//HELP2 > <?php > $fagnr="so480";//fooling the function with a static code, but this should be the HELP1 > $tabfag=finnMeldinger($fagnr);//this is the main problem, Impossible to solve!!!! > if (mysql_num_rows($tabfag) > 0) > >

    > while ($row = mysql_fetch_array($tabfag)) >

    > print "<option value=\"$row[dato]\">$row[dato]</option>"; > }//while > }//if > ?> > </select>Done. > <anchor title="go"> > go $(fagkode) $(dato)// just another test, and is working fine so i can see both WML variables from other cards > <go href="#meld"/> > </anchor> > </p> > </card> > > <card id="meld" title="meld"> > <p><?php > $datonr="051201";//fooling the function, but this should be the WML varibeles value in HELP" > $meldingen=finnMelding($fagnr,$datonr);// using the static value, should be HELP1 and HELP2 dynamic value instead!! > print "$meldingen"; > ?></p> > </card> > </wml> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    > Is it possible to make three textareas on one page (of course it is, but > read til the end, you`ll get the point) and let the user type into each > box in a different language with different charsets. > > For example, lets say I want to insert three versions of one text on one > page (without submitting the page first). In the first box, when i start > writing, I can write with english char-set, as I move to the second box, I > can write in russian and in the third box, the charset could already be > swedish. Is it possible? If it is, how? And then I want to write it all to > mysql database as well (keeping the correct char-sets).

    A really icky hack way would be to use FRAMESET tag and JavaScript...

    Each FRAME would be a different language, and the SUBMIT button would use JavaScript to work its way up to the FRAMESET page, which would then suck in the data from the FRAME pages to submit...

    This would be very, very, very icky, and there *has* to be a better way.

    I just dunno what it would be.

    --
    Visit the Zend Store at http://www.zend.com/store/
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    you can test for undefined variables using

    isset($var)

    or

    empty($var)

    look into the php manual for more details on these functions

    yes php does provide you with an option to create variables from variables themselves

    refer to the following

    http://www.php.net/manual/en/language.variables.variable.php

    hope that helps

    regards

    Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India

    ----- Original Message ----- From: "August Malson" <thearchgumac.com> To: <php-generallists.php.net> Sent: Thursday, February 08, 2001 12:41 PM Subject: [PHP] test for undefined variables & renaming variables

    > Q: > Does anyone know of a way to test for undefined variables? For example, I > am sending a variable into the page, but the processing of the page depends > on what is being passed to the page. > > Say, I am typing the following on the location bar: > index.php?fuseaction=something&fuse=6 > > and I want something to happen if fuse is actually declared, and something > else to happen if fuse is not defined. > > I have tried isdef(), but that function does not seem to work, and I > couldn't find it in the manual when I was looking for it. > > Code to use on: > > if($HTTP_GET_VARS("fuse") == NULL) then do something; else do something > else; > > > Q: > Also, does anyone know how to rename a variable? > > I want to create a variable $attributes_NameOfVariable, but it does not seem > to work. is there a function that exists in PHP that will assist me in this > process? > > Thank you for all of your help, and thank you for your time, > > August Malson > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net