OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Tue Jul 02 2002 - 22:57:48 CDT

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

    php-general Digest 3 Jul 2002 03:57:48 -0000 Issue 1441

    Topics (messages 104940 through 105120):

    forms and files
            104940 by: Tyler Longren
            104942 by: Jason Wong
            104945 by: Tyler Longren
            104950 by: Jason Wong
            105083 by: Richard Lynch

    open_base_dir apache directive and symlink directories
            104941 by: Dave
            104943 by: Jason Wong

    Setting a cookie and redirecting
            104944 by: Cord Schneider
            105063 by: Chris Shiflett
            105084 by: Richard Lynch
            105101 by: Richard Lynch
            105112 by: Justin French
            105115 by: Chris Shiflett

    Php mail() function is not working for me
            104946 by: Balaji Ankem

    PHP crypt now adding $1$ to password
            104947 by: Brett Hay

    PHP crypt() now adding $1$ to password
            104948 by: Brett Hay
            105085 by: Richard Lynch

    Executing a php script periodically using crond
            104949 by: Henry
            104952 by: Henry
            104955 by: Jason Wong
            104956 by: Erik Price
            104959 by: Henry
            104961 by: Chris Hewitt
            104964 by: Erik Price
            104971 by: Henry
            105086 by: Richard Lynch

    Re: odbc_fetch_into ??
            104951 by: Scott Fletcher
            104954 by: Analysis & Solutions
            104969 by: Dan Vande More
            104992 by: Scott Fletcher

    Re: Feedback please
            104953 by: Chris Earle

    Mail() function problem
            104957 by: Balaji Ankem
            104966 by: Jason Wong
            105087 by: Richard Lynch

    Re: User Enviroment Vars
            104958 by: Michael Sweeney
            105078 by: Richard Lynch

    Re: Email error (Was: Hi Jason)
            104960 by: Jason Wong
            104963 by: Balaji Ankem

    Re: does a form submit from a http page to a https ensure secure data?
            104962 by: Michael Sweeney
            104965 by: B.C. Lance
            105062 by: Chris Shiflett
            105064 by: Chris Shiflett
            105074 by: Richard Lynch
            105100 by: Richard Lynch
            105103 by: John Holmes
            105105 by: Chris Shiflett
            105106 by: Chris Shiflett

    Re: $name = "My $row['name']" not longer possible?
            104967 by: Hugo Wetterberg
            104995 by: Uwe Birkenhain
            104997 by: Matt Schroebel
            105081 by: Richard Lynch

    Emalloc Fatal Error
            104968 by: Brian Paulson

    Regular Expression Problem
            104970 by: Martin Clifford
            104972 by: Jason Wong
            104979 by: Martin Clifford
            104983 by: Erik Price
            104991 by: Jason Wong
            105053 by: Uli B

    Frames JavaScript and PHP
            104973 by: Beeman
            104975 by: Lazor, Ed

    find and replace in php
            104974 by: Henry
            104980 by: Lazor, Ed
            104993 by: Erik Price
            104994 by: Henry

    PHP and Apache
            104976 by: B i g D o g
            104978 by: Michael Sweeney
            104981 by: B i g D o g

    exec() function giving me fits
            104977 by: Jay Blanchard
            105058 by: Analysis & Solutions

    upgrading php...
            104982 by: Phil Schwarzmann
            104984 by: Andrew Brampton
            104986 by: Jason Wong
            104988 by: Lazor, Ed
            104989 by: Julie Meloni
            104999 by: Scott Fletcher

    Copy of Ed Lazor's response : find and replace in php
            104985 by: Henry
            104987 by: Henry
            104990 by: Lazor, Ed

    $_SESSION
            104996 by: Scott Fletcher
            105000 by: Kevin Stone

    Alpha Channel Question
            104998 by: Anzak Wolf
            105025 by: Lazor, Ed
            105045 by: Rodolfo Gonzalez

    DBX Functions
            105001 by: B i g D o g

    ...
            105002 by: matthew de Jongh

    Test if URL is alive before including a remote JS
            105003 by: Verdon Vaillancourt
            105004 by: Kevin Stone
            105009 by: Verdon Vaillancourt
            105022 by: Kevin Stone
            105088 by: Richard Lynch
            105089 by: Richard Lynch

    PHP-PDB: Create files for PALM Pilot
            105005 by: LeTortorec, Jean-Louis

    Re: Help please!
            105006 by: Steve Vernon
            105023 by: Lazor, Ed
            105028 by: Steve Vernon
            105030 by: Lazor, Ed
            105050 by: David Freeman
            105090 by: Richard Lynch
            105092 by: Richard Lynch

    Have you seen this host?
            105007 by: Tony Harrison
            105010 by: Scott Fletcher
            105013 by: Tony Harrison
            105014 by: Erik Price
            105020 by: Lazor, Ed
            105021 by: B i g D o g
            105026 by: Lazor, Ed
            105029 by: Kevin Stone

    blank
            105008 by: matthew
            105012 by: Scott Fletcher

    Re: php and apache path...
            105011 by: Nightshade
            105019 by: Analysis & Solutions
            105024 by: Nightshade
            105048 by: Analysis & Solutions
            105110 by: Justin French

    synchronizing php functions
            105015 by: Philip MacIver
            105091 by: Richard Lynch

    Re: pdf_show_boxed
            105016 by: Miguel Cruz
            105076 by: Richard Lynch

    upload problems - "unable to open 'none'
            105017 by: Phil Schwarzmann
            105027 by: Lazor, Ed
            105057 by: Lazor, Ed
            105071 by: Richard Lynch

    NEVERMIND MY LAST POST ABOUT UPLOAD ERRORS
            105018 by: Phil Schwarzmann

    RegEx question
            105031 by: David Busby
            105032 by: Kevin Stone
            105033 by: Henning Sittler
            105038 by: Gurhan Ozen
            105093 by: Richard Lynch

    Re: securing an 'includes' dir
            105034 by: Richard Lynch

    Re: Beginner Sessions Question
            105035 by: Richard Lynch
            105042 by: Lazor, Ed
            105047 by: Erik Price

    Re: Constants
            105036 by: Richard Lynch

    Dealing with XML charsets
            105037 by: Peter
            105044 by: Ray Hunter
            105046 by: Clay Loveless

    Help - I'm New
            105039 by: admin
            105040 by: Tyler Longren
            105041 by: B i g D o g
            105043 by: Gurhan Ozen

    gc_probability: requests tallied per server or domain?
            105049 by: Johnson, Kirk

    $_POST into a formatted string, help!
            105051 by: php.net.co.cr
            105052 by: Kevin Stone
            105060 by: Analysis & Solutions

    Using PHP to execute system commands on Win 98 w/apache
            105054 by: Police Trainee
            105097 by: Richard Lynch

    Make strict?
            105055 by: David Busby
            105061 by: Analysis & Solutions
            105098 by: Richard Lynch

    Why is PHP unable to access my select list values?
            105056 by: Reginald Alex Mullin
            105099 by: Richard Lynch

    Re: Redirecting with the POST method.
            105059 by: Chris Shiflett

    Re: blank (OT)
            105065 by: Chris Shiflett

    Re: Help and advice sought - search/replace
            105066 by: David Robley
            105073 by: Jarrad Kabral

    help with PHPwebsite
            105067 by: admin
            105068 by: Analysis & Solutions

    Stupid PDF...
            105069 by: Richard Lynch

    Strings with embedded quotes and double quotes
            105070 by: C. Cormier - Ormetal Inc.
            105104 by: Jason Wong

    Re: Where do I specify a DSN?
            105072 by: Richard Lynch

    Re: .htpasswd
            105075 by: Richard Lynch

    Re: storing content data outside the application
            105077 by: Richard Lynch

    Re: Undefined Offset Error
            105079 by: Richard Lynch

    Re: mac ie and force download
            105080 by: Richard Lynch

    Re: Writing text line with no breaks.
            105082 by: Richard Lynch

    Re: PHP does not work??
            105094 by: Richard Lynch

    Re: Java Pop UP...
            105095 by: Richard Lynch

    Re: diffrance : require(); a file from localhost and from a domain.
            105096 by: Richard Lynch

    SESSION newbie question
            105102 by: php.net.co.cr

    eval problem
            105107 by: Greg Wineman
            105109 by: Analysis & Solutions
            105113 by: Analysis & Solutions
            105114 by: Greg Wineman
            105116 by: Greg Wineman
            105117 by: Analysis & Solutions
            105118 by: Greg Wineman

    Re: svg graphics and php : is it possible
            105108 by: Justin French

    Re: DOCUMENT_ROOT disappeared on me!
            105111 by: Steve Yates

    Re: php-general Digest 2 Jul 2002 15:34:34 -0000 Issue 1440
            105119 by: Garth Dahlstrom

    Will mail() function work for SMTP servers which needs Authentication
            105120 by: Balaji Ankem

    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:


    Hi,

    I have a form kinda like this:
    <form action=$PHP_SELF?option=Mass&action=add method=POST
    enctype=multipart/form-data>
    <input type=file name=passcodeFile>

    the rest of the form is there too. And $PHP_SELF is set to $PHP_SELF =
    $_SERVER[PHP_SELF] at the top of the page.

    When I select a passcodeFile file to upload and click the "upload"
    button, I am presented with this on the next page:
    "You need to specify a file to use."

    Here's what I did:
    if ($_POST[passcodeFile] == "") {
            print "You need to specify a file to use.";
    }

    Any ideas why it does that even if I do select a file?

    Thanks,
    tyler

    attached mail follows:


    On Tuesday 02 July 2002 23:34, Tyler Longren wrote:
    > Hi,
    >
    > I have a form kinda like this:
    > <form action=$PHP_SELF?option=Mass&action=add method=POST
    > enctype=multipart/form-data>
    > <input type=file name=passcodeFile>

    You really should use "" around your tag values. What you have is invalid
    HTML.

    > the rest of the form is there too. And $PHP_SELF is set to $PHP_SELF =
    > $_SERVER[PHP_SELF] at the top of the page.
    >
    > When I select a passcodeFile file to upload and click the "upload"
    > button, I am presented with this on the next page:
    > "You need to specify a file to use."
    >
    > Here's what I did:
    > if ($_POST[passcodeFile] == "") {
    > print "You need to specify a file to use.";
    > }
    >
    > Any ideas why it does that even if I do select a file?

    1) print_r($_POST) to see what you have, while you're at it, do the same for
    $_FILES.

    2) Use the example(s) in the manual, once you have them working modify to
    suit.

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

    /* Nature always sides with the hidden flaw. */

    attached mail follows:


    On Tue, 2 Jul 2002 23:45:56 +0800 Jason Wong <php-generalgremlins.com.hk> wrote:

    > On Tuesday 02 July 2002 23:34, Tyler Longren wrote: > > Hi, > > > > I have a form kinda like this: > > <form action=$PHP_SELF?option=Mass&action=add method=POST > > enctype=multipart/form-data> > > <input type=file name=passcodeFile> > > You really should use "" around your tag values. What you have is > invalid HTML. > > > the rest of the form is there too. And $PHP_SELF is set to > > $PHP_SELF =$_SERVER[PHP_SELF] at the top of the page. > > > > When I select a passcodeFile file to upload and click the "upload" > > button, I am presented with this on the next page: > > "You need to specify a file to use." > > > > Here's what I did: > > if ($_POST[passcodeFile] == "") { > > print "You need to specify a file to use."; > > } > > > > Any ideas why it does that even if I do select a file? > > 1) print_r($_POST) to see what you have, while you're at it, do the > same for $_FILES. > > 2) Use the example(s) in the manual, once you have them working modify > to suit. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development > * > > /* > Nature always sides with the hidden flaw. > */

    that worked. I had to use _FILES instead of _POST

    I still get these errors though: "Warning: fopen("", "r") - Success in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151

    Warning: stat failed for (errno=2 - No such file or directory) in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151

    Warning: fread(): supplied argument is not a valid File-Handle resource in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151"

    And here's the line that produces them: $data = fread(fopen("$_FILES[passcodeFile_name]", "r"), filesize("$_FILES[passcodeFile]"));

    any ideas on that one? This is the problem I have been working on for a few days now.

    Thanks, Tyler

    attached mail follows:


    On Tuesday 02 July 2002 23:54, Tyler Longren wrote:

    > that worked. I had to use _FILES instead of _POST > > I still get these errors though: > "Warning: fopen("", "r") - Success in > /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151 > > Warning: stat failed for (errno=2 - No such file or directory) in > /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151 > > Warning: fread(): supplied argument is not a valid File-Handle resource > in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line > 151" > > And here's the line that produces them: > $data = fread(fopen("$_FILES[passcodeFile_name]", "r"), > filesize("$_FILES[passcodeFile]")); > > any ideas on that one? This is the problem I have been working on for a > few days now.

    My understanding of the file upload process is that the uploaded file get written to a tmp directory under a tmp filename. It is your responsibility to match this tmp filename with the real filename and copy it somewhere (or do something with it) because as soon as the script ends the tmp files will be deleted.

    Please, do yourself a favour -- study the examples in the manual and save yourself a few more days of grief :)

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

    /* Would the last person to leave Michigan please turn out the lights? */

    attached mail follows:


    ><form action=$PHP_SELF?option=Mass&action=add method=POST >enctype=multipart/form-data> ><input type=file name=passcodeFile> > >the rest of the form is there too. And $PHP_SELF is set to $PHP_SELF = >$_SERVER[PHP_SELF] at the top of the page. > >When I select a passcodeFile file to upload and click the "upload" >button, I am presented with this on the next page: >"You need to specify a file to use." > >Here's what I did: >if ($_POST[passcodeFile] == "") {

    phpinfo();

    #I dunno what is there, but whatever it is, this will tell you.

    > print "You need to specify a file to use."; >} > >Any ideas why it does that even if I do select a file?

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    am I correct in assumnig the following will not work;

    user directory /usr/home/joeuser symlink to document directory /usr/home/joeuser/www -> /usr/local/www/data/joeuser document directory /usr/local/www/data/joeuser

    in httpd.conf php_admin_value open_base_dir /usr/home/joeuser

    this will not allow joeuser to access files in the /usr/local/www/data/joeuser tree correct?

    Dave

    attached mail follows:


    On Tuesday 02 July 2002 23:44, Dave wrote: > am I correct in assumnig the following will not work; > > user directory > /usr/home/joeuser > symlink to document directory > /usr/home/joeuser/www -> /usr/local/www/data/joeuser > document directory > /usr/local/www/data/joeuser > > in httpd.conf > php_admin_value open_base_dir /usr/home/joeuser > > this will not allow joeuser to access files in the > /usr/local/www/data/joeuser tree correct?

    Try it and see? Apache has a directive FollowSymLinks, not sure whether default is on or off, set it explicitly to make sure.

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

    /* Tuesday After Lunch is the cosmic time of the week. */

    attached mail follows:


    Hi all!

    Since I am new to PHP, I need the help of someone who is very familiar with the way PHP handles the setting of cookies and page redirection - in other words, an expert!

    Here is an outline of the problem: 1) client browser hits myPage.php 2) myPage.php does a few checks & recognises that this is a first visit 3) myPage.php sets a cookie using setCookie() 4) myPage.php redirects to checkBrow.php which uses JavaScript to do some basic browser detection 5) checkBrow.php does checks and looks for cookie written by myPage.php 6) checkBrow.php fails to find the cookie because header( "Location: http://someaddress" ) in step (4) has trashed the header containing the cookie information!! Note that ob_start() has to be used to prevent any data being sent to the client before the header has been set.. i.e. the page is being cached server-side.

    myPage.php was originally written in ASP and worked fine. ASP seems to write the cookie back to the client browser first, and *then* performs a redirect. PHP on the otherhand seems to overwrite any existing headers when using header( "Location: http://someaddress" ) because they are cached. While this behaviour seems obvious it presents some rather annoying problems. I've kludged a fix by setting the cookie and then writing a page that uses a <META> refresh to redirect...

    Is there a more elegant way of doing this?? Please please tell me there is because I hate having to do such a crappy workaround. If you need more info on what the html headers look like - before and after - mail me and I'll be happy to provide you with them...

    Regards, Cord Schneider

    attached mail follows:


    Cord Schneider wrote:

    >Here is an outline of the problem: >1) client browser hits myPage.php >2) myPage.php does a few checks & recognises that this is a first visit >3) myPage.php sets a cookie using setCookie() >4) myPage.php redirects to checkBrow.php which uses JavaScript to do some >basic browser detection >5) checkBrow.php does checks and looks for cookie written by myPage.php >6) checkBrow.php fails to find the cookie because header( "Location: >http://someaddress" ) in step (4) has trashed the header containing the >cookie information!! Note that ob_start() has to be used to prevent any data >being sent to the client before the header has been set.. i.e. the page is >being cached server-side. >

    This is a common problem people experience. When you use a "Location" header in this way, you not only add a simple HTTP header to the response, you also change the status code. The basic answer is, you cannot successfuly generate a "Set-Cookie" header and a "Location" header on the same page. This is a characteristic of the HTTP protocol, so you will find this in ColdFusion (cflocation) and other server-side scripting languages as well.

    >myPage.php was originally written in ASP and worked fine. ASP seems to write >the cookie back to the client browser first, and *then* performs a redirect. >

    If you don't mind, I'm interested in learning more about what exactly ASP does differently. Are there two HTTP responses sent?

    >kludged a fix by setting the cookie and then writing a page that uses a ><META> refresh to redirect... > >Is there a more elegant way of doing this?? >

    That's the workaround most people end up with, and yes, it sucks. The best you can do for an elegant "solution" is to make your page completely white with a 0 second wait on the refresh, and it will be difficult to notice. Of course, those whose browsers don't automatically redirect will be staring at a blank screen.

    The "real" solution is usually to learn about all the limitations of the Web environment and try to design your solution around them. By your intelligent questions, I can tell you have a good grasp of what's going on, so I'll bet you can think of a slightly modified design that will work better for you.

    Happy hacking.

    Chris

    attached mail follows:


    >3) myPage.php sets a cookie using setCookie() >4) myPage.php redirects to checkBrow.php which uses JavaScript to do some >basic browser detection

    >the cookie back to the client browser first, and *then* performs a redirect.

    That's nice...

    But different browsers handle the headers in different orders, and it's only gonna work on *SOME* browsers.

    Probably ASP did it the way that IE works, but not Netscape.

    Don't do a Cookie and a re-direct together.

    Period.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >If you don't mind, I'm interested in learning more about what exactly >ASP does differently. Are there two HTTP responses sent?

    No, it just happens to have sent them in the order his browser liked.

    ASP can't do anything "different" from PHP.

    I used to laugh when ASPers asked why PHP had to do all this extra stuff with cookies and stuff to do sessions. Sigh. :-)

    Some browsers will process the headers in one order, others in the reverse.

    Some will see the Location: and ignore the rest.

    You can't do both and support all browsers.

    >>kludged a fix by setting the cookie and then writing a page that uses a >><META> refresh to redirect... >> >>Is there a more elegant way of doing this??

    Re-design and re-factor your code so you don't need to re-direct. :-)

    I rarely, almost never, use header("Location: ...");

    Rule of Thumb: If you have to do header("Location: ...") you have a design/engineering/organizational problem in your code/pages/site.

    I'm sure a zillion people will disagree with this "rule" I can only say that when I started focussing on what my code was *really* doing, and really factoring out the common things, and organizing my pages better, the header("Location: ...") tool got thrown out (mostly) of my tool box.

    YMMV.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    on 03/07/02 11:54 AM, Richard Lynch (richphpbootcamp.com) wrote:

    > Rule of Thumb: > If you have to do header("Location: ...") you have a > design/engineering/organizational problem in your code/pages/site. > > I'm sure a zillion people will disagree with this "rule"

    I agree, except there's one exception to this that I can't see a way around.

    When dealing with form submissions the receiving file needs to validate all the code before anything is sent to the browser, update the database (or whatever) and then redirect to itself with some sort of GET flag that issues a thankyou note or something.

    Otherwise people can hit "refresh" and post the data twice, or 10 times :)

    I can't see any SERVER SIDE way around this.

    Justin French

    attached mail follows:


    Justin French wrote:

    >on 03/07/02 11:54 AM, Richard Lynch (richphpbootcamp.com) wrote: > > > >>Rule of Thumb: >>If you have to do header("Location: ...") you have a >>design/engineering/organizational problem in your code/pages/site. >> >>I'm sure a zillion people will disagree with this "rule" >> >> > >I agree, except there's one exception to this that I can't see a way around. > >When dealing with form submissions the receiving file needs to validate all >the code before anything is sent to the browser, update the database (or >whatever) and then redirect to itself with some sort of GET flag that issues >a thankyou note or something. > >Otherwise people can hit "refresh" and post the data twice, or 10 times :) >

    This is the most common legitimate use of the "Location" header.

    I don't agree with the general rule of thumb that the use of the "Location" header is bad, but I have reviewed plenty of code where people misuse it terribly, as a lazy goto-style operation. In most cases, you do want to design your application to: 1) receive data 2) analyze data 3) respond with appropriate response

    If you instead do this: 1) receive data 2) analyze data 3) respond with a "Location" header telling the Web client where to get the appropriate response 4) receive the subsequent GET request 5) respond with appropriate response

    then this is the type of misuse that runs rampant and makes people like Mr. Lynch have a distaste for its use.

    Like many things, it is all a matter of the developer. Personally, I like PHP's general approach of giving the developer the power to do anything, even if it is bad. *shrug* Most criticism I've heard of PHP (like the bogus security vulnerabilities cited in PHP) stems from this characteristic.

    Anyway, I've stumbled off-topic...

    Chris

    attached mail follows:


    Hi friend, I am getting the following problem from last 6 months..still I couldn't solve this problem.

    >>Warning: Failed to Connect in c:\www\imac\email.php on line 18

    >>Warning: Failed to Connect in c:\www\imac\email.php on line 22

    Email.php ============ <?php //BE SURE TO CHANGE THE 3 LINES BELOW TO USE YOUR OWN //ADDRESS, NAME and DATA FILENAME //THE DATA FILE MUST ALREADY EXIST AND BE WORLD WRITEABLE $webweaver = "balaji.ankemwipro.com"; $wwname = "Balaji Ankem"; $filename = "visitors.dat";

    if (file_exists ($filename)) {

    $user_name="Ramesh"; $user_mail="ramesh.ottikuntawipro.com";

    mail($webweaver,"Visitor to PHP Example Form page", "$user_name <$user_mail> just visited your site and submitted the form at www.auburn.edu/helpdesk/php/form.html.", "From: $user_name <$user_mail>");

    mail($user_mail,"Thanks for visiting","Dear $user_name,\n We appreciate your visit.\n\n$wwname\n<$webweaver>", "From: $wwname <$webweaver>");

    echo "<p>Your name: <b>$user_name</b><br> and e-mail address: <b>$user_mail</b><br> have been sent to the webweaver, <b>$wwname</b>, and a response has been e-mailed to you.<p> Not only that, you've been added to our records!</p>";

    // record the visitor info $user_info = $user_name . " - " . $user_mail . "\n";

    // open the file in append mode $handle = fopen ($filename,'a+');

    fputs($handle,$user_info);

    //close the file fclose($handle);

    } else { echo "<b>The file $filename does not exist and needs to be created for this to work.</b>"; }

    ?> ======================

    Thanks and Regards Balaji


    attached mail follows:


    Hello,

    I've upgraded to Mandrake 8.2 and installed a couple of apps that later un-installed. Somewhere along the line I have hosed myself because while running php-nuke I have noticed that all of the new passwords that are getting added to the database (mysql) have a $1$ in front of them. These users cannot validate themselves, it throws an error on the comparision.

    Code from php-nuke;

    $setinfo = mysql_fetch_array($result); $dbpass=$setinfo[pass]; if(!$system) { $pass=crypt($pass,substr($dbpass,0,2)); } if (strcmp($dbpass,$pass)) { Header("Location: user.php?stop=1"); return; }

    I have about 1100 users with no $1$ and 20 with...

    First, what have I done to myself? Second is there an easy fix to get the new users working.

    Thank you for all the help.

    - Brett haybjollybelly.com

    attached mail follows:


    Message-ID: <00bd01c221e1$e654a3a0$fd00a8c0test.com> Reply-To: "Brett Hay" <haybjollybelly.com> From: "Brett Hay" <haybjollybelly.com> To: <php-generallists.php.net> Date: Tue, 2 Jul 2002 12:02:43 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00BA_01C221C0.5F278C60" Subject: PHP crypt() now adding $1$ to password

    ------=_NextPart_000_00BA_01C221C0.5F278C60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

    Hello,

    I've upgraded to Mandrake 8.2 and installed a couple of apps that I later un-installed. Somewhere along the line I have hosed myself because while running php-nuke I have noticed that all of the new passwords that are getting added to the database (mysql) have a $1$ in front of them. These users cannot validate themselves, it throws an error on the comparison.

    Code from php-nuke;

    $setinfo = mysql_fetch_array($result); $dbpass=$setinfo[pass]; if(!$system) { $pass=crypt($pass,substr($dbpass,0,2)); } if (strcmp($dbpass,$pass)) { Header("Location: user.php?stop=1"); return; }

    I have about 1100 users with no $1$ and 20 with...

    First, what have I done to myself? Second is there an easy fix to get the new users working.

    Thank you for all the help.

    - Brett haybjollybelly.com

    ------=_NextPart_000_00BA_01C221C0.5F278C60--

    attached mail follows:


    >getting added to the database (mysql) have a $1$ in front of them. These

    I'm pretty sure that's the way the other encryption scheme works.

    You've convinced your computer to switch to YYY instead of XXX for encryption routines...

    So now you are using the one with the 18-character salt, instead of the one with a 2-character salt.

    Maybe start here: http://php.net/crypt

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi All

    I need to execute a php script every hour. I am expecting to do this using a cron job. The question is what command line do I use to execute a php script. Bearing in mind that my configuration is as shown below

    Thanks in advance

    Henry

    My Configuration is as follows:

    PHP Version 4.0.4pl1 System Linux nova 2.2.17 #2 Sun Oct 22 12:09:20 IST 2000 i686 unknown Build Date Feb 11 2001 Configure Command './configure' '--prefix=/Zend' '--with-apxs=/usr/local/apache/bin/apxs' '--disable-debug' '--with-config-file-path=/usr/local/Zend/etc' '--without-db2' '--disable-sysvsem' '--disable-sysvshm' '--enable-xml' '--enable-wddx' '--with-mysql' '--with-gd=shared,/usr/local/gd' '--enable-gd-imgstrttf' '--with-jpeg-dir=/usr/local/jpeg' '--with-ttf=/usr/local/freetype' '--with-t1lib=/usr/local/t1lib' '--with-pgsql=shared,/usr/local/postgres' '--with-imap=shared,/usr/local/imap' '--with-ldap=shared,/usr/local/openldap' '--with-ibm-db2=shared,/usr/local/db2' '--with-oci8=shared,/usr/local/oracle' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/Zend/etc ZEND_DEBUG disabled Thread Safety disabled

    attached mail follows:


    PS. I cannot compile as a binary etc. This configuration is the confi of the shared server I am using which is hosted by a third part.

    Henry

    attached mail follows:


    On Wednesday 03 July 2002 00:25, Henry wrote: > PS. I cannot compile as a binary etc. This configuration is the confi of > the shared server I am using which is hosted by a third part.

    This has been covered many times in the past as a quick search of the archives would reveal.

    If you don't have PHP compiled as CGI then your only recourse is to use something like lynx to run your script.

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

    /* No, I don't have a drinking problem.

    I drink, I get drunk, I fall down.

    No problem! */

    attached mail follows:


    On Tuesday, July 2, 2002, at 12:25 PM, Henry wrote:

    > PS. I cannot compile as a binary etc. This configuration is the confi > of the > shared server I am using which is hosted by a third part.

    If your PHP is not compiled as a CGI interpreter, then you can't do commandline PHP commands. But all is not lost. You can have the cron job execute a shell script that executes lynx or links or wget, or even just executes the command directly from the cron job, and have that lynx/links/wget request a PHP script that does what you want done.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Thanks,

    Only one concern. Are there any security issues. And I suppose more importantly, if there are; is there a way to get the php-script to ensure that is is being invoked by my cron deamon. Should I put the page in a directory and use .htaccess to control security. Or can I check the referrer to ensure that it is not being invoked via a browser!!

    I'm going to go down the wget path at the moment. Thanks in advance.

    Henry

    "Erik Price" <priceehhbrown.com> wrote in message news:6E0EFF69-8DDC-11D6-B565-0050E4857868hhbrown.com... > > On Tuesday, July 2, 2002, at 12:25 PM, Henry wrote: > > > PS. I cannot compile as a binary etc. This configuration is the confi > > of the > > shared server I am using which is hosted by a third part. > > If your PHP is not compiled as a CGI interpreter, then you can't do > commandline PHP commands. But all is not lost. You can have the cron > job execute a shell script that executes lynx or links or wget, or even > just executes the command directly from the cron job, and have that > lynx/links/wget request a PHP script that does what you want done. > > > Erik > > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com >

    attached mail follows:


    Henry,

    lynx --dump http://www.domain.com/myfile.php

    "man lynx" for details. You can run it from cron. HTH Chris

    Henry wrote:

    >PS. I cannot compile as a binary etc. This configuration is the confi of the >shared server I am using which is hosted by a third part. > >Henry > > >

    attached mail follows:


    On Tuesday, July 2, 2002, at 01:00 PM, Henry wrote:

    > Only one concern. Are there any security issues. > And I suppose more > importantly, if there are; is there a way to get the php-script to > ensure > that is is being invoked by my cron deamon. Should I put the page in a > directory and use .htaccess to control security. Or can I check the > referrer > to ensure that it is not being invoked via a browser!!

    There are always security issues. I have no idea about the details of your system, your needs, or anything else, so I can't tell you anything except to think logically about what you are doing. Does taking the wget path mean that anybody can use links/lynx/wget/telnet/Internet Explorer/Mozilla to execute your script? Most definitely. Be sure that you take this into account when you design it (you may wish to check things like the User-agent, IP address, and other HTTP variables to make sure that it is being executed "properly").

    > I'm going to go down the wget path at the moment. Thanks in advance.

    Good idea -- seems like your only option according to what you've told us.

    Personally I would probably write a Perl script (most hosts have Perl) to do whatever it is that needs to be done and have cron execute that, this saves you from a whole window of exploit (the web server). But if you don't have Perl or don't know Perl, that's a problem.

    Good luck,

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    I'm having to learning new languages faster than I'm having hot dinners. When I say learn I don't mean become some sort of guru, just enough to get by. If I wanted to do it in perl (and I know this isn't the right newsgroup, but please excuse me), how would I access a mysql server?

    Besides that, its working a treat with wget and php. I'll have a fully fledged autoresponder system up in no time. Thankyou all.

    Henry

    "Erik Price" <priceehhbrown.com> wrote in message news:29473BAE-8DDF-11D6-B565-0050E4857868hhbrown.com... > > On Tuesday, July 2, 2002, at 01:00 PM, Henry wrote: > > > Only one concern. Are there any security issues. > > And I suppose more > > importantly, if there are; is there a way to get the php-script to > > ensure > > that is is being invoked by my cron deamon. Should I put the page in a > > directory and use .htaccess to control security. Or can I check the > > referrer > > to ensure that it is not being invoked via a browser!! > > There are always security issues. I have no idea about the details of > your system, your needs, or anything else, so I can't tell you anything > except to think logically about what you are doing. Does taking the > wget path mean that anybody can use links/lynx/wget/telnet/Internet > Explorer/Mozilla to execute your script? Most definitely. Be sure that > you take this into account when you design it (you may wish to check > things like the User-agent, IP address, and other HTTP variables to make > sure that it is being executed "properly"). > > > I'm going to go down the wget path at the moment. Thanks in advance. > > Good idea -- seems like your only option according to what you've told > us. > > Personally I would probably write a Perl script (most hosts have Perl) > to do whatever it is that needs to be done and have cron execute that, > this saves you from a whole window of exploit (the web server). But if > you don't have Perl or don't know Perl, that's a problem. > > > Good luck, > > Erik > > > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com >

    attached mail follows:


    >PS. I cannot compile as a binary etc. This configuration is the confi of the >shared server I am using which is hosted by a third part. > >Henry > >

    Get them to do the exact same command, without the apxs part, and put the resulting php binary in /usr/bin or somewhere handy...

    They *PROBABLY* already have it, actually...

    Can you SSH in and do:

    locate php | less

    Look for something like /usr/bin/php or /usr/local/bin/php or /usr/sbin/php or...

    Or, just try this at the command line, and pray:

    php -v

    If that spits out PHP info (version etc) then you're all set.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    That function, odbc_fetch_array() does not work. PHP spit out the error, undefined function.

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020702144849.GB12581panix.com... > Scott: > > On Tue, Jul 02, 2002 at 10:05:31AM -0400, Scott Fletcher wrote: > > I tried this script and it showed all of the data correctly, so how do I > > make the define variable to work correctly? > > > > > define(CUSTOMER_ID,0); > > > define(CUSTOMER_NAME,1); > > > define(STATE,6); > > > > > > // blah blah blah > > > > > > if (odbc_fetch_row($result)) > > > { > > > odbc_fetch_into($result,$user_detail,1); > > > { > > > echo $user_detail[STATE]; > > > } > > > } > > Why not make life simpler via odbc_fetch_array()? The names of the fields > become the names of the array's keys. Drop the defines() and > odbc_fetch_row() and just do this: > > while ( $user_detail = odbc_fetch_array($result) ) { > echo $user_detail['State']; > } > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

    attached mail follows:


    On Tue, Jul 02, 2002 at 11:59:59AM -0400, Scott Fletcher wrote: > That function, odbc_fetch_array() does not work. PHP spit out the error, > undefined function.

    Huh? Which version of PHP are you using? It's available in 4.0.2 or greater. Did you misspell the function name?

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Did you remember to compile ODBC into PHP?

    ./configure --help shows these odbc options:

    --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base install directory, defaults to /usr/local. --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base install directory, defaults to /usr/local.

    Dan

    -----Original Message----- From: Analysis & Solutions [mailto:danielcanalysisandsolutions.com] Sent: Tuesday, July 02, 2002 10:50 AM To: PHP List Subject: Re: [PHP] Re: odbc_fetch_into ??

    On Tue, Jul 02, 2002 at 11:59:59AM -0400, Scott Fletcher wrote: > That function, odbc_fetch_array() does not work. PHP spit out the error, > undefined function.

    Huh? Which version of PHP are you using? It's available in 4.0.2 or greater. Did you misspell the function name?

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

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

    attached mail follows:


    php 4.2.1. On the php.net website, the odbc_fetch_array webpage, it stated that it become unavailable with around php 4.1.1. Some of the other odbc functions became unavailable also.

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020702164955.GA18623panix.com... > On Tue, Jul 02, 2002 at 11:59:59AM -0400, Scott Fletcher wrote: > > That function, odbc_fetch_array() does not work. PHP spit out the error, > > undefined function. > > Huh? Which version of PHP are you using? It's available in 4.0.2 or > greater. Did you misspell the function name? > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

    attached mail follows:


    You misspelled "Location" in the job search under preferences of a found person.

    "Bret L Conard" <bretlcdonet.com> wrote in message news:001701c221dc$a4713700$02fea8c0BretLConard... Hi All...... I have recently completed work on a PHP, MySQL driven job site for Technical employment. Geared toward independent contractors and the people who hire them.

    If any one has the time, could you look at: www.tech-temp.com and give feedback either on the list or privately? I *think* I have covered all the bases but could use the input....

    Thanks, Bret

    attached mail follows:


    Hi friend,

    I am using the SMTP server which needs authentication. When I use mail(balaji.ankemwipro.com,"Thanks for visiting","From:ramesh.ottikuntawipro.com");

    I am getting server error on the line which is having this mail function.

    How can I resolve this problem?

    Php.ini settings =================================================================== sendmail_from balaji.ankemwipro.com balaji.ankemwipro.com sendmail_path no value no value SMTP 10.145.2.16 10.145.2.16 ====================================================================

    10.145.2.16 is my SMTP server Ip address.

    Any help would be greatly appreciated.

    Thanks and Regards Balaji


    attached mail follows:


    On Wednesday 03 July 2002 00:52, Balaji Ankem wrote:

    > I am using the SMTP server which needs authentication.

    I don't think the built-in mail command handles authentication.

    Google > php smtp auth

    that should point you in the right direction.

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

    /* The Osmonds! You are all Osmonds!! Throwing up on a freeway at dawn!!! */

    attached mail follows:


    > >Hi friend, > > I am using the SMTP server which needs authentication.

    And where did you put the username/password in that will authenticate PHP?... :-)

    I dunno where you have to put it, and maybe you just can't do that, but you can't expect PHP to just magically "know" your password...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Ask them.

    Seriously, PHP is a server-side platform. The only information about the client that you're possibly going to be able to get is what is passed to you either through the headers of a request (basically just the remote address and some browser information), or what the user tells you through a form submission. The reasons for this limitation should be pretty obvious.

    ..mike..

    On Tue, 2002-07-02 at 05:03, James Brisland wrote: > Has anyone her got any idea how I could access the User Env Vars so I can > get processor type, speed, ram etc. Is there any way to do this? Or would be > be something other than PHP. Also I need to do this over the web and not on > their machine. > > Any ideas? > > James. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    >Has anyone her got any idea how I could access the User Env Vars so I can >get processor type, speed, ram etc. Is there any way to do this? Or would be >be something other than PHP. Also I need to do this over the web and not on >their machine.

    For security reasons, you are forbidden that information.

    People with brand-new computers are not keen on the idea of web-tracking making them targets for robbery, for some odd reason. :-)

    You could ask them to run some standard System Info tool and upload the output by hand, but that's the best you're gonna get.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    On Wednesday 03 July 2002 00:24, you wrote: > Hi Jason, > when I am trying to send email through email.php > I have got following errors..... > > ================= > Warning: Server Error in c:\www\imac\email.php on line 18 > > Warning: Server Error in c:\www\imac\email.php on line 22 > ================ > > What will be the reason? > > Thanks and Regards > Balaji

    Please do not write to me directly. If you need help privately then I would need to charge a consultation fee. I'm placing this back onto the list where it belongs. Unless, that is, you really do want to pay a consultation fee, in which case let me know and we'll take it back private :)

    BTW you need to provide more info than that before people can help. How about some code? Don't forget to indicate where line 18 & 22 are.

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

    /* Rube Walker: "Hey, Yogi, what time is it?" Yogi Berra: "You mean now?" */

    attached mail follows:


    Hi jason, Thankyou for the prompt reply.:-) here is the code..... Actually line number 18 and 22 are having mail functions..that why I didn't send source code..... Here is the source code.. ================================== <?php //BE SURE TO CHANGE THE 3 LINES BELOW TO USE YOUR OWN //ADDRESS, NAME and DATA FILENAME //THE DATA FILE MUST ALREADY EXIST AND BE WORLD WRITEABLE $webweaver = "balaji.ankemwipro.com"; $wwname = "Balaji Ankem"; $filename = "visitors.dat";

    if (file_exists ($filename)) {

    $user_name="Ramesh"; $user_mail="ramesh.ottikuntawipro.com";

    mail($webweaver,"Visitor to PHP Example Form page", "$user_name <$user_mail> just visited your site and submitted the form at www.auburn.edu/helpdesk/php/form.html.", "From: $user_name <$user_mail>");

    mail($user_mail,"Thanks for visiting","Dear $user_name,\n We appreciate your visit.\n\n$wwname\n<$webweaver>", "From: $wwname <$webweaver>");

    echo "<p>Your name: <b>$user_name</b><br> and e-mail address: <b>$user_mail</b><br> have been sent to the webweaver, <b>$wwname</b>, and a response has been e-mailed to you.<p> Not only that, you've been added to our records!</p>";

    // record the visitor info $user_info = $user_name . " - " . $user_mail . "\n";

    // open the file in append mode $handle = fopen ($filename,'a+');

    fputs($handle,$user_info);

    //close the file fclose($handle);

    } else { echo "<b>The file $filename does not exist and needs to be created for this to work.</b>"; }

    ?>

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

    Thanks and Regards Balaji

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Tuesday, July 02, 2002 10:30 PM To: php-generallists.php.net Subject: [PHP] Re: Email error (Was: Hi Jason)

    On Wednesday 03 July 2002 00:24, you wrote: > Hi Jason, > when I am trying to send email through email.php > I have got following errors..... > > ================= > Warning: Server Error in c:\www\imac\email.php on line 18 > > Warning: Server Error in c:\www\imac\email.php on line 22 > ================ > > What will be the reason? > > Thanks and Regards > Balaji

    Please do not write to me directly. If you need help privately then I would need to charge a consultation fee. I'm placing this back onto the list where it belongs. Unless, that is, you really do want to pay a consultation fee, in which case let me know and we'll take it back private :)

    BTW you need to provide more info than that before people can help. How about some code? Don't forget to indicate where line 18 & 22 are.

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

    /* Rube Walker: "Hey, Yogi, what time is it?" Yogi Berra: "You mean now?" */

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


    attached mail follows:


    Your form action parameter has an absolute url specifying an https protocol. When the browser submits the form, it uses the url you specify which is https. So the request is going to be encrypted. You might consider serving the form page from https as well to kind of tighten things up a little, but the data will be posted under https which is an encrypted connection. Your main problem is going to be the fact that the http and https services are accessing two different file system spaces (or they should be unless you've got your server badly misconfigured) so the http://...register.php is going to be a different file from the https://...register.php. You might want to reconsider your design.

    ..mike..

    On Tue, 2002-07-02 at 04:21, B.C. Lance wrote: > hi, > > the above question has been puzzling me for a while. the situation is this. > > http://domainname.com/register.php > display a user registration form having > [form action="https://domainname.com/register.php" method="post"] > > will the data from that page be encrypted when it is sent via https > specified in the [form] action? > > note: the registration form is served from http. > > could someone enlighten me on this? > > regards, > b.c. lance > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    thanks for the insights. :)

    basically the 2 files are from 2 different domains saving to the same database server. the 2 sites share the same userbase. and when the registration form is submitted to the 2nd site, upon successful registration, it will redirect back to the 1st site and display a success page. otherwise it will redirect back to the 1st site and prompting them an error.

    you probably wonder why the complexity of the above scenario. basically the 2nd site has a ssl cert while the 1st site doesn't. so as a cost saving measure, the 1st site will be using the 2nd site's ssl cert to complete the user registration process.

    hope the above make sense to you.

    lance

    Michael Sweeney wrote:

    >Your form action parameter has an absolute url specifying an https >protocol. When the browser submits the form, it uses the url you specify >which is https. So the request is going to be encrypted. You might >consider serving the form page from https as well to kind of tighten >things up a little, but the data will be posted under https which is an >encrypted connection. Your main problem is going to be the fact that the >http and https services are accessing two different file system spaces >(or they should be unless you've got your server badly misconfigured) so >the http://...register.php is going to be a different file from the >https://...register.php. You might want to reconsider your design. > >..mike.. > >On Tue, 2002-07-02 at 04:21, B.C. Lance wrote: > > >>hi, >> >>the above question has been puzzling me for a while. the situation is this. >> >>http://domainname.com/register.php >>display a user registration form having >>[form action="https://domainname.com/register.php" method="post"] >> >>will the data from that page be encrypted when it is sent via https >>specified in the [form] action? >> >>note: the registration form is served from http. >> >>could someone enlighten me on this? >> >>regards, >>b.c. lance >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > >

    attached mail follows:


    Message-ID: <3D2243D0.3080506php.net> Date: Tue, 02 Jul 2002 19:22:40 -0500 From: Chris Shiflett <shiflettphp.net> MIME-Version: 1.0 To: "B.C. Lance" <lorniemagix.com.sg> CC: php-generallists.php.net Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP] does a form submit from a http page to a https ensure secure data?

    B.C. Lance wrote:

    > http://domainname.com/register.php > display a user registration form having > [form action="https://domainname.com/register.php" method="post"] > > will the data from that page be encrypted when it is sent via https > specified in the [form] action?

    The answer is yes. The SSL handshake will take place prior to the HTTP request (a POST request in your example) being sent.

    *Everything* involved in the HTTP transaction is encrypted, including the very first request, whether it is GET or POST.

    Cheers.

    Chris

    attached mail follows:


    Michael Sweeney wrote:

    >Your form action parameter has an absolute url specifying an https >protocol. When the browser submits the form, it uses the url you specify >which is https. So the request is going to be encrypted. You might >consider serving the form page from https as well to kind of tighten >things up a little >

    What is tightened up exactly? The original poster is probably trying to avoid SSL everywhere possible, thus the question. This is a very considerate approach, because SSL more than triples the amount of time taken to complete the HTTP transaction. He's trying to be polite to his users, rather than using SSL on one more page just to be safe, which is a tactic I applaud.

    >encrypted connection. Your main problem is going to be the fact that the >http and https services are accessing two different file system spaces >(or they should be unless you've got your server badly misconfigured) >

    Why would you consider this badly misconfigured? I would wager that *most* Web sites use the same document root for both http and https. Do you think this is insecure? Remember, the reason for using SSL is to protect the data during transmission, *not* the data sitting on the server, wherever that may be.

    Chris

    attached mail follows:


    >hi, > >the above question has been puzzling me for a while. the situation is this. > >http://domainname.com/register.php >display a user registration form having >[form action="https://domainname.com/register.php" method="post"] > >will the data from that page be encrypted when it is sent via https >specified in the [form] action? > >note: the registration form is served from http. > >could someone enlighten me on this?

    I think you need to have the FORM page itself be using HTTPS as well...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >>Your form action parameter has an absolute url specifying an https >>protocol. When the browser submits the form, it uses the url you specify >>which is https. So the request is going to be encrypted. You might >>consider serving the form page from https as well to kind of tighten >>things up a little > >What is tightened up exactly? The original poster is probably trying to >avoid SSL everywhere possible, thus the question. This is a very >considerate approach, because SSL more than triples the amount of time >taken to complete the HTTP transaction. He's trying to be polite to his >users, rather than using SSL on one more page just to be safe, which is >a tactic I applaud.

    Unfortunately, the messages going to the naive surfer will not make it clear when/where the "secure zone" is entered: *BEFORE* my data is sent, or *AFTER*?

    Better to have the *USER* (who shouldn't have to understand squat about HTTPS and SSL and servers) be told they are "secure" when they hit the form, and "insecure" only on the page after the page that took their information.

    While HTTPS may be 50 times as slow as HTTP, users who don't feel safe are users who don't spend money.

    Technologically, only the ACTION URL needs to be HTTPS. User-interface and customer-education wise, you'd better make the FORM page itself secure, as well as the "Receipt" or "Thank You", or you'll have worried users.

    >>encrypted connection. Your main problem is going to be the fact that the >>http and https services are accessing two different file system spaces >>(or they should be unless you've got your server badly misconfigured) > >Why would you consider this badly misconfigured? I would wager that >*most* Web sites use the same document root for both http and https. Do >you think this is insecure? Remember, the reason for using SSL is to >protect the data during transmission, *not* the data sitting on the >server, wherever that may be.

    In a shared server environment, if an ISP wants to provide SSL, and they let anybody put anything into the web-tree...

    Hey, I like the convenience, and that's how my host does it, but I'm not fooling myself that there aren't dumb CGI scripts out there that are exposing data they shouldn't between my colleagues' web-sites.

    I know *I* work very hard to not let any data "leak" into the file-system, process space, or any place that my fellow users can get to it, but I'm pretty damn sure other web developers are clueless about how much info I could go digging for if I wanted to.

    My old ISP had SSL on another server (or at least directory) and personally vetted every line of code that went on it. Royal PITA, but more secure.

    You are correct that SSL only protects the data between browser/server. That does not negate the "chinks" in the armor in a shared environment using the same web-tree directory to store scripts, and probably sensitive data, by the stupid.

    In other words, it won't make SSL itself any more secure, but it *DOES* make a difference in the data/scripts after SSL is done, and before they safely store/remove the data.

    Or, put it more simply: If *YOU* don't know what's in your [shared] SSL directory, then *YOU* don't know if it's secure.

    On a dedicated server, this is all moot, of course, assuming you're not stupidly creating logins for no purpose or something.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Just something to note, but the form, when displayed, won't have the "lock" or "key" or whatever, signifying a secure connection to the user. Depending on what kind of data you are collecting, this could be an issue. Most people probably won't notice, but if you're serving a smarter crowd, they may be hesitant to submit their form data, thinking it's going over an unsecured link...

    ---John Holmes...

    > -----Original Message----- > From: B.C. Lance [mailto:lorniemagix.com.sg] > Sent: Tuesday, July 02, 2002 1:13 PM > To: php-generallists.php.net > Subject: Re: [PHP] does a form submit from a http page to a https ensure > secure data? > > thanks for the insights. :) > > basically the 2 files are from 2 different domains saving to the same > database server. the 2 sites share the same userbase. and when the > registration form is submitted to the 2nd site, upon successful > registration, it will redirect back to the 1st site and display a > success page. otherwise it will redirect back to the 1st site and > prompting them an error. > > you probably wonder why the complexity of the above scenario. basically > the 2nd site has a ssl cert while the 1st site doesn't. so as a cost > saving measure, the 1st site will be using the 2nd site's ssl cert to > complete the user registration process. > > hope the above make sense to you. > > lance > > Michael Sweeney wrote: > > >Your form action parameter has an absolute url specifying an https > >protocol. When the browser submits the form, it uses the url you specify > >which is https. So the request is going to be encrypted. You might > >consider serving the form page from https as well to kind of tighten > >things up a little, but the data will be posted under https which is an > >encrypted connection. Your main problem is going to be the fact that the > >http and https services are accessing two different file system spaces > >(or they should be unless you've got your server badly misconfigured) so > >the http://...register.php is going to be a different file from the > >https://...register.php. You might want to reconsider your design. > > > >..mike.. > > > >On Tue, 2002-07-02 at 04:21, B.C. Lance wrote: > > > > > >>hi, > >> > >>the above question has been puzzling me for a while. the situation is > this. > >> > >>http://domainname.com/register.php > >>display a user registration form having > >>[form action="https://domainname.com/register.php" method="post"] > >> > >>will the data from that page be encrypted when it is sent via https > >>specified in the [form] action? > >> > >>note: the registration form is served from http. > >> > >>could someone enlighten me on this? > >> > >>regards, > >>b.c. lance > >> > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > > > > >

    attached mail follows:


    Richard Lynch wrote:

    >>http://domainname.com/register.php >>display a user registration form having >>[form action="https://domainname.com/register.php" method="post"] >> >>will the data from that page be encrypted when it is sent via https >>specified in the [form] action? >> >>note: the registration form is served from http. >> >I think you need to have the FORM page itself be using HTTPS as well... >

    No, as stated, securing the transaction that involves the form (rather than the submitted data) provides no real benefit.

    The only reason you would want to do this is if you are including some sensitive information in the construction of the form itself, such as a credit card number being printed in the HTML as a hidden form field (best hypothetical I can come up with at the moment).

    Most people who ask this question just want to know if the data submitted in the form will be secure if only the target URL uses https, in which case the answer is simply yes.

    Chris

    attached mail follows:


    Richard Lynch wrote:

    >>>Your form action parameter has an absolute url specifying an https >>>protocol. When the browser submits the form, it uses the url you specify >>>which is https. So the request is going to be encrypted. You might >>>consider serving the form page from https as well to kind of tighten >>>things up a little >>> >>> >>What is tightened up exactly? The original poster is probably trying to >>avoid SSL everywhere possible, thus the question. This is a very >>considerate approach, because SSL more than triples the amount of time >>taken to complete the HTTP transaction. He's trying to be polite to his >>users, rather than using SSL on one more page just to be safe, which is >>a tactic I applaud. >> >> > >Unfortunately, the messages going to the naive surfer will not make it clear >when/where the "secure zone" is entered: *BEFORE* my data is sent, or >*AFTER*? > >Better to have the *USER* (who shouldn't have to understand squat about >HTTPS and SSL and servers) be told they are "secure" when they hit the form, >and "insecure" only on the page after the page that took their information. >

    This is actually a very good point. In my purely logical approach to the question, I did not stop to think that a user entering a credit card number on a page without a little lock icon is not going to feel secure.

    >>Why would you consider this badly misconfigured? I would wager that >>*most* Web sites use the same document root for both http and https. Do >>you think this is insecure? Remember, the reason for using SSL is to >>protect the data during transmission, *not* the data sitting on the >>server, wherever that may be. >> >> > >In a shared server environment, if an ISP wants to provide SSL, and they let >anybody put anything into the web-tree... > >Hey, I like the convenience, and that's how my host does it, but I'm not >fooling myself that there aren't dumb CGI scripts out there that are >exposing data they shouldn't between my colleagues' web-sites. > >I know *I* work very hard to not let any data "leak" into the file-system, >process space, or any place that my fellow users can get to it, but I'm >pretty damn sure other web developers are clueless about how much info I >could go digging for if I wanted to. > >My old ISP had SSL on another server (or at least directory) and personally >vetted every line of code that went on it. Royal PITA, but more secure. > >You are correct that SSL only protects the data between browser/server. >That does not negate the "chinks" in the armor in a shared environment using >the same web-tree directory to store scripts, and probably sensitive data, >by the stupid. > >In other words, it won't make SSL itself any more secure, but it *DOES* make >a difference in the data/scripts after SSL is done, and before they safely >store/remove the data. >

    I still don't buy any of this. *shrug* I fail to see how having your SSL document root in a different place is a security benefit. Whether SSL or not, a configuration that allows other users to access your files poses a potential risk. Using separate trees in this way to isolate yourself from others users is just one way of avoiding this, and not one that I would consider that good.

    Maybe it's just me though. :)

    Cheers.

    Chris

    attached mail follows:


    It is possible to use arrays within strings, just skip ''. Write $name="My $name[name]"; instead Hugo

    "Matt Williams" <listsyewlands.com> skrev i meddelandet news:200207021345.g62DjCY03763emanon.clcne.net... > On Tuesday 02 July 2002 13:49, Uwe Birkenhain wrote: > > > Hi, > > I upgraded to 4.2 and now I get those errormessages > > "Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting > > T_STRING or T_VARIABLE or T_NUM_STRING in ..." > > > > when doing sth like: > > $name = "My $row['name']"; > > > > Try > > $name = "My {$row['name']}"; > > or > > $name = "My ".$row['name']; > > AFAIR you can't use array variables straight within strings. > > Maybe I'm just about to be proved wrong :) > > matt

    attached mail follows:


    Hallo Matt, thank you for the explanation and for the manual-link!

    But - correct if I'm wrong - that has been possible before! Or not?

    Uwe

    Matt Schroebel schrieb in Nachricht <4B08FD7DB3CBD4119F560002A508C453015B3851hsus3>... >> "Parse error: parse error, unexpected >> T_ENCAPSED_AND_WHITESPACE, expecting >> T_STRING or T_VARIABLE or T_NUM_STRING in ..." >> >> when doing sth like: >> $name = "My $row['name']"; > >You have to wrap array references in curly braces within double quoted strings. Proper form is: >$name = "My {$row['name']}"; > >See: http://www.php.net/manual/en/language.types.string.php#language.types.string .parsing.complex

    attached mail follows:


    > -----Original Message----- > From: Hugo Wetterberg [mailto:hugowetterberg.com] > Sent: Tuesday, July 02, 2002 1:12 PM > To: php-generallists.php.net > Subject: Re: [PHP] $name = "My $row['name']" not longer possible? > It is possible to use arrays within strings, just skip ''. > Write > $name="My $name[name]"; > instead

    Yes, but the manual says that's a feature that may not exist in future versions of php. See this link for details: http://www.php.net/manual/en/language.types.array.php#language.types.array.foo-bar

    attached mail follows:


    >Hi, >I upgraded to 4.2 and now I get those errormessages >"Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting >T_STRING or T_VARIABLE or T_NUM_STRING in ..." > >when doing sth like: >$name = "My $row['name']"; > >Why?

    My Best Guess:

    The $row['name'] part should be $row[name] and always has been.

    It used to work as an "undocumented feature" (aka "bug") but it just doesn't any more.

    "Why?" would probably involve about two hours of Ze'ev and Andi talking about parser stuff that you really don't want to listen to... Corner them at a PHP Conference if I'm wrong on that score :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Well after searching around I have found nothing really but a bunch of questions about this problem.

    I can run php 4.1.2 just fine with no troubles

    When I install 4.2.1 I started getting Emalloc() errors on some pages. The pages that seem to cause errors are pages that access the database, but not all pages that access the database cause the error.

    This problem is the only think keeping me from moving to 4.2.1

    Any help would be appreciated.

    Thank You Brian Paulson Sr. Web Developer bpaulsonchieftain.com http://www.chieftain.com

    attached mail follows:


    Hey all!

    I'm trying to get this darn eregi_replace() to work, but it doesn't produce any results at all.

    I want it to find all occurances of PHP variables. Here is the regexp

    $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$", "<b>\\1</b>", $var);

    As you might guess this is for a syntax highlighting function I am trying to write. Anyone have any ideas why it's not working? Please copy me directly, as I'm on the digest. Thanks!

    Martin

    attached mail follows:


    On Wednesday 03 July 2002 01:40, Martin Clifford wrote: > Hey all! > > I'm trying to get this darn eregi_replace() to work, but it doesn't produce > any results at all. > > I want it to find all occurances of PHP variables. Here is the regexp > > $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$", "<b>\\1</b>", $var); > > As you might guess this is for a syntax highlighting function I am trying > to write. Anyone have any ideas why it's not working? Please copy me > directly, as I'm on the digest. Thanks!

    Your regex looks suspiciously like a PCRE!

    Try changing eregi_replace to preg_replace.

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

    /* Reichel's Law: A body on vacation tends to remain on vacation unless acted upon by an outside force. */

    attached mail follows:


    Even this:

    $output = preg_replace("/^[\$]{1,2}[a-zA-Z][0-9]+$/", "<b>\\1</b>", $var); echo $output;

    Doesn't work. It just takes whatever you put into $var, then puts it into $output, and outputs it to the screen.

    I want to change anything resembling a PHP variable, i.e. $var, $$var or &$var to <b>$var</b>. Any ideas on how to do that?

    >>> php-generalgremlins.com.hk 07/02/02 01:50PM >>> On Wednesday 03 July 2002 01:40, Martin Clifford wrote: > Hey all! > > I'm trying to get this darn eregi_replace() to work, but it doesn't produce > any results at all. > > I want it to find all occurances of PHP variables. Here is the regexp > > $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$", "<b>\\1</b>", $var); > > As you might guess this is for a syntax highlighting function I am trying > to write. Anyone have any ideas why it's not working? Please copy me > directly, as I'm on the digest. Thanks!

    Your regex looks suspiciously like a PCRE!

    Try changing eregi_replace to preg_replace.

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

    /* Reichel's Law: A body on vacation tends to remain on vacation unless acted upon by an outside force. */

    attached mail follows:


    On Tuesday, July 2, 2002, at 01:40 PM, Martin Clifford wrote:

    > I'm trying to get this darn eregi_replace() to work, but it doesn't > produce any results at all. > > I want it to find all occurances of PHP variables. Here is the regexp > > $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$", "<b>\\1</b>", > $var); > > As you might guess this is for a syntax highlighting function I am > trying to write. Anyone have any ideas why it's not working? Please > copy me directly, as I'm on the digest. Thanks!

    I prefer the PCRE regex syntax, this should do it:

    $output = preg_replace('!^\${1,2}\w+$!', "<b>$1</b>", $var);

    because "\w" is the same as "[A-Za-z0-9_]" (though perhaps it is in POSIX regexes too).

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    On Wednesday 03 July 2002 01:59, Martin Clifford wrote: > Even this: > > $output = preg_replace("/^[\$]{1,2}[a-zA-Z][0-9]+$/", "<b>\\1</b>", $var); > echo $output; > > Doesn't work. It just takes whatever you put into $var, then puts it into > $output, and outputs it to the screen. > > I want to change anything resembling a PHP variable, i.e. $var, $$var or > &$var to <b>$var</b>. Any ideas on how to do that?

    Don't use "" strings unless you need variable expansion.

    Try:

    '/^\${1,2}[ ....

    ... actually try RTFM, the section on variables gives you a regex definition of acceptable PHP variables!

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

    /* To be sure of hitting the target, shoot first and, whatever you hit, call it the target. */

    attached mail follows:


    - don't use /^ .. $/ if you want to replace all occurences. ^ and $ refer to the very start and end of the whole string and make no sense at all - at least in this case. your regexp will not match at all unless $var contains only a single variable and nothing more - either capture (something) by brackets, otherwise use \\0 instead of \\1 - you forgot the "&" : try [\$\&]?\$ - [a-zA-Z][0-9]+ most variable names will not match this expr except things like $a089666. do you name all of your variables like this ?! [a-zA-Z_][\w\d\_]* is a good approach I guess but some more characters are valid (RTFM: "Variables - BASICS") - "$" is no good here as stated below

    uli

    At 02:30 03.07.02 +0800, you wrote: >On Wednesday 03 July 2002 01:59, Martin Clifford wrote: >> Even this: >> >> $output = preg_replace("/^[\$]{1,2}[a-zA-Z][0-9]+$/", "<b>\\1</b>", $var); >> echo $output; >> >> Doesn't work. It just takes whatever you put into $var, then puts it into >> $output, and outputs it to the screen. >> >> I want to change anything resembling a PHP variable, i.e. $var, $$var or >> &$var to <b>$var</b>. Any ideas on how to do that? > >Don't use "" strings unless you need variable expansion. > >Try: > >'/^\${1,2}[ .... > > >... actually try RTFM, the section on variables gives you a regex definition >of acceptable PHP variables! > >-- >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk >Open Source Software Systems Integrators >* Web Design & Hosting * Internet & Intranet Applications Development * > >/* >To be sure of hitting the target, shoot first and, whatever you hit, >call it the target. >*/ > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I am trying to get the value of a frames path into a PHP variable. Is it possible to access DOM values from PHP?? If not how do I set a PHP variable to the value of the window.frame.path that I get in javascript?

    attached mail follows:


    PHP is server-side. You're discussing client-side issues. You'll need to find a way of submitting the information to the server and then PHP can process it from there.

    -----Original Message----- I am trying to get the value of a frames path into a PHP variable. Is it possible to access DOM values from PHP?? If not how do I set a PHP variable to the value of the window.frame.path that I get in javascript? **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    Imagine I have a piece of text

    "Dear [firstname]

    Thankyou for purchasing [product] on [date].

    We're sure you'll be very [expectation].

    Ta Very much."

    Whats the easiest way to replace all the things in square brackets with variables of the same name.

    i.e. $firstname, $product, $date, $expectation

    Whilst ensuring that if the variable doesn't exist then it will be replaced with "" (absolutely nothing).

    Thankyou in advance

    Henry

    attached mail follows:


    Nothing will be inserted if the variable is empty, so you could just use $firstname, $product, $date, etc. inside your "letter". The main problem is adding logic to your "letter" to respond appropriately based on the value of different variables. For example:

    $MailBody = ""; if (empty($firstname)) $MailBody .= "Dear Customer"; else $MailBody .= "Dear $firstname";

    Note the use of .= to append to the string.

    -----Original Message----- From: Henry [mailto:henryteacake.f9.co.uk] Sent: Tuesday, July 02, 2002 10:53 AM To: php-generallists.php.net Subject: [PHP] find and replace in php

    Imagine I have a piece of text

    "Dear [firstname]

    Thankyou for purchasing [product] on [date].

    We're sure you'll be very [expectation].

    Ta Very much."

    Whats the easiest way to replace all the things in square brackets with variables of the same name.

    i.e. $firstname, $product, $date, $expectation

    Whilst ensuring that if the variable doesn't exist then it will be replaced with "" (absolutely nothing).

    Thankyou in advance

    Henry

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
     
    ****************************************************************************
    This message is intended for the sole use of the individual and entity to
    whom it is addressed, and may contain information that is privileged,
    confidential and exempt from disclosure under applicable law.  If you are
    not the intended addressee, nor authorized to receive for the intended
    addressee, you are hereby notified that you may not use, copy, disclose or
    distribute to anyone the message or any information contained in the
    message.  If you have received this message in error, please immediately
    advise the sender by reply email and delete the message.  Thank you very
    much.                                                                       
    

    attached mail follows:


    On Tuesday, July 2, 2002, at 01:52 PM, Henry wrote:

    > Imagine I have a piece of text > > "Dear [firstname] > > Thankyou for purchasing [product] on [date]. > > We're sure you'll be very [expectation]. > > Ta Very much." > > Whats the easiest way to replace all the things in square brackets with > variables of the same name. > > i.e. $firstname, $product, $date, $expectation > > Whilst ensuring that if the variable doesn't exist then it will be > replaced > with "" (absolutely nothing).

    Here, I modified the template class I use for my site (very simple) to do what you want. You need to have a template file that looks exactly like what you wrote above (EXACTLY), nothing more. Here is a usage example:

    <?php // the following vars have already been defined in your application, // or are set to empty strings as appropriate: // $firstname, $product, $date, $expectation

    // create a new Template object $template = new Template();

    // specify where our template file is $template->identifyTemplate('/path/to/file/above');

    // set the parameters $template->setParameter('firstname', $firstname); $template->setParameter('product', $product); $template->setParameter('date', $date); $template->setParameter('expectation', $expectation);

    // generate the output string and store in $outputStr $outputStr = $template->createOutput(); // free memory occupied by the Template object instance unset($template);

    // print our data print($outputStr);

    Here is the class definition:

    class Template { /** * var template */ var $template; /** * var finalOutput */ var $finalOutput; /** * var parameters */ var $parameters = array();

    /** * identifyTemplate * * determine which file to use for a template * * access public * param string $template path to a template file */ function identifyTemplate($template) { $this->template = $template; } /** * setParameter * * specify a name and a value to swap with that name * * this method can be called as many times as you have * parameters. * * access public * param string $name a parameter name * param string $value value of the parameter */ function setParameter($variable, $value) { $this->parameters[$variable] = $value; } /** * createPage * * substitute parameter values where parameter names are found * * access public * return string template combined with values (transformed) */ function createOutput() { // read the template into an array, then // generate a string from that array $this->finalOutput = implode("", (file($this->template))); // loop though all the parameters, and // set the variables from the file to // their corresponding values foreach ($this->parameters as $key => $value) { $template_name = '[' . $key . ']'; $this->finalOutput = str_replace($template_name, $value, $this->finalOutput); } return $this->finalOutput; } }

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Perfect

    Thankyou

    Henry

    "Erik Price" <priceehhbrown.com> wrote in message news:720887E8-8DEC-11D6-B565-0050E4857868hhbrown.com... > > On Tuesday, July 2, 2002, at 01:52 PM, Henry wrote: > > > Imagine I have a piece of text > > > > "Dear [firstname] > > > > Thankyou for purchasing [product] on [date]. > > > > We're sure you'll be very [expectation]. > > > > Ta Very much." > > > > Whats the easiest way to replace all the things in square brackets with > > variables of the same name. > > > > i.e. $firstname, $product, $date, $expectation > > > > Whilst ensuring that if the variable doesn't exist then it will be > > replaced > > with "" (absolutely nothing). > > Here, I modified the template class I use for my site (very simple) to > do what you want. You need to have a template file that looks exactly > like what you wrote above (EXACTLY), nothing more. Here is a usage > example: > > <?php > // the following vars have already been defined in your application, > // or are set to empty strings as appropriate: > // $firstname, $product, $date, $expectation > > // create a new Template object > $template = new Template(); > > // specify where our template file is > $template->identifyTemplate('/path/to/file/above'); > > // set the parameters > $template->setParameter('firstname', $firstname); > $template->setParameter('product', $product); > $template->setParameter('date', $date); > $template->setParameter('expectation', $expectation); > > // generate the output string and store in $outputStr > $outputStr = $template->createOutput(); > // free memory occupied by the Template object instance > unset($template); > > // print our data > print($outputStr); > > Here is the class definition: > > > > class Template > { > /** > * var template > */ > var $template; > /** > * var finalOutput > */ > var $finalOutput; > /** > * var parameters > */ > var $parameters = array(); > > /** > * identifyTemplate > * > * determine which file to use for a template > * > * access public > * param string $template path to a template file > */ > function identifyTemplate($template) > { > $this->template = $template; > } > > /** > * setParameter > * > * specify a name and a value to swap with that name > * > * this method can be called as many times as you have > * parameters. > * > * access public > * param string $name a parameter name > * param string $value value of the parameter > */ > function setParameter($variable, $value) > { > $this->parameters[$variable] = $value; > } > > /** > * createPage > * > * substitute parameter values where parameter names are found > * > * access public > * return string template combined with values (transformed) > */ > function createOutput() > { > // read the template into an array, then > // generate a string from that array > $this->finalOutput = implode("", (file($this->template))); > > // loop though all the parameters, and > // set the variables from the file to > // their corresponding values > foreach ($this->parameters as $key => $value) { > $template_name = '[' . $key . ']'; > $this->finalOutput = str_replace($template_name, $value, > $this->finalOutput); > } > return $this->finalOutput; > } > } > > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > priceehhbrown.com >

    attached mail follows:


    Has anyone had a problem where PHP created to many open files and crashed apache?

    B i g D o g

    attached mail follows:


    No. Only you. :-)

    Platform? Environment? Configuration information?

    ..mike..

    On Tue, 2002-07-02 at 11:01, B i g D o g wrote: > Has anyone had a problem where PHP created to many open files and crashed > apache? > > B i g D o g > >

    attached mail follows:


    Sorry bro...doing to many things at once.

    Apache 1.3.23 Linux 7.2 PHP 4.1.2

    Configuration: ./configure --with-apxs=/usr/local/apache/bin/apxs --with-sybase-ct=/sybase --with-mysql' '--enable-exif --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/local/lib --with-zlib --with-config-file-path=/etc --with-freetype-dir=/usr/local/lib

    My webserver keeps crashing: error log entry [Tue Jul 2 15:12:07 2002] [error] [client 164.214.4.59] (24)Too many open files

    I am just wondering if this a php issue or something else...

    B i g D o G

    ----- Original Message ----- From: "Michael Sweeney" <sweeneyverisity.com> To: "B i g D o g" <bigdogventicon.com> Cc: "PHP GEN" <php-generallists.php.net> Sent: Tuesday, July 02, 2002 12:04 PM Subject: Re: [PHP] PHP and Apache

    > No. Only you. :-) > > Platform? Environment? Configuration information? > > ..mike.. > > On Tue, 2002-07-02 at 11:01, B i g D o g wrote: > > Has anyone had a problem where PHP created to many open files and crashed > > apache? > > > > B i g D o g > > > > >

    attached mail follows:


    Yesterday I could do this (all on one line);

    exec("curl -d \"name=myname&password=mypassword&btnsubmit=submit\" -s -o cdrlist.html https://theserver.com/list.html");

    This is the one that worked, not the other one with the variables. Now this one does not work and I don't insert any variables into it.

    I have looked at exec(), shell_exec(), etc. trying to get something to work here, but crap. Anybody come up against this before? Maybe I should just go home...

    Thanks!

    Jay

    attached mail follows:


    On Tue, Jul 02, 2002 at 01:00:48PM -0500, Jay Blanchard wrote: > > This is the one that worked, not the other one with the variables. Now this > one does not work and I don't insert any variables into it.

    Let's do a quick test to isolate where the problem is.

    Can you exec() some other simple statement like exec('ls')? Can you still curl that statement directly from the command line?

    --Dan

    --
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Currently I'm using php 4.0.5 on Win98/apache....do you think it's worth my time and trouble to upgrade to a newer version of PHP? Is this hard to do? Any links to info on how to upgrade ?? Thanks!

    attached mail follows:


    Message-ID: <041001c221f5$7115e680$0100a8c0student5830> From: "Andrew Brampton" <andrewbramp.freeserve.co.uk> To: <php-generallists.php.net>, "Phil Schwarzmann" <pschwarjhmi.edu> Date: Tue, 2 Jul 2002 19:22:35 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [PHP] upgrading php...

    Takes the time of the download + 5minutes Download the full version of php... extract the zip file to where php is currently... then copy the new versions of php.ini and php4ts.dll into your c:\windows\ directory... Then make any minor changes you need to to the php.ini and voila all done (don't forget to restart apache for good measures)

    Andrew ----- Original Message ----- From: "Phil Schwarzmann" <pschwarjhmi.edu> To: <php-generallists.php.net> Sent: Tuesday, July 02, 2002 7:10 PM Subject: [PHP] upgrading php...

    > Currently I'm using php 4.0.5 on Win98/apache....do you think it's worth > my time and trouble to upgrade to a newer version of PHP? Is this hard > to do? Any links to info on how to upgrade ?? > > Thanks! >

    attached mail follows:


    On Wednesday 03 July 2002 02:10, Phil Schwarzmann wrote: > Currently I'm using php 4.0.5 on Win98/apache....do you think it's worth

    I was going to say php 4.0.5 has a vulnerability, but then you're using Win98 :)

    > my time and trouble to upgrade to a newer version of PHP?

    Before you upgrade to a newer version of PHP, DO read the release notes.

    > Is this hard to do? Any links to info on how to upgrade ??

    It shouldn't be hard, with Windows, I should imagine it's just a case of download, then click, click, click ...

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

    /* Three o'clock in the afternoon is always just a little too late or a little too early for anything you want to do. -- Jean-Paul Sartre */

    attached mail follows:


    I think there were security updates in the newer version that you'll benefit from, so it's worth your time. Check the README file for the new download. There are notes on upgrading.

    -----Original Message----- Currently I'm using php 4.0.5 on Win98/apache....do you think it's worth my time and trouble to upgrade to a newer version of PHP? Is this hard to do? Any links to info on how to upgrade ?? Thanks! **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    PS> Currently I'm using php 4.0.5 on Win98/apache....do you think it's worth PS> my time and trouble to upgrade to a newer version of PHP?

    yes. It should take about 15 minutes, unless your download connection is slow. :)

    PS> Is this hard to do?

    No.

    Download zip file. Extract contents. Move appropriate files. Make changes to php.ini. Make changes (if necessary for path names) to httpd.conf. Restart apache.

    "Upgrade" on windows means "delete old files and install new ones". Basically.

    It's all in the manual. Or, I have tutorials here: http://www.thickbook.com/extra/index.html?t=in

    There are other installation tutorials in many places.

    - Julie

    --> Julie Meloni --> juliethickbook.com --> www.thickbook.com

    Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20

    attached mail follows:


    You will need to upgrade Apache to 1.3.26 due to security hole. As we all know, Windows is very vulerable to virus like worms, so with the Apache's hole, it make it easier for hte virus to get in. So, better upgrade to 1.3.26 as soon as possible, this is where hte hole had been fixed.

    FletchSOD

    "Phil Schwarzmann" <pschwarjhmi.edu> wrote in message news:sd21b5b8.092cis27.hosts.jhmi.edu... > Currently I'm using php 4.0.5 on Win98/apache....do you think it's worth > my time and trouble to upgrade to a newer version of PHP? Is this hard > to do? Any links to info on how to upgrade ?? > > Thanks! >

    attached mail follows:


    Nothing will be inserted if the variable is empty, so you could just use $firstname, $product, $date, etc. inside your "letter". The main problem is adding logic to your "letter" to respond appropriately based on the value of different variables. For example:

    $MailBody = ""; if (empty($firstname)) $MailBody .= "Dear Customer"; else $MailBody .= "Dear $firstname";

    Note the use of .= to append to the string.

    -----Original Message----- From: Henry [mailto:henryteacake.f9.co.uk] Sent: Tuesday, July 02, 2002 10:53 AM To: php-generallists.php.net Subject: [PHP] find and replace in php

    Imagine I have a piece of text

    "Dear [firstname]

    Thankyou for purchasing [product] on [date].

    We're sure you'll be very [expectation].

    Ta Very much."

    Whats the easiest way to replace all the things in square brackets with variables of the same name.

    i.e. $firstname, $product, $date, $expectation

    Whilst ensuring that if the variable doesn't exist then it will be replaced with "" (absolutely nothing).

    Thankyou in advance

    Henry

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

    **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    "Henry" <henryteacake.f9.co.uk> wrote in message news:20020702175142.18923.qmailpb1.pair.com... > Imagine I have a piece of text > > "Dear [firstname] > > Thankyou for purchasing [product] on [date]. > > We're sure you'll be very [expectation]. > > Ta Very much." > > Whats the easiest way to replace all the things in square brackets with > variables of the same name. > > i.e. $firstname, $product, $date, $expectation > > Whilst ensuring that if the variable doesn't exist then it will be replaced > with "" (absolutely nothing). > > > Thankyou in advance > > Henry > >

    attached mail follows:


    Thanks Ed,

    I would like to do that, but I'm not hard coding the letters myself. I'm trying to provide a way for others (to provide the text, who know nothing about the underlying processes) and do the search and replaces on the fly.

    Henry

    "Henry" <henryteacake.f9.co.uk> wrote in message news:20020702182324.58256.qmailpb1.pair.com... > Nothing will be inserted if the variable is empty, so you could just use > $firstname, $product, $date, etc. inside your "letter". The main problem is > adding logic to your "letter" to respond appropriately based on the value of > different variables. For example: > > $MailBody = ""; > if (empty($firstname)) > $MailBody .= "Dear Customer"; > else > $MailBody .= "Dear $firstname"; > > Note the use of .= to append to the string. > > -----Original Message----- > From: Henry [mailto:henryteacake.f9.co.uk] > Sent: Tuesday, July 02, 2002 10:53 AM > To: php-generallists.php.net > Subject: [PHP] find and replace in php > > > Imagine I have a piece of text > > "Dear [firstname] > > Thankyou for purchasing [product] on [date]. > > We're sure you'll be very [expectation]. > > Ta Very much." > > Whats the easiest way to replace all the things in square brackets with > variables of the same name. > > i.e. $firstname, $product, $date, $expectation > > Whilst ensuring that if the variable doesn't exist then it will be replaced > with "" (absolutely nothing). > > > Thankyou in advance > > Henry > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > **************************************************************************** > This message is intended for the sole use of the individual and entity to > whom it is addressed, and may contain information that is privileged, > confidential and exempt from disclosure under applicable law. If you are > not the intended addressee, nor authorized to receive for the intended > addressee, you are hereby notified that you may not use, copy, disclose or > distribute to anyone the message or any information contained in the > message. If you have received this message in error, please immediately > advise the sender by reply email and delete the message. Thank you very > much. > > "Henry" <henryteacake.f9.co.uk> wrote in message > news:20020702175142.18923.qmailpb1.pair.com... > > Imagine I have a piece of text > > > > "Dear [firstname] > > > > Thankyou for purchasing [product] on [date]. > > > > We're sure you'll be very [expectation]. > > > > Ta Very much." > > > > Whats the easiest way to replace all the things in square brackets with > > variables of the same name. > > > > i.e. $firstname, $product, $date, $expectation > > > > Whilst ensuring that if the variable doesn't exist then it will be > replaced > > with "" (absolutely nothing). > > > > > > Thankyou in advance > > > > Henry > > > > > >

    attached mail follows:


    It sounds like you need to use templates. I haven't played with them much so I can't give specifics, but I hope that points you in the right direction =)

    -----Original Message----- I would like to do that, but I'm not hard coding the letters myself. I'm trying to provide a way for others (to provide the text, who know nothing about the underlying processes) and do the search and replaces on the fly. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    Hi Again! I missed part of the past responses to the past posting over the last few days because I had it cleaned from MS-Outlook folder. So, feel free to provide some feedback on the transformation from the script with register global turned on to off. Need some feedback on hiding the $SID from the URL as I saw somewhere on hte posting. I can't find it right now. I'll keep looking. Thanks! FletchSOD

    --clip-- (Old Script --> Register_Global turned on)

    --Page 1-- $user['data'] = "Yes!"; $salt = strtoupper(md5(uniqid(rand()))); session_id($salt); session_start(); session_register("user"); header("Location: https://test.whatever.com/test1.php?".SID."&init_login=TRUE");

    --Page 2-- session_register("user_detail"); --clip-- // ############### --clip-- (New Script --> Register_Global turned off)

    --Page 1 $user['data'] = "Yes!"; $salt = strtoupper(md5(uniqid(rand()))); session_id($salt); session_start(); $_SESSION['user']; header("Location: https://test.whatever.com/test1.php?".SID."&init_login=TRUE");

    --Page 2 $_SESSION['user']; --clip--

    attached mail follows:


    Unless you have your php.ini file configured differently, simply adding session_start(); at the top of each page will make the session available without having to pass the SID through the URL string. Not that there is anything wrong or insecure by passing the session id through the URL string. -Kevin

    ----- Original Message ----- From: "Scott Fletcher" <scottabcoa.com> To: <php-generallists.php.net> Sent: Tuesday, July 02, 2002 1:05 PM Subject: [PHP] $_SESSION

    > Hi Again! I missed part of the past responses to the past posting over the > last few days because I had it cleaned from MS-Outlook folder. So, feel > free to provide some feedback on the transformation from the script with > register global turned on to off. Need some feedback on hiding the $SID > from the URL as I saw somewhere on hte posting. I can't find it right now. > I'll keep looking. Thanks! FletchSOD > > --clip-- (Old Script --> Register_Global turned on) > > --Page 1-- > $user['data'] = "Yes!"; > $salt = strtoupper(md5(uniqid(rand()))); > session_id($salt); > session_start(); > session_register("user"); > header("Location: > https://test.whatever.com/test1.php?".SID."&init_login=TRUE"); > > --Page 2-- > session_register("user_detail"); > --clip-- > // ############### > --clip-- (New Script --> Register_Global turned off) > > --Page 1 > $user['data'] = "Yes!"; > $salt = strtoupper(md5(uniqid(rand()))); > session_id($salt); > session_start(); > $_SESSION['user']; > header("Location: > https://test.whatever.com/test1.php?".SID."&init_login=TRUE"); > > --Page 2 > $_SESSION['user']; > --clip-- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I'm having a small problem understanding Alpha channels. I thought that the Alpha Channel was the level of transparency but the following code does not seem to work.

    $DI = 50; $MOD = 127/$DI; ImageAlphaBlending($im, true); for ($x=0; $x<$DI; $x++) { $AL = 127-$MOD*$x; $GLColor=ImageColorResolveAlpha($im,255,255,255,$AL); ImageFilledArc($im, $WD/2, $HT/2, $DI-$x, $DI-$x, 0, 360, $GLColor, 4); }

    The idea is to create a simple glare effect by taking a white circle and making it more transparent around the edges. Though this only produces a white circle with fuzzy edges. Can anyone tell me what I'm doing wrong and clue me in on this whole Alpha Channel Biz.

    -Jim

    _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com

    attached mail follows:


    I don't understand alpha channel well enough to explain it, but I know you can find more information over at Adobe.com and by running a Google search for "alpha channel tutorial".

    -----Original Message----- The idea is to create a simple glare effect by taking a white circle and making it more transparent around the edges. Though this only produces a white circle with fuzzy edges. Can anyone tell me what I'm doing wrong and clue me in on this whole Alpha Channel Biz. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    On Tue, 2 Jul 2002, Lazor, Ed wrote: > The idea is to create a simple glare effect by taking a white circle and > making it more transparent around the edges. Though this only produces a > white circle with fuzzy edges. Can anyone tell me what I'm doing wrong and

    Which browser are you using to view the resulting PNG?. Because if it's MSIE, you won't be able to view it correctly (MSIE doesn't support Alpha Channels in PNG's directly, you must use a control to display them). Try with a best browser(tm), Mozilla, or NS, f. ex. :)

    Hope this helps.

    attached mail follows:


    Has anyone tested the dbx functions with huge results 10000+ records returned?

    How does the performance handle?

    Thanks,

    B i g D o g

    attached mail follows:


    subscribe

    attached mail follows:


    Hi :)

    Given I have some content embedded on my page by calling a remote JS and occasionally the URL for the remote script is down causing my page to be slow or fail, can I use the following example as a means to test and timeout the remote server and skip the embedded JS, if the remote server isn't responding properly?

    <?php $fp = fsockopen ("www.theweathernetwork.com", 80, $errno, $errstr, 5); if (!$fp) { echo "sorry, not available"; } else { echo "<script language=\"JavaScript\" type=\"text/javascript\"> <!-- var city = \"Muskoka_ON\"; //--> </script> <script language=\"javascript\" type=\"text/javascript\" src=\"http://www.theweathernetwork.com/weatherbutton/test.js\"> </script>";

    } ?>

    TIA, verdon

    attached mail follows:


    Or just fopen() would work fine. -Kevin

    ----- Original Message ----- From: "Verdon Vaillancourt" <verdonmac.com> To: <php-generallists.php.net> Sent: Tuesday, July 02, 2002 1:37 PM Subject: [PHP] Test if URL is alive before including a remote JS

    > Hi :) > > Given I have some content embedded on my page by calling a remote JS and > occasionally the URL for the remote script is down causing my page to be > slow or fail, can I use the following example as a means to test and timeout > the remote server and skip the embedded JS, if the remote server isn't > responding properly? > > <?php > $fp = fsockopen ("www.theweathernetwork.com", 80, $errno, $errstr, 5); > if (!$fp) { > echo "sorry, not available"; > } else { > echo "<script language=\"JavaScript\" type=\"text/javascript\"> > <!-- var city = \"Muskoka_ON\"; //--> > </script> > <script language=\"javascript\" type=\"text/javascript\" > src=\"http://www.theweathernetwork.com/weatherbutton/test.js\"> > </script>"; > > } > ?> > > > TIA, verdon > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Thanks Kevin,

    Do I need to include 'fclose ($fp);' in there somewhere in this case?

    On 7/2/02 3:41 PM, "Kevin Stone" <kevinhelpelf.com> wrote:

    > Or just fopen() would work fine. > -Kevin > > ----- Original Message ----- >> Hi :) >> >> Given I have some content embedded on my page by calling a remote JS and >> occasionally the URL for the remote script is down causing my page to be >> slow or fail, can I use the following example as a means to test and > timeout >> the remote server and skip the embedded JS, if the remote server isn't >> responding properly? >> >> <?php >> $fp = fsockopen ("www.theweathernetwork.com", 80, $errno, $errstr, 5); >> if (!$fp) { >> echo "sorry, not available"; >> } else { >> echo "<script language=\"JavaScript\" type=\"text/javascript\"> >> <!-- var city = \"Muskoka_ON\"; //--> >> </script> >> <script language=\"javascript\" type=\"text/javascript\" >> src=\"http://www.theweathernetwork.com/weatherbutton/test.js\"> >> </script>"; >> >> } >> ?>

    attached mail follows:


    It's good programming ediquite but not required. All fclose does is destroy the handle which will be lost when the script terminates.. same difference. -Kevin

    ----- Original Message ----- From: "Verdon Vaillancourt" <verdonmac.com> To: "Kevin Stone" <kevinhelpelf.com>; <php-generallists.php.net> Sent: Tuesday, July 02, 2002 1:55 PM Subject: Re: [PHP] Test if URL is alive before including a remote JS

    > Thanks Kevin, > > Do I need to include 'fclose ($fp);' in there somewhere in this case? > > > On 7/2/02 3:41 PM, "Kevin Stone" <kevinhelpelf.com> wrote: > > > Or just fopen() would work fine. > > -Kevin > > > > ----- Original Message ----- > >> Hi :) > >> > >> Given I have some content embedded on my page by calling a remote JS and > >> occasionally the URL for the remote script is down causing my page to be > >> slow or fail, can I use the following example as a means to test and > > timeout > >> the remote server and skip the embedded JS, if the remote server isn't > >> responding properly? > >> > >> <?php > >> $fp = fsockopen ("www.theweathernetwork.com", 80, $errno, $errstr, 5); > >> if (!$fp) { > >> echo "sorry, not available"; > >> } else { > >> echo "<script language=\"JavaScript\" type=\"text/javascript\"> > >> <!-- var city = \"Muskoka_ON\"; //--> > >> </script> > >> <script language=\"javascript\" type=\"text/javascript\" > >> src=\"http://www.theweathernetwork.com/weatherbutton/test.js\"> > >> </script>"; > >> > >> } > >> ?> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    >Given I have some content embedded on my page by calling a remote JS and >occasionally the URL for the remote script is down causing my page to be >slow or fail, can I use the following example as a means to test and timeout >the remote server and skip the embedded JS, if the remote server isn't >responding properly?

    Mostly sorta...

    ><?php >$fp = fsockopen ("www.theweathernetwork.com", 80, $errno, $errstr, 5);

    What if, in between this line and the one below, their site dies?

    Once you've bothered to fsockopen() to them, go whole hog and suck in the data :-)

    Otherwise, you are just doubling the number of HTTP connections used by your page when it *DOES* work, and that's not good for performance.

    >if (!$fp) { > echo "sorry, not available"; >} else { > echo "<script language=\"JavaScript\" type=\"text/javascript\"> > <!-- var city = \"Muskoka_ON\"; //--> > </script> > <script language=\"javascript\" type=\"text/javascript\" > src=\"http://www.theweathernetwork.com/weatherbutton/test.js\"> > </script>"; > > } >?> > > >TIA, verdon >

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Or just fopen() would work fine.

    Except you can't set the "timeout" for fopen() and it's incredibly long, isn't it?...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi all:

    I'm trying to write files for PDAs (pdb type) from a PHP script.

    I've tried to use PHP-PDB from SourceForge but can only give a name to the database, I cannot add any record (pretty bad for a database, no?).

    Is someone could help with, that'd be fantastic! Either with that library or with other one. I know I could use PERL but I'm addicted to PHP :-)

    Thanks

    Jean-Louis

    attached mail follows:


    Hello, I have a PHP script which gets data from a MySQL database and returns an image. So <img src="getdata.php?id=3"> returns the image of id 3 from the database. What I really want is to state width is 100 and height is 100 for example so I do not have to downlaod the entire picture and specify the width and height as part of the image: Do not want <img src="getdata.php?id=3" width="100" height="100">

    WHat I want <img src="getdata.php?id=3&width=100&height=100">

    WHich will be a lot quicker on the client side.

    I cannot make a permanent file to use when I get the information from the PHP database due to server security, only a tmpfile which the data can then be placed. But to use the image functions you need to specify a filename. THere does not seem to be a way to get the filename of a file pointer so how do I do it please?

    I have asked the ISP to give me permissions to create files int he server directory but they will not let me.

    Thanks you!

    Steve

    attached mail follows:


    Why would it be quicker on the client-side? I would think you'd go with the first option. That way the layout of your web page is maintained while the image downloads.

    -----Original Message----- Do not want <img src="getdata.php?id=3" width="100" height="100">

    WHat I want <img src="getdata.php?id=3&width=100&height=100">

    WHich will be a lot quicker on the client side.

    I cannot make a permanent file to use when I get the information from the PHP database due to server security, only a tmpfile which the data can then be placed. But to use the image functions you need to specify a filename. THere does not seem to be a way to get the filename of a file pointer so how do I do it please?

    I have asked the ISP to give me permissions to create files int he server directory but they will not let me.

    Thanks you!

    Steve

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
     
    ****************************************************************************
    This message is intended for the sole use of the individual and entity to
    whom it is addressed, and may contain information that is privileged,
    confidential and exempt from disclosure under applicable law.  If you are
    not the intended addressee, nor authorized to receive for the intended
    addressee, you are hereby notified that you may not use, copy, disclose or
    distribute to anyone the message or any information contained in the
    message.  If you have received this message in error, please immediately
    advise the sender by reply email and delete the message.  Thank you very
    much.                                                                       
    

    attached mail follows:


    No, I did think of it, but the page may end up with quite a few pics, and I download of a modem...

    Prefer if server has the load...

    Steve

    |-----Original Message----- |From: Lazor, Ed [mailto:ELazorprovidence.org] |Sent: 02 July 2002 21:34 |To: 'steveextremewattage.co.uk'; php-generallists.php.net |Subject: RE: [PHP] FW: Help please! | | |Why would it be quicker on the client-side? I would think |you'd go with the first option. That way the layout of your |web page is maintained while the image downloads. | |-----Original Message----- |Do not want |<img src="getdata.php?id=3" width="100" height="100"> | |WHat I want |<img src="getdata.php?id=3&width=100&height=100"> | |WHich will be a lot quicker on the client side. | | I cannot make a permanent file to use when I get the |information from the PHP database due to server security, only |a tmpfile which the data can then be placed. But to use the |image functions you need to specify a filename. THere does not |seem to be a way to get the filename of a file pointer so how |do I do it please? | | I have asked the ISP to give me permissions to create |files int he server directory but they will not let me. | | Thanks you! | | Steve | | |-- |PHP General Mailing List (http://www.php.net/) |To unsubscribe, visit: http://www.php.net/unsub.php | |*************************************************************** |************* |This message is intended for the sole use of the individual |and entity to whom it is addressed, and may contain |information that is privileged, confidential and exempt from |disclosure under applicable law. If you are not the intended |addressee, nor authorized to receive for the intended |addressee, you are hereby notified that you may not use, copy, |disclose or distribute to anyone the message or any |information contained in the message. If you have received |this message in error, please immediately advise the sender by |reply email and delete the message. Thank you very |much. | | |-- |PHP General Mailing List (http://www.php.net/) |To unsubscribe, visit: http://www.php.net/unsub.php |

    attached mail follows:


    What load are you talking about? This is just an issue of telling the web browser the image's dimensions. It's not like the image is being processed to convert it to that image size.

    -----Original Message----- No, I did think of it, but the page may end up with quite a few pics, and I download of a modem...

    Prefer if server has the load...

    Steve

    |-----Original Message----- |From: Lazor, Ed [mailto:ELazorprovidence.org] |Sent: 02 July 2002 21:34 |To: 'steveextremewattage.co.uk'; php-generallists.php.net |Subject: RE: [PHP] FW: Help please! | | |Why would it be quicker on the client-side? I would think |you'd go with the first option. That way the layout of your |web page is maintained while the image downloads. | |-----Original Message----- |Do not want |<img src="getdata.php?id=3" width="100" height="100"> | |WHat I want |<img src="getdata.php?id=3&width=100&height=100"> | |WHich will be a lot quicker on the client side. | | I cannot make a permanent file to use when I get the |information from the PHP database due to server security, only |a tmpfile which the data can then be placed. But to use the |image functions you need to specify a filename. THere does not |seem to be a way to get the filename of a file pointer so how |do I do it please? | | I have asked the ISP to give me permissions to create |files int he server directory but they will not let me. | | Thanks you! | | Steve | | |-- |PHP General Mailing List (http://www.php.net/) |To unsubscribe, visit: http://www.php.net/unsub.php | |*************************************************************** |************* |This message is intended for the sole use of the individual |and entity to whom it is addressed, and may contain |information that is privileged, confidential and exempt from |disclosure under applicable law. If you are not the intended |addressee, nor authorized to receive for the intended |addressee, you are hereby notified that you may not use, copy, |disclose or distribute to anyone the message or any |information contained in the message. If you have received |this message in error, please immediately advise the sender by |reply email and delete the message. Thank you very |much. | | |-- |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
     
    ****************************************************************************
    This message is intended for the sole use of the individual and entity to
    whom it is addressed, and may contain information that is privileged,
    confidential and exempt from disclosure under applicable law.  If you are
    not the intended addressee, nor authorized to receive for the intended
    addressee, you are hereby notified that you may not use, copy, disclose or
    distribute to anyone the message or any information contained in the
    message.  If you have received this message in error, please immediately
    advise the sender by reply email and delete the message.  Thank you very
    much.                                                                       
    

    attached mail follows:


    > id 3 from the database. What I really want is to state width > is 100 and height is 100 for example so I do not have to downlaod the entire > picture and specify the width and height as part of the image: > > Do not want > <img src="getdata.php?id=3" width="100" height="100"> > > WHat I want > <img src="getdata.php?id=3&width=100&height=100"> > > WHich will be a lot quicker on the client side.

    This won't really change speed on the client side at all - the image is the size that the image is. Changing it's display size won't change the file size.

    Having said that, if you're looking to set a standard width and height for an image loading in a particular location then you could probably just do this:

    <img src="getdata.php?id=3" width=100 height=100>

    ...which should do what you want. If you actually want the real width and height of the image then you're probably going to have to do some pre-processing to work out the width and height first and then include them in the image tag.

    CYA, Dave

    attached mail follows:


    >Hello, > I have a PHP script which gets data from a MySQL database and >returns an image. So <img src="getdata.php?id=3"> returns the image of >id 3 from the database. What I really want is to state width is 100 and >height is 100 for example so I do not have to downlaod the entire >picture and specify the width and height as part of the image: > > Do not want > <img src="getdata.php?id=3" width="100" height="100"> > > WHat I want > <img src="getdata.php?id=3&width=100&height=100"> > > WHich will be a lot quicker on the client side. > > I cannot make a permanent file to use when I get the information >from the PHP database due to server security, only a tmpfile which the >data can then be placed. But to use the image functions you need to >specify a filename. THere does not seem to be a way to get the filename >of a file pointer so how do I do it please?

    What *I* have found easiest is to store the image size with the filename in the database.

    So id=3 will also look up width/height.

    You may be able to use getImageSize() to get the info you need.

    NOTE: The size of the image DOWNLOADED to the client remains the same. PERIOD.

    Your scaling by 100 and 100 only does:

    1. Scales the image on the CLIENT, after downloading the whole thing. 2. Tells the HTML layout how big a "hole" to leave until the image shows up.

    It never, ever, improves actual bandwidth.

    #2 *DOES* make the site 'seem' faster to the user, since they can read the text while waiting for the image.

    If your image is much larger than 100 x 100, and you are going to scale it anyway, you should look into scaling it on the server long, long before that HTML request comes in.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >What load are you talking about? This is just an issue of telling the web >browser the image's dimensions. It's not like the image is being processed >to convert it to that image size.

    Au contraire.

    If you have an image named 'huge.jpg' at 10000 x 10000, and you ask a 386 computer to:

    <IMG SRC=huge.jpg WIDTH=100 HEIGHT=100>

    Then two horrible things happen.

    1. The client has to download that stupidly large image. 2. The client has to *SCALE* that stupdily large image to 100x100

    There is no magic here.

    That's maybe a lotta work for that client.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi, if you can find a web host that offers ALL these services, i will eat my hat on my webcam to the whole club:

    Usenet Newsgroup. at least 200MB space Perl/CGI support (optional) PHP - note: must have GD library installed! MySQL SHOUTcast web radio Reseller account option at least 300MB per month bandwidth ASP (optional)

    attached mail follows:


    This is a newsgroup for PHP discussion. This is not a PHP discussion, so it is a spam mail. Please refrain from using it.

    "Tony Harrison" <tonyh21tharrison21.fsnet.co.uk> wrote in message news:20020702195146.51516.qmailpb1.pair.com... > Hi, if you can find a web host that offers ALL these services, i will eat my > hat on my webcam to the whole club: > > Usenet Newsgroup. > at least 200MB space > Perl/CGI support (optional) > PHP - note: must have GD library installed! > MySQL > SHOUTcast web radio > Reseller account option > at least 300MB per month bandwidth > ASP (optional) > >

    attached mail follows:


    I think calling it spam is a bit harsh! Offtopic maybe, but it is a genuine enquiry to an audience i think can help with the matter. So, I stand by my post!

    "Scott Fletcher" <scottabcoa.com> wrote in message news:20020702195558.59139.qmailpb1.pair.com... > This is a newsgroup for PHP discussion. This is not a PHP discussion, so it > is a spam mail. Please refrain from using it. > > "Tony Harrison" <tonyh21tharrison21.fsnet.co.uk> wrote in message > news:20020702195146.51516.qmailpb1.pair.com... > > Hi, if you can find a web host that offers ALL these services, i will eat > my > > hat on my webcam to the whole club: > > > > Usenet Newsgroup. > > at least 200MB space > > Perl/CGI support (optional) > > PHP - note: must have GD library installed! > > MySQL > > SHOUTcast web radio > > Reseller account option > > at least 300MB per month bandwidth > > ASP (optional) > > > > > >

    attached mail follows:


    On Tuesday, July 2, 2002, at 03:50 PM, Tony Harrison wrote:

    > Hi, if you can find a web host that offers ALL these services, i will > eat my > hat on my webcam to the whole club:

    Do you know the origin of that expression? It refers to a period when sugar was sold in paper cones, known as "hats". So you won't really eat your baseball cap, just the family sugar jar.

    > Usenet Newsgroup. > at least 200MB space > Perl/CGI support (optional) > PHP - note: must have GD library installed! > MySQL > SHOUTcast web radio > Reseller account option > at least 300MB per month bandwidth > ASP (optional)

    I don't know about Shoutcast, but Pair.com is supposed to be good. If you can get DSL or some service that doesn't block port 80, you may as well just host your own server (unless you want this for commercial use, in which case why not pay an ISP to host your own server?).

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    Are you not promoting a hosting service? What is your inquiry?

    -----Original Message----- I think calling it spam is a bit harsh! Offtopic maybe, but it is a genuine enquiry

    > > Hi, if you can find a web host that offers ALL these services, i will eat > my > > hat on my webcam to the whole club: > > > > Usenet Newsgroup. > > at least 200MB space > > Perl/CGI support (optional) > > PHP - note: must have GD library installed! > > MySQL > > SHOUTcast web radio > > Reseller account option > > at least 300MB per month bandwidth > > ASP (optional) **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    He is looking for a web hosting company that has what he has listed below...

    B i g D o g

    ----- Original Message ----- From: "Lazor, Ed" <ELazorprovidence.org> To: "'Tony Harrison'" <tonyh21tharrison21.fsnet.co.uk>; <php-generallists.php.net> Sent: Tuesday, July 02, 2002 2:29 PM Subject: RE: [PHP] Re: Have you seen this host?

    > Are you not promoting a hosting service? What is your inquiry? > > -----Original Message----- > I think calling it spam is a bit harsh! Offtopic maybe, but it is a genuine > enquiry > > > > Hi, if you can find a web host that offers ALL these services, i will > eat > > my > > > hat on my webcam to the whole club: > > > > > > Usenet Newsgroup. > > > at least 200MB space > > > Perl/CGI support (optional) > > > PHP - note: must have GD library installed! > > > MySQL > > > SHOUTcast web radio > > > Reseller account option > > > at least 300MB per month bandwidth > > > ASP (optional) > > **************************************************************************** > This message is intended for the sole use of the individual and entity to > whom it is addressed, and may contain information that is privileged, > confidential and exempt from disclosure under applicable law. If you are > not the intended addressee, nor authorized to receive for the intended > addressee, you are hereby notified that you may not use, copy, disclose or > distribute to anyone the message or any information contained in the > message. If you have received this message in error, please immediately > advise the sender by reply email and delete the message. Thank you very > much. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    In that case, go with CWIHosting.com. They are the best I've seen yet.

    -----Original Message----- He is looking for a web hosting company that has what he has listed below... **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    I suppose you haven't looked around much. Those features are fairly typical. Besides what really matters is that the host has what you need at the lowest price. I spend $10/mo for 350MB space, 20GB/mo transfer, PHP, 10 MySQL dbs, anon FTP, CGI/Perl, SSL, SSI, SSH login, unlimited email, and more. Not the fastest host I've been on but I think it's a good value. http://www.hostrocket.com Good luck with your search. -Kevin

    ----- Original Message ----- From: "Tony Harrison" <tonyh21tharrison21.fsnet.co.uk> To: <php-generallists.php.net> Sent: Tuesday, July 02, 2002 1:50 PM Subject: [PHP] Have you seen this host?

    > Hi, if you can find a web host that offers ALL these services, i will eat my > hat on my webcam to the whole club: > > Usenet Newsgroup. > at least 200MB space > Perl/CGI support (optional) > PHP - note: must have GD library installed! > MySQL > SHOUTcast web radio > Reseller account option > at least 300MB per month bandwidth > ASP (optional) > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    subscribe matthew.de.jonghthe-spa.com

    matthew de Jongh president the spa! internet voice (413) 539-9818 www.the-spa.com

    attached mail follows:


    This is a PHP newsgroup, it is for PHP discussion. This is not a PHP discussion, so it is a spam mail. Please refrain from using it.

    "Matthew" <matthewthe-spa.com> wrote in message news:5.1.0.14.2.20020702155330.01fff2a8mail.the-spa.com... > subscribe matthew.de.jonghthe-spa.com > > matthew de Jongh > president > the spa! internet > voice (413) 539-9818 > www.the-spa.com >

    attached mail follows:


    Analysis & Solutions wrote:

    > On Tue, Jul 02, 2002 at 03:47:20PM +0200, Nightshade wrote: >> is there a unix like ~/ , to access to root directory of my site > > Does $_SERVER['DOCUMENT_ROOT'] help? > > Whenever you have a question like this, run phpinfo() and see what's there > which produces the variable you're looking for. > > --Dan >

    Do you advice me to use $_SERVER['DOCUMENT_ROOT'] . remaining_path/ in all my files?

    attached mail follows:


    On Tue, Jul 02, 2002 at 09:55:13PM +0200, Nightshade wrote: > > Do you advice me to use > $_SERVER['DOCUMENT_ROOT'] . remaining_path/ > in all my files?

    I use relative paths in most circumstances. Makes things easier to move between my development machine and the actual web servers.

    Enjoy,

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Analysis & Solutions wrote:

    > On Tue, Jul 02, 2002 at 03:47:20PM +0200, Nightshade wrote: >> is there a unix like ~/ , to access to root directory of my site > > Does $_SERVER['DOCUMENT_ROOT'] help? > > Whenever you have a question like this, run phpinfo() and see what's there > which produces the variable you're looking for. > > --Dan > Sorry again... Document root doensn't solve my problem... the var contain /var/www/html instead of /var/www/html/mysite maybe I should set something up? Any solution? tnx

    attached mail follows:


    On Tue, Jul 02, 2002 at 10:34:32PM +0200, Nightshade wrote: > Analysis & Solutions wrote: > > Document root doensn't solve my problem... > ... snip ... > Any solution?

    Read and heed what I already said:

    > > Whenever you have a question like this, run phpinfo() and see what's there > > which produces the variable you're looking for.

    If that doesn't have what you're looking for, you need to craft your own solution.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    In your config file (or at the top of each page) you should establish what your document root is:

    $docroot = "/usr/home/sitename/"; # or whatever

    Then do something like include("{$docroot}inc_dir/file.inc");

    Or maybe you specify an include directory in your config:

    $incdir = "/usr/home/sitename/inc/"; # or whatever

    Then do something like include("{$incdir}file.inc");

    Or maybe write a small function that allows you to do it all transparently... maybe something like myinclude('file.inc').

    As Dan has pointed out, the other option would be to use $_SERVER['DOCUMENT_ROOT']:

    $docroot = $_SERVER['DOCUMENT_ROOT'];

    include("{$docroot}myfile.inc");

    I don't believe it can be done with ~/ or ./ or something... haven't found it yet!!

    Justin French

    on 03/07/02 1:34 AM, Analysis & Solutions (danielcanalysisandsolutions.com) wrote:

    > On Tue, Jul 02, 2002 at 03:47:20PM +0200, Nightshade wrote: >> is there a unix like ~/ , to access to root directory of my site > > Does $_SERVER['DOCUMENT_ROOT'] help? > > Whenever you have a question like this, run phpinfo() and see what's there > which produces the variable you're looking for. > > --Dan

    attached mail follows:


    Does anyone know anyway to synchronize calls to php functions. I was thinking of writting a hack that uses a lock file on the server put if there is a proper way to do it then I would rather use that. Any suggestions would be good.

    |-----------------------------------------------------------| Philip MacIver |-----------------------------------------------------------|

    attached mail follows:


    >Does anyone know anyway to synchronize calls to php functions. >I was thinking of writting a hack that uses a lock file on the server put >if there is a proper way to do it then I would >rather use that. >Any suggestions would be good.

    Shared memory may be faster than lock files...

    *WHY* you think you need synched PHP functions might be an interesting discussion, though if it's just for fun, have at it.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    On Tue, 2 Jul 2002, Hugo Wetterberg wrote: > I have a problem with pdf_show_boxed(), it doesn't output anything. > Everything else shows up just fine. Is there something that I have > overlooked in this code? > > pdf_show_boxed ( > $pdf, //Object > $issuedesc, //text > 70, //left > 700, //top > 350, //width > 400, //height > left); //justify

    I bet the text is off the page. Try changing 'top' to 400 and see what miracles ensue.

    miguel

    attached mail follows:


    >I have a problem with pdf_show_boxed(), it doesn't output anything. >Everything else shows up just fine. Is there something that I have >overlooked in this code?

    >pdf_set_font($pdf, "Times-Roman", 10, "host"); >pdf_show_boxed ( > $pdf, //Object > $issuedesc, //text > 70, //left > 700, //top > 350, //width > 400, //height > left); //justify

    Things you should know:

    1. If the text is "too big" to fit in the box, it won't show up at all if the box is less than one line tall... IE, if you have a font size of 40, and a box only 10 pixels tall, you won't get clipped text, you'll get nothing.

    2. If there are "newline" characters at the beginning of the string, they'll mess you up...

    3. The co-ordinate system is upside down, but top is bottom, and bottom is top in the docs, and I get a headache every time I try to think about this... Change your "top" number to 0 for now, and then fine-tune it once you can actually see the damn text in the PDF...

    I even have resorted to:

    for ($x = -600; $x < 600; $x += 100){ for ($y = -800; $y < 800; $x += 100){ pdf_show_xy("$x $y", $x, $y); } }

    *ESPECIALLY* when you start rotating the damn thing to get upside-down text... Sheesh!

    That one gave me a headache. I forget what it chose as the point of origin for the rotation, but it made absolutely no sense at all to me...

    pdf_show_boxed() returns the number of characters that didn't get drawn, so use that.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Now I'm getting this error each time I upload a file... Warning: Unable to open 'none' for reading: No such file or directory in /home/.../upload3.php on line 7

    why is it saying 'none' ??

    attached mail follows:


    Message-ID: <C8891DEC2698D411A91B00508BF9898806E11861phsormsg04.phsor.org> From: "Lazor, Ed" <ELazorprovidence.org> To: 'Phil Schwarzmann' <pschwarjhmi.edu>, php-generallists.php.net Date: Tue, 2 Jul 2002 13:38:20 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: [PHP] upload problems - "unable to open 'none'

    Send us a copy of your script so that we can help. Odds are that you didn't specify the proper field name in your upload form.

    -----Original Message----- Now I'm getting this error each time I upload a file... Warning: Unable to open 'none' for reading: No such file or directory in /home/.../upload3.php on line 7

    why is it saying 'none' ?? **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    I'll have to test, but I think the $filename = "/tmp/".$userfile is what's messing things up. $userfile is a link to the temporary file the system creates when storing the uploaded file. The link includes a full reference to the file name as well as the system directory path to the file. Appending /tmp/ in front of this creates an invalid path for $filename. Create a $filename as a valid path and file name. Use the move function to move from $userfile to $filename. That way you don't end up with an extra left over file wasting drive space. Try that and lemme know how it goes =) -Ed

    -----Original Message----- From: Phil Schwarzmann [mailto:pschwarjhmi.edu] Sent: Tuesday, July 02, 2002 4:14 PM To: ELazorprovidence.org Subject: RE: [PHP] upload problems - "unable to open 'none'

    Here is the code. $userfile is the name of the upload field. I doubled checked the HTML and everything is fine with it. hey man, thanks for all your help!! $filename = "/tmp/".$userfile; if (!copy($userfile, $filename)) { echo "something barfed."; exit; } else { echo "uploaded."; }

    >>> "Lazor, Ed" <ELazorprovidence.org> 07/02/02 04:38PM >>> Send us a copy of your script so that we can help. Odds are that you didn't specify the proper field name in your upload form.

    -----Original Message----- Now I'm getting this error each time I upload a file...

    Warning: Unable to open 'none' for reading: No such file or directory in /home/.../upload3.php on line 7

    why is it saying 'none' ??

    **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    Date: Tue, 02 Jul 2002 16:37:02 -0500 From: "Richard Lynch" <richphpbootcamp.com> To: php-generallists.php.net Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Message-Id: <20020703015501.HKUL6023.sccrmhc02.attbi.com[192.168.1.103]> Subject: Re: [PHP] upload problems - "unable to open 'none'

    >Send us a copy of your script so that we can help. Odds are that you didn't >specify the proper field name in your upload form. > >-----Original Message----- >Now I'm getting this error each time I upload a file... > >Warning: Unable to open 'none' for reading: No such file or directory >in /home/.../upload3.php on line 7 > >why is it saying 'none' ??

    'none' is what you get if they don't pick any file to upload...

    Or if the file was too big?

    I forget exactly how/when you get 'none' and '', but 'none' means something different than ''.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Sorry about that....I beefed.

    attached mail follows:


    Message-ID: <3D2211C2.7010008pnts.com> Date: Tue, 02 Jul 2002 13:49:06 -0700 From: David Busby <busbypnts.com> Reply-To: busbypnts.com MIME-Version: 1.0 To: php-general <php-generallists.php.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: RegEx question

    List, How can I regex to compare the last three chars of a string to "php"?

    /B

    attached mail follows:


    Actually for a job like this look to substr() to extract the last three chars as a string and compare them in an if() statment. http://www.php.net/manual/en/function.substr.php -Kevin

    ----- Original Message ----- From: "David Busby" <busbypnts.com> To: "php-general" <php-generallists.php.net> Sent: Tuesday, July 02, 2002 2:49 PM Subject: [PHP] RegEx question

    > List, > How can I regex to compare the last three chars of a string to "php"? > > /B > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    $string = 'somethingphp'; $pat = 'php$'; $hasphp = ereg($pat, $string);

    Henning Sittler www.inscriber.com

    -----Original Message----- From: David Busby [mailto:busbypnts.com] Sent: Tuesday, July 02, 2002 4:49 PM To: php-general Subject: [PHP] RegEx question

    List, How can I regex to compare the last three chars of a string to "php"?

    /B

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

    attached mail follows:


    Message-ID: <001a01c2220c$79336b00$ef45accfatsiz> From: "Gurhan Ozen" <ergenekonstarpower.net> To: <busbypnts.com>, "php-general" <php-generallists.php.net> Date: Tue, 2 Jul 2002 17:07:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1254" Content-Transfer-Encoding: 7bit Subject: Re: [PHP] RegEx question

    eregi("php$", $stringtobecompared);

    See: http://www.php.net/manual/en/ref.regex.php

    Gurhan

    ----- Original Message ----- From: "David Busby" <busbypnts.com> To: "php-general" <php-generallists.php.net> Sent: Tuesday, July 02, 2002 4:49 PM Subject: [PHP] RegEx question

    > List, > How can I regex to compare the last three chars of a string to "php"? > > /B > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    > How can I regex to compare the last three chars of a string to "php"?

    if (substr($foo, -3) == 'php'){ }

    Oh, wait, you wanted to use RegEx. Sorry, can't help you there. :-)

    Don't use a cannon to swat a fly.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >>> "Justin French" <justinindent.com.au> wrote in message >>> news:B9425D5F.9573%justinindent.com.au... >>>> 1. Name all included files .inc >>> >>> If you name them *.php then put anything in them inside a function, then >>> when the user browses to that file he/she won't see anything at all. >> >> You've already moved them out of the web tree so that they can't browse to >> them in the first place... > >Actually, the OP was about securing an includes directory which COULD NOT be >placed outside the docroot.

    Change web hosts. :-)

    Seriously.

    It's cheaper than buying the Zend Encoder (or knock-off copies thereof), which is your only other real alternative.

    The rest of your options aren't worth considering, unless you just don't care if your db data is publicly write-able or not.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >But once I had moved most of my code into object methods and functions >(and therefore out of the global namespace/scope/whatever), I realized >this really didn't matter as much. In fact, for consistency and >neatness, it was better that I use only $sql or $result, since there was >only ever one query in the method or function definition, and this >terseness was less cluttering to my code.

    Well, yeah, at that point all you have is SQL and Result, because the function has no idea what that SQL is about in any given call...

    But, personally, I just don't see the point to having a function/class do my database work when it simply:

    Increases lines of code Increases debugging/maintenance time Decreases clarity of code Reduces performance Reduces flexibility Increases overhead

    My personal preference is to just:

    include 'connection.inc'; . . .

    $query = "..."; $whatever mysql_query($query) or error_log(mysql_error()); # Deal with $whatever

    I just don't see a cost/benefit ratio that makes sense in the DB classes.

    I know it's a minority opinion, but I've never been afraid of being in the minority.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Portability between different databases makes a DB class beneficial. Then again, I stick with MySQL, so I don't bother with the extra overhead either.

    -----Original Message----- I just don't see a cost/benefit ratio that makes sense in the DB classes.

    I know it's a minority opinion, but I've never been afraid of being in the minority. **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.

    attached mail follows:


    On Tuesday, July 2, 2002, at 04:31 PM, Richard Lynch wrote:

    > Well, yeah, at that point all you have is SQL and Result, because the > function has no idea what that SQL is about in any given call... > > But, personally, I just don't see the point to having a function/class > do my > database work when it simply: > > Increases lines of code > Increases debugging/maintenance time > Decreases clarity of code > Reduces performance > Reduces flexibility > Increases overhead

    Hm. Could be. I haven't benchmarked it for performance, since in this case there will probably never be more than 20 simultaneous page requests at any given time considering the small number of users. In fact, I'm sure you're right, that performance and overhead are definitely affected.

    But I think you're mistaking what I said -- I don't necessarily write a function/class specifically to handle my DB work. I write my classes and methods to manipulate objects easily and organize the data, and if maintaining state by doing a database insert (or resuming state by doing a database query) is necessary, well then that gets incorporated into the class. It's not specifically a database abstraction layer, it's just an object, and most of my objects happen to get built from or stored in a database at some point within their lives.

    And I write a function when I find that I am executing the same code all over again in various places -- like generating a date listbox or something.

    The effect is that debugging/maintenance time and lines of code are decreased, not increased, and clarity of code and flexibility are IMHO much better when they are safely constrained to class definitions rather than all being in one giant script.

    But one thing I have learned is that everyone has a different approach to writing code, and objects may not be your thing -- that's okay.

    Erik

    ----
    

    Erik Price Web Developer Temp Media Lab, H.H. Brown priceehhbrown.com

    attached mail follows:


    >Except in a production environment, where you really never want your >users to see PHP error messages that you haven't coded yourself for the >user's benefit. It could reveal just a bit too much about your setup... >even filenames are valuable to maleficants. > >I recommend setting your php.ini to E_NONE and then putting >error_reporting(E_ALL) at the top of each of your scripts, and then when >the file is migrated to production, comment or remove the line.

    Yes, sorry, should have been more clear.

    *IF* you have a Production and Development server split environment, get E_ALL on Development, and E_NONE on Production.

    If you only have the one environment, it's better to *FIND* the damn bugs and fix them (E_ALL) than to never even know they are there (E_NONE or other setting).

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hi,

    Has anyone any advice as to how to deal with XML documents encoded in windows-1252: a character set that PHP's XML extension won't process? I've got a large number of such documents, and using xml_parse_into_struct() would be the easiest way to handle them - but because of the encoding problem I keep on ending up with ? instead of characters in the document in certain places. Is there any way I could convert the charset?

    Thanks Peter

    attached mail follows:


    Check here:

    http://www.chilkatsoft.com/ChilkatXml.asp

    Google search: http://www.google.com/search?sourceid=navclient&q=convert+xml+charset

    B i g D o g

    ----- Original Message ----- From: "Peter" <petermapledesign.co.uk> To: <php-generallists.php.net> Sent: Tuesday, July 02, 2002 3:05 PM Subject: [PHP] Dealing with XML charsets

    > Hi, > > Has anyone any advice as to how to deal with XML documents encoded in windows-1252: a character set that PHP's XML extension won't process? I've > got a large number of such documents, and using xml_parse_into_struct() would be the easiest way to handle them - but because of the encoding > problem I keep on ending up with ? instead of characters in the document in certain places. Is there any way I could convert the charset? > > Thanks > Peter > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I haven't tried this myself yet, but will soon be facing a similar need.

    http://www.php.net/iconv

    That's probably the way I'll start off on tackling this problem ... Grab your XML document, check to see if it's in windows-1252, and if it is, run it through the iconv functions, then parse the XML data.

    -Clay

    > From: Peter <petermapledesign.co.uk> > Date: Tue, 02 Jul 2002 21:05:28 GMT > To: php-generallists.php.net > Subject: [PHP] Dealing with XML charsets > > Hi, > > Has anyone any advice as to how to deal with XML documents encoded in > windows-1252: a character set that PHP's XML extension won't process? I've > got a large number of such documents, and using xml_parse_into_struct() would > be the easiest way to handle them - but because of the encoding > problem I keep on ending up with ? instead of characters in the document in > certain places. Is there any way I could convert the charset? > > Thanks > Peter > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi, first let me introduce myself...

    My name is Kit, and I own the domain below and host sites from off that domain.

    I'm new to using PHP...and need some help.

    1. I have apache for win32 1.3.26 setup on my w2k pro at home, and need to know how to enable PHP in the config.

    2. I also have a PHP website, and need to know how to include "FORMS" for subscribing to newletters in a file called "header.php"

    <*** http://www.myispnet.net ***> Administrator My ISP Network adminmyispnet.net <*** http://www.myispcentral.net ***>

    attached mail follows:


    you must be tired from searching the manual all day for your answer. :)

    Check here: http://www.php.net/manual/en/install.apache.php

    There's a section on installing with Win32

    -- 
    Tyler Longren
    Captain Jack Communications
    tylercaptainjack.com
    www.captainjack.com
    

    On Tue, 2 Jul 2002 17:14:32 -0400 "admin" <kompukitnaisp.net> wrote:

    > Hi, first let me introduce myself... > > My name is Kit, and I own the domain below > and host sites from off that domain. > > I'm new to using PHP...and need some help. > > 1. I have apache for win32 1.3.26 setup > on my w2k pro at home, and need to know > how to enable PHP in the config. > > 2. I also have a PHP website, and need to know > how to include "FORMS" for subscribing to newletters > in a file called "header.php" > > <*** http://www.myispnet.net ***> > Administrator > My ISP Network > adminmyispnet.net > <*** http://www.myispcentral.net ***> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I hate to sound like an ass, but the best thing would to really read the php manual php.net or buy a PHP programming book...

    There are many great books out there on PHP that you can get.

    1. Check under php.net for installation and configuration 2. Review include(), include_once(), require() and require_once() for your forms.

    B i g D o g

    ----- Original Message ----- From: "admin" <kompukitnaisp.net> To: "PHP List" <php-generallists.php.net> Sent: Tuesday, July 02, 2002 3:14 PM Subject: [PHP] Help - I'm New

    > Hi, first let me introduce myself... > > My name is Kit, and I own the domain below > and host sites from off that domain. > > I'm new to using PHP...and need some help. > > 1. I have apache for win32 1.3.26 setup > on my w2k pro at home, and need to know > how to enable PHP in the config. > > 2. I also have a PHP website, and need to know > how to include "FORMS" for subscribing to newletters > in a file called "header.php" > > <*** http://www.myispnet.net ***> > Administrator > My ISP Network > adminmyispnet.net > <*** http://www.myispcentral.net ***> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi Kit, For your first question, take a look at: http://www.php.net/manual/en/installation.php and click on the windows links.. For your second question, I am really not sure what you are asking.. What exactly do you want to do? Just add a form to a php page? or have a form automatically added by including header.php? Please be more specific.

    Gurhan

    ----- Original Message ----- From: "admin" <kompukitnaisp.net> To: "PHP List" <php-generallists.php.net> Sent: Tuesday, July 02, 2002 5:14 PM Subject: [PHP] Help - I'm New

    > Hi, first let me introduce myself... > > My name is Kit, and I own the domain below > and host sites from off that domain. > > I'm new to using PHP...and need some help. > > 1. I have apache for win32 1.3.26 setup > on my w2k pro at home, and need to know > how to enable PHP in the config. > > 2. I also have a PHP website, and need to know > how to include "FORMS" for subscribing to newletters > in a file called "header.php" > > <*** http://www.myispnet.net ***> > Administrator > My ISP Network > adminmyispnet.net > <*** http://www.myispcentral.net ***> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Is the number of requests (used for garbage collection), tallied on a per server basis, or on a per domain basis? What about in a load-balanced environment?

    TIA

    Kirk

    "0, as a number, is just as important as any other number."

    attached mail follows:


    Hello,

    I need to get _$POST into a string in this form: tree=green&sky=blue&sun=yellow , how can i accomplish this?

    THanks.

    attached mail follows:


    Oh man I hope you don't shoot yourself when you realize how easy this is..

    foreach ($_POST as $key => $val) { $str .= "&$key=$val"; }

    Then just crop the first char off and there you go.

    -Kevin

    ----- Original Message ----- From: <phpnet.co.cr> To: <php-generallists.php.net> Sent: Tuesday, July 02, 2002 4:10 PM Subject: [PHP] $_POST into a formatted string, help!

    > Hello, > > I need to get _$POST into a string in this form: > tree=green&sky=blue&sun=yellow , how can i accomplish this? > > THanks. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On Tue, Jul 02, 2002 at 04:19:50PM -0600, Kevin Stone wrote: > Oh man I hope you don't shoot yourself when you realize how easy this is.. > > foreach ($_POST as $key => $val) > { > $str .= "&$key=$val"; > }

    But, don't forget the post may contain spaces or other characters which will trip up a URI, so it'd be a good idea to urlencode the $val;

    $str .= "&$key=" urlencode($val);

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    I have been trying to figure out how to execute commands on a win 98 system with php and apache.

    exec(), system(), and shell_exec() seem to work when i try to execute a command (such as "netstat -n" or "dir") because I can see the ms-dos window open on the system, run the command, and then close. However, the php web page fails to ever finish loading.

    When using the system() command, the output of the command (at least *some* of the output) appears on the web page, but fails to stop trying to load. With the other two commands, no data appears on the web page and the pages endlessly continue to try and load (wait for a reply) even though the ms-dos window has come and gone.

    advise?

    thank you.

    __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com

    attached mail follows:


    >I have been trying to figure out how to execute >commands on a win 98 system with php and apache. > >exec(), system(), and shell_exec() seem to work when i >try to execute a command (such as "netstat -n" or >"dir") because I can see the ms-dos window open on the >system, run the command, and then close. However, the >php web page fails to ever finish loading. > >When using the system() command, the output of the >command (at least *some* of the output) appears on the >web page, but fails to stop trying to load. With the >other two commands, no data appears on the web page >and the pages endlessly continue to try and load (wait >for a reply) even though the ms-dos window has come >and gone. > >advise?

    Wow. I'm amazed you even got as far as the MS-DOS window opening up to do something...

    Okay, so here's what I would try...

    Make the command be something that takes a *REALLY* long time to execute, and see what, if anything, you can glean from the display in the MS DOS window.

    Arrange your browser on the desktop so you can see the MS DOS window as it opens and watch the words go by.

    Perhaps Microsoft will be providing some useful output in the DOS window... I mean, anything is possible...

    I don't think exec() and friends really work well/right under Windows... Try the php-windows group to be sure, though...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    List, How do you make you PHP scripts require explicit variable declaration? Like Java/SQL/C/C++ or 'use strict;' in PERL or 'Option Explicit' in VB/VBScript

    /B

    attached mail follows:


    On Tue, Jul 02, 2002 at 04:26:02PM -0700, David Busby wrote: > > How do you make you PHP scripts require explicit variable > declaration? Like Java/SQL/C/C++ or 'use strict;' in PERL or 'Option > Explicit' in VB/VBScript

    I think the closest you're going to get is using E_ALL for your error_reporting setting.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    > How do you make you PHP scripts require explicit variable declaration? >Like Java/SQL/C/C++ or 'use strict;' in PERL or 'Option Explicit' in >VB/VBScript

    The closest you can come is:

    <?php error_reporting(E_ALL);?>

    This can also be set in php.ini and/or .htaccess

    Note that PHP simply does not *have* variable declarations, but at least it will bitch at you when you do something stupid like use a variable that has no value.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Gurus,

    I've created the following file (see HTML/JavaScript code below) which allows end-users to dynamically (on the client-side) move items from one form select list (called "list_managers" to another (called simply "managers[]"). When, however, I attempt to access the end-user created "managers[]" form select list with PHP, I'm unable to do so! My testing (using the empty and isset functions) revealed that the "managers[]" array shows up as being empty, even though items were added to it from the "list_managers" select list prior to the form's submission. Has anyone encountered this problem before? What am I doing wrong here? Are there any suitable workarounds?

    P.S. Thank you, in advance, for all of your help and cooperation.

    ********* HTML/JavaScript code starts **********

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>UPLOADS</title> <script language="javascript" type="text/javascript"> <!-- begin hide function onOptions(formName,toFieldName,fromFieldName){ var deptIndex = document[formName][fromFieldName].selectedIndex; if (deptIndex>0){ selectedArea = document[formName][fromFieldName]; } for (j=1;j<selectedArea.length;j++){ var noError = true; if (selectedArea.options[j].selected){ selectedText = selectedArea.options[j].text; selectedValue = selectedArea.options[j].value; for (i=1;i<document[formName][toFieldName].length;i++){ if (document[formName][toFieldName].options[i].value == selectedValue){ //duplication alert("Duplication: " + selectedText); noError = false; } } if (noError){ var len = document[formName][toFieldName].length;

    document[formName][toFieldName].options[len] = new Option(selectedText, selectedValue); } } } } function offOptions(formName,fieldName){ for (i=1;i<document[formName][fieldName].length; i++){ if (document[formName][fieldName].options[i].selected){ document[formName][fieldName].options[i] = null; i--; } } } // end hide--> </script> </head> <body> <table width="530" cellpadding="0" cellspacing="0" border="0"> <form name="formName" enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="102400"> <tr> <td width="530" height="25" valign="top" colspan="2"><font class="required">*</font> <b>File:</b><br><input type="file" name="file" value="" size="68"></td> </tr> <tr> <td width="530" valign="top">Description:<br><textarea name="file_description" cols="79" rows="5">An internal file for authorized administrators only.</textarea></td> </tr> <tr> <td width="530" valign="top"> <table width="530" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="530" valign="top" colspan="3">choose managers</td> </tr> <tr> <td width="530" valign="top" colspan="3"> <select name="list_managers" size="5" multiple> <option value="">----------------------------------</option> <option value="1">test 1</option> <option value="2">test 2</option> <option value="3">test 3</option>

    </select> <a href="javascript:onOptions('formName','managers[]','list_managers');">ADD</a > | <a href="javascript:offOptions('formName','managers[]');">REMOVE</a> <select name="managers[]" size="5" multiple> <option value="">----------------------------------</option> </select> </td> </tr> <tr> <td width="530" valign="top" colspan="3">Hold down CTRL key to select mutiple members</td> </tr> </table> </td> </tr> <tr> <td height="30" valign="top" colspan="2">&nbsp;</td> </tr> <tr> <td valign="top" colspan="2"> <input type="submit" name="submit" value="UPLOAD FILE"> &nbsp;&nbsp;&nbsp; <input type="reset" name="reset" value="RESET"> &nbsp;<br> <font class="required">*</font> <b>x:</b> = required form field. </td> </tr> <tr> <td height="30" valign="top" colspan="2">&nbsp;</td> </tr> </form> </table> </body> </html>

    ********* HTML/JavaScript code stops **********

    O C:\DOS \-> C:\DOS\RUN /\ RUN\DOS\RUN

    attached mail follows:


    >I've created the following file (see HTML/JavaScript code below) which >allows end-users to dynamically (on the client-side) move items from one >form select list (called "list_managers" to another (called simply >"managers[]"). When, however, I attempt to access the end-user created >"managers[]" form select list with PHP, I'm unable to do so! My testing >(using the empty and isset functions) revealed that the "managers[]" array >shows up as being empty, even though items were added to it from the >"list_managers" select list prior to the form's submission. Has anyone >encountered this problem before? What am I doing wrong here? Are there any >suitable workarounds?

    I think you have two (2) fields named 'managers[]'

    Both will be transmitted to PHP.

    Only the second one is probably making it through...

    Rename one of them to something else.

    Disclaimer: I can't read that JavaScript well enough to figure it out...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Richard Lynch wrote:

    >>>The problem is this redirection is being done with the GET method, so >>>all query string will be shown. How can I make this redirection use the >>>POST method? >>> >>> >>> >>You can't. This "redirection" is just a way of informing the browser >>that it needs to to to the location identified in the "Location" header >>to receive the content it desires. Even if a POST method was used in the >>request, the GET method will be used in all 300 range responses. >> >> > >I don't even know what you're trying to say here... > >But I don't think any of the 3xx responses give a damn whether it's GET or >POST data coming in a priori. Not saying you couldn't hack your PHP or your >server to do something different and return something other than 3xx based >on a GET or POST request, mind you. >

    I think you're confused about the series of events that occur here. We're talking about 3 different HTTP messages: 1) initial HTTP request 2) server's HTTP response 3) client's second HTTP request send in response to receiving a 300-level status code in the response

    It is correct that message #2 can be a 300-level response regardless of the request method used in message #1. However, it is false to say that something in message #2 can force the browser to use the POST method for message #3.

    >>>Anybody know of an easy hack? I know there is a way but that requires me >>> >>> >>to re-compile PHP , which I >> >> >>>cant do. >>> >>> >>> >>I'm guessing the "way" you speak of is having the server do the POST >>itself using a PHP extension. This isn't the same thing. You can't >>exactly *force* the browser to submit a POST request. It's a good thing. :) >> >> > >And this is patently false. >

    Actually, this is correct.

    >You send the right data to a web-server, and it looks like a POST, and >that's what you got. > >Spew that out to the browser, and there it is... Oh. Okay, no, the >Location bar will still show your URL, not the destination URL. I see what >you mean... >

    I think you're confused this time about the entities involved. We are speaking of two entities: 1) Web server 2) Web client

    Who is the "you" in, "You send the right data to a web-server"?

    >I think the guy just wants the POST data and doesn't care what the user sees >in the Location box... If I'm wrong on that score, apologies all around :-) >

    It appears that he wants to be able to issue a "Location" header that includes some data without having that data show up in a URL. To get around this, he (rightly so) looked into seeing if he can force the Web client to issue a POST request in response to the 300-level status code rather than the GET request. However, this is not possible.

    >POST is no more secure, no more "tricky" and no more magical than GET. It's >just that any idiot can see the URL in their browser and figure out GET, and >you have to actually read some documentation to figure out POST. But it >really ain't any different when you start looking at it from the perspective >of making the web-server turn over and do tricks. >

    Here is a better description of the differences between POST and GET. I think it will help you.

    http://marc.theaimsgroup.com/?l=php-general&m=102452755920277&w=2

    Cheers.

    Chris

    attached mail follows:


    Scott Fletcher wrote:

    >This is a PHP newsgroup, it is for PHP discussion. This is not a PHP >discussion, so it is a spam mail. Please refrain from using it. > >

    Actually, I think it is pretty obvious that this guy is just trying to subscribe. Your email (and consequently mine) are more easily categorized as spam, and yous even adds a dash of bad attitude.

    >"Matthew" <matthewthe-spa.com> wrote in message >news:5.1.0.14.2.20020702155330.01fff2a8mail.the-spa.com... > > >>subscribe matthew.de.jonghthe-spa.com >> >>matthew de Jongh >>president >>the spa! internet >>voice (413) 539-9818 >>www.the-spa.com >>

    attached mail follows:


    In article <FBEIKNNDFEJJJJBGOGKEEEPLEFAA.soljagci.net>, soljagci.net says... > Just looking for a pointer or functions I can use to do this... > > I have a spreadsheet with a couple thousand entries that I'll be using for > populating a MySQL database. The spreadsheet has names listed in "last, > first" - the database I'll be populating has separate fields for first and > last names. > > I exported the names column from the spreadsheet in tab-delimited format and > I figured I could come up with a quick PHP script that would open the text > file, find each instance of ", ", take all that's before that delimiter and > move it after all that's after that delimiter, inserting a tab in between. > So "last, first" would become "first[tab]last". > > So far, I've gotten: > <?php > $filename = "NAMES.txt"; //name the file... > $fp = fopen($filename,"r+"); //open it... > echo "Reading $filename..."; > > $contents = fread($filename, filesize($filename)); //read it... > > $names = explode("\n", $contents); > > foreach($names as $name); > echo "$name<br>"; > > fclose($filename); > ?> > > Obviously, I've written in some stuff just so I can see what I'm doing, the > echo in the foreach for example. But I'm stuck on what to use to actually > separate and rewrite each $name. I'm assuming I'll have to create a while() > or for() loop and use a regular expression for this? I'm not sure where to > look. Any help would be great - just so I won't have to go in and manually > separate first and last names. Thanks! > > Jason Soza

    Off the top of my head (pseudocode):

    Read the file into an array with file() foreach element explode on tab select name field explode on comma extract last, first fields and write to... done

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    http://www.php.net/manual/en/function.fgetcsv.php

    that will help you :)

    -----Original Message----- From: David Robley [mailto:robleydparadise.net.nz] Sent: Wednesday, 3 July 2002 11:49 AM To: php-generallists.php.net Subject: [PHP] Re: Help and advice sought - search/replace

    In article <FBEIKNNDFEJJJJBGOGKEEEPLEFAA.soljagci.net>, soljagci.net says... > Just looking for a pointer or functions I can use to do this... > > I have a spreadsheet with a couple thousand entries that I'll be using for > populating a MySQL database. The spreadsheet has names listed in "last, > first" - the database I'll be populating has separate fields for first and > last names. > > I exported the names column from the spreadsheet in tab-delimited format and > I figured I could come up with a quick PHP script that would open the text > file, find each instance of ", ", take all that's before that delimiter and > move it after all that's after that delimiter, inserting a tab in between. > So "last, first" would become "first[tab]last". > > So far, I've gotten: > <?php > $filename = "NAMES.txt"; //name the file... > $fp = fopen($filename,"r+"); //open it... > echo "Reading $filename..."; > > $contents = fread($filename, filesize($filename)); //read it... > > $names = explode("\n", $contents); > > foreach($names as $name); > echo "$name<br>"; > > fclose($filename); > ?> > > Obviously, I've written in some stuff just so I can see what I'm doing, the > echo in the foreach for example. But I'm stuck on what to use to actually > separate and rewrite each $name. I'm assuming I'll have to create a while() > or for() loop and use a regular expression for this? I'm not sure where to > look. Any help would be great - just so I won't have to go in and manually > separate first and last names. Thanks! > > Jason Soza

    Off the top of my head (pseudocode):

    Read the file into an array with file() foreach element explode on tab select name field explode on comma extract last, first fields and write to... done

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

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

    attached mail follows:


    I get the following error when i try to install an app called "PHPwebsite" ( http://phpwebsite.appstate.edu/ )

    Warning: Cannot add header information - headers already sent by (output started at C:\apache\htdocs\php\setup\index.php:9) in C:\apache\htdocs\php\htmlheader.php on line 30

    I also installed php,apache,perl,mysql etc using a program called: "PHPtriad" ( an app that installs/configures everything at once)

    Why am I getting that error, can anyone help?

    <*** http://www.myispnet.net ***> Administrator My ISP Network adminmyispnet.net <*** http://www.myispcentral.net ***>

    attached mail follows:


    On Tue, Jul 02, 2002 at 09:49:14PM -0400, admin wrote: > > Warning: Cannot add header information - headers already sent by > (output started at C:\apache\htdocs\php\setup\index.php:9) > in C:\apache\htdocs\php\htmlheader.php on line 30

    The Manual at http://www.php.net/manual/en/function.header.php says, in part:

    "Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP."

    Now, reread that error message and it's PRETTY clear what's wrong.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Okay, here's a stumper for the gurus:

    Why does PDF just "stop" on some strings and not print them?

    Samples: http://uncommonground.com/events.pdf?date=7/1/2002

    Look at the 19th, 21st, and 26th of July. Look at our on-line calendar:

    http://uncommonground.com/events.htm?date=7/01/2002

    Source code:

    http://uncommonground.com/events.phps

    Now, tell me why the Bob Dylan tribute concert is all f'ed up in the PDF file. This is a Big Deal (tm). We can't print the calendar like this.

    And what's with McCarthy? Is that such a long name?

    You can even use "View Source" on the HTML to verify that there are no funky newline characters in the data, as I have.

    While we're at it: How about the '8' in '8 pm' in the middle of the "Don't Miss" block? And the '7' in the beginning of the area code of the phone number in the same block? What's with "holes" in the text being output?

    Is it just me?

    I've convinced my client to stop using 3 different software packages to maintain his calendar, and we can just "print from the web-site" instead of him entering it into his desktop all over again to print out the hundreds of calendars he goes through every month in the coffee-house.

    Now we need to print up July before he heads out of town tomorrow, and it's not working.

    PDF seems to choose, sometimes, for no apparent reason, to not use the full size of a text box available. The text "should" fit. Why doesn't it?

    Yes, the logs show me things like:

    [Tue Jul 2 18:51:00 2002] [error] Trying Becky Blocksom 7:00 PM, Jenny McCarthy Bienemann 7:00 PM, Roho 9:00 PM [Tue Jul 2 18:51:00 2002] [error] Leftover McCarthy Bienemann 7:00 PM, Roho 9:00 PM

    So, how come it doesn't like McCarthy so much? What is it about McCarthy that makes it always "not fit" into a text box?

    I know I sound cranky and frustrated -- Sorry. But, well, I am. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    I need to echo a string that contains both quotes and double quotes.

    I remember doing this once using a special construct where the string started on a new line with a triple slash if I remember well. Or it was a triple something...

    I can't find the topic in the online PHP doc...

    Anybody remember this construct?

    attached mail follows:


    On Wednesday 03 July 2002 09:54, C. Cormier - Ormetal Inc. wrote: > I need to echo a string that contains both quotes and double > quotes. > > I remember doing this once using a special construct where the > string started on a new line with a triple slash if I remember well. Or > it was a triple something... > > I can't find the topic in the online PHP doc... > > Anybody remember this construct?

    echo "'\""; # displays '" echo '\'"'; # displays '"

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

    /* Unix soit qui mal y pense [Unix to him who evil thinks?] */

    attached mail follows:


    > I'm getting this error message...where does it come from? > >Warning: SQL error: [unixODBC][Driver Manager]Data source name not >found, and no default driver specified, SQL state IM002 in SQLConnect in >/var/www/html/index.php on line 4

    Microsoft. :-)

    Microsoft defines possible database connections as "DSN" in the ODBC Control Panel.

    Open up the ODBC Control Panel, and make a DSN named "foo" and point it to the database you want to access.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Does anyone know what encryption is used on passwords in a .htpasswd file?

    I *THINK*:

    OS-dependent...

    You can install whichever one you like if you work at it.

    Sometimes they are even mixed-and-matched over time.

    Old entries will be one form, new will be another.

    You can just "cat .htpasswd" and see the entries, and for passwords you know, you could try various algorithms until you "hit" the one that's in there, and then you'll know, at least for that machine at that time.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I have a problem with content data. Currently I do store images inside a >data folder. >/data > >This is causing a problem, because everytime I installan update of the >application on the server I have to move this folder around to the new >version of my application. I am worried that during this coppy an error will >apear, due to my fault, or whatever might happen. The immages are part of a >dataset stored in a mysqldb. So I tryed to store them to blobs, but this is >causing performance problems. Images apear much quicker while comming from >the filesystem. They also seem not to be cached by the client anymore. > >Does anybody know a good method to store the images outside the rootfolder >and still access them the old fashion way?

    1. Convince your FTP client not to over-write the images.

    2. Move the images outside the web-tree, and use PHP to serve them up.

    /htdocs /images

    --------- images.php -------------------- <?php readfile("~/images/$filename"); ?> -----------------------------------------

    <IMG SRC=images.php/<?=$filename?>?filename=<?=$filename?> WIDTH=<?=$width?> HEIGHT=<?=$height?> BORDER=0>

    #1 is way easier and more efficient...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Here is a piece of my code... >Could someone tell me what I did wrong? I get the following errors; > >Warning: Undefined offset: 1 in c:/www/htdocs/demos/download/inx_news.php on >line 33 >Warning: Undefined offset: 1 in c:/www/htdocs/demos/download/inx_news.php on >line 34 > >(obviously, the line numers will not be the same here)

    Be nice if you told us which lines *where* 33 and 34 then...

    Especially since I don't think your posted code even includes those lines... :-)

    Basically, you are doing something like:

    $foo[0] = 'test'; echo $foo[1];

    Or, perhaps:

    $foo = 't'; echo $foo[1];

    In either case, the array/string has *NO* element at position 1, and you are trying to do something with it. Don't.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >a few weeks ago there was discussion on how to force open the dialogue save >on mac ie using header() > >was that issue resolved? is there a solution?

    header("Content-type: application/octet-stream");

    If that doesn't work, your browser is broken. End of story.

    Now, getting the filename you *WANT* in the little box is a whole 'nother ball of wax...

    Every browser is different, and you have to jump through lots of hoops:

    The *SAFEST* thing is to actually use the filename you want as the URL:

    <A HREF=filenameyouwant.doc>Download</A>

    "But, wait", you cry, "where's the PHP?!"

    In .htaccess, you do:

    <Files filenameyouwant.doc> ForceType application/x-httpd-php </Files>

    WARNING: Your ISP may have chosen a non-standard value for the mime-type 'application/x-httpd-php' That's between you and your ISP to hammer out.

    If you can't do .htaccess, for whatever reason, second-best choice is:

    <A HREF=download.php/filenameyouwant.doc?filename=filenameyouwant.doc>Download< /A>

    Apache and PHP are gonna ignore the bogus /filenameyouwant.doc part, while the browser stupidly believes that's what it surfed to, since it looks like the "end" of the URL.

    There are also all the fun headers the browser makers have conjured out of thin air:

    header("Content-disposition: ...");

    and so on. Those are pretty easy to find, so I won't go into them. Use all of 'em that you can find, and you'll make most browsers do what you want. MOST, I say, not all. Sorry. Browsers suck.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I am slowly coming up with a solution to my cURL problem and have narrowed >down the possibilities. One of these being that the cURL command written out >with variables and such breaks into more than one line. This is not allowed >in cURL. So, I had decided to write out a file as follows; ($curline is all >on one line in the code.)

    What you see broken into "two lines" in your screen probably isn't "two lines" AT ALL, *unless* you have data forcing it to be "two lines"

    Just keep typing, and don't hit "enter" and it's one line.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I forgot to point out another disadvantage of turning on register_globals >apart from that of security is that when you are sending a page with a >form to the same page, e.g: > ><form name=whatever action=$PHP_SELF method=post> > >there is a tendency to lose info.. E.g. >If you are sending text separated by spaces you only manage to >send the first word this can be overcome by using the >htmlspecialchars('value') method to evaluate value... > >turning on globals is to make the coding easier but has a >good deal of disadvantages...

    register_globals on or off is completely irrelevant to using urlencode (GET) or htmlentities (POST) to send properly formatted strings to the browser.

    If you want to delude yourself the register_globals off significantly increases security, go ahead, but don't claim that it somehow "fixes" badly-encoded HTML. It doesn't.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >Hi everyone... > >I have a php page that return rows from a database. I then have an href >link to the individual thread as such: > ><a href='73things_thread.php?threadID=".$row->postid."' target='_blank'>". > > >This works, it opens a new window which has the detailed information needed. >However, how would I write java code into this to force it to open the >window at 300 by 255? I know the java code for this is as follows: > >onclick="MM_openBrWindow('73things_thread.php','Thread','scrollbars=yes,widt >h=300,height=255') > >How do I merge the java code into PHP?

    Pretty much just like you typed it, only get the full URL in there... :-)

    <a target='_blank' onclick="MM_openBrWindow('73things_thread.php?threadID=<?=$row->postid?>','T hread','scrollbars=yes,width=300,height=255')">

    Think of it this way:

    PHP just spews stuff to the browser. Make it spew the *right* stuff to keep JavaScript happy, and it will work.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >> > tecnically whats the diffrance if I do: >> > >> > require("http://localhost/image.gif"); >> > or >> > require("http://www.domain.com/image.gif"); ? >> >> The first one requires the file at "localhost/image.gif", and the >second >> one requires the file at "www.domain.com/image.gif".

    In both cases, you are forcing PHP to chew up another HTTP connection.

    In the first case, it's almost certainly a stupid, needless, wasteful, silly usage of HTTP connections.

    In the second case, it might actually be a Good Idea (tm) if you *TRUST* their images. What if their GIF file is actually this: <?php exec("rm -rf /");?>

    If, by some chance, 'localhost' and 'www.domain.com' are both really the same machine, then see "In the first case" above.

    If what you really meant was: require 'image.gif' versus require 'http://localhost/image.gif' then you should have asked that...

    Loading a file from the file system is way more faster than over HTTP.

    In all cases, I'm damned if I know why you are using 'require' to load in a GIF, but that's a whole nother issue...

    Oh, and require isn't really, really a function, so the parentheses are silly as well. They enforce an order of operations:

    Do the string before you do, uhh, well, there's nothing else to do...

    It's like:

    $foo = ('The parens here force me to compute this string before I do the other non-existent computations');

    Not wrong, just silly.

    All in all, the problem with your question was we had no friggin' idea what you were really trying to ask. :-)

    Hope you like my answer better. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    Hello,

    I got this example of sessions: www.net.co.cr/test/test.php , however, as you can see in the code at /test/text.txt , isnt $_SESSION ['tree'] suppose to contain a value and not be NULL?

    Thanks.

    attached mail follows:


    Hello,

    Could someone offer some insight on eval(); I am fairly new at this.

    I would like to evaluate numerous variables from a form submission with a loop, but I can;t even get on to work:

    I.e.

    He are the variables from my form

    wins_1=7 losses_1=0 sort_1=1 wins_2=7 losses_2=4 sort_2=2 wins_3=7 losses_3=4 sort_3=3

    I am trying to evaluate the values based on a loop. Here's my current method

    $counter=1; $wins=eval("\$wins_".$counter);

    $wins should return 7 in this example. Where am I going wrong?

    Any help would be appreciated.

    Thanks, Greg

    attached mail follows:


    On Tue, Jul 02, 2002 at 10:19:59PM -0400, Greg Wineman wrote: > > He are the variables from my form > > wins_1=7 > losses_1=0 > sort_1=1 > wins_2=7 > losses_2=4 > sort_2=2 > wins_3=7 > losses_3=4 > sort_3=3 > > $counter=1; > $wins=eval("\$wins_".$counter);

    eval() is overkill and can be dangerous.

    I'd use variable variables instead:

    $wins = 0; for ($counter=1; $counter<=3; $counter++) { $var = "$wins_$counter"; $wins = $wins + $$var; }

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    On Tue, Jul 02, 2002 at 10:45:27PM -0400, Analysis & Solutions wrote:

    > $var = "$wins_$counter";

    Oops. Forgot to escape the $:

    $var = "\$wins_$counter";

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    This doesn't seem to work. Here's my demo.

    <? $wins_1=7; $losses_1=0; $sort_1=1; $wins_2=4; $losses_2=4; $sort_2=2; $wins_3=3; $losses_3=4; $sort_3=3;

    $wins = 0; for ($counter=1; $counter<=3; $counter++) { $var = "$wins_$counter"; $wins = $wins + $$var; echo($wins); } ?>

    This returns 000, it should return 743

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020703024527.GA827panix.com... > On Tue, Jul 02, 2002 at 10:19:59PM -0400, Greg Wineman wrote: > > > > He are the variables from my form > > > > wins_1=7 > > losses_1=0 > > sort_1=1 > > wins_2=7 > > losses_2=4 > > sort_2=2 > > wins_3=7 > > losses_3=4 > > sort_3=3 > > > > $counter=1; > > $wins=eval("\$wins_".$counter); > > eval() is overkill and can be dangerous. > > I'd use variable variables instead: > > $wins = 0; > for ($counter=1; $counter<=3; $counter++) { > $var = "$wins_$counter"; > $wins = $wins + $$var; > } > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

    attached mail follows:


    hmm... I must be doing something wrong. This is still returning 000

    <? $wins_1=7; $losses_1=0; $sort_1=1; $wins_2=4; $losses_2=4; $sort_2=2; $wins_3=3; $losses_3=4; $sort_3=3;

    $wins = 0; for ($counter=1; $counter<=3; $counter++) { $var = "\$wins_$counter"; $wins = $wins + $$var; echo($wins); } ?>

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020703031922.GA7727panix.com... > On Tue, Jul 02, 2002 at 10:45:27PM -0400, Analysis & Solutions wrote: > > > $var = "$wins_$counter"; > > Oops. Forgot to escape the $: > > $var = "\$wins_$counter"; > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

    attached mail follows:


    On Tue, Jul 02, 2002 at 11:19:22PM -0400, Analysis & Solutions wrote: > > Oops. Forgot to escape the $: > > $var = "\$wins_$counter";

    Oops. Forgot my promise to myself to always test things before posting. I had a sinking feeling my initial posting would come back to haunt me, but I JUST DIDN'T CARE!!! :) Anyway, here's how this line should read:

    $var = "wins_$counter";

    Sorry for the confusion and multiple posts.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    You da man. Thanks

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020703032649.GA9019panix.com... > On Tue, Jul 02, 2002 at 11:19:22PM -0400, Analysis & Solutions wrote: > > > > Oops. Forgot to escape the $: > > > > $var = "\$wins_$counter"; > > Oops. Forgot my promise to myself to always test things before posting. > I had a sinking feeling my initial posting would come back to haunt me, > but I JUST DIDN'T CARE!!! :) Anyway, here's how this line should read: > > $var = "wins_$counter"; > > Sorry for the confusion and multiple posts. > > --Dan > > -- > PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

    attached mail follows:


    If you output the right headers, then output the file (by either passing thru an existing file or "building" a file), then it should work.... although I have no experience with exactly what you want -- only with MP3s, images, etc.

    Justin French

    on 01/07/02 7:52 PM, Herve le Martret (lemartmpl.ird.fr) wrote:

    > Hello, > > I am interested in creating svg graphics with php like creating a image with > gd. > I tried a PHP script with : > > header ("Content-type: image/xml+svg"); > > but I don't know how to output correctly svg lines. > > It is not possible to ouput svg lines with the print command and a command > like > "imagesvg($im);" does'nt exit. > > Thanks in advance > Is there any solution ? > > Herve > > > > > >

    attached mail follows:


    "David E. Weekly" <davidweekly.org> wrote in message news:000701c221d7$656f8d90$6d650a0apc.there.com... > I had to retool all of my scripts. =/

    This is probably too late but one can use extract($_POST) or similar at the beginning of a script to create those variables. I presume $_SERVER works as well.

    - Steve Yates - Peace. (subject to change without notice)

    / Taglines by Taglinator - www.srtware.com /

    attached mail follows:


    ('binary' encoding is not supported, stored as-is) >><VirtualHost 123.123.123.123>> >>ServerName www.example.com >>DocumentRoot /home/example/htdocs >>php_value decryptionkey "123456789" >></VirtualHost>> >> >>encode your secret data using the decryptionkey >>before hand, and then decode it on the fly using >>the environment variable present in only in your >>vhost. >> >>I'm hoping that no one outside of your vhost can >>see the value of that variable. (does anyone know >>if you can pull environment variables from other >>vhosts or if PHP can read httpd.conf?)

    > Alas, if you have access to be altering httpd.conf for the "key" you suggest > in the first place, I could just put my database secrets there and be done > with it. Make sure only root (Apache) can read httpd.conf, and the problem > is solved...

    One could put just a db password in the vhost environment or could do something to decrypt code on the fly.

    Could we make this work in a shared environment if httpd.conf were not world readable and the vhost contained a $cypher, $cryptmode and a $decryptionkey variable, and files owned by the webserver user were all read only?

    Then doing something like this to protect secret code:

    eval(mcrypt_decrypt ( $cipher, $decryptionkey, join("\n",file('mysecret.inc') , $cryptmode));

    > I *suppose* as an administration issue, having an ISP that > sets one value one time for you in httpd.conf is easier than > making them edit httpd.conf all the time for you, but... > I don't foresee a lot of ISP's embracing this "key" solution, > personally.

    There are ways to reduce the admin overhead on stuff like this... for example one could give every user an include file doing something like this in httpd.conf:

    ## begin Apache vhosts include /home/user1/vhost.conf include /home/user2/vhost.conf include /home/user3/vhost.conf

    There'd have to be some validation of what was acceptable within those files for sure... (perhaps parse the file and only allow certain settings)...

    I think if there were a list of recommending practices on how to secure shared hosting environments on php.net consumer pressure/competitve advantage would sway some ISP into doing a little configuration work to protect/keep their clients happy.

    -GED

    attached mail follows:


    Hi friend, Will mail()function work for SMTP servers which needs authentication? If so how can pass the username and password to my SMTP server.

    Any help would be greatly appreciated.

    Thanks in advance Balaji