OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Sat Jul 20 2002 - 19:10:35 CDT

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

    php-general Digest 21 Jul 2002 00:10:35 -0000 Issue 1476

    Topics (messages 108648 through 108682):

    Problem with sessions
            108648 by: JJ Harrison
            108651 by: Matt
            108654 by: JJ Harrison
            108658 by: JJ Harrison
            108665 by: JJ Harrison

    Re: PDF pain
            108649 by: Michael Hall
            108661 by: Rasmus Lerdorf
            108662 by: Michael Hall
            108664 by: Rasmus Lerdorf

    Re: == vs = should generate a warning or error -- was: Why won't this work?
            108650 by: Daevid Vincent

    Re: CRLF Injection in mail()
            108652 by: John Holmes

    Any free mailing list software?
            108653 by: Dasmeet Singh

    Re: POST question
            108655 by: Lowell Allen

    problem with exec
            108656 by: umesh
            108660 by: Bas Jobsen

    Re: Searching...
            108657 by: softm

    sablotron compile
            108659 by: Michael Hall

    Setting process priority
            108663 by: Gunnar Steinn

    Re: More File Uploading Problems
            108666 by: Roger Lewis

    Re: retrieve data from multidimensional array
            108667 by: rdkurth.starband.net

    session trans_sid and ob_start("ob_gzhandler")
            108668 by: Thomas Weber

    Dynamic menu
            108669 by: César Aracena
            108671 by: John Holmes
            108681 by: César Aracena

    Re: damned "false"
            108670 by: Craig Vincent

    HELP!!!!!
            108672 by: Georgie Casey

    Re: [PHP-DB] Dynamic menu
            108673 by: Mark Middleton

    how do i get the domain that the script is called from?
            108674 by: Police Trainee
            108675 by: Matt Babineau

    finding if $key has value
            108676 by: Peter J. Pieczora

    CLARIFICATION: how do i get the domain that the script is called from?
            108677 by: Police Trainee
            108679 by: John Holmes

    HTML E-mails
            108678 by: Alex Kirk

    getting variables from other functions
            108680 by: Tim Luoma

    Re: Forms problem?
            108682 by: Bruce Karstedt

    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:


    I have a login script which calls this function if it is a proper user etc.

    function register_in_session($uinfo){
    // Used in conjuction with validate to input user info into the session
      $_SESSION['uid'] = $uinfo[0];
     $_SESSION['gid'] = $uinfo[1];
      $_SESSION['banid'] = $uinfo[2];
     $_SESSION['username'] = $uinfo[3];
     $_SESSION['fname'] = $uinfo[4];
     $_SESSION['lname'] = $uinfo[5];
     $_SESSION['email'] = $uinfo[6];
    }

    as a test i use this function in all my pages.

    function welcome_or_login(){
    if(isset($_SESSION['fname'])){
     echo 'Hello '.$_SESSION['fname'].'.';
     } else {
     do_h('Login', 3, 'y');
     do_hr();
     login_form('');
     }
    }

    Only on the login page my test user's name is displayed. On all other pages
    it reverts to the login form.

    the files all link to a required includes file which includes all of the
    functions.

    Here are my php.ini settings for sessions.

    ; Handler used to store/retrieve data.
    session.save_handler = files

    ; Argument passed to save_handler. In the case of files, this is the path
    ; where data files are stored. Note: Windows users have to change this
    ; variable in order to use PHP's session functions.
    session.save_path = C:\PHP\sessiondata ; argument passed to save_handler

    ; Whether to use cookies.
    session.use_cookies = 1

    ; Name of the session (used as cookie name).
    session.name = SID

    ; Initialize session on request startup.
    session.auto_start = 0

    ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
    session.cookie_lifetime = 0

    ; The path for which the cookie is valid.
    session.cookie_path = /

    ; The domain for which the cookie is valid.
    session.cookie_domain =

    ; Handler used to serialize data. php is the standard serializer of PHP.
    session.serialize_handler = php

    ; Percentual probability that the 'garbage collection' process is started
    ; on every session initialization.
    session.gc_probability = 1

    ; After this number of seconds, stored data will be seen as 'garbage' and
    ; cleaned up by the garbage collection process.
    session.gc_maxlifetime = 1440

    ; Check HTTP Referer to invalidate externally stored URLs containing ids.
    session.referer_check =

    ; How many bytes to read from the file.
    session.entropy_length = 0

    ; Specified here to create the session id.
    session.entropy_file =

    ;session.entropy_length = 16

    ;session.entropy_file = /dev/urandom

    ; Set to {nocache,private,public} to determine HTTP caching aspects.
    session.cache_limiter = nocache

    ; Document expires after n minutes.
    session.cache_expire = 180

    ; use transient sid support if enabled by compiling with --enable-trans-sid.
    session.use_trans_sid = 1

    url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

    I don't pass along the session id manually either.

    My server is windows 2000 server with ISS 5.0. - 400mhz pII 256mb ram 40gig
    hdd.

    This is my first time using sessions so i could be doing anything

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    attached mail follows:


    >From: "JJ Harrison" <webmastertececo.com> >Sent: Saturday, July 20, 2002 7:31 AM >Subject: [PHP] Problem with sessions

    > Only on the login page my test user's name is displayed. On all other pages > it reverts to the login form.

    Are you doing a session_start() on all of the other pages?

    attached mail follows:


    It is in an include file which is included in all the files.

    the first line in the file is session_start();

    maybe it should be in each file rather than an include what do you think?

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    "Matt" <mschroebelepooch.com> wrote in message news:00fd01c22fe3$b5f1ce80$299aa8c0epooch.com... > >From: "JJ Harrison" <webmastertececo.com> > >Sent: Saturday, July 20, 2002 7:31 AM > >Subject: [PHP] Problem with sessions > > > Only on the login page my test user's name is displayed. On all other > pages > > it reverts to the login form. > > Are you doing a session_start() on all of the other pages? > >

    attached mail follows:


    BTW I know sessions is 'sort of' working as the sid is passed along through the url when I turn cookies off.

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    "Matt" <mschroebelepooch.com> wrote in message news:00fd01c22fe3$b5f1ce80$299aa8c0epooch.com... > >From: "JJ Harrison" <webmastertececo.com> > >Sent: Saturday, July 20, 2002 7:31 AM > >Subject: [PHP] Problem with sessions > > > Only on the login page my test user's name is displayed. On all other > pages > > it reverts to the login form. > > Are you doing a session_start() on all of the other pages? > >

    attached mail follows:


    got it now!

    it was a prob with passing and array to a function"Jj Harrison" <webmastertececo.com> wrote in message news:20020720112915.38024.qmailpb1.pair.com... > I have a login script which calls this function if it is a proper user etc. > > function register_in_session($uinfo){ > // Used in conjuction with validate to input user info into the session > $_SESSION['uid'] = $uinfo[0]; > $_SESSION['gid'] = $uinfo[1]; > $_SESSION['banid'] = $uinfo[2]; > $_SESSION['username'] = $uinfo[3]; > $_SESSION['fname'] = $uinfo[4]; > $_SESSION['lname'] = $uinfo[5]; > $_SESSION['email'] = $uinfo[6]; > } > > as a test i use this function in all my pages. > > function welcome_or_login(){ > if(isset($_SESSION['fname'])){ > echo 'Hello '.$_SESSION['fname'].'.'; > } else { > do_h('Login', 3, 'y'); > do_hr(); > login_form(''); > } > } > > Only on the login page my test user's name is displayed. On all other pages > it reverts to the login form. > > the files all link to a required includes file which includes all of the > functions. > > Here are my php.ini settings for sessions. > > ; Handler used to store/retrieve data. > session.save_handler = files > > ; Argument passed to save_handler. In the case of files, this is the path > ; where data files are stored. Note: Windows users have to change this > ; variable in order to use PHP's session functions. > session.save_path = C:\PHP\sessiondata ; argument passed to save_handler > > ; Whether to use cookies. > session.use_cookies = 1 > > > ; Name of the session (used as cookie name). > session.name = SID > > ; Initialize session on request startup. > session.auto_start = 0 > > ; Lifetime in seconds of cookie or, if 0, until browser is restarted. > session.cookie_lifetime = 0 > > ; The path for which the cookie is valid. > session.cookie_path = / > > ; The domain for which the cookie is valid. > session.cookie_domain = > > ; Handler used to serialize data. php is the standard serializer of PHP. > session.serialize_handler = php > > ; Percentual probability that the 'garbage collection' process is started > ; on every session initialization. > session.gc_probability = 1 > > ; After this number of seconds, stored data will be seen as 'garbage' and > ; cleaned up by the garbage collection process. > session.gc_maxlifetime = 1440 > > ; Check HTTP Referer to invalidate externally stored URLs containing ids. > session.referer_check = > > ; How many bytes to read from the file. > session.entropy_length = 0 > > ; Specified here to create the session id. > session.entropy_file = > > ;session.entropy_length = 16 > > ;session.entropy_file = /dev/urandom > > ; Set to {nocache,private,public} to determine HTTP caching aspects. > session.cache_limiter = nocache > > ; Document expires after n minutes. > session.cache_expire = 180 > > ; use transient sid support if enabled by compiling with --enable-trans-sid. > session.use_trans_sid = 1 > > url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" > > I don't pass along the session id manually either. > > My server is windows 2000 server with ISS 5.0. - 400mhz pII 256mb ram 40gig > hdd. > > This is my first time using sessions so i could be doing anything > -- > JJ Harrison > webmastertececo.com > www.tececo.com > >

    attached mail follows:


    Thanks for your pointers Richard, you've given me plenty of ideas for when things go wrong as I continue to explore PHP and PDF.

    As it turns out, my problem was a typo copied faithfully from 'Programming PHP'. For anyone else trying the example (Hello world in PDF, on p 234), make sure you use "application/x-pdf" in the Content-Type header, not "application/pdf" as printed in the book.

    If this really is a typo, could someone let me know and maybe I'll register it with O'Reilly if they don't already know about it.

    Typos happen in all books, especially technical books. Apart from this small error (?), the book is great and has really filled out the holes in my PHP knowledge.

    Michael

    On Sat, 20 Jul 2002, Richard Lynch wrote:

    > > > >Thanks for all the suggestions. I am making progress after discovering a > >typo in my code (single quotes in a header() string containing a $var ... > >double quotes fixed it). > > > >Now I get a pdf document but no text :-( > > > >If I save the doc to disk and try to open it with xpdf, it complains that > >the "xref table" is broken and that it can't find a "trailer dictionary". > > Even though you fixed one bug, make sure the header calls are at the end of > your PHP script... > > Any other bugs lurking will show up in the browser before the Content-type, > and you'll actually see them. > > I'd also make sure all my PDF/PHP code as doing as much error-checking as > possible. > > Check all return values to be sure they are valid. > > I don't know what an xref table or trailer dictionary are, but if those are > standard PDF elements, and your PHP code is trying to create them, I'd sure > zero in on that section of code first, as well as the section immediately > preceding it, which might be polluting the PDF stream of data with a PHP > error message. > > Open up that PDF file in a text editor, and search for "Error" in it. > >

    attached mail follows:


    > Thanks for your pointers Richard, you've given me plenty of ideas for when > things go wrong as I continue to explore PHP and PDF. > > As it turns out, my problem was a typo copied faithfully from 'Programming > PHP'. For anyone else trying the example (Hello world in PDF, on p 234), > make sure you use "application/x-pdf" in the Content-Type header, not > "application/pdf" as printed in the book. > > If this really is a typo, could someone let me know and maybe I'll > register it with O'Reilly if they don't already know about it. > > Typos happen in all books, especially technical books. Apart from this > small error (?), the book is great and has really filled out the holes in > my PHP knowledge.

    Well, I wrote that, and it is not a typo. Your browser is simply misconfigured. If you install Adobe's Acrobat Reader, which these days is the de-facto standard PDF browser plugin, it will register itself as application/pdf. Same for every other PDF viewer on every platform I have ever tried.

    So, if you want people to be able to view your page, you better use application/pdf and not application/x-pdf and fix your browser config while you are at it.

    -Rasmus

    attached mail follows:


    Thanks for that, I'll leave O'Reilly alone.

    For the record, I was using Konqueror and Mozilla (and xpdf) on RedHat 7.2, standard installations.

    Michael

    On Sat, 20 Jul 2002, Rasmus Lerdorf wrote:

    > > Thanks for your pointers Richard, you've given me plenty of ideas for when > > things go wrong as I continue to explore PHP and PDF. > > > > As it turns out, my problem was a typo copied faithfully from 'Programming > > PHP'. For anyone else trying the example (Hello world in PDF, on p 234), > > make sure you use "application/x-pdf" in the Content-Type header, not > > "application/pdf" as printed in the book. > > > > If this really is a typo, could someone let me know and maybe I'll > > register it with O'Reilly if they don't already know about it. > > > > Typos happen in all books, especially technical books. Apart from this > > small error (?), the book is great and has really filled out the holes in > > my PHP knowledge. > > Well, I wrote that, and it is not a typo. Your browser is simply > misconfigured. If you install Adobe's Acrobat Reader, which these days is > the de-facto standard PDF browser plugin, it will register itself as > application/pdf. Same for every other PDF viewer on every platform I have > ever tried. > > So, if you want people to be able to view your page, you better use > application/pdf and not application/x-pdf and fix your browser config > while you are at it. > > -Rasmus > > >

    -- 
    --------------------------------
    n   i   n   t   i  .   c   o   m
    php-python-perl-mysql-postgresql
    --------------------------------
    Michael Hall     nintininti.com
    --------------------------------
    

    attached mail follows:


    I'm on Linux/Mozilla as well. See this screenshot:

    http://lerdorf.com/pdf.png

    -Rasmus

    On Sun, 21 Jul 2002, Michael Hall wrote:

    > > Thanks for that, I'll leave O'Reilly alone. > > For the record, I was using Konqueror and Mozilla (and xpdf) on RedHat > 7.2, standard installations. > > Michael > > > On Sat, 20 Jul 2002, Rasmus Lerdorf wrote: > > > > Thanks for your pointers Richard, you've given me plenty of ideas for when > > > things go wrong as I continue to explore PHP and PDF. > > > > > > As it turns out, my problem was a typo copied faithfully from 'Programming > > > PHP'. For anyone else trying the example (Hello world in PDF, on p 234), > > > make sure you use "application/x-pdf" in the Content-Type header, not > > > "application/pdf" as printed in the book. > > > > > > If this really is a typo, could someone let me know and maybe I'll > > > register it with O'Reilly if they don't already know about it. > > > > > > Typos happen in all books, especially technical books. Apart from this > > > small error (?), the book is great and has really filled out the holes in > > > my PHP knowledge. > > > > Well, I wrote that, and it is not a typo. Your browser is simply > > misconfigured. If you install Adobe's Acrobat Reader, which these days is > > the de-facto standard PDF browser plugin, it will register itself as > > application/pdf. Same for every other PDF viewer on every platform I have > > ever tried. > > > > So, if you want people to be able to view your page, you better use > > application/pdf and not application/x-pdf and fix your browser config > > while you are at it. > > > > -Rasmus > > > > > > > > -- > -------------------------------- > n i n t i . c o m > php-python-perl-mysql-postgresql > -------------------------------- > Michael Hall nintininti.com > -------------------------------- >

    attached mail follows:


    > That would suck since many many PHP programs use stuff like: > > while($row=mysql_fetch_row($result)) { ... } > > There is absolutely nothing wrong with doing an assignment in > a conditional and if it generated a warning it would drive a > lot of people crazy.

    First off, I have to LMAO at "that would suck". So unexpected but humorus.

    But seriously, this is why I suggest it be a config file option. Not a new way of doing things, to break old code. But something toggle-able.

    Or, I'm sure the PHP parser could be made smarter to look for common 'assigments' that are supposed to be 'conditions'.

    For example I seriously doubt that NOBODY EVER means to do

    if ($x = 5) { }

    That CLEARLY is supposed to be using a == and not =

    And I'm sure there are other such obvious cases that the parser could check for somehow.

    Just a suggestion. Thass all.

    attached mail follows:


    > -----Original Message----- > From: Richard Lynch [mailto:richphpbootcamp.com] > Sent: Saturday, July 20, 2002 3:24 AM > To: php-generallists.php.net > Subject: [PHP] Re: CRLF Injection in mail() > > >Maybe I'm behind the times, but I just found out about this one today. > >Basically if a user can take your form that sends an email, and send a > >value like "This is my subject\nBcc: myemailmyisp.com" for the subject, > >then they will get Bcc'd on every email your script later sends. One > > NO! They'll get a Bcc: on the *ONE* email they sent with your FORM.

    It depends on your form. If you have a "contact the admins" form, then they can find out your email. Or say you are running an AA help group and you provide a way for people to email each other through the web. Someone can type in a message and then your PHP script send out a message to each of the members, but the message is from your web site, not the person, so their identities are hidden, for privacy reasons. Now if I put in a contaminated Subject, I can get CC:d on EVERY email that the script sends out at that time. I can find out everyone's email address. How are you protecting the privacy of your users? > Since they *SENT* the email, that does not seem like much of an issue to > me.

    It's not the content they would be after, it would be finding out the email addresses of the recipients.

    > Or are you *STORING* the Subject:, and then re-using *THEIR* Subject for > other emails? Yikes. Why in the world would you do that? If you're > letting > them decide what the subject is in emails sent out by somebody else, > that's > just wrong in the first place.

    It would just work each time they filled out the form.

    > >method to use is to download your form (Save As), modify the usual > >'text' box into a <textarea> and put in a value like that given above. > >Note that it has to be an actual line feed (like in a textarea), not > >just a \n typed in (that'll get escaped by magic_quotes, hopefully). > > If they want to be really kosher, they need \r\n, not just \n in there. > > Read the RFC's.

    OK.

    > >Where this comes into play as "bad" is when you're trying to hide email > >addresses, and now the user can Bcc: themselves on everything sent out > >and find out the email address of everyone. > > No, no, no. Unless you're foolish enough to let them upload their altered > HTML to your web-site, or be sending out emails from other people using > *THEIR* subject as data.

    But most forms do let people choose their own subject. And I don't have to upload the code anywhere, just provide a full http:// address to your form processing page. I can spoof HTTP_REFERRER if you are checking for that. Now if your authenticating or using a session, it may be harder.

    > >Why isn't, or is this, considered a bug? Is there any valid reason for > >PHP not to check for this itself and say that Subject (and whatever > >other fields are vulnerable) can only contain a subject header and > >that's it? > > > >What do you think? > > If you are worried about it, your PHP script can simply check the subject > before you send the email. > > <?php > $subject = explode("\n", $subject); > $subject = trim($subject[0]); > mail(...,$subject,...); > ?>

    Many ways to fix it, once you are aware of it.

    > It's certainly not a PHP "bug" for PHP to let you put whatever you want in > your Subject, no matter how badly-designed that might be. > > It's not PHP's job to stop you from doing "stupid" things :-)

    But if you use mail($to,$subject,$message,$headers), then PHP should ONLY allow a SUBJECT: header to be set in the $subject parameter. Same thing for $to. It's not PHP stopping us from doing stupid things, it's PHP doing what it says it's going to do, only letting the value of $subject set the Subject: header and that's it.

    This is something that 99% of the people out there aren't going to think about. Look at all the problems already with cross-site scripting. It's an easy fix, yes, once you know about it, but I think it could be better handled at the PHP core level.

    Is there ever a need to let someone set additional headers in the Subject part of mail()? Why allow people the change to do it and have unwanted consequences when it's easily fixed for everyone?

    My $0.02 :)

    ---John Holmes...

    attached mail follows:


    Is there any free mailing software that uses PHP/MySQL? I am looking for a simple yet powerful software that could manage addressess in thousands and several mailing lists together. Thanx in advance.

    -- 
    

    --- Watch Indian TV Schedules Online http://www.einfotimes.com Earn Money to Read Emails (NOT SPAM) http://hp.fedoxpress.com

    attached mail follows:


    > From: Mike Tuller <phpce.anoka.k12.mn.us> > > I have a page with a form that has a drop down menu that I can select > different items that I want to display on another page where I can add more > information to be entered into a database. I can do that by using this on > the page that displays. > > while ($row = mysql_fetch_array( $sql_result )) > { > $_POST["asset_type"] = $row["asset_type"]; > } > > What I want to do is have a different page display for different choices. So > if I choose one type of asset to add, then submit it to be added to the > database, I want to have a script that reads what the selection was and > displays the page that matches the type of asset that matches it. > > I think the best way to do this is to have the "$_POST["asset_type"]" go to > a second page that decides if $_POST["asset_type"] = "Computer" go to the > page for adding computer information, or if it equals "Printer" is goes to > the page for entering printer information. The question I have is how can I > make sure the $_POST["asset_type"] carries onto a third page and how do I > make it so that when a selection is made, it opens the correct third page? > I think you could do this with just two pages. Set the action of the form on the first page to be the URL of the second page. Make the form displayed on the second page dependent on the value passed from the first page -- the value being the selection made from the drop down menu. Let the form(s) on the second page do all the database submission.

    --
    Lowell Allen
    

    attached mail follows:


    Hi Gurus,

    I am using PHP 4.1.1, Postgresql 7.2 and Perl 5.6.0 on Linux.

    I want to execute a perl script throgh a PHP, which will take backup of the database after submit button on the PHP is clicked.

    But I am unable to do it, can anybody pls. help me. Following is the part of code I am using,

    PHP Code _________________

    if($_POST['btnSubmit']) { exec("perl /usr/local/apache/htdocs/mlm/test/check1.pl &"); }

    Perl Script follows (check1.pl) _____________________________

    #!/usr/bin/perl -

    use POSIX qw(strftime); $Date=POSIX::strftime("%Y%m%d%H%M", localtime); system("pg_dump -S postgres -f testUDdb >/usr/local/apache/htdocs/mlm/admin/backup/".$Date."backup");

    Thanking you in anticipation.

    Regards

    Umesh. ***************************** Umesh A. Deshmukh. Manas Solutions Pvt. Ltd. umeshmanas-solutions.com http://www.manas-solutions.com Ph. : 91+020+4006358,4223991/92 *****************************

    attached mail follows:


    Hi,

    > #!/usr/bin/perl -

    So you needn't call perl again > exec("perl /usr/local/apache/htdocs/mlm/test/check1.pl &"); maybe exec("/usr/local/apache/htdocs/mlm/test/check1.pl &"); or exec("/usr/bin/perl .......

    > use POSIX qw(strftime); > $Date=POSIX::strftime("%Y%m%d%H%M", localtime); > system("pg_dump -S postgres -f testUDdb > > >/usr/local/apache/htdocs/mlm/admin/backup/".$Date."backup");

    Why don't you do this in php direct?

    --
    <?
    $Date=date("YmdHM");
    echo `g_dump -S postgres -f testUDdb 
    '/usr/local/apache/htdocs/mlm/admin/backup/'.$Date.'backup' 2>&1`;
    ?>
    --
    

    attached mail follows:


    > Am I missing something? If you do a COUNT() in the query then, in general, > it'll only return 1 row. You then use this row to determine the result of the > COUNT(). IE using mysql_numrows() on this result is inappropriate.

    but not wrong. Just simple paranoia.

    attached mail follows:


    I went for a swiss army knife build of PHP with pdflib, xml and xslt (sablotron). Everything went fine until make install, which exited with:

    make[1]: *** [libphp4.1a] Error 1

    and

    make: *** [install-recursive] Error 1

    Everything works fine until I try to add Sablotron. Sablotron compiled and installed OK.

    Is there a fix here?

    TIA

    Michael

    attached mail follows:


    Hi there, here is my problem

    I'm using php to generate a dynamic pdf document and when ready send it with email. Since it takes few minutes to generate I start a new process with popen that makes the pdf like this

    popen("./pdf.php \"".$outputarray."\" > /dev/null &", "r");

    pdf.php then generates it and everything is ok but this new process takes so much cpu that the site is halted for these few minutes. My question... is there a way to set pdf.php-process to a lower priority? I've searched everywere and couldn't find it.

    Please reply in email since I will miss it otherwise

    Gunnar Steinn gsmhi.is

    attached mail follows:


    What a mailing list! I very much appreciate the timely and constructive help. From all your responses, I was able to put together a solution for uploading files to a server that worked. Here it is.

    I created a file called getfiles.php in which I put the form that the user uses to upload his file: (I've left the text and formatting out of this post)

    <form enctype="multipart/form-data" name="frmUploadFile" action="storefile.php" method="post"> <input type="file" name="fileUpload" size="20"> <input type="submit" value="Upload this file" name="cmdSubmit"> </form> Richard, "size" is the size of the text box into which the selected file goes. I created another file called storefile.php that moves the uploaded file from the default temp directory to the assigned directory:

    <?php // In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES. if (is_uploaded_file($HTTP_POST_FILES['fileUpload']['tmp_name'])) { move_uploaded_file($HTTP_POST_FILES['fileUpload']['tmp_name'], "/home/sites/home/users/demodocs/web/ProjDocs/" . $HTTP_POST_FILES['fileUpload']['name']); } else { echo "Possible file upload attack. Filename: " . $HTTP_POST_FILES['fileUpload']['name']; } ?>

    Note 1: The php manual, http://www.php.net/manual/en/features.file-upload.php, is confusing to us newbies in that it is not clear that there should be a variable file name in the path definition. Note 2: There must be a dot '.' before the '$' in the file name. I had omitted the dot, and accordingly got parsing error messages. Both of the above files are put in the web site root, /home/sites/home/users/demo/web

    When I point my browser to getfiles.php the form appears and I can browse for files from my hard drive. When I upload the file, it goes to the default tmp directory and is then moved to ../demodocs/web/ProjDocs Note: I got permission denied errors until I fixed chmod for the /ProjDocs directory. Neither 755, 666, 766 nor 622 worked. What works is 777.

    I'm using PHP 4.0.6 on a Cobalt RaQ4 with Apache 1.3.20

    Thanks again, all Roger Lewis

    attached mail follows:


    Hello Jason, It might work but I can not for the life of me figure out how to use it to get the data. Below is what I have so far but don't know where to go from there If I search for a word that is in $row_1 I what it return every line that it is in and there will usually be more than one. This is a virtusertable table for sendmail that I am searching. I need to retrieve data change data and delete data with this script. So far all I have done is separate the data so I can do something with it. I don't know maybe I am going at this all wrong if somebody has a better idea please let me know

    function bs_file($filename) { $fp = fopen($filename, "r"); if (!($fp)) { return 0; } while (!feof($fp)) { $temp .= fread($fp, 4096); } $arr = explode("\n", $temp); return $arr; }

    $filename="./etc/virtusertable"; $file=bs_file($filename); for($i = 0; $i < count($file); $i++){ $value = $file[$i]; $arra = explode(" ", $value); <-this is searching on a tab $row_0 = $arra[0]; $row_1 = $arra[1]; $multi=array($row_0,$row_1); echo "$multi[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$multi[1]<br>"; }

    Saturday, July 20, 2002, 2:33:32 AM, you wrote:

    JW> On Saturday 20 July 2002 15:49, rdkurthstarband.net wrote: >> I have a multidimensional array. How can I search and retrieve all data >> that is like $value from it. >> the array looks like this $multi=array($row_0,$row_1); I want to >> retrieve all data where $value matches $row_1 and display the data on >> the screen. I know that array_search and in_array will tell me that >> the data exist but I what to retrieve it.

    JW> Doesn't array_search() do what you want? Presumably if you're searching for JW> something you know what you're searching for then all you need to know is JW> where it is found.

    -- 
    Best regards,
     rdkurth                            mailto:rdkurthstarband.net
    

    attached mail follows:


    Hi, i have a problem with sessions. I use the trans_sid ('couse i don't like cookies) and everything worked fine... but when i insert ob_start("ob_gzhandler") to my script, to compress the output, the URLs don't get rewrited. Has anyone a suggestion for this prob? I have the entire of the output in a variable to rewrite something in it via regex, maybe someone has a regex for rewriting local links with the session-tag.

    Thanks, Thomas 'Neo' Weber

    ---
    thomasyoungarts.org
    neogothic-chat.de
    

    attached mail follows:


    Hi all. I’m making a few dynamic menus that grab information from a MySQL DB. What I don’t know is how to print only one line of each. I don’t want a Drop Down List displaying 4 times the same line if the information is repeated in 4 rows in the same table. What I’m using is something like: $query = “SELECT * FROM tbl_name”; $result = mysql_quiery($query) or die(mysql_error()); $num_rows = mysql_num_rows($result);

    <select name="select_name"> <option SELECTED>Select Something</option> for ($i=0; $i<$num_rows: $i++) { $row = mysql_fetch_array($result); print ("<option value=\"".$row[some]."\">".$row[some_else]."</option>"); } </select> This works just fine now that I don’t have 2 or more rows with the “some_else” repeated. Is there a WHERE or something like that which I can use for this? Thanks in advancem <mailto:webmastericaam.com.ar> Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621

    attached mail follows:


    Use GROUP_BY in your query on the some_else column

    SELECT * FROM table GROUP BY some_else

    ---John Holmes...

    > -----Original Message----- > From: César Aracena [mailto:icaamicaam.com.ar] > Sent: Saturday, July 20, 2002 3:13 PM > To: PHP General List; PHP DB List > Subject: [PHP] Dynamic menu > > Hi all. I’m making a few dynamic menus that grab information from a > MySQL DB. What I don’t know is how to print only one line of each. I > don’t want a Drop Down List displaying 4 times the same line if the > information is repeated in 4 rows in the same table. What I’m using is > something like: > > $query = “SELECT * FROM tbl_name”; > $result = mysql_quiery($query) or die(mysql_error()); > $num_rows = mysql_num_rows($result); > > > <select name="select_name"> > <option SELECTED>Select Something</option> > > for ($i=0; $i<$num_rows: $i++) > { > $row = mysql_fetch_array($result); > print ("<option value=\"".$row[some]."\">".$row[some_else]."</option>"); > } > > </select> > > This works just fine now that I don’t have 2 or more rows with the > “some_else” repeated. Is there a WHERE or something like that which I > can use for this? > > Thanks in advancem > > <mailto:webmastericaam.com.ar> Cesar Aracena > CE / MCSE+I > Neuquen, Argentina > +54.299.6356688 > +54.299.4466621 >

    attached mail follows:


    Thanks Mark and John.

    >From the MySQL manual: "The options [for the SELECT statement] DISTINCT, DISTINCTROW and ALL specify whether duplicate rows should be returned. The default is (ALL), all matching rows are returned. DISTINCT and DISTINCTROW are synonyms and specify that duplicate rows in the result set should be removed."

    $query = "SELECT DISTINCT * FROM tbl_name";

    I hope this helps! -Mark

    > Use GROUP_BY in your query on the some_else column > > SELECT * FROM table GROUP BY some_else > > ---John Holmes...

    > > -----Original Message----- > > From: César Aracena [mailto:icaamicaam.com.ar] > > Sent: Saturday, July 20, 2002 3:13 PM > > To: PHP General List; PHP DB List > > Subject: [PHP] Dynamic menu > > > > Hi all. I’m making a few dynamic menus that grab information from a > > MySQL DB. What I don’t know is how to print only one line of each. I > > don’t want a Drop Down List displaying 4 times the same line if the > > information is repeated in 4 rows in the same table. What I’m using is > > something like: > > > > $query = “SELECT * FROM tbl_name”; > > $result = mysql_quiery($query) or die(mysql_error()); > > $num_rows = mysql_num_rows($result); > > > > > > <select name="select_name"> > > <option SELECTED>Select Something</option> > > > > for ($i=0; $i<$num_rows: $i++) > > { > > $row = mysql_fetch_array($result); > > print ("<option > value=\"".$row[some]."\">".$row[some_else]."</option>"); > > } > > > > </select> > > > > This works just fine now that I don’t have 2 or more rows with the > > “some_else” repeated. Is there a WHERE or something like that which I > > can use for this? > > > > Thanks in advancem > > > > <mailto:webmastericaam.com.ar> Cesar Aracena > > CE / MCSE+I > > Neuquen, Argentina > > +54.299.6356688 > > +54.299.4466621 > >

    attached mail follows:


    > I am not very happy how generaly boolean comparison is solved in > PHP...but I checked different stuff and like this shouldn't be: > ---- > <? > $a="null"; > if ($a="dwa") { // one sign = so it is OK > echo "OK"; > } > if ($a=true) { > echo "OK"; > } > if ($a=false) { > echo "OK"; //but it is not written!!!!!!! > } > ?> > I tested it in PHP4.2.0 (LINUX)

    Well your problem is you're not doing ANY comparisons. Your if statements are assigning values. Not comparing...to compare you need to use == , not just =. With your current statements, each if statement will always be true, just the value of $a changes at each if.

    <? $a="null"; if ($a=="dwa") { // one sign = so it is OK echo "OK"; } if ($a==true) { echo "OK"; } if ($a==false) { echo "OK"; //but it is not written!!!!!!! } ?>

    Is what you need. Also for me boolean checks in my opinion are much simplier if you use 1-0 for the comparison (but use what you need, I don't know your entire code).

    Sincerely,

    Craig Vincent

    attached mail follows:


    check out this page: http://www.clickatell.com/central/skins/converters/convert_bitmaps.php

    they wont give me a copy of this script. so i need to write my own. i would just access the script from my servers, with fopen(), but i couldnt think of a way to do this with a file upload....

    willing to pay for a solution

    attached mail follows:


    Try the "SELECT DISTINCT" syntax in MySQL

    From the MySQL manual: "The options [for the SELECT statement] DISTINCT, DISTINCTROW and ALL specify whether duplicate rows should be returned. The default is (ALL), all matching rows are returned. DISTINCT and DISTINCTROW are synonyms and specify that duplicate rows in the result set should be removed."

    $query = "SELECT DISTINCT * FROM tbl_name";

    I hope this helps! -Mark

    > -----Original Message----- > From: César Aracena [mailto:icaamicaam.com.ar] > Sent: Saturday, July 20, 2002 12:13 PM > To: PHP General List; PHP DB List > Subject: [PHP-DB] Dynamic menu > > > Hi all. I’m making a few dynamic menus that grab information from a > MySQL DB. What I don’t know is how to print only one line of each. I > don’t want a Drop Down List displaying 4 times the same line if the > information is repeated in 4 rows in the same table. What I’m using is > something like: > > $query = “SELECT * FROM tbl_name”; > $result = mysql_quiery($query) or die(mysql_error()); > $num_rows = mysql_num_rows($result); > > > <select name="select_name"> > <option SELECTED>Select Something</option> > > for ($i=0; $i<$num_rows: $i++) > { > $row = mysql_fetch_array($result); > print ("<option value=\"".$row[some]."\">".$row[some_else]."</option>"); > } > > </select> > > This works just fine now that I don’t have 2 or more rows with the > “some_else” repeated. Is there a WHERE or something like that which I > can use for this? > > Thanks in advancem > > <mailto:webmastericaam.com.ar> Cesar Aracena > CE / MCSE+I > Neuquen, Argentina > +54.299.6356688 > +54.299.4466621 > >

    attached mail follows:


    Script ABC.php is located at http://www.xyz.com/ABC.php echo $SCRIPT_NAME would return ABC.php echo $SOMETHING_HERE should return xyz.com or www.xyz.com

    --> What should be in the $SOMETHING_HERE spot?

    I need this to also work with something such as http://12.24.48.96/ABC.php where echo $SOMETHING_HERE would return 12.24.48.96

    thanks

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    Look at $_SERVER['HTTP_HOST'] for the www.thesite.com version and $_SERVER['LOCAL_ADDR'] for the IP

    Matt Babineau MCWD / CCFD ----------------------------------------- e: mattcriticalcode.com p: 603.943.4237 w: http://www.criticalcode.com PO BOX 601 Manchester, NH 03105

    -----Original Message----- From: Police Trainee [mailto:policetraineeyahoo.com] Sent: Saturday, July 20, 2002 3:56 PM To: PHP Subject: [PHP] how do i get the domain that the script is called from?

    Script ABC.php is located at http://www.xyz.com/ABC.php echo $SCRIPT_NAME would return ABC.php echo $SOMETHING_HERE should return xyz.com or www.xyz.com

    --> What should be in the $SOMETHING_HERE spot?

    I need this to also work with something such as http://12.24.48.96/ABC.php where echo $SOMETHING_HERE would return 12.24.48.96

    thanks

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

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

    attached mail follows:


    here is what i try to accpmplish: $key "name's" in an array are: a1, a2, a3, .... . $value dependes weather it has been checked, selected or entered.

    while (list($k, $v) = each($data)) { for ($i=0; $i<count($k); $i++) { if (substr ($k[$i], 0, 1) == 'a') { if ($k == !$v) { // <-- ???? $sectionA_error = 1; } else { $sectionA_error = 0; } } } } if ($sectionA_error) { echo "Nothing entered.\n<br>"; } else { echo "at least one entry.\n<br>"; }

    what i'm trying to get is: if there is a least one or doesn't matter how many values error = 0, if there is no value than error =1.

    cheers,

    Peter

    attached mail follows:


    for clarification, what I am trying to be able to do is determine whether the user entered "http://www.xyz.com/abc.php" to get to the script or if they entered "http://12.24.48.96/abc.php" to get to the script.

    Thanks

    > Script ABC.php is located at > http://www.xyz.com/ABC.php > echo $SCRIPT_NAME would return ABC.php > echo $SOMETHING_HERE should return xyz.com or > www.xyz.com > > --> What should be in the $SOMETHING_HERE spot? > > I need this to also work with something such as > http://12.24.48.96/ABC.php where echo > $SOMETHING_HERE would return > 12.24.48.96 > > thanks

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    For clarification, did you even try $_SERVER['HTTP_HOST'] like it was suggested?

    ---John Holmes...

    > -----Original Message----- > From: Police Trainee [mailto:policetraineeyahoo.com] > Sent: Saturday, July 20, 2002 5:04 PM > To: PHP > Subject: [PHP] CLARIFICATION: how do i get the domain that the script is > called from? > > for clarification, what I am trying to be able to do > is determine whether the user entered > "http://www.xyz.com/abc.php" to get to the script or > if they entered "http://12.24.48.96/abc.php" to get to > the script. > > Thanks > > > > Script ABC.php is located at > > http://www.xyz.com/ABC.php > > echo $SCRIPT_NAME would return ABC.php > > echo $SOMETHING_HERE should return xyz.com or > > www.xyz.com > > > > --> What should be in the $SOMETHING_HERE spot? > > > > I need this to also work with something such as > > http://12.24.48.96/ABC.php where echo > > $SOMETHING_HERE would return > > 12.24.48.96 > > > > thanks > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - Feel better, live better > http://health.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hello all,

    I've just set out to build a PHP-based mail system that will be able to send HTML e-mails to a variety of mail clients. So far, I'm having moderate success: I can get Yahoo! and Hotmail to see the HTML, but not Netscape Mail or Outlook Express.

    I was wondering, is there anything special I should be putting in my mail() call to achieve broad compatibility? I'm already sending a header that includes:

    MIME-Version: 1.0\r\n Content-type: text/html; charset=iso-8859-1\r\n

    Also, does anyone know of a list of mail client compatiblity levels with HTML e-mail?

    Thanks, Alex Kirk

    attached mail follows:


    I am just getting started with functions, and have checked the manual and Core PHP Programming but I'm still missing something.

    I have two functions in the same PHP file

    BTW "$SEARCHDATE" is in this format YYYYMMDD such as 20020720 for July 20th, 2002

    function set_search_info ($SEARCHDATE) { global $SEARCHYEAR ; global $SEARCHMONTH ; global $SEARCHDAY ; $SEARCHYEAR = substr("$SEARCHDATE", 0,4); $SEARCHMONTH = substr("$SEARCHDATE", -4,-2); $SEARCHDAY = substr("$SEARCHDATE", -2); }

    function get_yesterday_info ($YESTERDAY) {

    global $YESTERDAYHUMAN ; global $YESTERDAYLINK ; global $PREVIOUSCOMMENT ; global $LINKBACK ;

    $YESTERDAYHUMAN = strftime("%B %d %Y",mktime(0,0,0,$SEARCHMONTH,$SEARCHDAY-1,$SEARCHYEAR));

    $YESTERDAYLINK = "&lt;&lt; <a href=\"$SCRIPT?$YESTERDAY\">$YESTERDAYHUMAN</a>";

    $PREVIOUSCOMMENT = Exec("/usr/bin/rdjpgcom images/$YESTERDAY.jpg");

    $LINKBACK = "yes" ; }

    But $YESTERDAYHUMAN keeps getting set to: November 29 1999 even though $SEARCHYEAR and $SEARCHMONTH and $SEARCHDAY are set properly outside of get_yesterday_info

    Thanks TjL

    attached mail follows:


    Why not?

    Bruce Karstedt President Technology Consulting Associates, Ltd. Tel: 847-735-9488 Fax: 847-735-9474

    -----Original Message----- From: skellerhealthtvchannel.org [mailto:skellerhealthtvchannel.org] Sent: Friday, July 19, 2002 11:38 AM To: php-generallists.php.net Subject: RE: [PHP] Re: Forms problem? Importance: Low

    > Or get an editor that understands PHP and JavaScript that > will color-code it all for you.

    Homesite... w00t!

    Just don't try to use Homesite as a WYSIWYG editor.

    ~Steve-o

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