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: Fri Jan 31 2003 - 18:09:23 CST

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

    php-general Digest 1 Feb 2003 00:09:23 -0000 Issue 1856

    Topics (messages 133757 through 133842):

    Re: PHP & Apache
            133757 by: John W. Holmes

    Re: iCal parser and importing iCal to database
            133758 by: Jerry Artman

    Re: Send commands to a shell program
            133759 by: Marek Kilimajer

    Unable to upload multiple files
            133760 by: Antti
            133763 by: Justin French
            133769 by: Antti
            133773 by: Marek Kilimajer
            133774 by: Jason Wong
            133777 by: Antti
            133780 by: John W. Holmes
            133781 by: Antti
            133782 by: John W. Holmes
            133784 by: Antti
            133785 by: Marek Kilimajer
            133788 by: Antti
            133792 by: John W. Holmes
            133795 by: Marek Kilimajer
            133798 by: Jason Wong
            133808 by: Antti
            133840 by: John W. Holmes

    Re: reading attachmentsl
            133761 by: Chris Hayes

    Exclusion in Regex not working
            133762 by: SLanger.spirit21.de
            133764 by: Chris Hayes
            133765 by: Justin French

    Re: + in filenames
            133766 by: Marek Kilimajer
            133772 by: ed.home.homes2see.com

    HTTP || FTP Upload? Wich one?
            133767 by: Evan

    Re: Making a file manager with PHP?
            133768 by: Marek Kilimajer

    Re: Introduction
            133770 by: Julie Williams
            133775 by: Jason Wong
            133796 by: Julie Williams
            133797 by: John Nichel
            133799 by: Marek Kilimajer
            133802 by: Julie Williams
            133804 by: John Nichel

    Newsletter using PHP and MySQL
            133771 by: Steve Vernon

    checkboxes and php...
            133776 by: Mr. BuNgL3
            133778 by: Matt Schroebel

    Re: mysq_connect()
            133779 by: Chris Hewitt

    Problems with 4.3.0 cli and paths
            133783 by: Robert Mena
            133786 by: Marek Kilimajer

    How to enter username and Password from PHP script?
            133787 by: Ananth Kesari

    another problem with 4.3.0 : imagecreatefromjpeg undefined
            133789 by: Robert Mena

    Global "structures" (newbie)
            133790 by: Karina S

    How can I... force some HTML tags for all links to jpg files.
            133791 by: Al

    Delete files via PHP
            133793 by: Miguel Brás
            133794 by: Řyvind Vestavik
            133817 by: Miguel Brás

    Installing PHP on Apache 2 and FreeBSD
            133800 by: Jacob Bolton
            133807 by: Chris Hewitt

    Re: PHP - mysql_info question
            133801 by: Mark McCulligh

    Strange session-problem with php-file in <img src…
            133803 by: Victor Spĺng Arthursson

    Re: .php extensions versus .html
            133805 by: Chris Shiflett

    Re: need some guidance
            133806 by: Seth Hopkins

    Re: Strange_session-problem_with_php-file_in_<img_src…
            133809 by: Chris Shiflett
            133810 by: Victor Spĺng Arthursson

    php ISA v.s. php CGI
            133811 by: Victor

    Question
            133812 by: Mike Tuller
            133814 by: John W. Holmes

    Opera form oddity
            133813 by: bill

    Form Processing - Multiple inputs of the same name
            133815 by: Mike Potter
            133816 by: Tracy Finifter Rotton
            133818 by: Philip Olson

    Re:_[PHP]_Strange_session-problem_with_php-file_in_<img_src…
            133819 by: Chris Shiflett

    Followup on form problems
            133820 by: Julie Williams
            133821 by: John W. Holmes
            133822 by: John W. Holmes

    Installation problems
            133823 by: Jacob Bolton

    move a record into a different table
            133824 by: DC
            133827 by: Mr. BuNgL3
            133831 by: Kevin Stone
            133833 by: Paul Roberts

    doing auto number myself to a primary key...
            133825 by: Mr. BuNgL3
            133828 by: Kevin Stone
            133839 by: John W. Holmes

    Script to export MySQL structure & data
            133826 by: Janos Rusiczki
            133829 by: Brent Baisley
            133834 by: Janos Rusiczki
            133841 by: Mark McCulligh

    Help Needed
            133830 by: Pushpinder Singh Garcha
            133832 by: Kevin Stone

    new to php/mysql
            133835 by: Sam
            133836 by: Matt
            133837 by: Janos Rusiczki

    how can I start running a perl cgi from php
            133838 by: qt
            133842 by: Jason Wong

    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:


    > $name = ab;
    > Notice: Use of undefined constant ab - assumed 'ab' in
    > c:\inetpub\wwwroot\sdd\pages\name&age.php on line 3

    <rant>
    Honestly, do you read the error messages or do you just post them to the
    list? You need to stop using us for the easy answer and do a little
    looking yourself. For example... when I see that error, I'm going to ask
    my self "why is PHP thinking ab is a constant?" Do I mean it to be a
    constant? If so, I must of forgot to define() it somewhere. If it's not
    supposed to be a constant, what is it supposed to be? An integer... well
    a and b don't make very good integers, so probably not. It's supposed to
    be a string, right? So why is PHP thinking it's a constant? At this
    point, if I didn't know what was going on, I'd go to the manual and read
    the chapter on variable types and the sections on constants and
    strings... to learn what the difference is. I'll guarantee that if you
    actually read those sections, you'd realize... on your own... (imagine
    that) that strings have to be surrounded by quotes... either single or
    double (the section will even explain the difference). So now you'd know
    the answer, you found it yourself, you maybe learned a few other things
    as you read, and I bet you would have gotten your answer a lot faster
    than waiting for answers on a mailing list...
    </rant>

    ---John W. Holmes...

    PHP Architect - A monthly magazine for PHP Professionals. Get your copy
    today. http://www.phparch.com/

    attached mail follows:


    Just drop on over to

    http://phpicalendar.sourceforge.net/nuke/

    and I think you'll find what you are looking for.

    Jerry Artman
    Budget and Reimbursement
    gartmlssm.org

    attached mail follows:


    popen might help you, but if you want to control programs from a
    browser, you will encounter one problem - once your script is finished,
    your program is closed too.

    Antti wrote:

    > I want to for example give commands to mpg321 when it is executed with
    > the -R option (remote control mode). Is this possible with exec() or
    > other execute php functions. What I mean is to execute commands while
    > being in a shell program. Hope you got it!
    >
    > antti
    >
    >

    attached mail follows:


    When I push the submit button it starts to send the request to my server
    and uploads a file, but if I upload more than one at a time it doesn't
    even start to upload them. My upload max should be like 50M in php.ini.
    What is the problem.

    antti

    attached mail follows:


    Firstly, try uploading two SMALL files (say, no more than 1k each), just to
    check if it's an issue with *two files*, or an issue with *file size*,
    *script time outs* (maximum execution time) or something else.

    Start ruling them out, one at a time.

    Justin

    on 01/02/03 12:03 AM, Antti (anttivictoria.fi) wrote:

    > When I push the submit button it starts to send the request to my server
    > and uploads a file, but if I upload more than one at a time it doesn't
    > even start to upload them. My upload max should be like 50M in php.ini.
    > What is the problem.
    >
    > antti
    >

    attached mail follows:


    Justin French wrote:
    > Firstly, try uploading two SMALL files (say, no more than 1k each), just to
    > check if it's an issue with *two files*, or an issue with *file size*,
    > *script time outs* (maximum execution time) or something else.
    >
    > Start ruling them out, one at a time.
    >
    > Justin
    >
    >
    > on 01/02/03 12:03 AM, Antti (anttivictoria.fi) wrote:
    >
    >
    >>When I push the submit button it starts to send the request to my server
    >>and uploads a file, but if I upload more than one at a time it doesn't
    >>even start to upload them. My upload max should be like 50M in php.ini.
    >>What is the problem.
    >>
    >>antti
    >>
    >
    >

    Two 1 kb files went trough but not two mp3's. What are the critical
    lines in php.ini in this case? Maybe I have missed something...?

    antti

    attached mail follows:


    check max_post_size in php.ini

    Antti wrote:

    > When I push the submit button it starts to send the request to my
    > server and uploads a file, but if I upload more than one at a time it
    > doesn't even start to upload them. My upload max should be like 50M in
    > php.ini. What is the problem.
    >
    > antti
    >
    >

    attached mail follows:


    On Friday 31 January 2003 21:47, Antti wrote:
    > Justin French wrote:
    > > Firstly, try uploading two SMALL files (say, no more than 1k each), just
    > > to check if it's an issue with *two files*, or an issue with *file size*,
    > > *script time outs* (maximum execution time) or something else.
    > >
    > > Start ruling them out, one at a time.

    > > on 01/02/03 12:03 AM, Antti (anttivictoria.fi) wrote:
    > >>When I push the submit button it starts to send the request to my server
    > >>and uploads a file, but if I upload more than one at a time it doesn't
    > >>even start to upload them. My upload max should be like 50M in php.ini.
    > >>What is the problem.
    > >>
    > >>antti
    >
    > Two 1 kb files went trough but not two mp3's. What are the critical
    > lines in php.ini in this case? Maybe I have missed something...?

    As Justin suggested "Start ruling them out, one at a time". You've ruled out
    one (number of files). Now figure out whether it's the size. Upload
    successfully larger files until it fails (or otherwise).

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    http://marc.theaimsgroup.com/?l=php-general
    ------------------------------------------
    /*
    To stay youthful, stay useful.
    */
    

    attached mail follows:


    Marek Kilimajer wrote: > check max_post_size in php.ini > > Antti wrote: > >> When I push the submit button it starts to send the request to my >> server and uploads a file, but if I upload more than one at a time it >> doesn't even start to upload them. My upload max should be like 50M in >> php.ini. What is the problem. >> >> antti >> >> >

    Ok now I am able to send the request. I set the post_max_size into 50M and now when the request is sent the whole apache goes down giving: "The document containd no data" everytime I send a request. I tried also 10M but same happens. What the h**l is this?

    antti

    attached mail follows:


    > Ok now I am able to send the request. I set the post_max_size into 50M > and now when the request is sent the whole apache goes down giving: "The > document containd no data" everytime I send a request. I tried also 10M > but same happens. What the h**l is this?

    Do you have this line in your form?

    <input type="hidden" name="MAX_FILE_SIZE" value="30000">

    and is it set to a value greater than the size of all the files you're trying to upload? Some browers actually pay attention to this.

    ---John Holmes...

    attached mail follows:


    1lt John W. Holmes wrote: >>Ok now I am able to send the request. I set the post_max_size into 50M >>and now when the request is sent the whole apache goes down giving: "The >>document containd no data" everytime I send a request. I tried also 10M >>but same happens. What the h**l is this? > > > Do you have this line in your form? > > <input type="hidden" name="MAX_FILE_SIZE" value="30000"> > > and is it set to a value greater than the size of all the files you're > trying to upload? Some browers actually pay attention to this. > > ---John Holmes... >

    No, I don't have that line.

    attached mail follows:


    > >>Ok now I am able to send the request. I set the post_max_size into 50M > >>and now when the request is sent the whole apache goes down giving: "The > >>document containd no data" everytime I send a request. I tried also 10M > >>but same happens. What the h**l is this? > > > > > > Do you have this line in your form? > > > > <input type="hidden" name="MAX_FILE_SIZE" value="30000"> > > > > and is it set to a value greater than the size of all the files you're > > trying to upload? Some browers actually pay attention to this. > > > > ---John Holmes... > > > > No, I don't have that line.

    Try it then...

    ---John Holmes...

    attached mail follows:


    1lt John W. Holmes wrote: >>>>Ok now I am able to send the request. I set the post_max_size into 50M >>>>and now when the request is sent the whole apache goes down giving: "The >>>>document containd no data" everytime I send a request. I tried also 10M >>>>but same happens. What the h**l is this? >>> >>> >>>Do you have this line in your form? >>> >>><input type="hidden" name="MAX_FILE_SIZE" value="30000"> >>> >>>and is it set to a value greater than the size of all the files you're >>>trying to upload? Some browers actually pay attention to this. >>> >>>---John Holmes... >>> >> >>No, I don't have that line. > > > Try it then... > > ---John Holmes... >

    No affect. Still gives the "The document contains no data".

    attached mail follows:


    Show us the code

    Antti wrote:

    > 1lt John W. Holmes wrote: > >>>>> Ok now I am able to send the request. I set the post_max_size into >>>>> 50M >>>>> and now when the request is sent the whole apache goes down >>>>> giving: "The >>>>> document containd no data" everytime I send a request. I tried >>>>> also 10M >>>>> but same happens. What the h**l is this? >>>> >>>> >>>> >>>> Do you have this line in your form? >>>> >>>> <input type="hidden" name="MAX_FILE_SIZE" value="30000"> >>>> >>>> and is it set to a value greater than the size of all the files you're >>>> trying to upload? Some browers actually pay attention to this. >>>> >>>> ---John Holmes... >>>> >>> >>> No, I don't have that line. >> >> >> >> Try it then... >> >> ---John Holmes... >> > > No affect. Still gives the "The document contains no data". > >

    attached mail follows:


    Marek Kilimajer wrote: > Show us the code > > Antti wrote: > >> 1lt John W. Holmes wrote: >> >>>>>> Ok now I am able to send the request. I set the post_max_size into >>>>>> 50M >>>>>> and now when the request is sent the whole apache goes down >>>>>> giving: "The >>>>>> document containd no data" everytime I send a request. I tried >>>>>> also 10M >>>>>> but same happens. What the h**l is this? >>>>> >>>>> >>>>> >>>>> >>>>> Do you have this line in your form? >>>>> >>>>> <input type="hidden" name="MAX_FILE_SIZE" value="30000"> >>>>> >>>>> and is it set to a value greater than the size of all the files you're >>>>> trying to upload? Some browers actually pay attention to this. >>>>> >>>>> ---John Holmes... >>>>> >>>> >>>> No, I don't have that line. >>> >>> >>> >>> >>> Try it then... >>> >>> ---John Holmes... >>> >> >> No affect. Still gives the "The document contains no data". >> >> >

    The upload form: (There are ofcourse many of of the first three inputs.) <form action='$PHP_SELF' method='POST' enctype='multipart/form-data'>

    <input class='form' type='text' size='3' name='tracknum[]' value='$tracks'> <input class='form' type='text' size='25' name='uartist[]' value='$uartist'> <input class='form' type='text' size='25' name='usong[]' value=''>

    <input type='hidden' name='MAX_FILE_SIZE' value='10000'> <input type='hidden' name='upload' value='yes'> <input class='nappi' type='submit' name='submit' value='Upload songs'>

    And the php part:

    $number_of_files = count($_FILES['userfile']); for ($i=0; $i < $number_of_files; $i++) { if ($_FILES['userfile']['size'] !== 0) { $namename= "$uartist[$i]-$usong[$i].mp3"; $file=$_FILES['userfile']['tmp_name'][$i]; if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], "/mp3/$namename")) { print "<tr><td>File $namename upload and rename succesful!</td></tr>"; } } else { print "<tr><td>You have to upload some files!</td></tr>"; } }

    antti

    attached mail follows:


    > <input type='hidden' name='MAX_FILE_SIZE' value='10000'>

    You're saying you're only uploading 10K total... for all of the files. If the browser is respecting this, and you're trying to upload more than 10K, then it could not upload anything and you get your error.

    If it was a PHP issue, it seems like you'd get an error or warning from PHP, not from the web server (which is where "document contains no data" would come from, I assume?)

    ---John Holmes...

    attached mail follows:


    > The upload form: (There are ofcourse many of of the first three inputs.) > <form action='$PHP_SELF' method='POST' enctype='multipart/form-data'> > > <input class='form' type='text' size='3' name='tracknum[]' > value='$tracks'> > <input class='form' type='text' size='25' name='uartist[]' > value='$uartist'> > <input class='form' type='text' size='25' name='usong[]' value=''>

    I assume here should be <input class='form' type='file' size='25' name='userfile[]'>

    > <input type='hidden' name='MAX_FILE_SIZE' value='10000'> > <input type='hidden' name='upload' value='yes'> > <input class='nappi' type='submit' name='submit' value='Upload songs'> > > > And the php part: > > $number_of_files = count($_FILES['userfile']);

    $number_of_files will be 5 if any number of files is uploaded, cause you count $_FILES['userfile']['size'], $_FILES['userfile']['name'], $_FILES['userfile']['tmp_name'], $_FILES['userfile']['error'] and $_FILES['userfile']['type'] You can count $_FILES['userfile']['tmp_name'] instead

    > > for ($i=0; $i < $number_of_files; $i++) > { > if ($_FILES['userfile']['size'] !== 0)

    use $_FILES['userfile']['size'][$i] here

    > > { > $namename= "$uartist[$i]-$usong[$i].mp3"; > $file=$_FILES['userfile']['tmp_name'][$i]; > if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], > "/mp3/$namename")) > { > print "<tr><td>File $namename upload and rename > succesful!</td></tr>"; > } > } > else > { > print "<tr><td>You have to upload some files!</td></tr>"; > } > } > > antti > > >

    attached mail follows:


    On Friday 31 January 2003 22:33, 1LT John W. Holmes wrote: > > >>Ok now I am able to send the request. I set the post_max_size into 50M > > >>and now when the request is sent the whole apache goes down giving: > > >> "The document containd no data" everytime I send a request. I tried > > >> also 10M but same happens. What the h**l is this? > > > > > > Do you have this line in your form? > > > > > > <input type="hidden" name="MAX_FILE_SIZE" value="30000"> > > > > > > and is it set to a value greater than the size of all the files you're > > > trying to upload? Some browers actually pay attention to this.

    > > No, I don't have that line. > > Try it then...

    Please don't perpetuate this urban legend :-)

    _Not_ having that line has no effect on uploads (ie does NOT prevent uploads).

    However _having_ that line _may_ prevent uploads.

    Thus if you have trouble with uploads then you should NOT have that line. As most browsers don't give a monkey about that line there is no reason to have it, period.

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    http://marc.theaimsgroup.com/?l=php-general
    ------------------------------------------
    /*
    Ray's Rule of Precision:
    	Measure with a micrometer.  Mark with chalk.  Cut with an axe.
    */
    

    attached mail follows:


    1lt John W. Holmes wrote: >><input type='hidden' name='MAX_FILE_SIZE' value='10000'> > > > You're saying you're only uploading 10K total... for all of the files. If > the browser is respecting this, and you're trying to upload more than 10K, > then it could not upload anything and you get your error. > > If it was a PHP issue, it seems like you'd get an error or warning from PHP, > not from the web server (which is where "document contains no data" would > come from, I assume?) > > ---John Holmes... >

    That 10 k is not the right value that I had. I had 100000 but just edited it and it changed when I pasted it here. So that is not the proglem.

    After all these changes it still doesn't work =(...

    antti

    attached mail follows:


    > <input class='form' type='text' size='3' name='tracknum[]' > value='$tracks'> > <input class='form' type='text' size='25' name='uartist[]' > value='$uartist'> > <input class='form' type='text' size='25' name='usong[]' value=''> > > > <input type='hidden' name='MAX_FILE_SIZE' value='10000'> > <input type='hidden' name='upload' value='yes'> > <input class='nappi' type='submit' name='submit' value='Upload songs'> > > > And the php part: > > $number_of_files = count($_FILES['userfile']); > for ($i=0; $i < $number_of_files; $i++) > { > if ($_FILES['userfile']['size'] !== 0) > { > $namename= "$uartist[$i]-$usong[$i].mp3"; > $file=$_FILES['userfile']['tmp_name'][$i]; > if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], > "/mp3/$namename")) > { > print "<tr><td>File $namename upload and rename > succesful!</td></tr>"; > } > } > else > { > print "<tr><td>You have to upload some files!</td></tr>"; > } > }

    You don't even have a "file" form element, or an element named "userfile" so your FOR loop will never run...

    ---John W. Holmes...

    PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

    attached mail follows:


    At 11:11 31-1-2003, you wrote: >hi all > > I'm writing a mail client and I got problem with attachments. I have no >idea how to read and save attachments. Mayby someone already did something >like that a can help me with some advice or giving me link to some >resourses. Maybe it helps to see how an attachment is send, then you can try to reverse the process to read in attachments.

    assume that $filedata holds the data you want to attach the encoding can done in many ways, so read the headers carefully

    //prepare mail body $filedata = chunk_split(base64_encode($filedata)); $type = "application/octet-stream"; $encoding = "base64"; mt_srand((double)microtime()*1000000); $boundary = '--b'.md5(uniqid(mt_rand())) . getmypid(); //so the boundary line can be quite diverse $mailbody = "From: PHP backup script by Arakrys\n" ."MIME-Version: 1.0\n" ."Content-Type: multipart/mixed; " ."boundary=\"$boundary\"\n\n" ."This is a MIME encoded message. \n\n" ."--$boundary\n" ."Content-Type: text/plain"; //if ($this->charset != "") $mailbody .= "; charset=$this->charset"; $mailbody .="\n" ."Content-Transfer-Encoding: 8bit\n\n" .$message . "\n\n\n--$boundary"; $data = "Content-Type: $type"."; name = \"$filename\"" ."\n" ."Content-Transfer-Encoding: $encoding" ."\n\n$filedata\n"; $mailbody .= "\n$data\n--$boundary" ."--\n";

    //send mail mail($mailto, $MYSQL_DB.' database backup '.date("d M Y H:i"), ' ', $mailbody) or die ('Could not send email!'); }

    attached mail follows:


    Hello Everyone

    This might be slightly offtopic since I'm not sure its php related but.... I'm working on a script where some inputdata is taken for further processing. For validation purposes I want to make sure certain chars are not part of the input. Basically stuff like $ * :; etc...

    So I'm using ereg(pattern, input) to see if the pattern matches or not.

    Example

    if(ereg($pattern, $input)) { // do allowed stuff } else { // do something for the illegal input } SO for exclusion I build the following pattern [^$] and pass it to ereg above. So if the input includes a $ the ereg should return false and the processing shouldn't take place.

    Well the thing is for $pattern = '[^$]' it doesn't work. Input including '$' is still passed to the allowed stuff code block. So am I doing something wrong or is there a problem with the character coding of my editor

    BtW I'm using W2K with PHP 4.1.x Apache 1.3.X and TextPad 4.x for editing. I save my scripts as ANSI format. Meaning only legal ASCII Characters + German extended code page.

    Can anybody help me?

    I also tried [^a] as a pattern but the input can contain a and slip through.

    attached mail follows:


    At 14:11 31-1-2003, you wrote:

    >So I'm using ereg(pattern, input) to see if the pattern matches or not. > >SO for exclusion I build the following pattern [^$] and pass it to ereg >above. So if the input includes a $ the ereg should return false and the >processing shouldn't take place. > >Well the thing is for $pattern = '[^$]' it doesn't work. Input including >'$' is still passed to the allowed stuff code block. I remember something like $ had to be double escaped like \\$

    attached mail follows:


    Can I make a suggestion?

    I tend to look at the issue of user input the other way around... rather than excluding things I don't think I want, I choose in allow things I *DO* want... so instead of saying a username shouldn't contain !#$%^&*()_+-=<>?":';, I say it should contain a-zA-Z0-9_-.

    This means that I allow what I trust, rather than assuming I can think of every possible "bad" character the user might choose.

    <? // a-zA-Z0-9_ are valid in this case if(preg_match("/^[a-zA-Z0-9_]*$/", $username)) { // good } else { // bad } ?>

    To answer your question, (and i've got ZERO experience with regexp's, and the above regexp was written for me by someone on this list!) is that you need to escape some characters, like a $ sign, with a \.

    Cheers,

    Justin

    on 01/02/03 12:11 AM, SLangerspirit21.de (SLangerspirit21.de) wrote:

    > Hello Everyone > > This might be slightly offtopic since I'm not sure its php related but.... > I'm working on a script where some inputdata is taken for further > processing. For validation purposes I want to make sure certain chars are > not part of the input. Basically stuff like $ * :; etc... > > So I'm using ereg(pattern, input) to see if the pattern matches or not. > > Example > > if(ereg($pattern, $input)) > { > // do allowed stuff > } > else > { > // do something for the illegal input > } > SO for exclusion I build the following pattern [^$] and pass it to ereg > above. So if the input includes a $ the ereg should return false and the > processing shouldn't take place. > > Well the thing is for $pattern = '[^$]' it doesn't work. Input including > '$' is still passed to the allowed stuff code block. > So am I doing something wrong or is there a problem with the character > coding of my editor > > BtW I'm using W2K with PHP 4.1.x Apache 1.3.X and TextPad 4.x for editing. > I save my scripts as ANSI format. Meaning only legal ASCII Characters + > German extended code page. > > Can anybody help me? > > I also tried [^a] as a pattern but the input can contain a and slip > through. > >

    attached mail follows:


    I use this: $name=strtr( $name, " ?*#$%^:+=<>/\"", "______________");

    Victor wrote:

    >I DO want preserve the filenames, and the pluses come from the user >(beta testers that deliberately try to hack the script) . all I want to >do is make sure the the script doeasnt breack when a user uploads a file >that has the + character in it's name. > >- Vic > >-----Original Message----- >From: Richard Whitney [mailto:rwxend.net] >Sent: Saturday, January 25, 2003 5:32 PM >To: Victor >Cc: php-generallists.php.net >Subject: RE: [PHP] + in filenames > >Victor! > >What are you trying to accomplish? >Do you want to preserve the original filename? >Why not give uploaded files uniformly unique names? > >In other words, where are the +'s coming from? > >So, a little more detail, please! > >RW > > >Quoting Victor <siliconhypeyahoo.ca>: > >### Here is some sample code: >### >### ________________________________________________ >### >### $file_name = explode(".", $_FILES['picture']['name']); >### $name = str_replace('', '_', $file_name[0]); >### >### # check if file uploaded is good >### if >### ( >### !in_array($_FILES['picture']['type'], >### $file_type) >### || trim($_FILES['picture']['tmp_name']) == "" >### || trim($_FILES['picture']['tmp_name']) == >### "none" >### ) >### { >### echo ('You can upload a JPG or JPEG filetype >### only.'); >### >### exit; >### } >### >### # Add slashes to prevent certain errors >### $picture_name = strip_tags($_FILES['picture']['name']); >### $picture_name = addslashes($picture_name); >### $picture_name = str_replace("\r\n", "", $picture_name); >### $picture_name = str_replace(" ", "", $picture_name); >### >### ____________________________________________________ >### >### -----Original Message----- >### From: Richard Whitney [mailto:rwxend.net] >### Sent: Saturday, January 25, 2003 5:12 PM >### To: Victor >### Cc: php-generallists.php.net >### Subject: Re: [PHP] + in filenames >### >### Some sample code would help, but maybe try urldecode('$filename'); >### >### RW >### >### Quoting Victor <victorargilent.com>: >### >### ### I have a file upload field, and some filename checking code, but >it >### ### breaks the code whenever a + is inside the filename it verifies >### space >### ### and other tags but breaks on + in the name. Anyone know a fix >for >### this >### ### please? >### ### >### ### - Vic >### ### >### ### >### >______________________________________________________________________ >### ### Post your free ad now! http://personals.yahoo.ca >### ### >### ### -- >### ### PHP General Mailing List (http://www.php.net/) >### ### To unsubscribe, visit: http://www.php.net/unsub.php >### ### >### ### >### >### >### -- >### Richard Whitney >### Transcend Development >### Producing the next phase of your internet presence. >### rwxend.net >### http://xend.net >### 602-971-2791 >### >### -- >### PHP General Mailing List (http://www.php.net/) >### To unsubscribe, visit: http://www.php.net/unsub.php >### >### >______________________________________________________________________ >### Post your free ad now! http://personals.yahoo.ca >### >### -- >### PHP General Mailing List (http://www.php.net/) >### To unsubscribe, visit: http://www.php.net/unsub.php >### >### > > > >

    attached mail follows:


    On Fri, 31 Jan 2003, Marek Kilimajer wrote:

    > I use this: > $name=strtr( $name, > " ?*#$%^:+=<>/\"", > "______________"); >

    I'm hoping that double quote was a typo??

    Ed

    attached mail follows:


    Hi to all! I'm working at a simple script that let me upload files in a Intranet. The problem is that these files are videos, so really big (in the order of Gbytes). I think that HTTP upload doesn't fit to solve this problem so I thought about FTP. Can you tell me what do you think about this? What are the maxsizes given for HTTP and FTP in the RFC (don't care about php.ini)? HTTP maxfilesize == 2Gb is it correct? Do you think is better developing a simple application with C++Builder?

    Thanks for your attention, Evan

    attached mail follows:


    Search www.hotscripts.com, I'm sure you will find something

    Max Tappenden wrote:

    >Clear DayHello there. >Basically I'm trying to make a file manager with PHP. >Here's what I need to do >Ok I have artists and coders working for my site >No FTP >I want them to be able to upload/download files from me as and when they please without having to email me the files >The files that will be uploaded and downloaded are with these extentions >.htm >.html >.php >.phps >.jpg >.gif >.swf >I can scrape together the upload bit, but the download bit just runs the file rather than brings up the download feature of the web browser. How can I make it download it? >TIA! > >

    attached mail follows:


    Thanks for the welcome! And naturally, I need help. :-)

    I am just learning PHP, although I have taken programming classes in C and am a little familiar with writing small scripts.

    My husband wrote a simple PHP script for a client of ours, which I have the pleasure of fine-tuning, the idea being to get me to learn PHP.

    Well, the script doesn't do what it should, and neither I nor even my husband can figure out why. Hopefully, someone here can guide us as to what we are doing wrong. :-)

    Basically, all the script does (or should do) is build an e-mail to a client based on a set of variables defined by the user, using an HTML form. It is also supposed to warn the user with a "print" message whenever a variable is missing. The form is at the following address: http://www.swedishengineering.com/newsite/requestresponse.html

    I've saved the script in text format so that you can look at, it is located at the following address: http://www.swedishengineering.com/newsite/requestresponse.rtf

    The errors are as follows:

    When the customer's e-mail is omitted, a print message should appear, to the effect of "Hey, you need to specify the e-mail!". However, when the e-mail is omitted *and* one of the options is clicked, the message does not appear, but rather, the user gets re-directed to the index page.

    When the "Parts" option is chosen, but no parts are indicated, a print message should appear to let the user know that a part number needs to be entered. However, the script bypasses this and builds the e-mail anyway.

    I hope this makes sense and would greatly appreciate any help.

    Thanks!!

    Julie

    -----Original Message----- From: Mike Kercher [mailto:mikeCamaroSS.net] Sent: Thursday, January 30, 2003 6:21 PM To: 'Julie Williams' Subject: RE: [PHP] Introduction

    You have the right address and welcome

    -----Original Message----- From: Julie Williams [mailto:julienaturalwebs.com] Sent: Thursday, January 30, 2003 11:07 PM To: php-generallists.php.net Subject: [PHP] Introduction

    Hello everyone,

    I just subscribed to the list and wanted to say hello. Also to check if I have the right address.

    :-)

    Julie Williams

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

    attached mail follows:


    On Saturday 01 February 2003 00:47, Julie Williams wrote:

    > Basically, all the script does (or should do) is build an e-mail to a > client based on a set of variables defined by the user, using an HTML form. > It is also supposed to warn the user with a "print" message whenever a > variable is missing. The form is at the following address: > http://www.swedishengineering.com/newsite/requestresponse.html > > I've saved the script in text format so that you can look at, it is located > at the following address: > http://www.swedishengineering.com/newsite/requestresponse.rtf

    If your code isn't humungous then you should include it (inline, not as an attachment) with your post. There are many reasons why people would not click on a link to see your code (laziness, or fear of being social-engineered to spread the latest MS-related exploit etc).

    If your code _is_ humungous, then a link might be appropriate and note saying _why_ you're posting a link would be nice.

    Also, your intent to make the code look pretty(?) by converting to RTF seems misguided. Stick to plain-text.

    > The errors are as follows: > > When the customer's e-mail is omitted, a print message should appear, to > the effect of "Hey, you need to specify the e-mail!". However, when the > e-mail is omitted *and* one of the options is clicked, the message does not > appear, but rather, the user gets re-directed to the index page. > > When the "Parts" option is chosen, but no parts are indicated, a print > message should appear to let the user know that a part number needs to be > entered. However, the script bypasses this and builds the e-mail anyway. > > I hope this makes sense and would greatly appreciate any help.

    It's good you that you explain what you're trying to do, and what you expect the program to do, and what actually happens instead. (Some people just say "here's my code, it doesn't work, what's wrong?" -- or words to that effect)

    However it would make more sense if we could see some code :)

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    http://marc.theaimsgroup.com/?l=php-general
    ------------------------------------------
    /*
    Sleep is for the weak and sickly.
    */
    

    attached mail follows:


    Hi Jason,

    Sorry, I'm very new to this. Since my code is not huge, I have included it below. I removed some of the text so that it is less bulky. I hope everything is clear. Thanks for your help!

    <?php //Build email Body based on customer request IF (isset($custemail)) { IF ($request_type=="Service_Advice") { $body = "Thank you for your request for service information..."; $body .= $comments; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: julienaturalwebs.com\r\n"; $headers .= "To: ".$custemail."\r\n";

    mail($custemail, "Your Service Advice Request", $body, $headers);

    header("Location:index.html"); } ELSE IF ($request_type=="Parts_Advice") { $body = "Thank you for your request for parts information..."; $body .= $comments; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: julienaturalwebs.com\r\n"; $headers .= "To: ".$custemail."\r\n";

    mail($custemail, "Your Parts Advice Request", $body, $headers);

    header("Location:index.html"); } ELSE IF ($request_type=="Parts") { IF ((!isset($part1)) && (!isset($part2)) && (!isset($part3)) && (!isset($part4)) && (!isset($part5)) && (!isset($part6))) print ("Please go back and include part information!"); ELSE { $body = "Thank you for your parts request. The information you requested is listed below:<BR>&nbsp;<BR>"; $body .= "<TABLE>"; $body .= "<TR><TH>Part #</TH><TH>Part Name</TH><TH>Price</TH><TH>Shipping</TH><TH>Availability</TH></TR>"; IF (isset($part1)) $body .= "<TR><TD>$part1</TD><TD>$partname1</TD><TD>$price1</TD><TD>$sprice1</TD><TD> $avail1</TD></TR>"; IF (isset($part2)) $body .= "<TR><TD>$part2</TD><TD>$partname2</TD><TD>$price2</TD><TD>$sprice2</TD><TD> $avail2</TD></TR>"; IF (isset($part3)) $body .= "<TR><TD>$part3</TD><TD>$partname3</TD><TD>$price3</TD><TD>$sprice3</TD><TD> $avail3</TD></TR>"; IF (isset($part4)) $body .= "<TR><TD>$part4</TD><TD>$partname4</TD><TD>$price4</TD><TD>$sprice4</TD><TD> $avail4</TD></TR>"; IF (isset($part5)) $body .= "<TR><TD>$part5</TD><TD>$partname5</TD><TD>$price5</TD><TD>$sprice5</TD><TD> $avail5</TD></TR>"; IF (isset($part6)){ $body .= "<TR><TD>$part6</TD><TD>$partname6</TD><TD>$price6</TD><TD>$sprice6</TD><TD> $avail6</TD></TR>"; $body .= "</TABLE>"; $body .= "Our Service departments are located on the following page:<BR>&nbsp;<BR>"; $body .= $comments; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: julienaturalwebs.com\r\n"; $headers .= "To: ".$custemail."\r\n";

    mail($custemail, "Your Parts Request", $body, $headers);

    header("Location:index.html"); } } } ELSE { print ("Please go back and enter the customer's request type!"); } } ELSE { print ("Please go back and enter the customer's email address!"); } ?>

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.biz] Sent: Friday, January 31, 2003 6:15 AM To: php-generallists.php.net Subject: Re: [PHP] Introduction

    On Saturday 01 February 2003 00:47, Julie Williams wrote:

    > Basically, all the script does (or should do) is build an e-mail to a > client based on a set of variables defined by the user, using an HTML form. > It is also supposed to warn the user with a "print" message whenever a > variable is missing. The form is at the following address: > http://www.swedishengineering.com/newsite/requestresponse.html > > I've saved the script in text format so that you can look at, it is located > at the following address: > http://www.swedishengineering.com/newsite/requestresponse.rtf

    If your code isn't humungous then you should include it (inline, not as an attachment) with your post. There are many reasons why people would not click on a link to see your code (laziness, or fear of being social-engineered to spread the latest MS-related exploit etc).

    If your code _is_ humungous, then a link might be appropriate and note saying _why_ you're posting a link would be nice.

    Also, your intent to make the code look pretty(?) by converting to RTF seems misguided. Stick to plain-text.

    > The errors are as follows: > > When the customer's e-mail is omitted, a print message should appear, to > the effect of "Hey, you need to specify the e-mail!". However, when the > e-mail is omitted *and* one of the options is clicked, the message does not > appear, but rather, the user gets re-directed to the index page. > > When the "Parts" option is chosen, but no parts are indicated, a print > message should appear to let the user know that a part number needs to be > entered. However, the script bypasses this and builds the e-mail anyway. > > I hope this makes sense and would greatly appreciate any help.

    It's good you that you explain what you're trying to do, and what you expect the program to do, and what actually happens instead. (Some people just say "here's my code, it doesn't work, what's wrong?" -- or words to that effect)

    However it would make more sense if we could see some code :)

    --
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    http://marc.theaimsgroup.com/?l=php-general
    ------------------------------------------
    /*
    Sleep is for the weak and sickly.
    */
    

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

    attached mail follows:


    Julie,

    What version of PHP? Where is $custemail coming from, form on another page/same page, database? Global variables on or off in your php.ini?

    Julie Williams wrote: > Hi Jason, > > Sorry, I'm very new to this. Since my code is not huge, I have included it > below. I removed some of the text so that it is less bulky. I hope > everything is clear. Thanks for your help! > > > <?php > //Build email Body based on customer request > IF (isset($custemail)) { > IF ($request_type=="Service_Advice") { > $body = "Thank you for your request for service information..."; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Service Advice Request", $body, $headers); > > header("Location:index.html"); > } > ELSE IF ($request_type=="Parts_Advice") { > $body = "Thank you for your request for parts information..."; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Parts Advice Request", $body, $headers); > > header("Location:index.html"); > } > ELSE IF ($request_type=="Parts") { > IF ((!isset($part1)) && (!isset($part2)) && (!isset($part3)) > && (!isset($part4)) && (!isset($part5)) && (!isset($part6))) > print ("Please go back and include part information!"); > ELSE { > $body = "Thank you for your parts request. The information you > requested is listed below:<BR>&nbsp;<BR>"; > $body .= "<TABLE>"; > $body .= "<TR><TH>Part #</TH><TH>Part > Name</TH><TH>Price</TH><TH>Shipping</TH><TH>Availability</TH></TR>"; > IF (isset($part1)) > $body .= > "<TR><TD>$part1</TD><TD>$partname1</TD><TD>$price1</TD><TD>$sprice1</TD><TD> > $avail1</TD></TR>"; > IF (isset($part2)) > $body .= > "<TR><TD>$part2</TD><TD>$partname2</TD><TD>$price2</TD><TD>$sprice2</TD><TD> > $avail2</TD></TR>"; > IF (isset($part3)) > $body .= > "<TR><TD>$part3</TD><TD>$partname3</TD><TD>$price3</TD><TD>$sprice3</TD><TD> > $avail3</TD></TR>"; > IF (isset($part4)) > $body .= > "<TR><TD>$part4</TD><TD>$partname4</TD><TD>$price4</TD><TD>$sprice4</TD><TD> > $avail4</TD></TR>"; > IF (isset($part5)) > $body .= > "<TR><TD>$part5</TD><TD>$partname5</TD><TD>$price5</TD><TD>$sprice5</TD><TD> > $avail5</TD></TR>"; > IF (isset($part6)){ > $body .= > "<TR><TD>$part6</TD><TD>$partname6</TD><TD>$price6</TD><TD>$sprice6</TD><TD> > $avail6</TD></TR>"; > $body .= "</TABLE>"; > $body .= "Our Service departments are located on the following > page:<BR>&nbsp;<BR>"; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Parts Request", $body, $headers); > > header("Location:index.html"); > } > } > } > ELSE { > print ("Please go back and enter the customer's request type!"); > } > } > ELSE { > print ("Please go back and enter the customer's email address!"); > } > ?> > > > > -----Original Message----- > From: Jason Wong [mailto:php-generalgremlins.biz] > Sent: Friday, January 31, 2003 6:15 AM > To: php-generallists.php.net > Subject: Re: [PHP] Introduction > > > On Saturday 01 February 2003 00:47, Julie Williams wrote: > > >>Basically, all the script does (or should do) is build an e-mail to a >>client based on a set of variables defined by the user, using an HTML > > form. > >> It is also supposed to warn the user with a "print" message whenever a >>variable is missing. The form is at the following address: >>http://www.swedishengineering.com/newsite/requestresponse.html >> >>I've saved the script in text format so that you can look at, it is > > located > >>at the following address: >>http://www.swedishengineering.com/newsite/requestresponse.rtf > > > If your code isn't humungous then you should include it (inline, not as an > attachment) with your post. There are many reasons why people would not > click > on a link to see your code (laziness, or fear of being social-engineered to > spread the latest MS-related exploit etc). > > If your code _is_ humungous, then a link might be appropriate and note > saying > _why_ you're posting a link would be nice. > > > Also, your intent to make the code look pretty(?) by converting to RTF seems > misguided. Stick to plain-text. > > >>The errors are as follows: >> >>When the customer's e-mail is omitted, a print message should appear, to >>the effect of "Hey, you need to specify the e-mail!". However, when the >>e-mail is omitted *and* one of the options is clicked, the message does > > not > >>appear, but rather, the user gets re-directed to the index page. >> >>When the "Parts" option is chosen, but no parts are indicated, a print >>message should appear to let the user know that a part number needs to be >>entered. However, the script bypasses this and builds the e-mail anyway. >> >>I hope this makes sense and would greatly appreciate any help. > > > It's good you that you explain what you're trying to do, and what you expect > the program to do, and what actually happens instead. (Some people just say > "here's my code, it doesn't work, what's wrong?" -- or words to that effect) > > However it would make more sense if we could see some code :) > > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > Sleep is for the weak and sickly. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Take a look at http://www.php.net/manual/en/security.registerglobals.php Basicly you should use $_REQUEST['custemail'] ...

    Julie Williams wrote:

    >Hi Jason, > >Sorry, I'm very new to this. Since my code is not huge, I have included it >below. I removed some of the text so that it is less bulky. I hope >everything is clear. Thanks for your help! > > ><?php >//Build email Body based on customer request >IF (isset($custemail)) { > IF ($request_type=="Service_Advice") { > $body = "Thank you for your request for service information..."; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Service Advice Request", $body, $headers); > > header("Location:index.html"); > } > ELSE IF ($request_type=="Parts_Advice") { > $body = "Thank you for your request for parts information..."; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Parts Advice Request", $body, $headers); > > header("Location:index.html"); > } > ELSE IF ($request_type=="Parts") { > IF ((!isset($part1)) && (!isset($part2)) && (!isset($part3)) > && (!isset($part4)) && (!isset($part5)) && (!isset($part6))) > print ("Please go back and include part information!"); > ELSE { > $body = "Thank you for your parts request. The information you >requested is listed below:<BR>&nbsp;<BR>"; > $body .= "<TABLE>"; > $body .= "<TR><TH>Part #</TH><TH>Part >Name</TH><TH>Price</TH><TH>Shipping</TH><TH>Availability</TH></TR>"; > IF (isset($part1)) > $body .= >"<TR><TD>$part1</TD><TD>$partname1</TD><TD>$price1</TD><TD>$sprice1</TD><TD> >$avail1</TD></TR>"; > IF (isset($part2)) > $body .= >"<TR><TD>$part2</TD><TD>$partname2</TD><TD>$price2</TD><TD>$sprice2</TD><TD> >$avail2</TD></TR>"; > IF (isset($part3)) > $body .= >"<TR><TD>$part3</TD><TD>$partname3</TD><TD>$price3</TD><TD>$sprice3</TD><TD> >$avail3</TD></TR>"; > IF (isset($part4)) > $body .= >"<TR><TD>$part4</TD><TD>$partname4</TD><TD>$price4</TD><TD>$sprice4</TD><TD> >$avail4</TD></TR>"; > IF (isset($part5)) > $body .= >"<TR><TD>$part5</TD><TD>$partname5</TD><TD>$price5</TD><TD>$sprice5</TD><TD> >$avail5</TD></TR>"; > IF (isset($part6)){ > $body .= >"<TR><TD>$part6</TD><TD>$partname6</TD><TD>$price6</TD><TD>$sprice6</TD><TD> >$avail6</TD></TR>"; > $body .= "</TABLE>"; > $body .= "Our Service departments are located on the following >page:<BR>&nbsp;<BR>"; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Parts Request", $body, $headers); > > header("Location:index.html"); > } > } > } > ELSE { > print ("Please go back and enter the customer's request type!"); > } >} >ELSE { > print ("Please go back and enter the customer's email address!"); > } >?> > > > >-----Original Message----- >From: Jason Wong [mailto:php-generalgremlins.biz] >Sent: Friday, January 31, 2003 6:15 AM >To: php-generallists.php.net >Subject: Re: [PHP] Introduction > > >On Saturday 01 February 2003 00:47, Julie Williams wrote: > > > >>Basically, all the script does (or should do) is build an e-mail to a >>client based on a set of variables defined by the user, using an HTML >> >> >form. > > >> It is also supposed to warn the user with a "print" message whenever a >>variable is missing. The form is at the following address: >>http://www.swedishengineering.com/newsite/requestresponse.html >> >>I've saved the script in text format so that you can look at, it is >> >> >located > > >>at the following address: >>http://www.swedishengineering.com/newsite/requestresponse.rtf >> >> > >If your code isn't humungous then you should include it (inline, not as an >attachment) with your post. There are many reasons why people would not >click >on a link to see your code (laziness, or fear of being social-engineered to >spread the latest MS-related exploit etc). > >If your code _is_ humungous, then a link might be appropriate and note >saying >_why_ you're posting a link would be nice. > > >Also, your intent to make the code look pretty(?) by converting to RTF seems >misguided. Stick to plain-text. > > > >>The errors are as follows: >> >>When the customer's e-mail is omitted, a print message should appear, to >>the effect of "Hey, you need to specify the e-mail!". However, when the >>e-mail is omitted *and* one of the options is clicked, the message does >> >> >not > > >>appear, but rather, the user gets re-directed to the index page. >> >>When the "Parts" option is chosen, but no parts are indicated, a print >>message should appear to let the user know that a part number needs to be >>entered. However, the script bypasses this and builds the e-mail anyway. >> >>I hope this makes sense and would greatly appreciate any help. >> >> > >It's good you that you explain what you're trying to do, and what you expect >the program to do, and what actually happens instead. (Some people just say >"here's my code, it doesn't work, what's wrong?" -- or words to that effect) > >However it would make more sense if we could see some code :) > > >-- >Jason Wong -> Gremlins Associates -> www.gremlins.biz >Open Source Software Systems Integrators >* Web Design & Hosting * Internet & Intranet Applications Development * >------------------------------------------ >Search the list archives before you post >http://marc.theaimsgroup.com/?l=php-general >------------------------------------------ >/* >Sleep is for the weak and sickly. >*/ > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > >

    attached mail follows:


    Hi John,

    The variables are coming from a form, located at:

    http://www.swedishengineering.com/newsite/requestresponse.html

    I don't know what version of PHP or if the global variables are on or off. I would have to ask the client who their provider is and contact them. I'm guessing you're asking me this because you don't see anything wrong with the script's logic?

    Julie

    -----Original Message----- From: John Nichel [mailto:jnichelby-tor.com] Sent: Friday, January 31, 2003 8:10 AM To: Julie Williams Cc: php-generallists.php.net Subject: Re: [PHP] Introduction

    Julie,

    What version of PHP? Where is $custemail coming from, form on another page/same page, database? Global variables on or off in your php.ini?

    Julie Williams wrote: > Hi Jason, > > Sorry, I'm very new to this. Since my code is not huge, I have included it > below. I removed some of the text so that it is less bulky. I hope > everything is clear. Thanks for your help! > > > <?php > //Build email Body based on customer request > IF (isset($custemail)) { > IF ($request_type=="Service_Advice") { > $body = "Thank you for your request for service information..."; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Service Advice Request", $body, $headers); > > header("Location:index.html"); > } > ELSE IF ($request_type=="Parts_Advice") { > $body = "Thank you for your request for parts information..."; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Parts Advice Request", $body, $headers); > > header("Location:index.html"); > } > ELSE IF ($request_type=="Parts") { > IF ((!isset($part1)) && (!isset($part2)) && (!isset($part3)) > && (!isset($part4)) && (!isset($part5)) && (!isset($part6))) > print ("Please go back and include part information!"); > ELSE { > $body = "Thank you for your parts request. The information you > requested is listed below:<BR>&nbsp;<BR>"; > $body .= "<TABLE>"; > $body .= "<TR><TH>Part #</TH><TH>Part > Name</TH><TH>Price</TH><TH>Shipping</TH><TH>Availability</TH></TR>"; > IF (isset($part1)) > $body .= > "<TR><TD>$part1</TD><TD>$partname1</TD><TD>$price1</TD><TD>$sprice1</TD><TD> > $avail1</TD></TR>"; > IF (isset($part2)) > $body .= > "<TR><TD>$part2</TD><TD>$partname2</TD><TD>$price2</TD><TD>$sprice2</TD><TD> > $avail2</TD></TR>"; > IF (isset($part3)) > $body .= > "<TR><TD>$part3</TD><TD>$partname3</TD><TD>$price3</TD><TD>$sprice3</TD><TD> > $avail3</TD></TR>"; > IF (isset($part4)) > $body .= > "<TR><TD>$part4</TD><TD>$partname4</TD><TD>$price4</TD><TD>$sprice4</TD><TD> > $avail4</TD></TR>"; > IF (isset($part5)) > $body .= > "<TR><TD>$part5</TD><TD>$partname5</TD><TD>$price5</TD><TD>$sprice5</TD><TD> > $avail5</TD></TR>"; > IF (isset($part6)){ > $body .= > "<TR><TD>$part6</TD><TD>$partname6</TD><TD>$price6</TD><TD>$sprice6</TD><TD> > $avail6</TD></TR>"; > $body .= "</TABLE>"; > $body .= "Our Service departments are located on the following > page:<BR>&nbsp;<BR>"; > $body .= $comments; > $headers .= "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > $headers .= "From: julienaturalwebs.com\r\n"; > $headers .= "To: ".$custemail."\r\n"; > > mail($custemail, "Your Parts Request", $body, $headers); > > header("Location:index.html"); > } > } > } > ELSE { > print ("Please go back and enter the customer's request type!"); > } > } > ELSE { > print ("Please go back and enter the customer's email address!"); > } > ?> > > > > -----Original Message----- > From: Jason Wong [mailto:php-generalgremlins.biz] > Sent: Friday, January 31, 2003 6:15 AM > To: php-generallists.php.net > Subject: Re: [PHP] Introduction > > > On Saturday 01 February 2003 00:47, Julie Williams wrote: > > >>Basically, all the script does (or should do) is build an e-mail to a >>client based on a set of variables defined by the user, using an HTML > > form. > >> It is also supposed to warn the user with a "print" message whenever a >>variable is missing. The form is at the following address: >>http://www.swedishengineering.com/newsite/requestresponse.html >> >>I've saved the script in text format so that you can look at, it is > > located > >>at the following address: >>http://www.swedishengineering.com/newsite/requestresponse.rtf > > > If your code isn't humungous then you should include it (inline, not as an > attachment) with your post. There are many reasons why people would not > click > on a link to see your code (laziness, or fear of being social-engineered to > spread the latest MS-related exploit etc). > > If your code _is_ humungous, then a link might be appropriate and note > saying > _why_ you're posting a link would be nice. > > > Also, your intent to make the code look pretty(?) by converting to RTF seems > misguided. Stick to plain-text. > > >>The errors are as follows: >> >>When the customer's e-mail is omitted, a print message should appear, to >>the effect of "Hey, you need to specify the e-mail!". However, when the >>e-mail is omitted *and* one of the options is clicked, the message does > > not > >>appear, but rather, the user gets re-directed to the index page. >> >>When the "Parts" option is chosen, but no parts are indicated, a print >>message should appear to let the user know that a part number needs to be >>entered. However, the script bypasses this and builds the e-mail anyway. >> >>I hope this makes sense and would greatly appreciate any help. > > > It's good you that you explain what you're trying to do, and what you expect > the program to do, and what actually happens instead. (Some people just say > "here's my code, it doesn't work, what's wrong?" -- or words to that effect) > > However it would make more sense if we could see some code :) > > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > Sleep is for the weak and sickly. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

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

    attached mail follows:


    Well, one of the most common problems encountered here is forms / global variables. The form on your page is using the post method, so chances are, you need to reference your variables by the global post array, ie

    $_POST['custemail'] $_POST['request_type'] etc.

    Instead of $custemail and $request_type. If the form is using the get method (or any time variables are being passed in the URL), you'll want to use the global get array, ie

    $_GET['some_variable'] $_GET['anoter_variable']

    Then there's the global request array which will get all types passed to the page, ie.

    $_REQUEST['some_variable']

    You may want to take a look here for a better explanation of variables and scope...

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

    Julie Williams wrote: > Hi John, > > The variables are coming from a form, located at: > > http://www.swedishengineering.com/newsite/requestresponse.html > > I don't know what version of PHP or if the global variables are on or off. > I would have to ask the client who their provider is and contact them. I'm > guessing you're asking me this because you don't see anything wrong with the > script's logic? > > Julie > > -----Original Message----- > From: John Nichel [mailto:jnichelby-tor.com] > Sent: Friday, January 31, 2003 8:10 AM > To: Julie Williams > Cc: php-generallists.php.net > Subject: Re: [PHP] Introduction > > > Julie, > > What version of PHP? Where is $custemail coming from, form on another > page/same page, database? Global variables on or off in your php.ini? > > Julie Williams wrote: > >>Hi Jason, >> >>Sorry, I'm very new to this. Since my code is not huge, I have included > > it > >>below. I removed some of the text so that it is less bulky. I hope >>everything is clear. Thanks for your help! >> >> >><?php >>//Build email Body based on customer request >>IF (isset($custemail)) { >> IF ($request_type=="Service_Advice") { >> $body = "Thank you for your request for service information..."; >> $body .= $comments; >> $headers .= "MIME-Version: 1.0\r\n"; >> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; >> $headers .= "From: julienaturalwebs.com\r\n"; >> $headers .= "To: ".$custemail."\r\n"; >> >> mail($custemail, "Your Service Advice Request", $body, $headers); >> >> header("Location:index.html"); >> } >> ELSE IF ($request_type=="Parts_Advice") { >> $body = "Thank you for your request for parts information..."; >> $body .= $comments; >> $headers .= "MIME-Version: 1.0\r\n"; >> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; >> $headers .= "From: julienaturalwebs.com\r\n"; >> $headers .= "To: ".$custemail."\r\n"; >> >> mail($custemail, "Your Parts Advice Request", $body, $headers); >> >> header("Location:index.html"); >> } >> ELSE IF ($request_type=="Parts") { >> IF ((!isset($part1)) && (!isset($part2)) && (!isset($part3)) >> && (!isset($part4)) && (!isset($part5)) && (!isset($part6))) >> print ("Please go back and include part information!"); >> ELSE { >> $body = "Thank you for your parts request. The information you >>requested is listed below:<BR>&nbsp;<BR>"; >> $body .= "<TABLE>"; >> $body .= "<TR><TH>Part #</TH><TH>Part >>Name</TH><TH>Price</TH><TH>Shipping</TH><TH>Availability</TH></TR>"; >> IF (isset($part1)) >> $body .= >> > > "<TR><TD>$part1</TD><TD>$partname1</TD><TD>$price1</TD><TD>$sprice1</TD><TD> > >>$avail1</TD></TR>"; >> IF (isset($part2)) >> $body .= >> > > "<TR><TD>$part2</TD><TD>$partname2</TD><TD>$price2</TD><TD>$sprice2</TD><TD> > >>$avail2</TD></TR>"; >> IF (isset($part3)) >> $body .= >> > > "<TR><TD>$part3</TD><TD>$partname3</TD><TD>$price3</TD><TD>$sprice3</TD><TD> > >>$avail3</TD></TR>"; >> IF (isset($part4)) >> $body .= >> > > "<TR><TD>$part4</TD><TD>$partname4</TD><TD>$price4</TD><TD>$sprice4</TD><TD> > >>$avail4</TD></TR>"; >> IF (isset($part5)) >> $body .= >> > > "<TR><TD>$part5</TD><TD>$partname5</TD><TD>$price5</TD><TD>$sprice5</TD><TD> > >>$avail5</TD></TR>"; >> IF (isset($part6)){ >> $body .= >> > > "<TR><TD>$part6</TD><TD>$partname6</TD><TD>$price6</TD><TD>$sprice6</TD><TD> > >>$avail6</TD></TR>"; >> $body .= "</TABLE>"; >> $body .= "Our Service departments are located on the following >>page:<BR>&nbsp;<BR>"; >> $body .= $comments; >> $headers .= "MIME-Version: 1.0\r\n"; >> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; >> $headers .= "From: julienaturalwebs.com\r\n"; >> $headers .= "To: ".$custemail."\r\n"; >> >> mail($custemail, "Your Parts Request", $body, $headers); >> >> header("Location:index.html"); >> } >> } >> } >> ELSE { >> print ("Please go back and enter the customer's request type!"); >> } >>} >>ELSE { >> print ("Please go back and enter the customer's email address!"); >> } >>?> >> >> >> >>-----Original Message----- >>From: Jason Wong [mailto:php-generalgremlins.biz] >>Sent: Friday, January 31, 2003 6:15 AM >>To: php-generallists.php.net >>Subject: Re: [PHP] Introduction >> >> >>On Saturday 01 February 2003 00:47, Julie Williams wrote: >> >> >> >>>Basically, all the script does (or should do) is build an e-mail to a >>>client based on a set of variables defined by the user, using an HTML >> >>form. >> >> >>>It is also supposed to warn the user with a "print" message whenever a >>>variable is missing. The form is at the following address: >>>http://www.swedishengineering.com/newsite/requestresponse.html >>> >>>I've saved the script in text format so that you can look at, it is >> >>located >> >> >>>at the following address: >>>http://www.swedishengineering.com/newsite/requestresponse.rtf >> >> >>If your code isn't humungous then you should include it (inline, not as an >>attachment) with your post. There are many reasons why people would not >>click >>on a link to see your code (laziness, or fear of being social-engineered > > to > >>spread the latest MS-related exploit etc). >> >>If your code _is_ humungous, then a link might be appropriate and note >>saying >>_why_ you're posting a link would be nice. >> >> >>Also, your intent to make the code look pretty(?) by converting to RTF > > seems > >>misguided. Stick to plain-text. >> >> >> >>>The errors are as follows: >>> >>>When the customer's e-mail is omitted, a print message should appear, to >>>the effect of "Hey, you need to specify the e-mail!". However, when the >>>e-mail is omitted *and* one of the options is clicked, the message does >> >>not >> >> >>>appear, but rather, the user gets re-directed to the index page. >>> >>>When the "Parts" option is chosen, but no parts are indicated, a print >>>message should appear to let the user know that a part number needs to be >>>entered. However, the script bypasses this and builds the e-mail anyway. >>> >>>I hope this makes sense and would greatly appreciate any help. >> >> >>It's good you that you explain what you're trying to do, and what you > > expect > >>the program to do, and what actually happens instead. (Some people just > > say > >>"here's my code, it doesn't work, what's wrong?" -- or words to that > > effect) > >>However it would make more sense if we could see some code :) >> >> >>-- >>Jason Wong -> Gremlins Associates -> www.gremlins.biz >>Open Source Software Systems Integrators >>* Web Design & Hosting * Internet & Intranet Applications Development * >>------------------------------------------ >>Search the list archives before you post >>http://marc.theaimsgroup.com/?l=php-general >>------------------------------------------ >>/* >>Sleep is for the weak and sickly. >>*/ >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hiya, I have nearly finished a project I am working on, and completely forgot about having a newsletter service! Basically its a website, and on the registration page people opt in or out of the newsletter, and this is a field in the database.

    So either once a week, or randomly I want to be able to send a newsletter to about a million people (hopefully if all goes to plan).

    What I did envisage was running a PHP script through the command line, which got the first 100 or so which wanted the newsletter, then the next 100 etc, till all the users who wanted the newsletter got it. Now my Linux is a bit hazy, but I think I can run this low priority, because Iam not bothered if it will take a day or so to send them all.

    Sommat like this:

    1- Read the first 100 emails that want the newsletter 2- Email them

    3- If read 100, then go to 1 (but start from 100), if not quit

    So basically my questions are:

    1- Is this the best way? Or should I use some mailing list software? I do want them to subsribe/unsubsribe through the website

    2- Is there a point when the script would time out? I know in Apache, u can set a time limit for a script, but would a command line PHP script have the same problem? Ihave never run PHP through the command line.

    Thanks a lot, any advive or links would be great...

    Oh yeh nearly forgot, although it will be hosted on Linux, it will be tested on Windows 2k, so hopefully the mehtod would work for Win 2k but this is not necessary...

    Steve

    PS I have looked at a few archives, and searched the net but not seen anything that helpful...

    attached mail follows:


    Hi... can you give me some lights in this subject? How checkboxes work with php? Or where i can find some info about this? Or both :) Ex: if i want to erase from db all data with the checkbox active...

    thanks...

    attached mail follows:


    > -----Original Message----- > From: Mr. BuNgL3 [mailto:mrbunglenetcabo.pt] > Sent: Friday, January 31, 2003 8:43 AM > To: php-generallists.php.net > Subject: [PHP] checkboxes and php... > > > Hi... > can you give me some lights in this subject? How checkboxes > work with php? > Or where i can find some info about this? Or both :) > Ex: if i want to erase from db all data with the checkbox active...

    Search the archives ... http://marc.theaimsgroup.com/?l=php-general&w=2&r=1&s=checkbox&q=b

    attached mail follows:


    Cesar Rodriguez wrote:

    >-------------snip---------------------- >The message I get is: > >"Fatal error: Call to undefined function: mysql_pconnect() in >var/www/html/lesson/firsta.php" > >Seems that PHP4 does not find the MySQL library. I checked php.ini and >httpd.conf files and everything is in its place apparently. I re-installed >everything from scratch with no positive result. I would appreciate advice >on this issue. >

    I think the best way to prove whether you have mysql support or not would be to look at the output of phpinfo(). If this does not show mysql support then you will need to recompile php with it. Is this a standard RH 8.0 installation or have you modified it?

    HTH Chris

    >

    attached mail follows:


    Hi,

    I have upgraded my server with the 4.3.0 version. The cli was upgraded also and all my scripts started to crash.

    I ususally put a #!/husr/local/bin/php -q in all scripts that need to be executed from the crontab.

    All the sudden the scripts ended with error messages such as Warning: main(../php/define.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /home/httpd/html/script.php on line 11

    What's going on ?

    Do I need to put the full path now ?

    regards.

    __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

    attached mail follows:


    Generally yes, since 4.3 cli does not change the working directory

    Robert Mena wrote:

    >Hi, > >I have upgraded my server with the 4.3.0 version. The >cli was upgraded also and all my scripts started to >crash. > >I ususally put a #!/husr/local/bin/php -q in all >scripts that need to be executed from the crontab. > >All the sudden the scripts ended with error messages >such as Warning: main(../php/define.php) >[http://www.php.net/function.main]: failed to create >stream: No such file or directory in >/home/httpd/html/script.php on line 11 > >What's going on ? > >Do I need to put the full path now ? > >regards. > >__________________________________________________ >Do you Yahoo!? >Yahoo! Mail Plus - Powerful. Affordable. Sign up now. >http://mailplus.yahoo.com > > >

    attached mail follows:


    Hi,

    I am working on porting PHP onto NetWare. I am testing the various features on NetWare. In one such testing I need to be able to enter username and password from a PHP script which is read off into PHP through an API which can be passed to my code for usage. How can I do it? Also, how is this done on Unix/Linux environment?

    Your help in this is appreciated.

    Thanks, Ananth.

    attached mail follows:


    Hello again,

    another problem with 4.3.0. I have gd support but after the upgrade my scripts started complaing :

    Fatal error: Call to undefined function: imagecreatefromjpeg()

    My ./configure (the same used for ages).

    './configure' '--with-apxs' '--with-ttf' '--with-xml' '--with-gd' '--with-ftp' '--enable-session' '--enable-trans-sid' '--with-zlib' '--enable-inline-optimization' '--with-mcrypt' '--enable-sigchild' '--with-config-file-path=/etc' '--with-freetype'

    __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

    attached mail follows:


    Hi,

    I'm a beginner in PHP and I want to access some variable all of my php sites. I want to order them in an array, class,...

    Eg.: User.Name User.Phone General.Info Camera.Type Camera.Class ...

    What is the most secure and "beautiful" solution for that in PHP? Can I add an array into the $_SESSION variable? Any tutorial on the net? I have found some but they always use only username and userpass. What's in a big project? An exact example would be a big help for me.

    Thanks!

    attached mail follows:


    I've got a folder with about 100 jpg files and a menu which a link to each one.

    Works fine but looks crude. Obviously, the image shows as a default on a white background, located in the upper left.

    I'd like to spiffy up the appearance with a background color and centering the image. [e.g. with a simple html file or whatever]

    I would prefer to not to redo the menu file or the jpgs.

    Was hoping there would be a way to do this similar to the Apache HeaderName directive for folder listings.

    I tried in the htaccess file:

    IndexOptions +FancyIndexing AddDescription "test text" *.jpg

    But this doesn't even show the the test text.

    Thanks........

    attached mail follows:


    Hi guys,

    I made a upload file's script and it works fine.

    No, I wanna create a page where it will display the directory content and will let me delete any file standing there.

    Is there any way to use php for that? Where can I get info about it?

    BTW, I have PHP/MySQL working on a Linux system

    Thx in advance Miguel

    attached mail follows:


    Read the manual first. If you can't find it, search the net (google is a great place to start). If you still can't find it, _then_ ask on the list.

    I had no idea how to do this, but it took me 30 sec to find out, and I'm a newbie.

    http://no.php.net/manual/en/function.unlink.php

    vennlig hilsen Řyvind

    On Fri, 31 Jan 2003, Miguel Brás wrote:

    > Hi guys, > > I made a upload file's script and it works fine. > > No, I wanna create a page where it will display the directory content and > will let me delete any file standing there. > > Is there any way to use php for that? Where can I get info about it? > > BTW, I have PHP/MySQL working on a Linux system > > Thx in advance > Miguel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hey, thx for your speech

    In a matter of fact, I have 2 books about PHP and all they say about the unlink function (I use it in my upload system) is that it is suposed to force the delete of the temporary file that it is created during the upload process.

    So, i was never thinking that the unlink fuction was able to do it.

    Sorry for thge trouble Miguel

    "Řyvind vestavik" <Oyvind.Vestavikidi.ntnu.no> escreveu na mensagem news:Pine.GSO.4.40.0301311641490.23242-100000furu.idi.ntnu.no...

    Read the manual first. If you can't find it, search the net (google is a great place to start). If you still can't find it, _then_ ask on the list.

    I had no idea how to do this, but it took me 30 sec to find out, and I'm a newbie.

    http://no.php.net/manual/en/function.unlink.php

    vennlig hilsen Řyvind

    On Fri, 31 Jan 2003, Miguel Brás wrote:

    > Hi guys, > > I made a upload file's script and it works fine. > > No, I wanna create a page where it will display the directory content and > will let me delete any file standing there. > > Is there any way to use php for that? Where can I get info about it? > > BTW, I have PHP/MySQL working on a Linux system > > Thx in advance > Miguel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hey all,

    Here's the situation. I'm on a server running FreeBSD and Apache 2. Someone else installed both. There is software that is running on this server, that I'm sure is dependent on certain options being compiled into Apache.

    I'm trying to install PHP on the server to make life a little easier with some scripting. I don't think SO is compiled into Apache and that obviously keeps me from compiling PHP as an apache mod.

    But if I complile apache and don't include options that are needed for the software, I'll obviously break the software.

    So my question is, is there a way to see what options are compiled into Apache, so that if I recompiled it, I could make sure to include the current options that are compiled now? Thanks in advance everyone!

    Jacob Bolton

    attached mail follows:


    Jacob Bolton wrote:

    > >But if I complile apache and don't include options that are needed for the >software, I'll obviously break the software. > >So my question is, is there a way to see what options are compiled into >Apache, so that if I recompiled it, I could make sure to include the current >options that are compiled now? Thanks in advance everyone! >

    "httpd -l" will show options statically compiled.

    HTH Chris

    attached mail follows:


    Does "Nope" mean to both my questions.

    Does MySQL create a log file of warnings? and can PHP call it?

    I figure even if MySQL as a log file, PHP can't call it, because the PHP function mysql_info was only add in 4.3.0

    Mark.

    attached mail follows:


    Hi everyone!

    I'm having a severe session problem. I'm having a file called createjpg.php that creates a jpg-image and returns it as a picture, with the correct header. This file is included on another php-file like this:

    <img src="createjpg.php?id=xyz">

    What I need the file createjpg.php to do is to check wether or not the user is logged in and if she is so, she should be able to see some other picture or something that will be processed in the file createjpg.php when it executes.

    The problem is that since the file createjpg.php is'nt loaded in the browser as and ordinary file, it doesnt recognizes the session variable… I think it's because that the web server loads it or something like that and it does not know that a session variable belongs to the user who loaded the file with the img scr on…

    Please, help! How can I overcome this?

    Best regards,

    Victor

    attached mail follows:


    --- Guru Geek <gurugeek2002g-i-w-s.com> wrote: > I was wondering, can you call a php script in the middle > of a html page? ... > Does anyone else know how to use php on a page and yet > keep the .html extension?

    Configure your Web server to treat .html files as PHP. This has been discussed before, so there are probably some examples in the archives of how to do this.

    Chris

    attached mail follows:


    Yeah, I was thinking more of the HTML way. With the help you two and some google searching I see that it will be difficult to pull out specific areas of a site.

    For example --- The news headlines from yahoo.com

    I've got a code that grabs that now. I just need to tweak it a bit to get the data to look presentable.

    <?php

    //Define the variables $url = ""; $start = ''; $end = '';

    //Opens the file and pulls out the requested info $openfile = fopen($url, "r"); $file = fread($openfile, 50000); $data = eregi("$start(.*)$end", $file, $siteinfo);

    //Make it look pretty $siteinfo[1] = strip_tags($siteinfo[1], "<img>");

    fclose($openfile); echo "$siteinfo[1]";

    ?>

    "Justin French" <justinindent.com.au> wrote in message news:BA6080D9.1E618%justinindent.com.au... > On a major level, create or use a large CMS (content management system), and > use the information you have in the databases / file system to establish > what's new, modified, etc. > > On a smaller level, you could check which files have been updated in X days > (I think) with PHP, and display them as a list, which some selective > listing. > > On a pain-in-the-ass level, you could maintain a HTML page with links on it > to things you've recently updated, and maintain it manually. > > > If you're talking about *another site* (not yours), it would be even harder. > > > Justin > > > on 31/01/03 4:28 PM, Seth Hopkins (shopkins006cox.net) wrote: > > > Hey everyone. I'm wondering if someone could lead me in the right direction > > on this one. What could I use to see if a site has been updated and then > > display what has been added to it? > > > > Any advice is appreciated. > > Thanks. > > > > Seth > > > > >

    attached mail follows:


    --- Victor <victormiceandbrains.dk> wrote: > <img src="createjpg.php?id=xyz"> ... > The problem is that since the file createjpg.php is'nt > loaded in the browser as and ordinary file, it doesnt > recognizes the session variable.

    When a browser requests an image, the request is identical to a request for any other resource, be it a .html file or a .php script. It will send cookies, URL variables (if they are in the src attribute as your example shows), and anything else that a normal request includes.

    Instead of trying to tell us what the problem is, just explain what trouble you are having. We can then tell *you* what the problem is.

    Chris

    attached mail follows:


    fredagen den 31 januari 2003 kl 18.08 skrev Chris Shiflett:

    > Instead of trying to tell us what the problem is, just > explain what trouble you are having. We can then tell *you* > what the problem is.

    Ok, first I have the function

    session_start();

    function return_session_raettighet($session = null) { if ( isset($session) ) { return $session; } else { return 0; } }

    I ask this function to return the value of a specifik session, that is, if the user is logged in the value is at least 10.

    Then I perform

    if(return_session_raettighet($HTTP_SESSION_VARS["session_raettighet"]) < 10) { ImageAlphaBlending($img_des, true); $im_copy = imagecreatefrompng(const_picture_dir . "/copyright.png"); $copy_imgsize = GetImageSize(const_picture_dir . "/copyright.png"); $copyxloc = (($imgwidth + (2*$kant))/2)-($copy_imgsize[0]/2); $copyyloc = (($imgheight + (2*$kant))/2)-($copy_imgsize[1]/2); imagecopy($img_des, $im_copy,$copyxloc,$copyyloc,0,0,$copy_imgsize[0], $copy_imgsize[1]); }

    this means, that if the user is not logged in, a copyright © sign will appear over the image.

    And this fails… Don't know why because the same code works on other pages…

    Sincerely

    Victorr

    attached mail follows:


    What is the difference between PHP ISAPI filter and PHP CGI (which one would be better to install on IIS 5?)

    -thanks,

    - vic

    ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca

    attached mail follows:


    I am working from an example in a book that has the following and is not explained very well:

    # read results of query, then clean up while ($row = mysql_fetch_row($result)) { print ("<TR>\n"); for ($i = 0; $i < mysql_num_fields ($result); $i++) { # escape any special characters and print printf ("<TD>%s</TD>\n", htmlspecialchars ($row[$i])); } print ("</TR>\n"); }

    I understand most of what is going on here except for this line:

    printf ("<TD>%s</TD>\n", htmlspecialchars ($row[$i]));

    Can someone explain to me what the %s is?

    Mike

    attached mail follows:


    [snip] > I understand most of what is going on here except for this line: > > printf ("<TD>%s</TD>\n", htmlspecialchars ($row[$i])); > > Can someone explain to me what the %s is?

    www.php.net/sprintf

    sprintf() and printf() have the same type of syntax and all of the %s, etc, are explained on the sprintf() page given above.

    ---John Holmes...

    attached mail follows:


    I had a browser reporting itself as Opera 7.0 [en] fail recently in submitting a form.

    Specifically, it didn't forward the right value.

    Using this html in the form

    <INPUT TYPE="Radio" NAME="detail[1][]" VALUE="4" >

    The browser sent the value "on" instead of the value "4". So, the form couldn't be processed correctly.

    Has anybody encountered this? Workarounds?

    attached mail follows:


    Is it possible to pass an group of input boxes of the same name, then get the values of all the checked boxes or filled out textboxes? How do I get ALL the IDs passed. Right now it only passes the last ID. Do I really have to give them all unique names?

    For example...

    <html> <head> </head> <body> <form action="testform.php" method="post"> <input type="checkbox" value="0" name="DeleteIDs"></input> Jon Smith<br> <input type="checkbox" value="1" name="DeleteIDs"></input> David Callow<br> <input type="checkbox" value="2" name="DeleteIDs"></input> Peter Parker<br> . . . <input type="submit" value="Delete Users"> </form> </body> </html>

    This list of DeleteIDs will be build dynamically. I want the user to be able to check the boxes they want to delete and pull the IDs on the posted page.

    How do I get ALL the IDs passed. Right now it only passes the last ID.

    Thanks,

    Mike

    attached mail follows:


    Change the name of your checkboxes in your HTML to something like:

    name="DeleteIDs[]"

    This will make it an array, and you can access all the elements like

    $_POST['DeleteIDs'][0]

    etc.

    (This should really be in a FAQ somewhere...)

    -- tracy

    On 1/31/03 11:17 AM, "Mike Potter" <mikemikenbob.com> wrote:

    > Is it possible to pass an group of input boxes of the same name, then get > the values of all the checked boxes or filled out textboxes? > How do I get ALL the IDs passed. Right now it only passes the last ID. Do > I really have to give them all unique names? > > For example... > > <html> > <head> > </head> > <body> > <form action="testform.php" method="post"> > <input type="checkbox" value="0" name="DeleteIDs"></input> Jon Smith<br> > <input type="checkbox" value="1" name="DeleteIDs"></input> David Callow<br> > <input type="checkbox" value="2" name="DeleteIDs"></input> Peter Parker<br> > . > . > . > <input type="submit" value="Delete Users"> > </form> > </body> > </html> > > This list of DeleteIDs will be build dynamically. I want the user to be > able to check the boxes they want to delete and pull the IDs on the posted > page. > > How do I get ALL the IDs passed. Right now it only passes the last ID. > > Thanks, > > Mike > >

    -- 
    Tracy F. Rotton
    tracytaupecat.com
    http://www.taupecat.com/
    

    "... I like the 49ers because they're pure of heart, Seattle because they've got something to prove, and the Raiders because they always cheat." -- Lisa Simpson, "Lisa the Greek"

    attached mail follows:


    On Fri, 31 Jan 2003, Tracy Finifter Rotton wrote:

    > Change the name of your checkboxes in your HTML to something like: > > name="DeleteIDs[]" > > This will make it an array, and you can access all the elements like > > $_POST['DeleteIDs'][0] > > etc. > > (This should really be in a FAQ somewhere...)

    Using arrays with forms is in a faq: http://www.php.net/manual/en/faq.html.php#faq.html.arrays

    How do you feel this should be expanded? Mentioning that unchecked checkboxes do not pass values, and that the default value is 'on' (if checked) ... would be good too.

    I remember posting some information on this topic in the past: http://marc.theaimsgroup.com/?l=php-general&m=101142826821051 http://marc.theaimsgroup.com/?l=php-general&m=98576486229922

    Anyway, I agree, just not sure if there should be one specific faq for each form type, such as checkboxes or select boxes or... Ideally one faq would explain it for all types, checkboxes or otherwise. Making it short/concise and understandable for all user levels (such as newbies) is the tricky part. Well, actually, the tricky part is convincing people to read faqs :)

    Regards, Philip

    > On 1/31/03 11:17 AM, "Mike Potter" <mikemikenbob.com> wrote: > > > Is it possible to pass an group of input boxes of the same name, then get > > the values of all the checked boxes or filled out textboxes? > > How do I get ALL the IDs passed. Right now it only passes the last ID. Do > > I really have to give them all unique names? > > > > For example... > > > > <html> > > <head> > > </head> > > <body> > > <form action="testform.php" method="post"> > > <input type="checkbox" value="0" name="DeleteIDs"></input> Jon Smith<br> > > <input type="checkbox" value="1" name="DeleteIDs"></input> David Callow<br> > > <input type="checkbox" value="2" name="DeleteIDs"></input> Peter Parker<br> > > . > > . > > . > > <input type="submit" value="Delete Users"> > > </form> > > </body> > > </html> > > > > This list of DeleteIDs will be build dynamically. I want the user to be > > able to check the boxes they want to delete and pull the IDs on the posted > > page. > > > > How do I get ALL the IDs passed. Right now it only passes the last ID. > > > > Thanks, > > > > Mike > > > > > > -- > Tracy F. Rotton > tracytaupecat.com > http://www.taupecat.com/ > > "... I like the 49ers because they're pure of heart, > Seattle because they've got something to prove, > and the Raiders because they always cheat." > -- Lisa Simpson, "Lisa the Greek" > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    --- Victor <victormiceandbrains.dk> wrote: > I ask this function to return the value of a specifik > session, that is, if the user is logged in the value > is at least 10.

    ...

    > this means, that if the user is not logged in, a > copyright © sign will appear over the image. > > And this fails… Don't know why because the same code > works on other pages…

    What exactly is failing? Do you mean that a user who is not logged in does not see the copyright sign?

    If this is so, is the reason because your function is returning a 0 or because the value of your session variable is less than 10? I do not understand why you are checking to make sure it is at least 10, but maybe the sessions are working fine, and your logic needs a bit of tuning.

    Chris

    attached mail follows:


    Hi everyone,

    Well, after much debugging, turns out it was the "isset" command that was causing all the problems. By simply removing that, everything started working properly.

    Thanks to everyone for their input!

    Julie Williams

    -----Original Message----- From: John Nichel [mailto:jnichelby-tor.com] Sent: Friday, January 31, 2003 8:53 AM To: Julie Williams Cc: php-generallists.php.net Subject: Re: [PHP] Introduction

    Well, one of the most common problems encountered here is forms / global variables. The form on your page is using the post method, so chances are, you need to reference your variables by the global post array, ie

    $_POST['custemail'] $_POST['request_type'] etc.

    Instead of $custemail and $request_type. If the form is using the get method (or any time variables are being passed in the URL), you'll want to use the global get array, ie

    $_GET['some_variable'] $_GET['anoter_variable']

    Then there's the global request array which will get all types passed to the page, ie.

    $_REQUEST['some_variable']

    You may want to take a look here for a better explanation of variables and scope...

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

    Julie Williams wrote: > Hi John, > > The variables are coming from a form, located at: > > http://www.swedishengineering.com/newsite/requestresponse.html > > I don't know what version of PHP or if the global variables are on or off. > I would have to ask the client who their provider is and contact them. I'm > guessing you're asking me this because you don't see anything wrong with the > script's logic? > > Julie > > -----Original Message----- > From: John Nichel [mailto:jnichelby-tor.com] > Sent: Friday, January 31, 2003 8:10 AM > To: Julie Williams > Cc: php-generallists.php.net > Subject: Re: [PHP] Introduction > > > Julie, > > What version of PHP? Where is $custemail coming from, form on another > page/same page, database? Global variables on or off in your php.ini? > > Julie Williams wrote: > >>Hi Jason, >> >>Sorry, I'm very new to this. Since my code is not huge, I have included > > it > >>below. I removed some of the text so that it is less bulky. I hope >>everything is clear. Thanks for your