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: Sun Jul 28 2002 - 22:02:09 CDT

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

    php-general Digest 29 Jul 2002 03:02:09 -0000 Issue 1492

    Topics (messages 110052 through 110080):

    Re: Extra spacing with <br> in HTML
            110052 by: Kevin Breit

    Re: Help reg. create user and allocate space
            110053 by: Tech Support
            110060 by: Jason Wong

    Re: Speed issues.
            110054 by: John Holmes
            110064 by: Yves Vrancken

    Re: php 'mail()' security
            110055 by: Tech Support
            110056 by: John Holmes
            110062 by: Bob Lockie
            110066 by: Tech Support
            110072 by: Dennis Gearon

    Re: running php with .html files?
            110057 by: Henry
            110063 by: Peter
            110067 by: Peter Janett

    Re: PHP/MySQL Search Engine Query Question
            110058 by: Tech Support

    Oracle 8i SQL Problem..
            110059 by: Frank S. Kicenko

    Re: need help reg. User Accounts
            110061 by: Bob Lockie

    REGEX for credit card number
            110065 by: Mike Mannakee

    REGEX for phone #
            110068 by: Mike Mannakee

    need help with uploading images
            110069 by: Deadsam
            110071 by: Oscar F
            110073 by: Deadsam

    Adding slashes when magic quotes is off?
            110070 by: Leif K-Brooks

    Re: How do I show the sourse code?
            110074 by: David Robley

    David Steculorum/MIS/XLGroup is out of the office.
            110075 by: DSteculorum.xlserv.com

    sessions and https
            110076 by: Mike Mannakee
            110077 by: Oscar F
            110078 by: Tom Rogers
            110079 by: Mike Mannakee

    Logging out with authentication
            110080 by: Ray Todd Stevens

    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:


    On Sun, 2002-07-28 at 10:14, Justin French wrote:
    > on 29/07/02 12:02 AM, Kevin Breit (mrproperximian.com) wrote:
    >
    > >> Aaaannny way, you can't modify WHAT php does in nl2br, but you can do
    > >> something to the resulting code, like replacing "</li><br />" with "</li>":
    > >>
    > >> <?
    > >> $original = "<ul><li>Blar</li></ul>";
    > >> $new = nl2br($original);
    > >> $new = str_replace('</li><br />', '</li>', $new);
    > >> ?>
    > >
    > > Hmmm..you've got it backwards, but I see what you mean. I'll tool
    > > around with it tonight.
    >
    > I don't think I did....
    >
    > Manual Quote:
    >
    > Description
    > mixed str_replace ( mixed search, mixed replace, mixed subject)
    >
    > So, we search for </li><br /> (the problem being the unnecessary <br />, and
    > replace it with </li>.
    >
    > Unless I'm misunderstanding the question/problem.
    Oh wait, you're right!

    Kevin

    -- 
    Kevin Breit <mrproperximian.com>
    

    attached mail follows:


    Are you asking us how to write an entire online community program???

    Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: "umesh" <umeshmanas-solutions.com> To: <php-generallists.php.net> Sent: Sunday, July 28, 2002 6:40 AM Subject: [PHP] Help reg. create user and allocate space

    > Hi Gurus, > > I am using PHP-4.1.1, postgresql on Linux. > > I want the following functionality, I dont know how to implement it. > > Each time a new user registeres, I want to create mail account by the name > he specifies and allocate him some space of the server, say 2mb. > > How this is incorporated ? > > Please help. > > Thanking you all in anticipation. > > > Regards > > Umesh. > ***************************** > Umesh A. Deshmukh. > Manas Solutions Pvt. Ltd. > umeshmanas-solutions.com > http://www.manas-solutions.com > Ph. : 91+020+4006358,4223991/92 > ***************************** >

    attached mail follows:


    On Sunday 28 July 2002 19:40, umesh wrote: > Hi Gurus, > > I am using PHP-4.1.1, postgresql on Linux. > > I want the following functionality, I dont know how to implement it. > > Each time a new user registeres, I want to create mail account by the name > he specifies and allocate him some space of the server, say 2mb. > > How this is incorporated ?

    Manual -> Program Execution functions

    These functions would allow PHP to call any system command or program. How you actually create the mail account and set quotas has nothing at all to do with PHP.

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

    /* Radial Telemetry Infiltration */

    attached mail follows:


    > I am new to PHP and trying to implement some PHP and MySQL on my website. > My > website has a lot of tables and inside some of those tables, I want to > display information that is drawn out of the MySQL database using PHP. I > was > wondering what goes faster: > > (A). Building the whole page normally up in HTML, doing the usual <table> > <td> and so forth, and then inside the <td> calling up the PHP in order to > display the information. For example: <td> <?php ...... ?> </td> > > (B). Doing everything in the PHP document, also the 'building' of the > tables, and then including the PHP script in the main page. For example > using printf("<tr><td> and so forth.

    (A) will be faster, generally. Plus it's easier to read and find the PHP snippets in the HTML, than it is to read an entire page of print/echo statements. And it'll generally open neatly in a graphical HTML editor, too.

    ---John Holmes...

    attached mail follows:


    Thanks for the help, guys . I appreciate it. And Bas, thanks for that link. Interesting material for a novice PHP-user as myself.

    Yves Vrancken

    attached mail follows:


    There is no substitute for good data verification such as strip_tags() or some regular expressions to limit valid input. I also would recomend checking the referrer to be sure someone doesn't hijack you form and try to modify it and submit it from a remote location. Here is an example:

    if (validReferrer() === false) die("invalid referrer");

    function validReferrer() { $_valid_referrers = array("www.yoursite.com","www2.yoursite.com","yoursite.com"); $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); $ref = explode('/', $referer); if ( in_array($ref[1], $_valid_referrers) ) return true; else return false; }

    Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: "Dennis Gearon" <gearondcvc.net> To: "Bob Lockie" <bjlockielockie.ca> Cc: <php-generallists.php.net> Sent: Saturday, July 27, 2002 10:54 PM Subject: Re: [PHP] php 'mail()' security

    > What I meant was, how to sanitize the input on the forms so that > malicious stuff cannot be put as commands, etc. in the email address, or > body, or 'extra' field of the 'mail()' function in PHP. > -- > ----------------------------------------------------------------- > Joy is just a thing (to be).. raised on, > Love is just the way to Live and Die, > John Denver. > ----------------------------------------------------------------- > He lost a friend, but kept his Memory (also John Denver), > Thank you...John Corones...my friend always. > ----------------------------------------------------------------- > Look lovingly upon the present, > for it holds the only things that are forever true. > ----------------------------------------------------------------- > Sincerely, Dennis Gearon (Kegley) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    HTTP_REFERRER can be spoofed quite easily with some browsers.

    The best way to handle this is to provide as much of your own data as possible, and validate anything you do end up using from the user.

    For instance, use your own subject, make sure the To: address comes from you (a file or database, whatever), etc... Make sure anything coming from the user, that you put into the headers, subject, from, reply-to, etc... do not have any line breaks. A simple str_replace or something to remove them, or pop up an error if they are there, will work.

    The less user data you can use the better. It gives them less of a chance to insert extra headers, which is pretty much the only threat. If there's a possibility of the email not being shown as plain text, then you'll want to use striptags() like others mentioned.

    ---John Holmes...

    > -----Original Message----- > From: Tech Support [mailto:jgrillweb-1hosting.net] > Sent: Sunday, July 28, 2002 10:57 AM > To: Dennis Gearon; Bob Lockie > Cc: php-generallists.php.net > Subject: Re: [PHP] php 'mail()' security > > There is no substitute for good data verification such as strip_tags() or > some regular expressions to limit valid input. I also would recomend > checking the referrer to be sure someone doesn't hijack you form and try > to > modify it and submit it from a remote location. Here is an example: > > if (validReferrer() === false) > die("invalid referrer"); > > function validReferrer() > { > $_valid_referrers = > array("www.yoursite.com","www2.yoursite.com","yoursite.com"); > $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); > $ref = explode('/', $referer); > if ( in_array($ref[1], $_valid_referrers) ) > return true; > else > return false; > } > > Jim Grill > Support > Web-1 Hosting > http://www.web-1hosting.net > ----- Original Message ----- > From: "Dennis Gearon" <gearondcvc.net> > To: "Bob Lockie" <bjlockielockie.ca> > Cc: <php-generallists.php.net> > Sent: Saturday, July 27, 2002 10:54 PM > Subject: Re: [PHP] php 'mail()' security > > > > What I meant was, how to sanitize the input on the forms so that > > malicious stuff cannot be put as commands, etc. in the email address, or > > body, or 'extra' field of the 'mail()' function in PHP. > > -- > > ----------------------------------------------------------------- > > Joy is just a thing (to be).. raised on, > > Love is just the way to Live and Die, > > John Denver. > > ----------------------------------------------------------------- > > He lost a friend, but kept his Memory (also John Denver), > > Thank you...John Corones...my friend always. > > ----------------------------------------------------------------- > > Look lovingly upon the present, > > for it holds the only things that are forever true. > > ----------------------------------------------------------------- > > Sincerely, Dennis Gearon (Kegley) > > > > -- > > 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:


    >There is no substitute for good data verification such as strip_tags() or >some regular expressions to limit valid input. I also would recomend >checking the referrer to be sure someone doesn't hijack you form and try to >modify it and submit it from a remote location. Here is an example: > >if (validReferrer() === false) > die("invalid referrer"); > >function validReferrer() >{ > $_valid_referrers = >array("www.yoursite.com","www2.yoursite.com","yoursite.com"); > $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); > $ref = explode('/', $referer); > if ( in_array($ref[1], $_valid_referrers) ) > return true; > else > return false; >}

    That is a good idea. $_SERVER['HTTP_REFERER'] is the web server identifier, right? My web server is 10.0.0.5 from the internal LAN. I am hesitant to allow HTTP_REFERERs from 10.0.0.5 because it seems to me that it would be easy enough to configure a strange box to imitate 10.0.0.5. Can I somehow check that the HTTP_REFERER = localhost?

    attached mail follows:


    I think you are looking for something different.

    do this:

    print "<pre>"; print_r($_SERVER); print "</pre>";

    You will see a whole bunch of useful globals. As a matter of fact, try this one out too:

    print "<pre>"; print_r($GLOBALS); print "</pre>";

    Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: "Bob Lockie" <bjlockielockie.ca> To: "Dennis Gearon" <gearondcvc.net>; "Tech Support" <jgrillweb-1hosting.net> Cc: <php-generallists.php.net> Sent: Sunday, July 28, 2002 1:19 PM Subject: Re: [PHP] php 'mail()' security

    > > >There is no substitute for good data verification such as strip_tags() or > >some regular expressions to limit valid input. I also would recomend > >checking the referrer to be sure someone doesn't hijack you form and try to > >modify it and submit it from a remote location. Here is an example: > > > >if (validReferrer() === false) > > die("invalid referrer"); > > > >function validReferrer() > >{ > > $_valid_referrers = > >array("www.yoursite.com","www2.yoursite.com","yoursite.com"); > > $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); > > $ref = explode('/', $referer); > > if ( in_array($ref[1], $_valid_referrers) ) > > return true; > > else > > return false; > >} > > That is a good idea. > $_SERVER['HTTP_REFERER'] is the web server identifier, right? > My web server is 10.0.0.5 from the internal LAN. > I am hesitant to allow HTTP_REFERERs from 10.0.0.5 because it seems to me that it would be easy enough to configure a strange box > to imitate 10.0.0.5. > Can I somehow check that the HTTP_REFERER = localhost? > > > > >

    attached mail follows:


    No, but thanks, the other input is more towards what I was looking for. I want to take in an email address, and various other fields. Then, send an email using 'mail()' with the other fields as the 'body', and the email address as the 'reply_to' address, to someone in my company. That way, they can read the submitted information, and then just hit 'reply' on their mail program when they want to comment on the material.

    "Tech Support" <jgrillweb-1hosting.net> wrote: > > I think you are looking for something different. > > do this: > > print "<pre>"; > print_r($_SERVER); > print "</pre>"; > > You will see a whole bunch of useful globals. As a matter of fact, try this > one out too: > > print "<pre>"; > print_r($GLOBALS); > print "</pre>"; > > Jim Grill > Support > Web-1 Hosting > http://www.web-1hosting.net > ----- Original Message ----- > From: "Bob Lockie" <bjlockielockie.ca> > To: "Dennis Gearon" <gearondcvc.net>; "Tech Support" > <jgrillweb-1hosting.net> > Cc: <php-generallists.php.net> > Sent: Sunday, July 28, 2002 1:19 PM > Subject: Re: [PHP] php 'mail()' security > > > > > >There is no substitute for good data verification such as strip_tags() or > > >some regular expressions to limit valid input. I also would recomend > > >checking the referrer to be sure someone doesn't hijack you form and try > to > > >modify it and submit it from a remote location. Here is an example: > > > > > >if (validReferrer() === false) > > > die("invalid referrer"); > > > > > >function validReferrer() > > >{ > > > $_valid_referrers = > > >array("www.yoursite.com","www2.yoursite.com","yoursite.com"); > > > $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); > > > $ref = explode('/', $referer); > > > if ( in_array($ref[1], $_valid_referrers) ) > > > return true; > > > else > > > return false; > > >} > > > > That is a good idea. > > $_SERVER['HTTP_REFERER'] is the web server identifier, right? > > My web server is 10.0.0.5 from the internal LAN. > > I am hesitant to allow HTTP_REFERERs from 10.0.0.5 because it seems to me > that it would be easy enough to configure a strange box > > to imitate 10.0.0.5. > > Can I somehow check that the HTTP_REFERER = localhost? > > > > > > > > > >

    ----------------------------------------------------------------- Joy is just a thing (to be).. raised on, Love is just the way to Live and Die, John Denver. ----------------------------------------------------------------- He lost a friend, but kept his Memory (also John Denver), Thank you...John Corones...my friend always. ----------------------------------------------------------------- Look lovingly upon the present, for it holds the only things that are forever true. ----------------------------------------------------------------- Sincerely, Dennis Gearon (Kegley)

    attached mail follows:


    That did the trick.

    Thanks.

    Henry

    "Michael Sims" <mhsimsmidsouth.rr.com> wrote in message news:e3m7kuo9nu1lol85tc2pr1j6epqbf1htef4ax.com... On Sun, 28 Jul 2002 08:18:40 +0100, you wrote:

    >Hi All, [...] >I have a php script that I wish to execute but I want to put it in >index.html (not index.php) > >I know there is a solution involving configuration files in either the >directory wher the file is held or specifically for the server. >(Unfortunately I don't have access to the conf files for the server because >I'm currently using a shared serever from an ISP). [...]

    You didn't say what web server you are using, so I will assume it's Apache. If your server is configured to allow .htaccess files to override global settings, you should be able to create one in your directory and add:

    AddType application/x-httpd-php .html

    attached mail follows:


    Why can't you just have <?PHP at the top of the page and ?> at the bottom?

    "Henry" <henryteacake.f9.co.uk> wrote in message news:20020728071807.34569.qmailpb1.pair.com... > Hi All, > > I'm sure I saw a posting on this subject a month ago so please excuse me for > not paying attention the first time ;-| > > I have a php script that I wish to execute but I want to put it in > index.html (not index.php) > > I know there is a solution involving configuration files in either the > directory wher the file is held or specifically for the server. > (Unfortunately I don't have access to the conf files for the server because > I'm currently using a shared serever from an ISP). > > Any help is greatly appreciated. Even pointers in the right direction would > be useful. > > TIA > > Henry > > > > >

    attached mail follows:


    You need to append or create a .htaccess file in the same folder as index.html, and add this line:

    <Files "index.html"> ForceType application/x-httpd-php </Files>

    Then, just treat the index.html file as a php file.

    HTH,

    Peter Janett

    New Media One Web Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PostgreSQL coming soon!

    http://www.newmediaone.net webmasternewmediaone.net (303)828-9882

    ----- Original Message ----- From: "Peter" <newsaddresssaracenvsu.org.uk> To: <php-generallists.php.net> Sent: Sunday, July 28, 2002 1:16 PM Subject: [PHP] Re: running php with .html files?

    > Why can't you just have > <?PHP > at the top of the page and > ?> > at the bottom? > > > "Henry" <henryteacake.f9.co.uk> wrote in message > news:20020728071807.34569.qmailpb1.pair.com... > > Hi All, > > > > I'm sure I saw a posting on this subject a month ago so please excuse me > for > > not paying attention the first time ;-| > > > > I have a php script that I wish to execute but I want to put it in > > index.html (not index.php) > > > > I know there is a solution involving configuration files in either the > > directory wher the file is held or specifically for the server. > > (Unfortunately I don't have access to the conf files for the server > because > > I'm currently using a shared serever from an ISP). > > > > Any help is greatly appreciated. Even pointers in the right direction > would > > be useful. > > > > TIA > > > > Henry > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Here is an idea

    <? // make array out of words in search string $search_array = explode(' ', $search);

    // make regexp pattern '.*(this|or|that).*' $string = ".*(" . implode('|', $search_array) . ").*";

    $query = "SELECT * FROM my_table WHERE body REGEXP '$string'"; $result = mysql_query($query, $connection); $res = mysql_num_rows($result); if ($res < 1) die("no match for $search"); ?>

    using this method "car" would match "car", "carwash", "scar", "scarred", etc. Since this result will contain the entire boy of text you could some more matching or scoring for relevancy

    <? while ( $row = mysql_fetch_assoc($result) ) { $num = sizeof($search_array); for ($i = 0; $i < $num; $i++) { if ( preg_match("/.*\b$search_array[$i]/i", $row[body]) ) { // it was found so score 25 to start $score[$row[page_title_or_something]] += 25; $body_size = strlen($row[body]); // this is the first case-insensitive occurance of the word $temp = stristr($row[body], "$search_array[$i]"); $pos = strlen($row[body])-strlen($temp); if ($pos == $body_size) $pos = 0; // score higher $percent = ( ($pos / $body_size * 1000) / 10 ); $score[$row[page_title_or_something]] += ((100 - number_format($percent)) / 2); // this is the first occurance of the word by it's self preg_match("/[^a-z0-9]?($search_array[$i])([^0-9a-z])?/i", $row[body], $matches); $temp = stristr($row[body], trim($matches[0])); $pos_clean = strlen($row[body])-strlen($temp); if ($pos_clean == $body_size) $pos_clean = 0; // score higher $percent = ( ($pos_clean / $body_size * 1000) / 10 ); $score[$row[page_title_or_something]] += (100 - number_format($percent)); // this is how many times it occured in total $reps = substr_count($row[body], "$search_array[$i]"); // score higher $score[$row[page_title_or_something]] += ($reps * 5); // this is how many times it occured by it's self $rc = preg_grep("/[^a-z0-9]?($search_array[$i])([^0-9a-z])?/i", explode(" ", $row[body]) ); $reps_clean = sizeof($rc); // score higher $score[$row[page_title_or_something]] += ($reps_clean * 10); } } ?>

    I had that code from a previous working project. I copied it and changed some var names to make it more clear. I did not test it in this format but it is a good example and you could certainly improve it or build on it.

    Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: "Paul Maine" <pmaineaustin.rr.com> To: "PHP PHP" <php-generallists.php.net> Sent: Saturday, July 27, 2002 9:31 PM Subject: [PHP] PHP/MySQL Search Engine Query Question

    > I am currently working on a website that is implemented using PHP and MySQL. > > The site currently has a simple search engine that allows a shopper to type > in a search string that is stored in $search. For example, if a shopper > types in 1972 Ford Mustang > $string ="1972 Ford Mustang" > > Using the following SQL statement: > SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search% > > Records are returned that have this exact string and in this exact order > (I'm aware a wild card character is included on the front and back of the > string). > > My desire is to be able to logically AND each token of the search together > independent or the order of the tokens. > I want to return all records that have Mustang AND 1972 AND Ford. > > Since a shopper inputs the search string in advance I don't know how many > tokens will be used. > > I would appreciate any suggestions. > > Regards, > Paul > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Hi, This really isn't a PHP issue..sorry. I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL which works for MSSQL 2K and seems correct for Oracle... but keeps giving me a Error.. ORA-00933 SQL command not properly ended on the following query...

    SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, usergrp.userid, users.userdescrip FROM grp LEFT JOIN usergrp ON grp.grp=usergrp.grp LEFT JOIN users ON usergrp.userid=users.userid ORDER BY grp.grp

    The error keeps pointing at the first "LEFT JOIN". Anybody know why?

    attached mail follows:


    >Hi Gurus, > >I am using PHP-4.1.1 on Linux, >I wanted to know the difference between "nobody" user and normal user of >operating system. > >This question just came to mind when, neither nobody's directory nor any >entry was not found in /home or elsewhere.

    The web server can be run by any user. The 'nobody' user is usually used since it has no login capabailities. 'nobody' can't login and hence has no home. From the /etc/passwd "obody:x:99:99:Nobody:/:/sbin/nologin".

    attached mail follows:


    Does anyone have a regular expression that works to validate credit card numbers?

    Mike

    attached mail follows:


    I'm using a regular expression (below) to check phone numbers. I'm getting an error that I can't make sense of.

    $regex = "^((\(\d{3}(\) -))?*\d{3}(- )\d{4},?*)+$";

    Output I'm getting = Warning: REG_BADRPT in /home/basemen/public_html/verify_order.php on line 28

    Anyone know what this means? I know it's not bitching about the phone number, it's bitching about the expression. But why? Some thing wrong with the expression? It works fine in PERL, which this is supposed to be compatible with.

    Mike

    attached mail follows:


    I'm trying to get an uploader to work, where you check to make sure it's a jpeg file that's being uploaded, and no other files allowed. the server is unix linux using php4.1 Any help would be appreciated. thanks in advance deasdam

    attached mail follows:


    deadsman,

    if (($filename_type != "image/jpeg") && ($filename_type != "image/jpg") && ($filename_type != "image/pjpeg")) { header("Location:submitError.php"); exit; //goes to an error page if the file wasnt a jpg } else { $upload_path = "/path/of/the/$filename_name"; if (is_uploaded_file($filename)) { Exec("cp $filename $upload_path"); } else { //do whatever if it wasnt uploaded }

    The "file" formfield, is called filename.. just in case... if you call it myFile, you'd have to replace $filename with that.

    Hope this helps.

    Oscar.-

    ----- Original Message ----- From: "Deadsam" <deadsamsympatico.ca> To: <php-generallists.php.net> Sent: Sunday, July 28, 2002 5:53 PM Subject: [PHP] need help with uploading images

    > I'm trying to get an uploader to work, where you check to make sure it's a > jpeg file that's being uploaded, and no other files allowed. the server is > unix linux using php4.1 > Any help would be appreciated. > thanks in advance > deasdam > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Thanks oscar I'll give this a go, I tried just using filetype != image/jpeg so mabey adding the rest will help , I read there was a problem with some browser with uploading hopfully this will solve the problem. much apprecatied Deadsam

    "Oscar F" <listswebdevfm.com> wrote in message news:002001c23684$fc68ba20$bc00a8c0320jupiter... > deadsman, > > if (($filename_type != "image/jpeg") && ($filename_type != "image/jpg") && > ($filename_type != "image/pjpeg")) { > header("Location:submitError.php"); exit; //goes to an error page if the > file wasnt a jpg > } else { > $upload_path = "/path/of/the/$filename_name"; > if (is_uploaded_file($filename)) { > Exec("cp $filename $upload_path"); > } else { > //do whatever if it wasnt uploaded > } > > The "file" formfield, is called filename.. just in case... if you call it > myFile, you'd have to replace $filename with that. > > Hope this helps. > > Oscar.- > > ----- Original Message ----- > From: "Deadsam" <deadsamsympatico.ca> > To: <php-generallists.php.net> > Sent: Sunday, July 28, 2002 5:53 PM > Subject: [PHP] need help with uploading images > > > > I'm trying to get an uploader to work, where you check to make sure it's a > > jpeg file that's being uploaded, and no other files allowed. the server is > > unix linux using php4.1 > > Any help would be appreciated. > > thanks in advance > > deasdam > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >

    attached mail follows:


    I'm making a website for a friend, and trying to do everything the right way. I want to add slashes to EGPCS values. I know how to use this, but one of the comments on the get_magic_quotes_gpc entry in the manual points out that it wouldn't work with arrays in these values - and they have a point. Does anyone have code that works with arrays in EGPCS values? Thanks.

    attached mail follows:


    In article <20020728014252.16566.qmailpb1.pair.com>, haematte.se says... > I have seen on some of the script-sites around some nice ways of presenting > the source code. Often in nice colors. So, the natural question is: how is > that done (cause I don't think anyone has the patience to put &lt; and &gt; > around all the <>)

    If you are using php v4 you can do this with show_source(), or if using apache, you can configure it to serve source code with syntax highlighting rather than parsing the code.

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    I will be out of the office starting 27/07/2002 and will not return until 04/08/2002.

    Sorry but I am out of the Office till the 4th of August. Please contact Roger Smith for any emergency.

    The information contained in this e-mail message may be privileged and confidential information and is intended only for the use of the individual and/or entity identified in the alias address of this message. If the reader of this message is not the intended recipient, or an employee or agent responsible to deliver it to the intended recipient, you are hereby requested not to distribute or copy this communication. If you have received this communication in error, please notify us immediately by telephone or return e-mail and delete the original message from your system.

    attached mail follows:


    Do sessions not work when using an https connection? It seems I'm losing my data between pages.

    Mike

    attached mail follows:


    Mike,

    I have used them with https, and they work fine. Make sure you are calling session_start(); on every page you need your session vars.

    Oscar.-

    ----- Original Message ----- From: "Mike Mannakee" <mikebasementideas.com> To: <php-generallists.php.net> Sent: Sunday, July 28, 2002 9:21 PM Subject: [PHP] sessions and https

    > Do sessions not work when using an https connection? It seems I'm losing my > data between pages. > > Mike > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Hi,

    Monday, July 29, 2002, 11:21:34 AM, you wrote: MM> Do sessions not work when using an https connection? It seems I'm losing my MM> data between pages.

    MM> Mike

    If you are changing domain names when going to https you will lose the session info if relying on cookies. You will have to hard code the session id in the url if this is the case.

    -- 
    regards,
    Tom
    

    attached mail follows:


    Thank you. This has been driving me up the wall like you wouldn't believe.

    Mike

    "Tom Rogers" <trogerskwikin.com> wrote in message news:3935421243.20020729120947kwikin.com... > Hi, > > Monday, July 29, 2002, 11:21:34 AM, you wrote: > MM> Do sessions not work when using an https connection? It seems I'm losing my > MM> data between pages. > > MM> Mike > > If you are changing domain names when going to https you will lose the > session info if relying on cookies. You will have to hard code the > session id in the url if this is the case. > > -- > regards, > Tom >

    attached mail follows:


    I am working on a web site that is using php controled www- authenticate authentication. User ids are specific to users and different pages and different levels of information for a given page will be displayed based on the user id used. The problem is how do you log out without having to quit all browser sessions. Anyone doing this? Care to share code that makes it work? -------------------------------------------------------------------- -------------- Ray Todd Stevens Specialists in Network and Security Consulting Senior Consultant Software audit service available Stevens Services Suite 21 3754 Old State Rd 37 N Bedford, IN 47421 (812) 279-9394 Raytoddkiva.net

    Thought for the day: Concerto (n): a fight between a piano and a pianist.

    For PGP public key send message with subject please send PGP key

    If this message refers to an attachment the attachment may arrive as a seperate mail message depending on the type of mail client and gateway software you are using.