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: Mon Feb 26 2001 - 11:00:56 CST

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

    php-general Digest 26 Feb 2001 17:00:56 -0000 Issue 535

    Topics (messages 41650 through 41704):

    Re: Simple String Replace Question
            41650 by: Jeff Oien
            41679 by: PHPBeginner.com

    Re: PHP4 directives in httpd.conf not working
            41651 by: David Robley
            41675 by: PHPBeginner.com

    php4 as a module AND a cgi
            41652 by: colin olkowski
            41660 by: Michael A. Peters
            41662 by: Jason Brooke

    Escape %
            41653 by: Website4S.aol.com
            41654 by: John LYC
            41655 by: Website4S.aol.com

    register stop working with a site
            41656 by: Plamen Slavov

    My system don't store session data, anybody can help me!!
            41657 by: Securez
            41666 by: Securez
            41668 by: Christian Reiniger

    Re: a good hosting experience
            41658 by: Michael A. Peters

    Newbie: why do I get this error?
            41659 by: Harshdeep S Jawanda
            41663 by: Harshdeep S Jawanda
            41667 by: Yasuo Ohgaki

    installation problem
            41661 by: tribal00.libero.it

    Re: Download PHP from Linux machine?
            41664 by: Rick Hodger

    multiple file upload..
            41665 by: John LYC
            41671 by: Yasuo Ohgaki

    FreeHostage:PHP&MySQL
            41669 by: Bruno Mário Amaral Almeida
            41673 by: Michael A. Peters
            41674 by: PHPBeginner.com
            41680 by: PHPBeginner.com
            41682 by: Jeff Oien

    Fopen only absolute IP
            41670 by: Paolo Ciraci

    setcookie don't work well...
            41672 by: Nuno Costa
            41688 by: Chris Lee

    Re: mysql_info()
            41676 by: PHPBeginner.com

    Re: Printing long strings
            41677 by: PHPBeginner.com

    Re: Using one invocation of PHP executable to generate multiple pages?
            41678 by: PHPBeginner.com

    nullterra.com.br - should get removed
            41681 by: Maxim Maletsky

    ftp connection
            41683 by: Jon A

    Re: Join causing Error?
            41684 by: Johnny Withers

    AS400/Java Toolkit and PHP
            41685 by: Conover, Ryan

    DNS Lookups Fail
            41686 by: Scott Rothgaber

    PERL to PHP
            41687 by: Clayton Dukes
            41690 by: kevin1
            41691 by: Clayton Dukes

    Very strange Nutscrape behavior - PHP/JS/DHTML???
            41689 by: Brian V Bonini

    mcrypt and encrypted field length
            41692 by: Hardy Merrill

    Browser?
            41693 by: Paulson, Joseph V. \"Jay\"

    Making a variable
            41694 by: Clayton Dukes
            41697 by: Dan Olsen
            41699 by: Clayton Dukes

    Re: php (cgi version) with Apache and suexec - help
            41695 by: jhagan.binghamton.edu

    header() and require()
            41696 by: Jason Jacobs

    hiding .php
            41698 by: MaD dUCK

    Re: Making a variable -Trim output
            41700 by: Clayton Dukes
            41703 by: Dan Olsen

    How to enable GD with PHP
            41701 by: SED

    Re: Detecting JavaScript
            41702 by: Dave Goodrich
            41704 by: Dan Olsen

    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:


    > <html>
    > <body>
    >
    > <form method=post>
    > <textarea name="str" cols=50 rows=10></textarea><br>
    > <input type=submit>
    > </form>
    >
    > <hr><pre>
    > <?php
    > $str = ereg_replace("([^\r\n])\r\n([^\r\n])", "\\1 \\2", $str);
    > echo $str;
    > ?>
    > </pre>
    >
    > </body>
    > </html>

    Got it now. I didn't didn't have <pre></pre> tags in mine. With
    the <pre> tags it works as prescribed. Thanks! The other
    troubleshooting examples were helpful too to know what's
    going on with those characters.
    Jeff Oien

    attached mail follows:


    Would

    $string_new = ereg_replace("\n[ \t\r\n]*\n", "\n", $string);

    work for you?

    Sincerely,

     Maxim Maletsky
     Founder, Chief Developer

     PHPBeginner.com (Where PHP Begins)
     maximphpbeginner.com
     www.phpbeginner.com

    -----Original Message-----
    From: Jeff Oien [mailto:jeffwebdesigns1.com]
    Sent: Monday, February 26, 2001 3:37 AM
    To: PHP
    Subject: [PHP] Simple String Replace Question

    I would like to get rid of \n characters unless there
    are two or more in a row. So for example if there
    is a long email formatted like we do here with
    line break I want to remove the line breaks so
    text can be wrapped by a browser, but also show
    paragraph breaks where necessary. This is what
    I have:
    $string_new = str_replace("\n", "", $string);
    How can I augment this to not replace:
    \n
    \n
    Thanks.
    Jeff Oien

    -- 
    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 Mon, 26 Feb 2001 15:30, Brian White wrote: > I have php4 running under Apache. Under that apache I have several > <VirtualHost>s. I want to set to some of the PHP.INI values under > one of those hosts. So far I have tried the following values in > my httpd.conf file: > > 1) include_path "/my/phpinc/path" > 2) php_include_path "/my/phpinc/path" > 3) php3_include_path "/my/phpinc/path" > 4) php4_include_path "/my/phpinc/path" > > None of them have worked - I can't even restart Apache with them in > place. "/my/phpinc/path" definitely exists. > > What am I doing wrong? > > Regs > > Brian White

    PHP4 uses different Apache configuration directives (see http://au.php.net:81/manual/en/configuration.php ) I think the one you want is probably php_value so

    php_value include_path "/my/phpinc/path"

    might work.

    -- 
    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:


    try these:

    php_value include_path "/my/phpinc/path"

    but why instead not to create a .htaccess file, or if you don't want it to be modified by user to make a one single auto_prepend with:

    $file = "$DOCUMENT_ROOT/my/phpinc/path"; if(file_exists($file)) include_once($file);

    this wouyld work for you better since there would be no chances that the file does not exist (or was deleted by user) and that it won't be included more then once

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Brian White [mailto:bwhitesteptwo.com.au] Sent: Monday, February 26, 2001 2:01 PM To: PHP Subject: [PHP] PHP4 directives in httpd.conf not working

    I have php4 running under Apache. Under that apache I have several <VirtualHost>s. I want to set to some of the PHP.INI values under one of those hosts. So far I have tried the following values in my httpd.conf file:

    1) include_path "/my/phpinc/path" 2) php_include_path "/my/phpinc/path" 3) php3_include_path "/my/phpinc/path" 4) php4_include_path "/my/phpinc/path"

    None of them have worked - I can't even restart Apache with them in place. "/my/phpinc/path" definitely exists.

    What am I doing wrong?

    Regs

    Brian White ------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: bwhitesteptwo.com.au

    --
    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 all,

    my question is this, how would one install PHP4 as a module and as a cgi?

    somewhere in the install notes for php4 (redhat) the docs clearly say do not install both, yet my old hosting company was able to do it.

    btw, i just moved from the world of virtual hosting on a FreeBSD box to my own RedHat server.

    is this a linux vs. freebsd issue?

    colin olkowski - frodointerport.net

    attached mail follows:


    colin olkowski wrote: > > hi all, > > my question is this, how would one install PHP4 as a module and as a cgi? > > somewhere in the install notes for php4 (redhat) the docs clearly say do not > install both, yet my old hosting company was able to do it. > > btw, i just moved from the world of virtual hosting on a FreeBSD box to my > own RedHat server. > > is this a linux vs. freebsd issue?

    No. I've had php3 running as both, anyways... It does require some work on the httpd.conf file.

    You have to set the directives properly for the directory containing the php dependant upon wether you want cgi to handle it or php to handle it.

    I have to ask, though, why would you want to run it as a cgi?

    Its slower as cgi and runs more security risks. I'd only run it as a cgi if that was my only choice.

    It works very well as a DSO, I believe you can only use the Zend Optimizer if its built as a DSO (I could be wrong on that)- I can't think of why you want to.

    > > colin olkowski - frodointerport.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

    -- 
    -=-=-=-=-=-=-=-=-=-=-=-=-
    Michael A. Peters
    Abriasoft Senior Developer
    

    attached mail follows:


    > I have to ask, though, why would you want to run it as a cgi? > > Its slower as cgi and runs more security risks. > I'd only run it as a cgi if that was my only choice.

    It's probably less of a security risk when utilised via the cgi actually, at least when using Apache as the webserver because you can use suExec to cause it to run under the script owner's uid instead of Apache's. I've often considered switching vhosts over to the cgi version instead of module for this very reason.

    jason

    attached mail follows:


    Hi,

    Anyone know the best method to escape the % sign in PHP?

    I`ve checked the manual and devshed and didn`t come across much, is there a command like addslashes() or would I have to use something like this...

    $Field="A%D%E"; $Field1=str_replace("%","percent",$Field);

    Thanks for any input

    Ade

    attached mail follows:


    there is addslashes(); http://www.php.net/manual/en/function.addslashes.php

    john

    Website4Saol.com wrote:

    > Hi, > > Anyone know the best method to escape the % sign in PHP? > > I`ve checked the manual and devshed and didn`t come across much, is there a > command like addslashes() or would I have to use something like this... > > $Field="A%D%E"; > $Field1=str_replace("%","percent",$Field); > > Thanks for any input > > Ade > > -- > 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 a message dated 26/02/2001 07:17:57 GMT Standard Time, johnedlabs.com writes:

    << there is addslashes(); http://www.php.net/manual/en/function.addslashes.php john >>

    addslashes() doesn`t work on the % sign though

    Ade

    attached mail follows:


    Hi all, i was wondering if someone has any idea about how to register that a client has stopped working with my site and log him/her out?

    attached mail follows:


    In my system i have apache-1.3.17, (i probe 1.3.14 but the problem persist), when i register a variable the session is generatet and a file sess_f5g ... is generated under /tmp but the file is empty size=0, and no data is stored.

    <?php session_start();

    if( !isset( $c)) { session_register("c"); $c = 1; }

    echo $c . "<br>";

    ?> <a href="index.php">reload</A>

    this example that works fine in other system with the same configuration, don't work in my machine, everytime he say 1.

    my system is a red hat 6.2 with 2.2.14 and my php is 4.0.4pl1

    attached mail follows:


    This is a correction:

    I create a new dir

    /usr/local/tmp with this perms:

    rwxrwxrwt root root

    and change the dir for store session data to /usr/local/tmp and works, but in certain situation the some data aren't sotored, :(. in /tmp don't store data why??

    I set loogin to a file if i set the file in /tmp/php.log the file is created but empty, why?? i set this file in /usr/local/tmp it works fine.

    i don't understand what is the problem, both dirs have the same permisions.

    attached mail follows:


    On Monday 26 February 2001 10:26, Securez wrote:

    > <?php > session_start(); > > if( !isset( $c)) { > session_register("c"); > $c = 1; > } > > echo $c . "<br>"; > > ?> > <a href="index.php">reload</A> > > this example that works fine in other system with the same > configuration, don't work in my machine, everytime he say 1.

    Well, you never change $c, so it of course always says 1

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

    ...10001000110101011010101101011110111010113...????

    attached mail follows:


    Wow. Julie is on this list!

    // send note to self to modify filter and sort for good tips...

    Hi Julie. LOVED your book.

    With regard to Hurricane Electronic- we (Abriasoft) use them for our colocating, and they have always been very proffesional and fair to deal with. They have a really nice facility, its clean and well run.

    Anyway, I don't know squat about their virtual hosting. Does their virtual hosting provide webDAV support?

    If yes, does it do it right for dynamic content?

    i.e. Alias /Linux_Pages/ "/var/www/Linux_Pages/"

    Alias /Linux_Pages-src/ "/var/www/Linux_Pages/"

    <Directory "/var/www/Linux_Pages"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all AuthType Basic AuthName DAV AuthUserFile dav.auth </Directory>

    followed by a

    <IfModule mod_dav.c> DAVLockDB /var/apache/dav/moddav DAVMinTimeout 600

    <Location /Linux_Pages-src/> DAV On ForceType text/plain <Limit PUT POST PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require user michael </Limit> </Location> </IfModule>

    The ForceType in the mod_dav directive lets me use webDAV client like Goliath on MacOS or DAVExplorer on Linux to get the php source without it being processed first- but I haven't yet found a host that provides webDAV and sets up an extra alias for getting the source php unparsed, which is what you really want 'cause dynamic content is definately the way to go.

    If anyone knows of a hosting company that does that- I'd love to hear about it. I suppose I could just get a 1U- but $200/mo is steep for a non profit making personal site... ;)

    Thanks for any suggestions/comments

    Julie Meloni wrote: > > As a follow-up to the "Terrible Hosting Experience" posts, here's a > "Good Hosting Experience" post. > > I completely and unabashedly recommend Hurricane Electric (www.he.net), > for virtual or dedicated hosting. AND...they're not paying me a thing to > say that. :) > > They have virtual host packages starting at ten bucks. thickbook.com > runs on a thirty bucks a month virtual hosting package, and it's just > fine (as far as I can tell). PHP 4, MySQL at all levels of pricing, and > you can control local PHP values with .htaccess, just fine. > > I also have a 1U dedicated server there for $200/mo > (www.mytrainingcamp.com) and am ecstatic about it. > > So, go Hurricane! > > - Julie > > +----------------------------------------+ > | Julie Meloni (juliethickbook.com) | > | | > | "PHP Essentials" and "PHP Fast & Easy" | > | http://www.thickbook.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

    -- 
    -=-=-=-=-=-=-=-=-=-=-=-=-
    Michael A. Peters
    Abriasoft Senior Developer
    

    attached mail follows:


    Hello everybody,

    I am a newbie, so please help me out with my rather basic question.

    Please take a look at the following code snippet:

    class HTMLTable extends HTMLElement { var $attributes;

    function HTMLTable() { $attributes[] = array("border", "0"); $attributes[] = array("cellpadding", "0"); // and some other things }

    function emit() { // I get an error on this line $arrLength = count($this->attributes[1]); } }

    On the line indicated above, I get the error: "Warning: Undefined property: attributes in html_base_classes.inc on line <line-number>"

    Can anybody give me a clue as to why this is happening?

    -- 
    Regards,
    Harshdeep Singh Jawanda.
    

    attached mail follows:


    Hi all,

    I changed

    > function HTMLTable() { > $attributes[] = array("border", "0"); > $attributes[] = array("cellpadding", "0"); > // and some other things > }

    to

    $attributes = array(array("border", "0"), array("cellpadding", "0"));

    but am still getting the same error.

    What am I doing wrong here?

    -- 
    Regards,
    Harshdeep Singh Jawanda.
    

    attached mail follows:


    > > Hi all, > > I changed > > > function HTMLTable() { > > $attributes[] = array("border", "0"); > > $attributes[] = array("cellpadding", "0"); > > // and some other things > > } > > to > > $attributes = array(array("border", "0"), > array("cellpadding", "0"));

    I'm not sure, but is this what you want?

    $attributes = array(array('border'=>0),array('cellpadding'=>0)); or $attributes[] = array('border'=>0); $attributes[] = array('cellpadding'=>0);

    --
    Yasuo Ohgaki
    

    attached mail follows:


    I'm a beginner but...I can't install php-4.o.4pl1 on my linux mandrake..why? When I run configure ,the program checks all the files... there are some missing..but it never return an error it return a warning 'you will need bison if you want to regenerate the php parsers' and after other check..it stops with this error'cannot find output for lex;giving up'

    what can i do? thanks Daniele

    attached mail follows:


    Joe Stump <jstumpzebulon.miester.org> wrote in message news:20010223133347.B16249zebulon.miester.org... > lynx -source http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_ site=www.php.net > php-4.0.4pl1.tar.gz will work - also try wget

    Why do so many people apparently not bother to actually read what people are writing?

    On a unix shell, try putting a \ in front of all your funny characters. eg:

    http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz\&source site=www.php.net

    Or whatever the URL is. I think that got mangled by Outlook.

    --
    Rick Hodger
    

    > On Fri, Feb 23, 2001 at 03:28:14PM -0600, Jorge Alvarez wrote: > > Hi there, > > > > I want to download PHP from my Linux server, but I can't just type "lynx > > http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_ > > site=www.php.net" > > > > This is the link in the PHP downloads page, but the shell gets confused by > > the & character. > > > > What should I do? > > > > Best Regards, > > > > Jorge. > > > > > > > > -- > > 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, -o) > http://www.miester.org http://www.care2.com /\\ > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V > -------------------------------------------------------------------------- ----- > > > -- > 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 have a situation. i hope im clear abt this. i need to post multiple set of data elements into php. each set consists of data elements of text, textarea, radio buttons, checkboxes and even a file(image). most fields are optional. all sets are not subset of each other but belongs to the same universal set.

    all these sets of data elements are posted using one single form and this form will only display at most 3 set of form elements input at one time. the user of course can do more than 3. by declaring how many he/she wants before landing on this page. meaning if user chose 4 , the form display 3 sets. User submits and the form will again appear with one set this time.

    the form will not update the database till the user finishes number of sets he/she had declared. i only have problem with the (image) file data element. this image file.. if existing , is stored into the database as blob.

    questions: 1. if file is not declared, what does the file elements holds?... i sometimes get null value, sometimes get "none" 2. does my logic works.. coz usually the file elements in the last form post will work.. but the previous will be corrupted. 3. i try using file input elements as arrays.. meaning <input type=file name=filearr[x]>.. doesn't work? 4.anyone know how to work around this... does anyone encounter problem like these before?

    thanks for any help.... john

    here's what i do.... ignore any syntax error. this is just a stripdown version of the code.. it is just for putting across the logic..

    /////////////////////////////////////////////////////////////////////////////////

    if($submit) { //loop to run thur all QuestDiax and convert into characters. for ($j=0; $i < $index; $i++,$j++) { $filestr = "QuestDia".$j; if($$filestr) $diagram[$j] = addslashes(fread(fopen($$filestr,"r"), filesize($$filestr))); }//for

    //insert into database

    }//if submit

    print "<form enctype=".." method = post ....>";

    for($i=0; $i < 3; $i++) { print "<input type=\"file\" name=\"QuestDia".$i."\">"; }//for

    print "</form>";

    attached mail follows:


    snip > questions: > 1. if file is not declared, what does the file elements holds?... i > sometimes get null value, sometimes get "none"

    I get following output with PHP4.0.4pl1 w/ Linux (I set php.ini to store uploaded files info to $HTTP_UPLOAD_FILES. You will get different output if you don't)

    --------- OUTPUT - when files to upload are not specified ---------- Key = userfile, Val = Array

    a.. Key = name, Val = Array a.. Key = 0, Val = a.. Key = 1, Val = a.. Key = type, Val = Array a.. Key = 0, Val = application/octet-stream a.. Key = 1, Val = application/octet-stream a.. Key = tmp_name, Val = Array a.. Key = 0, Val = none a.. Key = 1, Val = none a.. Key = size, Val = Array a.. Key = 0, Val = 0 a.. Key = 1, Val = 0 ---------------------------------

    --------- CODE - file_upload.php ----------- <html> <head> <title>File Upload Test</title> <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> </head>

    <body bgcolor="#FFFFFF"> <?php // Data about Uploaded Files are stored in array in $HTTP_POST_FILES["input_name"] while(list($k,$v) = each($HTTP_POST_FILES)) { print("Key = $k, Val = $v <br>\n"); if (is_array($v)) { while(list($tk, $tv) = each($v)) { print("<li>Key = $tk, Val = $tv<br>\n"); if (is_array($tv)) { while(list($ttk, $ttv) = each($tv)) { print("<li>Key = $ttk, Val = $ttv<br>\n"); } } } } } ?>

    <form enctype="multipart/form-data" action="file_upload.php" method="post"> <input type="text" name"text" value="TEST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000000"> <!-- Do any browsers care about MAX_FILE_SIZE? --> Send this file: <input type="file" name="userfile[]"> Send this file: <input type="file" name="userfile[]"> <input type="submit" value="Send File"> </form> </body> </html> -----------------------------------------------------------

    > 2. does my logic works.. coz usually the file elements in the last form > post will work.. but the previous will be corrupted.

    I cannot understand what you mean well....

    > 3. i try using file input elements as arrays.. meaning <input type=file > name=filearr[x]>.. doesn't work?

    See the code and output, it works. (at least when PHP stores uploaded file info to $HTTP_UPLOAD_FILES. Does not work w/o it?)

    > 4.anyone know how to work around this... does anyone encounter problem > like these before?

    Did you copy temp file? It will be deleted.

    Regards

    --
    Yasuo Ohgaki
    

    attached mail follows:


    Hi everyone, Can anyone tell me where can i find a place where to put my PHP/MySQL applications for free? Many thanks Bye Bruno

    attached mail follows:


    Are you looking for a place to host your site- or a place for people to download apps you've written?

    Bruno Mário Amaral Almeida wrote: > > Hi everyone, > Can anyone tell me where can i find a place where to put my PHP/MySQL applications for free? > Many thanks > Bye > Bruno

    -- 
    -=-=-=-=-=-=-=-=-=-=-=-=-
    Michael A. Peters
    Abriasoft Senior Developer
    

    attached mail follows:


    Have you tried www.isamillionaire.com ?

    they have php4 / mySQL support, they are free and have no banner ads.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Bruno Mário Amaral Almeida [mailto:mutocasclix.pt] Sent: Monday, February 26, 2001 9:00 PM To: php-generallists.php.net Subject: [PHP] FreeHostage:PHP&MySQL

    Hi everyone, Can anyone tell me where can i find a place where to put my PHP/MySQL applications for free? Many thanks Bye Bruno

    attached mail follows:


    Use SourceForge.com, in case you still are building your OpenSource application,

    you can then host it and use it there.....

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: michaelc36988-a.ptbrg1.sfba.home.com [mailto:michaelc36988-a.ptbrg1.sfba.home.com]On Behalf Of Michael A. Peters Sent: Monday, February 26, 2001 9:56 PM To: Bruno Mário Amaral Almeida Cc: php-generallists.php.net Subject: Re: [PHP] FreeHostage:PHP&MySQL

    Are you looking for a place to host your site- or a place for people to download apps you've written?

    Bruno Mário Amaral Almeida wrote: > > Hi everyone, > Can anyone tell me where can i find a place where to put my PHP/MySQL applications for free? > Many thanks > Bye > Bruno

    --
    -=-=-=-=-=-=-=-=-=-=-=-=-
    Michael A. Peters
    Abriasoft Senior Developer
    

    -- 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:


    http://www.f2s.com/ is another option. Jeff Oien

    > Hi everyone, > Can anyone tell me where can i find a place where to put my PHP/MySQL > applications for free? > Many thanks > Bye > Bruno >

    attached mail follows:


    I can't use any filesystem function (fopen, file, fsockopen, etc.) to open a remote file (fopen wrapper is obviously on).

    For example if I try the following:

    $S = file ("http://www.yahoo.com/");

    I obtain the error: "Bad file descriptor"

    If I use an absolute IP address:

    $S = file ("http://216.32.74.50/");

    I have no problem.

    The machine runs BSDI BSD/OS 4.1 + PHP 4.0.3pl1 + Apache 1.3.11

    No problem to access dns from this machine as "ping www.yahoo.com" or "wget www.yahoo.com" work well.

    I don't want to use absolute IP numbers to retrieve data from remote file (as they can change often). Any ideas, suggestions?

    Thank you.

    Dr. Paolo Ciraci - EDP Manager and Webmaster ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Nautica On Line - http://www.nautica.it EuroMeteo - http://www.eurometeo.com SCUBAweb - http://www.scubaweb.it

    attached mail follows:


    I try to use this function to prevent that the same visitor vote for more than one time in a hour but it don't work, the code is this: if($vote!=1) { $time=time(); $time=$time + 36000; setcookie("vote","1",$time); }

    If the visitor vote, the vote counts, than if he try to vote again the vote don't count, but if he try again it counts, the cookie is delete and i don't know why, i use IE 5.5. Can some one help me.

    attached mail follows:


    you have to set to path and the domain name too...

    setcookie('vote', '1', $time, '/', '.someite.com');

    --
    

    Chris Lee Mediawaveonline.com

    ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120

    leemediawaveonline.com

    ""Nuno Costa"" <ncostaseist.com> wrote in message news:000e01c09ff0$feee9570$1e01a8c0ncosta... I try to use this function to prevent that the same visitor vote for more than one time in a hour but it don't work, the code is this: if($vote! { $time=time(); $time=$time + 36000; setcookie("vote","1",$time); }

    If the visitor vote, the vote counts, than if he try to vote again the vote don't count, but if he try again it counts, the cookie is delete and i don't know why, i use IE 5.5. Can some one help me.

    attached mail follows:


    Yes you are wrong,

    what you can do is to search for the SQL queries in tutorials which will return you that information. also phpinfo() has some very little and necessary coverage of basic php-mysql configurations,

    if you download phpmyadmin you will have this option there (even with edit).

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: grios [mailto:grios]On Behalf Of Gustavo Vieira Goncalves Coelho Rios Sent: Monday, February 26, 2001 9:16 AM To: php-generallists.php.net Subject: [PHP] mysql_info()

    Am i wrong or php does not support mysql_info() function ?

    Is there plans to support it?

    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
    

    attached mail follows:


    Yes, you could use stripslashes($string) on it's output, in this way it will be no different as it was inputted.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Clayton Dukes [mailto:cdukescdukes.com] Sent: Monday, February 26, 2001 9:57 AM To: php-generallists.php.net Subject: [PHP] Printing long strings

    How can I get php to print a long string and ignore any of the characters in the string?

    ie: $string = "so<me'strin^g"; print $string;

    isn't there some kind of command to use that keeps the string exactly as it is?

    Clayton Dukes CCNA, CCDA, CCDP, CCNP Internetwork Solutions Engineer Internetwork Management Engineer Thrupoint, Inc. Tampa, FL (c) 904.477.7825 (h) 904.292.1881

    attached mail follows:


    Could you please be more specific on your need?

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Jim Lum [mailto:jlumcox.rr.com] Sent: Monday, February 26, 2001 9:21 AM To: php-generallists.php.net Subject: [PHP] Using one invocation of PHP executable to generate multiple pages?

    Hi,

    I have PHP installed on a Win95 machine. What I'd like to do is to use a PHP page that will create multiple HTML pages.

    I guess that I can execute PHP.EXE multiple times, but was thinking that this means that it's going thru the overhead of starting up PHP.EXE each time. Is there any way to tell PHP.EXE to build multiple HTML pages, i.e., kind of like a loop?

    Jim

    -- 
    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:


    Mensagem Automatica do Terra [nullterra.com.br]

    Could anyone please remove this guy? his mailbox has exceeded by size, guess he didn't know how many subscribers are on this list....

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    attached mail follows:


    I need some help...

    I try to do a ftp connection with php, but when i run the script it claims that ftp_connect is "call to undefined function.

    I have done a call to phpinfo, and it shows that ftp IS enabled! - Whats wrong?

    Here is what i use:

    $conn_id = ftp_connect("MyFtpSite"); $login_result = ftp_login($conn_id, "MyUserName", "MyPassword");

    etc...

    thanks for any help you can give me.

    Jon A

    attached mail follows:


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

    Maybe this will help: Break the query up into a variable so PHP can string it together better. Exec. the query, check the result, if good, check the results for rows, if results, display results, else, do nothing, if query faield, set err to 1 and set an error message.

    mysql_select_db("centraldb",$db); $qorder++; $query="SELECT q.questid, q.question, q.answer, q.qorder, q.depart, q.catid, " ."q.active, q.global, q.adate, q.author, q.authoremail, q.askemail, ."c.catid, c.category, c.under, c.corder, c.active " ." FROM central_groupfaqq q, central_groupfaqcat c " ."WHERE q.active = '1' AND q.global = '1' AND c.active = '1' " ."ORDER BY c.under, c.order, q.qorder;" ; if($result=mysql_query($query)) { if($num=mysql_num_ros($result)) { while ($myrow = mysql_fetch_row($result)) //display resutls } } else { //no results } } else { //bad query $err=1 $errMsg="Failed Query: $query<br>".mysql_errno()." : ".mysql_error(); }

    <---somehwere in html file---->

    if(!$err) { //display results and info here } else { printf("%s\n",$errMsg); }

    - --------------------- Johnny Withers johnnymindbender.net p. 601.853.0211 c. 601.954.9133

    - -----Original Message----- From: Keith Spiller [mailto:larentiumgilanet.com] Sent: Sunday, February 25, 2001 2:30 AM To: php-dblists.php.net; php-generallists.php.net Cc: mysqllists.mysql.com Subject: Join causing Error?

    Can anyone tell me why this: Line 282 mysql_select_db("centraldb",$db); Line 283 $qorder++; Line 284 $result = mysql_query("SELECT q.questid, q.question, q.answer, q.qorder, q.depart, q.catid, q.active, q.global, q.adate, q.author, q.authoremail, q.askemail, c.catid, c.category, c.under, c.corder, c.active FROM central_groupfaqq q, central_groupfaqcat c WHERE q.active = '1' AND q.global = '1' AND c.active = '1' ORDER BY c.under, c.order, q.qorder",$db); Line 285 while ($myrow = mysql_fetch_row($result))

    Would cause this error: Warning: Supplied argument is not a valid MySQL result resource in faqbody.php3 on line 285

    When changing the same SELECT statement to: Line 284 $result = mysql_query("SELECT * FROM central_groupfaqq WHERE active = '1' ORDER BY qorder",$db);

    Works perfectly?

    Keith Spiller a.k.a. Larentium

    -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

    iQA/AwUBOpppHLFNxPoD98ryEQL95QCffp7UNf0lJdx0lwSUjFdRKRths94AoIsS 4fpFCCXraXVYdkR2Hg5mKd0P =vlca -----END PGP SIGNATURE-----

    attached mail follows:


    > I am using php 4.0.4pl1. I added the AS400 toolkit to the JVM so I can > interface with an AS400. but for some reason when I go to use a class in > the JVM it says. > > Fatal error: Cannot instantiate non-existent class: java in > c:\Inetpub\wwwroot/AS400/testtoolbox.php on line 11 > > Below is the code I used. > <? > include "c:\\Inetpub\\wwwroot\\library\\calfunction.inc"; > include "c:\\Inetpub\\wwwroot\\library\\AS400lib\\standard.inc"; > session_register('userinfo'); > $user=$userinfo->user; > $pass=$userinfo->pass; > $printer=$userinfo->printer; > //java constructor is AS400("system", "user", "pass") > $as400 = new Java("com.ibm.as400.access.AS400", "X.X.X.X", "$user", > "$pass") > or die("Unable to Connect to AS400"); > ?> > > Ryan Conover >

    attached mail follows:


    PHP 4.0.4 pl1, Apache 1.3.17, BSD/OS 4.1 pl37

    Good Morning!

    Please forgive me if this has been covered ad nauseum, but I have searched high and low for an answer with no luck.

    After building PHP as a module, following the online instructions, Apache complained that it could not resolve hostnames. I got around this by using IP's in httpd.conf and making wusage do the lookups.

    Is there a fix for this or is it an unpleasant side effect that we must accept and deal with?

    Thanks, Scott

    --
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    *                                                       *
    *  Easley Internet Solutions              864.859.2400  *
    *  Easley, SC  USA                   Fax: 864.855.5864  *
    *  http://www.easley.net/            AIM:     ExCavSGT  *
    *                                                       *
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    

    attached mail follows:


    Hi :-) Can someone tell me how to do the equivalant of this Perl script in PHP?

    ### ### This function prints all lines between the dashes read in a text file ### ### The file looks like this:

    # ----------------------------- # Somedata: something # Someother: something else # ------------------------------ # # Several paragraphs # Several paragraphs # Several paragraphs # ----------END-------------- #

    #!/usr/bin/perl -w rray = <STDIN>;

    $inside = 0; foreach $line (rray) { if ($line =~ /-----/ig) { $inside = 1; } elsif ($line =~ /-----/gi) { $inside = 0; }

    if ($inside == 1) { print $line; } }

    TIA! Clayton Dukes CCNA, CCDA, CCDP, CCNP Internetwork Solutions Engineer Internetwork Management Engineer Thrupoint, Inc. Tampa, FL (c) 904.477.7825 (h) 904.292.1881

    attached mail follows:


    your can use the PCRE functions in php - much better than ereg and all that - if you know perl already...

    Clayton Dukes wrote:

    > > > Hi :-) > > Can someone tell me how to do the equivalant of this Perl script in PHP? > > > > ### > ### This function prints all lines between the dashes read in a text file > ### > > ### The file looks like this: > > > > # ----------------------------- > > # Somedata: something > > # Someother: something else > > # ------------------------------ > > # > > # Several paragraphs > > # Several paragraphs > > # Several paragraphs > > # ----------END-------------- > > # > > > > > > > > #!/usr/bin/perl -w > rray = <STDIN>; > > > > > $inside = 0; > foreach $line (rray) { > if ($line =~ /-----/ig) { > $inside = 1; > } elsif ($line =~ /-----/gi) { > $inside = 0; > } > > > > if ($inside == 1) { > print $line; > } > } > > > > > > TIA! > > Clayton Dukes > CCNA, CCDA, CCDP, CCNP > Internetwork Solutions Engineer > Internetwork Management Engineer > Thrupoint, Inc. > Tampa, FL > (c) 904.477.7825 > (h) 904.292.1881 > > attachment.txt > > Content-Type: > > text/plain

    attached mail follows:


    How? I don't know perl all that well, I am just trying to convert some scripts.

    ----- Original Message ----- From: "kevin1" <kevin1outcomemail.com> To: "Clayton Dukes" <cdukescdukes.com> Cc: <php-generallists.php.net> Sent: Monday, February 26, 2001 10:29 AM Subject: Re: [PHP] PERL to PHP

    > your can use the PCRE functions in php - much better than ereg and all > that - if you know perl already... > > Clayton Dukes wrote: > > > > > > > Hi :-) > > > > Can someone tell me how to do the equivalant of this Perl script in PHP? > > > > > > > > ### > > ### This function prints all lines between the dashes read in a text file > > ### > > > > ### The file looks like this: > > > > > > > > # ----------------------------- > > > > # Somedata: something > > > > # Someother: something else > > > > # ------------------------------ > > > > # > > > > # Several paragraphs > > > > # Several paragraphs > > > > # Several paragraphs > > > > # ----------END-------------- > > > > # > > > > > > > > > > > > > > > > #!/usr/bin/perl -w > > rray = <STDIN>; > > > > > > > > > > $inside = 0; > > foreach $line (rray) { > > if ($line =~ /-----/ig) { > > $inside = 1; > > } elsif ($line =~ /-----/gi) { > > $inside = 0; > > } > > > > > > > > if ($inside == 1) { > > print $line; > > } > > } > > > > > > > > > > > > TIA! > > > > Clayton Dukes > > CCNA, CCDA, CCDP, CCNP > > Internetwork Solutions Engineer > > Internetwork Management Engineer > > Thrupoint, Inc. > > Tampa, FL > > (c) 904.477.7825 > > (h) 904.292.1881 > > > > attachment.txt > > > > Content-Type: > > > > text/plain > > > > -- > 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:


    This could be a JS issue but right now I'm really not sure.

    I have this code,

    } elseif ($cat == 'bikes' && $sub_cat == 'Road') { $i = 1; while ( list($type,) = each($bikes[$sub_cat])) { echo "<TD><IMG SRC=\"images/spacer.gif\" WIDTH=\"25\" HEIGHT=\"1\" ALT=\"\" BORDER=\"0\"></TD>\n"; echo "<TD><A HREF=\"#\" CLASS=\"menu\" onMouseOver=\"popUp('HM_Menu$i',event)\" onMouseOut=\"popDown('HM_Menu$i')\" onClick=\"return false\">$type</A></TD>\n"; $i++; } echo "<SCRIPT LANGUAGE=\"JavaScript1.2\" SRC=\"HM_Loader.js\" TYPE=\"text/javascript\"></SCRIPT>";

    Which creates this (in IE),

    <TD><IMG SRC="images/spacer.gif" WIDTH="25" HEIGHT="1" ALT="" BORDER="0"></TD> <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu1',event)" onMouseOut="popDown('HM_Menu1')" onClick="return false">Trek</A></TD> <TD><IMG SRC="images/spacer.gif" WIDTH="25" HEIGHT="1" ALT="" BORDER="0"></TD> <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu2',event)" onMouseOut="popDown('HM_Menu2')" onClick="return false">Schwinn</A></TD> <TD><IMG SRC="images/spacer.gif" WIDTH="25" HEIGHT="1" ALT="" BORDER="0"></TD> <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu3',event)" onMouseOut="popDown('HM_Menu3')" onClick="return false">LeMond</A></TD> <TD><IMG SRC="images/spacer.gif" WIDTH="25" HEIGHT="1" ALT="" BORDER="0"></TD> <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu4',event)" onMouseOut="popDown('HM_Menu4')" onClick="return false">Moots</A></TD> <SCRIPT LANGUAGE="JavaScript1.2" SRC="HM_Loader.js" TYPE="text/javascript"></SCRIPT>

    However, in NN it creates,

    <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu1',event)" onMouseOut="popDown('HM_Menu1')" onClick="return false">Trek</A></TD> <TD><IMG SRC="images/spacer.gif" WIDTH="25" HEIGHT="1" ALT="" BORDER="0"></TD> <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu2',event)" onMouseOut="popDown('HM_Menu2')" onClick="return false">Schwinn</A></TD> <TD><IMG SRC="images/spacer.gif" WIDTH="25" HEIGHT="1" ALT="" BORDER="0"></TD> <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu3',event)" onMouseOut="popDown('HM_Menu3')" onClick="return false">LeMond</A></TD> <TD><IMG SRC="images/spacer.gif" WIDTH="25" HEIGHT="1" ALT="" BORDER="0"></TD> <TD><A HREF="#" CLASS="menu" onMouseOver="popUp('HM_Menu4',event)" onMouseOut="popDown('HM_Menu4')" onClick="return false">Moots</A></TD>

    Specifically the line, echo "<SCRIPT LANGUAGE=\"JavaScript1.2\" SRC=\"HM_Loader.js\" TYPE=\"text/javascript\"> is simply missing and the JS of course does not work.

    Now, if I reload the page the Jscript WILL work however the line, echo "<SCRIPT LANGUAGE=\"JavaScript1.2\" SRC=\"HM_Loader.js\" TYPE=\"text/javascript\"> still does not show up in the source.....

    This is version 4.08 and it only appears to happen with NN furthermore it only happens when the browser is first loaded. Once I go to the page and refresh it I can go to other pages, even other sites and come back to it and it will still be fine. But, as soon as I restart the browser and go to the site it happens again.

    What do you all think? Is this a PHP, Javascript, or DHTML issue?

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

    attached mail follows:


    First, can anyone point me to a good "mcrypt" primer or tutorial?

    Second, how can I determine what type and length I should make a database field that will hold encrypted data? Is there some table somewhere which tells how long a resulting encrypted field will be based on the encryption type and/or length of the plaintext field?

    Example: If I have a 20 character field and want to use Triple DES to encrypt it, can I find out how long the resulting field will be - what is the longest it will be? Will the resulting encrypted field always be the same length? Should I make the data type some variation of "text" or "varchar"?

    TIA.

    -- 
    Hardy Merrill
    Mission Critical Linux, Inc.
    http://www.missioncriticallinux.com
    

    attached mail follows:


    Is there a way to tell what browser is being used by the client in php?

    Thanks, Jay

    attached mail follows:


    How can I make this a variable?

    ie:

    foreach (file("$file.txt") as $line) { print ("" . trim(str_replace("'", "''", $line)) . "\n"); }

    changed to:

    $data = foreach (file("$file.txt") as $line) { print ("" . trim(str_replace("'", "''", $line)) . "\n"); }

    Simply adding the $data = in front of it doesn't work, I assume it needs to be enclosed by () or ; or something right?

    Thanks :-)

    Clayton Dukes

    attached mail follows:


    you can concatentate the variable inside the foreach loop.

    foreach (file("$file.txt") as $line) { $data .= ("" . trim(str_replace("'", "''", $line)) . "\n"); }

    -----Original Message----- From: Clayton Dukes [mailto:cdukescdukes.com] Sent: Monday, February 26, 2001 8:17 AM To: php-generallists.php.net Subject: [PHP] Making a variable

    How can I make this a variable?

    ie:

    foreach (file("$file.txt") as $line) { print ("" . trim(str_replace("'", "''", $line)) . "\n"); }

    changed to:

    $data = foreach (file("$file.txt") as $line) { print ("" . trim(str_replace("'", "''", $line)) . "\n"); }

    Simply adding the $data = in front of it doesn't work, I assume it needs to be enclosed by () or ; or something right?

    Thanks :-)

    Clayton Dukes

    attached mail follows:


    Thanks!

    ----- Original Message ----- From: "Dan Olsen" <dolseninformano.net> To: <php-generallists.php.net> Sent: Monday, February 26, 2001 11:39 AM Subject: RE: [PHP] Making a variable

    > > you can concatentate the variable inside the foreach loop. > > foreach (file("$file.txt") as $line) { > $data .= ("" . trim(str_replace("'", "''", $line)) . "\n"); > } > > > > -----Original Message----- > From: Clayton Dukes [mailto:cdukescdukes.com] > Sent: Monday, February 26, 2001 8:17 AM > To: php-generallists.php.net > Subject: [PHP] Making a variable > > > How can I make this a variable? > > ie: > > foreach (file("$file.txt") as $line) { > print ("" . trim(str_replace("'", "''", $line)) . "\n"); > } > > changed to: > > $data = foreach (file("$file.txt") as $line) { > print ("" . trim(str_replace("'", "''", $line)) . "\n"); > } > > Simply adding the $data = in front of it doesn't work, I assume it needs to > be enclosed by () or ; or something right? > > > Thanks :-) > > > Clayton Dukes > > > -- > 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:


    The php.ini file has safe-mode = Off so I don't think that is the problem.

    Suexec is checking to see that the php binary has the same uid/gid as the virtual host user running the php script. Since the php binary is owned by the web server user and the script is owned by one of the virtual host users, the uids/gids do not match and I get an error. I don't see how this can work. If it is possible to run the php binary through suexec, what am I missing? Has anybody gotten the cgi version of php to work with Apache, suexec, and virtual hosting? All replies are appreciated.

    -john

    On Fri, 23 Feb 2001, Richard Lynch wrote:

    > Don't use safe-mode in your suExec PHP CGI configure. > > suExec pretty much does everything safe mode does anyway, and more. > > -- > 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: <jhaganbinghamton.edu> > Newsgroups: php.general > Sent: Friday, February 23, 2001 1:18 PM > Subject: [PHP] php (cgi version) with Apache and suexec - help > > > > > > I've been trying to get the cgi version of php working with Apache and > > suexec but so far I have not had much success. I've installed the Apache > > module version of php and it seems to work fine. I then installed the > > cgi version of php and it too seems to work fine as long as it > > doesn't run through suexec. Suexec works fine for other (perl, c, > > etc...) cgi's. > > > > Here's what I have in Apache's httpd.conf: > > AddType application/x-httpd-php .php > > Action application/x-httpd-php /cgi-bin/php.cgi > > > > When I try to access a .php file I get an error about the command not > > being in the document root. This is one of the tests suexec performs and > > it is true, the cgi-bin directory (and hence the php binary) is not under > > the document root (although the .php file is). > > > > If I change httpd.conf to this: > > ScriptAlias /php-bin/ "/local/www/php/" > > AddType application/x-httpd-php .php > > Action application/x-httpd-php /php-bin/php.cgi > > > > Now the php binary is under the document root but when I try to access a > > .php file I get an error that the target uid/gid does not match that of > > the directory or program. This is also true since the php binary is owned > > by the web server and the .php file is owned by another user. > > > > So my question is "What am I missing?". How can I ever get the cgi > > version of php to work with suexec? The php binary is owned by the web > > server but the .php files will be owned by other users. > > > > Here is some more information about the environment in which I am working > > in case it is relevant: > > > > Solaris 7 > > Apache 1.3.17 > > php 4.04pl1 > > > > I'm just about ready to give up on this one. Thanks in advance for any > > and all help. > > > > -john > > > > > > > > -- > > 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:


    Hi. In some of my files, I have a require statement to get some global stuff accessable. I also have some header() redirects. They don't work (they worked before I added the requires). I moved the require under one of the header()s and that one works now, but I can't move it under the other one because stuff has to happen before the redirect and it needs the required stuff. So my question is do require statements produce output that I can't see (which would make the redirects not work)? The files I'm requiring don't have any output, which is why I'm confused. Thanks.

    Jason

    attached mail follows:


    hi, i would like to set up a script "forum" such that you can call a url

    http://www.server.com/forum/general

    and it will php-parse forum and pass /general as PATH_INFO. it's easy to get done as http://www.server.com/forum.php/general, but i would like to disclose the script name for reasons of obscurity.

    in fact, i would really like every request to be fed through something like /index.php, where the actual relative URI of the site is passed as PATH_INFO. so something of the form

    http://www.server.com/url/to/a/page

    would call /index.php with PATH_INFO=/url/to/a/page, and index.php could take care of whatever needs to be done to display that information. this can easily be done with a 404.php script, but i'd much rather do it transparently without this sort of abuse of the 404 feature.

    thanks, martin

    [greetings from the heart of the sun]# echo madduck!#:1:s\.net

    -- 
    "and no one sings me lullabies,
     and no one makes me close my eyes,
     and so i throw the windows wide,
     and call to you across the sky"
                                                       -- pink floyd, 1971
    

    attached mail follows:


    Thanks again, Is there a way I can tell it to print all but the first 13 lines and the last two lines of the text file?

    -Clayton

    ----- Original Message ----- From: "Dan Olsen" <dolseninformano.net> To: <php-generallists.php.net> Sent: Monday, February 26, 2001 11:39 AM Subject: RE: [PHP] Making a variable

    > > you can concatentate the variable inside the foreach loop. > > foreach (file("$file.txt") as $line) { > $data .= ("" . trim(str_replace("'", "''", $line)) . "\n"); > } > > > > -----Original Message----- > From: Clayton Dukes [mailto:cdukescdukes.com] > Sent: Monday, February 26, 2001 8:17 AM > To: php-generallists.php.net > Subject: [PHP] Making a variable > > > How can I make this a variable? > > ie: > > foreach (file("$file.txt") as $line) { > print ("" . trim(str_replace("'", "''", $line)) . "\n"); > } > > changed to: > > $data = foreach (file("$file.txt") as $line) { > print ("" . trim(str_replace("'", "''", $line)) . "\n"); > } > > Simply adding the $data = in front of it doesn't work, I assume it needs to > be enclosed by () or ; or something right? > > > Thanks :-) > > > Clayton Dukes > > > -- > 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:


    yes but you might want to use a for() loop instead since you know what you want.

    $arrayoflines = file(“$file.txt”); $arraysize = sizeof($arrayoflines); $limit = $arraysize - 2;

    for (i=0; i<$arraysize; i++) { if ( (i>12) && (i<$limit) ) { $output .= $arrayoflines[i]; } }

    you’ll have to debug, but it should work.

    DanO

    -----Original Message----- From: Clayton Dukes [mailto:cdukescdukes.com] Sent: Monday, February 26, 2001 8:43 AM To: Dan Olsen; php-generallists.php.net Subject: Re: [PHP] Making a variable -Trim output

    Thanks again, Is there a way I can tell it to print all but the first 13 lines and the last two lines of the text file?

    -Clayton

    ----- Original Message ----- From: "Dan Olsen" <dolseninformano.net> To: <php-generallists.php.net> Sent: Monday, February 26, 2001 11:39 AM Subject: RE: [PHP] Making a variable

    > > you can concatentate the variable inside the foreach loop. > > foreach (file("$file.txt") as $line) { > $data .= ("" . trim(str_replace("'", "''", $line)) . "\n"); > } > > >

    attached mail follows:


    Hi,

    I downloaded the GD libary and want to enable it with PHP but I cant figure out how to do that - can anyone tell me how to do it? Do I have to put the path to GD-libary inside the PHP.ini and if so, where?

    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! ------------------------------------------

    attached mail follows:


    Nothing tested, just off the top of my head. The single most reliable way to do that would be to have a page that runs JavaScript.

    For instance, if the JavaScript executes, it redirects to your JavaScript enabled page, if not, the page does a refresh to a non JavaScript enabled page.

    <html><head><title>tester></title> <script language='JavaScript'> window.location('http://some.javascript.enabled.page'); </script> <meta http-equiv=refresh content='5;url=http://some.nonjavascripting.page'> </head>

    The trick would be a matter of timing, the JavaScript must successfully execute before the timer runs out on the refresh tag. You can of course get much fancier, changing the redirect based on the client information that PHP has available. PHP could effectively write the JavaScript to the page based on the known capabilities of the client. For instance the refresh tag is generally useless for browsers like Lynx, as is the JavaScript.

    Alternatively, you could (just supposing now...) have the first page do an instant refresh, using JavaScript to trigger a value in PHP. If the value is set, JavaScript was enabled, if it is not, JavaScript was turned off.

    But I've not tried it.

    DAve

    --
    Dave Goodrich
    Director of Interface Development
    Reality Based Learning Company
    9521 NE Willows Road, Suite 100
    Redmond, WA 98052 
    Toll Free 1-877-869-6603 ext. 237
    Fax (425) 558-5655 
    davegrblc.com 
    http://www.rblc.com
    

    > From: Jochen Kächelin <jkwa-p.de> > Reply-To: <jkwa-p.de> > Date: Sun, 25 Feb 2001 05:37:17 +0100 > To: "Php-GeneralLists. Php. Net" <php-generallists.php.net> > Subject: [PHP] Detecting JavaScript > > Who can give me a PHP-Script to > detect if JavaScript is enabled? > > It should work with both, IE and NN! > > thanks > > -- > Ihr WEBberater > Stuttgarter Str.3, D-73033 Göppingen > Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598 > http://www.wa-p.de ** mailto:jkwa-p.de > > > -- > 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:


    this is a function that is BUILT-IN to HTML for the last few versions.

    <script> //some script here </script>

    <noscript> <meta http-equiv=refresh content='5;url=http://some.nonjavascripting.page'> </noscript>

    --
    

    this will redirect non-javascript browsers to a non-javascript page.

    DanO

    -----Original Message----- From: Dave Goodrich [mailto:davegrblc.com] Sent: Monday, February 26, 2001 8:56 AM To: jkwa-p.de Cc: php Subject: Re: [PHP] Detecting JavaScript

    Nothing tested, just off the top of my head. The single most reliable way to do that would be to have a page that runs JavaScript.

    For instance, if the JavaScript executes, it redirects to your JavaScript enabled page, if not, the page does a refresh to a non JavaScript enabled page.

    <html><head><title>tester></title> <script language='JavaScript'> window.location('http://some.javascript.enabled.page'); </script> <meta http-equiv=refresh content='5;url=http://some.nonjavascripting.page'> </head>

    The trick would be a matter of timing, the JavaScript must successfully execute before the timer runs out on the refresh tag. You can of course get much fancier, changing the redirect based on the client information that PHP has available. PHP could effectively write the JavaScript to the page based on the known capabilities of the client. For instance the refresh tag is generally useless for browsers like Lynx, as is the JavaScript.

    Alternatively, you could (just supposing now...) have the first page do an instant refresh, using JavaScript to trigger a value in PHP. If the value is set, JavaScript was enabled, if it is not, JavaScript was turned off.

    But I've not tried it.

    DAve

    -- Dave Goodrich Director of Interface Development Reality Based Learning Company 9521 NE Willows Road, Suite 100 Redmond, WA 98052 Toll Free 1-877-869-6603 ext. 237 Fax (425) 558-5655 davegrblc.com http://www.rblc.com