OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Thu Jul 18 2002 - 16:56:01 CDT

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

    php-general Digest 18 Jul 2002 21:56:01 -0000 Issue 1472

    Topics (messages 108233 through 108343):

    Re: Sessions: watertight?
            108233 by: Jason Wong
            108234 by: joakim.andersson.cybercom.se
            108235 by: PHPCoder
            108242 by: Justin French
            108328 by: 1LT John W. Holmes

    Accessing Ports
            108236 by: Thomas \"omega\" Henning
            108245 by: Marek Kilimajer
            108248 by: Cal Evans
            108253 by: Adam Voigt

    snmp / php / linux /error
            108237 by: MAAS
            108239 by: David Robley

    Re: ErrorDocument 404 & Form
            108238 by: David Robley
            108241 by: Matt
            108243 by: Fabien Penso
            108310 by: Peter

    Re: Upload File Problem
            108240 by: Mark Colvin
            108247 by: joakim.andersson.cybercom.se
            108249 by: Mark Colvin

    Re: how to access javascipt variables in PHP
            108244 by: Kondwani Spike Mkandawire

    Re: Includes vs. Functions
            108246 by: Jay Blanchard
            108260 by: Rick Widmer

    Any PHP editor for windows
            108250 by: Dasmeet Singh
            108251 by: Jay Blanchard
            108276 by: Andrew Chase

    mod_rewrite problem
            108252 by: adrian murphy
            108271 by: CC Zona
            108284 by: Sameh Attia

    Cookies - good or bad???
            108254 by: PHPCoder
            108255 by: Kondwani Spike Mkandawire
            108261 by: Analysis & Solutions
            108262 by: Scott Fletcher
            108272 by: Cord Schneider
            108281 by: Scott Fletcher
            108287 by: Kondwani Spike Mkandawire
            108293 by: Scott Fletcher
            108296 by: Justin French
            108302 by: Justin French
            108311 by: Alberto Serra
            108315 by: Scott Fletcher
            108318 by: Analysis & Solutions
            108327 by: Alberto Serra

    Test of GD
            108256 by: Jay Blanchard

    Code errors
            108257 by: Chris Crane
            108258 by: Scott Fletcher
            108259 by: Chris Crane
            108269 by: Analysis & Solutions
            108270 by: Marek Kilimajer
            108277 by: Chris Crane
            108282 by: Chris Crane
            108299 by: Analysis & Solutions

    Re: Test of GD - SOLVED
            108263 by: Jay Blanchard

    XML with PHP & cURL.
            108264 by: Scott Fletcher
            108265 by: Jay Blanchard
            108268 by: Analysis & Solutions
            108274 by: Scott Fletcher
            108275 by: Scott Fletcher

    Warning: e-mails being harvested from PHP newsgroups
            108266 by: Cord Schneider
            108278 by: Bret L Conard

    Re: Someone Help please
            108267 by: Chris Crane
            108273 by: Analysis & Solutions

    apache.conf for php
            108279 by: Scott Fletcher
            108304 by: Jason Wong

    php.ini problem
            108280 by: Andre
            108285 by: Sameh Attia
            108301 by: Analysis & Solutions
            108308 by: Andre

    PHP and Date()
            108283 by: Chris Crane
            108286 by: Jay Blanchard
            108295 by: Chris Crane
            108300 by: Jay Blanchard

    Cannot parse html pages in php
            108288 by: Keith Roberts
            108289 by: Keith Roberts
            108297 by: Kondwani Spike Mkandawire

    php and html
            108290 by: Keith Roberts
            108291 by: Keith Roberts
            108292 by: Jay Blanchard

    Re: why my php can not get values from Form?
            108294 by: skeller.healthtvchannel.org

    Check for Associative Array
            108298 by: Henning Sittler
            108303 by: Martin Clifford
            108305 by: Henning Sittler
            108306 by: Jason Wong
            108307 by: Martin Clifford
            108309 by: Kevin Stone
            108312 by: Steve Edberg

    rebooting linux using php
            108313 by: Harpreet Kaur
            108314 by: John S. Huggins
            108316 by: Scott Fletcher
            108320 by: 1LT John W. Holmes
            108335 by: Scott Fletcher
            108338 by: Jason Reid

    spawning scripts to different graphical targets
            108317 by: Alberto Serra
            108319 by: Martin Clifford
            108321 by: Alberto Serra
            108325 by: Dennis Moore

    ARRAY_PUSH with $key
            108322 by: Joshua E Minnie
            108324 by: Analysis & Solutions

    Truncate ::: DAM!!!!!
            108323 by: vins
            108326 by: vins
            108332 by: vins

    Arrays and Regs
            108329 by: Martin Clifford

    php/shell question...
            108330 by: Kelly Meeks
            108331 by: Jay Blanchard

    Loading a File into Variable - How??
            108333 by: Monty
            108334 by: Alberto Serra
            108336 by: Monty
            108342 by: Andre Dubuc

    PHP versus .Net?
            108337 by: jsegovia.mindspring.com

    Question about using if elseif ...
            108339 by: Fargo Lee
            108341 by: Analysis & Solutions
            108343 by: Pete James

    Refreshing session variables
            108340 by: N. Pari Purna Chand

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    On Thursday 18 July 2002 17:39, joakim.anderssoncybercom.se wrote:

    Joakim, please don't take offence, I know you're being helpful but ...

    > Taken straigh from the manual:
    > (http://www.php.net/manual/en/ref.session.php)
    >
    > [quote]
    > There are two methods to propagate a session id:

    [snip]

    ... do we really need quotes from the manual? You've already given the pointer
    which is sufficient in itself for any interested parties to look up the
    relevant information.

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

    /* Only people with names beginning with 'A' are getting mail this week (a la Microsoft) */

    attached mail follows:


    > From: Jason Wong [mailto:php-generalgremlins.com.hk] > Sent: Thursday, July 18, 2002 11:46 AM > > Joakim, please don't take offence, I know you're being helpful but ...

    None taken.

    > ... do we really need quotes from the manual? You've already > given the pointer > which is sufficient in itself for any interested parties to > look up the > relevant information.

    You're right about this. Wont happen again... :-)

    /Joakim

    attached mail follows:


    Thanks OK, I have checked my phpinfo(); and the *session.use_trans_sid* = 1 ; *session.use_cookies =* On, so I'm not sure if I need to turn the cookies bit off, but I would think it not to be necessary. ; So, I can't see why the URL's aren't changed on my pages... Now, something to contemplate so long; say I DO get the URL bit right, what method does PHP use to determine which URL's to append? Would this method have a considerable overhead on performance? ( given that there could be alot of session usage on my domains). I'm rather interested in the workings of this URL "detection", as it basically means that PHP runs forward through all my pages to see where the session stops and and it's difficult for me to see how PHP can tell which pages have to do with which sessions. Arguably one can have two session "threads" that has some overlapping files, and my mind boggles as to how php can track the session vars, secially if the one session thread were to use the same session variable names ( which is surely possible right?) I guess my question is very academic, but I'm trying to understand the workings of sessions.. But for now, my main concern is getting PHP to work it's magic with my URL's.

    Thanks

    joakim.anderssoncybercom.se wrote:

    >Taken straigh from the manual: >(http://www.php.net/manual/en/ref.session.php) > >[quote] >There are two methods to propagate a session id: > >- Cookies > >- URL parameter > >The session module supports both methods. Cookies are optimal, but since >they are not reliable (clients are not bound to accept them), we cannot rely >on them. The second method embeds the session id directly into URLs. > >PHP is capable of doing this transparently when compiled with >--enable-trans-sid. If you enable this option, relative URIs will be changed >to contain the session id automatically. Alternatively, you can use the >constant SID which is defined, if the client did not send the appropriate >cookie. SID is either of the form session_name=session_id or is an empty >string. >[/quote] > >Regards >Joakim Andersson > > >>-----Original Message----- >>From: PHPCoder [mailto:internetvsa.co.za] >>Sent: Thursday, July 18, 2002 11:17 AM >>To: php-general >>Subject: [PHP] Sessions: watertight? >> >> >>Hi >>I'm doing some reading on sessions and how it works etc, and have a >>concern (which is probably fed by my ignorance on the topic). >>The couple of "simple session examples" I have found in the PHP/MySQL >>book by Luke Welling & Laura Thompson gives a simple 3 page session >>example where the session is started on the first page, a variable is >>registered as a session var and then has a link to the next >>page where >>the session_start() is called and the session_var is echoed to >>illustrate the workings of a session. >>My understanding is that PHP will either use cookies to store the >>session ID on the client's pc, or send it via URL, so, assuming that >>cookies is a no-go, can I now assume that PHP will attach >>it's session >>ID to each and every URL located on my .php page? >>The reason I'm asking is as follow: >>I did the little excersise, and then deliberately rejected my >>browsers >>call to process the cookie, and then the script didn't return the >>variable as it did previously... >>And now, assuming that I can assume that PHP will attach the >>SID to all >>URL's , how does it know to which URL's to attach, or am I >>supposed to >>manually attach them, leaving me with another question, If I have to >>manually code the SID into the URL, then the whole session >>"coockies if >>possible" approach doesn't seem to work??? >> >>Can someone explain it in more detail for me plz? >>Thanks >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >

    attached mail follows:


    on 18/07/02 7:39 PM, joakim.anderssoncybercom.se (joakim.anderssoncybercom.se) wrote:

    > PHP is capable of doing this transparently when compiled with > --enable-trans-sid. If you enable this option, relative URIs will be changed > to contain the session id automatically.

    It's worth pointing out that enable-trans-sid IS NOT bullet proof. It doesn't work on all javascripts (or any other client-side scripting, and I'm sure there's some other scenario's that it skips.

    It takes care of relative URLs within standard HTML. I have a feeling it doesn't work in IFRAME's, but does for FRAME's.

    It worth doing some testing if you go down this road.

    Justin French

    attached mail follows:


    ----- Original Message ----- From: "PHPCoder" <internetvsa.co.za> To: <joakim.anderssoncybercom.se> Cc: "php-general" <php-generallists.php.net> Sent: Thursday, July 18, 2002 6:18 AM Subject: Re: [PHP] Sessions: watertight?

    > Thanks > OK, I have checked my phpinfo(); and the *session.use_trans_sid* = 1 ; > *session.use_cookies =* On, so I'm not sure if I need to turn the > cookies bit off, but I would think it not to be necessary. ; So, I can't > see why the URL's aren't changed on my pages...

    Was PHP compiled with --enable_trans_sid or whatever flag is it??

    > Now, something to contemplate so long; say I DO get the URL bit right, > what method does PHP use to determine which URL's to append? Would this > method have a considerable overhead on performance? ( given that there > could be alot of session usage on my domains).

    Yeah, it would affect performance. Not sure how much. I imagine that's why you actually have to set a compile time option to enable this.

    >I'm rather interested in > the workings of this URL "detection", as it basically means that PHP > runs forward through all my pages to see where the session stops and and > it's difficult for me to see how PHP can tell which pages have to do > with which sessions.

    PHP knows it has to deal with sessions when you call session_start() at the beginning of the page.

    >Arguably one can have two session "threads" that > has some overlapping files, and my mind boggles as to how php can track > the session vars, secially if the one session thread were to use the > same session variable names ( which is surely possible right?)

    No, session names are unique. That's the whole idea...I use your unique session id to identify you each time you return to my pages.

    ---John Holmes...

    attached mail follows:


    Hello,

    Can i access my paralel or USB port with PHP server side?

    Thomas "omega" Henning

    attached mail follows:


    Only if you write your own module.

    Thomas \"omega\" Henning wrote:

    >Hello, > >Can i access my paralel or USB port with PHP server side? > >Thomas "omega" Henning > > > > >

    attached mail follows:


    No.

    No. PHP runs on the server. It knows nothing of the client.

    =C=

    * * Cal Evans * The Virtual CIO * http://www.calevans.com *

    -----Original Message----- From: Thomas "omega" Henning [mailto:tomimediasoft.ro] Sent: Thursday, July 18, 2002 5:33 AM To: php-generallists.php.net Subject: [PHP] Accessing Ports

    Hello,

    Can i access my paralel or USB port with PHP server side?

    Thomas "omega" Henning

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

    attached mail follows:


    If you mean the ports on the server, theoretically yes, if get the right permissions set and figure out all the device settings.

    Adam adamcryptocomm.com

    On Thu, 2002-07-18 at 08:29, Cal Evans wrote: > No. > > No. PHP runs on the server. It knows nothing of the client. > > =C= > > * > * Cal Evans > * The Virtual CIO > * http://www.calevans.com > * > > > -----Original Message----- > From: Thomas "omega" Henning [mailto:tomimediasoft.ro] > Sent: Thursday, July 18, 2002 5:33 AM > To: php-generallists.php.net > Subject: [PHP] Accessing Ports > > > Hello, > > Can i access my paralel or USB port with PHP server side? > > Thomas "omega" Henning > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Iam trying to use my php file in a Linux machine.

    #!/usr/local/bin/snmp_guard.php -q

    <? $bat = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.12.0"); $sum = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.13.0"); $drift = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.10.0"); $verk = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.11.0"); echo $bat; ?>

    Then I start it with php snmp_guard.php

    All I get is

    Call to undefeind funcion snmpget()

    WHY??

    attached mail follows:


    In article <20020718103644.19470.qmailpb1.pair.com>, maastelia.com says... > Iam trying to use my php file in a Linux machine. > > #!/usr/local/bin/snmp_guard.php -q > > <? > $bat = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.12.0"); > $sum = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.13.0"); > $drift = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.10.0"); > $verk = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.11.0"); > echo $bat; > ?> > > Then I start it with php snmp_guard.php > > All I get is > > Call to undefeind funcion snmpget() > > WHY??

    That error is usually an indication that the particular resource hasn't been included when php was compiled.

    Use phpinfo() to see what capabilities your installation has.

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    In article <plop87znwq2bb3.fsflinuxfr.org>, pensolinuxfr.org says... > > Tom a écrit : > > > Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in > > httpd.conf or an .htaccess file) follows absolute paths, so you are calling > > your engine.php out of the root directory of the machine. So the question > > is, do you have engine.php in the / folder? If not you can put it there or > > just adjust your ErrorDocument command to point to the path of the file. > > No, you didn't understand. I'll make a simpler example. Let's say I did > use : > > ErrorDocument 404 /phpinfo.php > > /phpinfo.php exists, it just does phpinfo(); > > If I call http://localhost/dontexist?plop=foobar I will see the phpinfo, > and I will see variables like : > > REDIRECT_ERROR_NOTES: File does not exist: /var/www/dontexist > REDIRECT_QUERY_STRING: plop=foobar > REDIRECT_REQUEST_METHOD: GET > REDIRECT_STATUS: 404 > etc > > but $plop won't be set, and there is no way to get the variables > back. In POST method I won't even see the REDIRECT_QUERY_STRING at > all. So should this work, if not why, and is there a way to fix it ?

    I seem to remember some discussion about this ages ago - there was some difference between how ErrorDocument works in httpd.conf and .htaccess - you might try the latter and see if there is a different result.

    Then again, I might not be remembering correctly, so ...

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    > Well it still is in GET method because the url does still exist with the > ?plop=foobar but in case I want to use POST method (which I will as my > form has huge textarea) everything disappear. > Also this is a turn around I don't like, I would first understand why it > doesn't work, and if I can fix it. I browsed the the apache source, and it looks to me that the message body is simply read and dumped into the bit bucket on a 404 with an ErrorDocument (and thus isn't passed as part of the internal request to the ErrorDocument itself). Perhaps you ought to ask the apache list.

    attached mail follows:


    Matt a écrit :

    >> Well it still is in GET method because the url does still exist with the >> ?plop=foobar but in case I want to use POST method (which I will as my >> form has huge textarea) everything disappear. >> Also this is a turn around I don't like, I would first understand why it >> doesn't work, and if I can fix it.

    > I browsed the the apache source, and it looks to me that the message body > is simply read and dumped into the bit bucket on a 404 with an ErrorDocument > (and thus isn't passed as part of the internal request to the ErrorDocument > itself). Perhaps you ought to ask the apache list.

    Apparently, as I do read http://www.geocrawler.com/archives/3/182/1999/4/0/1646542/, it's an Apache problem.

    Thanks, I move on an Apache user list :)

    -- 
    Fabien Penso <pensolinuxfr.org> | LinuxFr a toujours besoin de :
    http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/
    

    attached mail follows:


    If you removed the ErrorDocument 404 /phpinfo.php from the apache conf (or reset it to original value), what happens? Do you get a standard 404 not found error page?

    "Fabien Penso" <pensolinuxfr.org> wrote in message news:plop87ele1z2xj.fsflinuxfr.org... > > Matt a écrit : > > >> Well it still is in GET method because the url does still exist with the > >> ?plop=foobar but in case I want to use POST method (which I will as my > >> form has huge textarea) everything disappear. > >> Also this is a turn around I don't like, I would first understand why it > >> doesn't work, and if I can fix it. > > > I browsed the the apache source, and it looks to me that the message body > > is simply read and dumped into the bit bucket on a 404 with an ErrorDocument > > (and thus isn't passed as part of the internal request to the ErrorDocument > > itself). Perhaps you ought to ask the apache list. > > Apparently, as I do read > http://www.geocrawler.com/archives/3/182/1999/4/0/1646542/, it's an > Apache problem. > > Thanks, I move on an Apache user list :) > > -- > Fabien Penso <pensolinuxfr.org> | LinuxFr a toujours besoin de : > http://perso.LinuxFr.org/penso/ | http://linuxFr.org/dons/

    attached mail follows:


    Joakim,

    Thank you for your reply. I tried your example and get 'Possible file upload attack: filename.' meaning that 'if (is_uploaded_file($_FILES['img1']['tmp_name']))' returns false. I put a couple of echo statements in before the if statement to check '$img1_name' '$img1_size and '$img1_type' and these all returned the correct values. I have my upload_tmp_dir in php.ini set to /var/www/html/img and this folder has 777 permissions. Do you think the file is not getting to temp directory and if so any idea why?

    **************************************************** This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. ****************************************************

    attached mail follows:


    > From: Mark Colvin [mailto:mark.colvinccmltd.co.uk] > Sent: Thursday, July 18, 2002 12:41 PM > To: joakim.anderssoncybercom.se > > Joakim, > > Thank you for your reply. I tried your example and get > 'Possible file upload > attack: filename.' meaning that 'if > (is_uploaded_file($_FILES['img1']['tmp_name']))' returns > false. I put a > couple of echo statements in before the if statement to check > '$img1_name' > '$img1_size and '$img1_type' and these all returned the > correct values. I > have my upload_tmp_dir in php.ini set to /var/www/html/img > and this folder > has 777 permissions. Do you think the file is not getting to > temp directory > and if so any idea why?

    Have you tried echoing $_FILES['img1']['tmp_name'] or $HTTP_POST_FILES['img1']['tmp_name']? If the first doesn't work, you may have to exchange $_FILES to $HTTP_POST_FILES or $_FILES['img1']['tmp_name'] to $img1_tmp_name etc.

    /Joakim

    attached mail follows:


    Joakim,

    Thanks again. $HTTP_POST did the trick. I did look through the archives before posting but didn't come across this solution. I obviously didn't look hard enough!

    **************************************************** This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. ****************************************************

    attached mail follows:


    Wouldnt this work? <form name=myForm action=sendPage.php action=post> <script language = javascript> function myFunc(){ var myJavaScriptVar = initialValue... ....Do What Ever (manipulate myVar)...

    document.myForm.fieldName.value = myJavaScriptVar;

    </script>

    <input type=hidden name=fieldName value=init>

    <?php // If the function my Func has been executed you can do // the following... echo "<input type=hidden name=fieldName value=$fieldName>"; ?>

    // If you are not running apache (if running IIS) you may get an undefined // variable notice on running your script to rid yourself of // this do the following instead of the php above... <?php if(isset($fieldName)){ echo "<input type=hidden name=fieldName value=$fieldName>"; } ?>

    Hope this Helps...

    Spike...

    attached mail follows:


    [snip] Chris, thanks for describing your method. The reason I really dislike Functions in PHP is because you have to pass every variable needed by a function, even if that variable is global in the main script, which is a pain in the ass when a function needs a long string of variables. It makes it easier to forget a variable in the list and can make the code look messy.

    So, that's why I prefer includes, because the code is operating on the same level as the main script and can easily use variables set locally without making them global.

    I'll use a function if it only needs one or two variables passed to it, but, I find myself using more Includes than Functions because of the variable passing necessary. [/snip]

    Includes vs. Functions? How about includes that have functions, which a lot of developers do. For instance, I have a function set up for database connections. I use it by including it with pages that require database connections. I think this probably should be Functions vs. Blocks of Code (that might be placed in an included file). Actually I see this as being potentially messier, IMHO. I will have to remember many variable names that are used in the included file, rather than passing variables I am using locally to functions with clearly thought out names. Example;

    a. I need a variable to hold this standard deviation result. Since I do the stdv calculation in the block I included I need to go see what the name of the variable is and use that, so I don't muck up the code.

    b. calcStdDev($myCurrentVariable); oh, I need one for here too so, calcStdDev($anotherVariable);

    I just think that you are selling yourself short, and ultimately your code will be harder to document and maintain. Using blocks is OK, if that block can be 'functionalized' I say do it.

    For efficiency in processing it really will not make much difference in an included file whether that file is blocks, or functions.

    Jay

    "You’re just jealous because the voices are talking to me"

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    At 09:20 PM 7/17/02 -0500, Michael Sims wrote:

    >$superglobals = array("var1", "var2", "var3", "var4", "var5", "..."); > >Now inside the function you can do this: > >function somefunction ($somevar) { > > global $superglobals; > foreach($superglobals as $varname) { > global $$varname; //resolves to $var1, $var2, $var3, etc. > } > > //Other stuff here > >}

    You're working too hard!

    function somefunction( $somevar ) {

    global $suberglobals;

    extract( $superglobals );

    //Other stuff here

    }

    Rick

    attached mail follows:


    Hey, does anyone knows of a good PHP editor for windows. I have also heard emacs is available for windows. Does anyone know where to download it from? Dasmeet http://www.einfotimes.com

    attached mail follows:


    [snip] Hey, does anyone knows of a good PHP editor for windows. I have also heard emacs is available for windows. Does anyone know where to download it from? Dasmeet http://www.einfotimes.com [/snip}

    There are a few, but these two are the ones I see used most;

    http://www.phpedit.com/ PHPEdit -- has some bugs, but not bad (free) http://www.zend.com/store/products/zend-studio.php -- Zend Studio (version 2.0 is free)

    HTH!

    Jay

    "Why take life so seriously? It isn’t permanent."

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    ftp://ftp.gnu.org/gnu/windows/emacs/latest

    A helpful Emacs resource: http://www.emacswiki.org/cgi-bin/wiki.pl

    Be sure to download php-mode for Emacs, too! http://sourceforge.net/projects/php-mode/

    And PSGML if you do much with HTML/XHTML/XML: http://www.lysator.liu.se/projects/about_psgml.html

    -Andy

    > -----Original Message----- > From: Dasmeet Singh [mailto:dasmeettunmail.com] > Sent: Thursday, July 18, 2002 2:59 AM > To: php-generallists.php.net > Subject: [PHP] Any PHP editor for windows > > > Hey, does anyone knows of a good PHP editor for windows. I have also > heard emacs is available for windows. Does anyone know where to download > it from? > Dasmeet > http://www.einfotimes.com

    attached mail follows:


    Hi, the following code redirects www.usersite.mysite.biz to www.mysite.biz/users/sites/usersite

    the problem is when the 'www' is left out it doesn't work. could someone help me to fix this? many thanks

    RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.[^.]+\.mysite\.biz$ RewriteRule ^(.+) %{HTTP_HOST}$1 [C] RewriteRule ^www\.([^.]+)\.mysite\.biz(.*) http://www.mysite.biz/users/sites/$1 RewriteCond %{HTTP_HOST} ^www\.[^.]+\.mysite\.ie$ RewriteRule ^(.+) %{HTTP_HOST}$1 [C] RewriteRule ^www\.([^.]+)\.mysite\.ie(.*) http://www.mysite.biz/users/sites/$1

    adrian.

    attached mail follows:


    In article <003d01c22e58$dcb45240$6601a8c0yourwrjlo8t8dt>, adrian.murphy2020tourism.com (Adrian Murphy) wrote:

    > the following code redirects www.usersite.mysite.biz to > www.mysite.biz/users/sites/usersite > > the problem is when the 'www' is left out it doesn't work. <snip> > RewriteEngine on > RewriteCond %{HTTP HOST} ^www\.[^.]+\.mysite\.biz$ > RewriteRule ^(.+) %{HTTP HOST}$1 [C] > RewriteRule ^www\.([^.]+)\.mysite\.biz(.*) > http://www.mysite.biz/users/sites/$1 > RewriteCond %{HTTP HOST} ^www\.[^.]+\.mysite\.ie$ > RewriteRule ^(.+) %{HTTP HOST}$1 [C] > RewriteRule ^www\.([^.]+)\.mysite\.ie(.*) > http://www.mysite.biz/users/sites/$1

    Change each of those instances of "^www\." to "^(www\.)?"

    -- 
    CC
    

    attached mail follows:


    Adrian Murphy wrote: > > Hi, > the following code redirects www.usersite.mysite.biz to www.mysite.biz/users/sites/usersite > > the problem is when the 'www' is left out it doesn't work. > could someone help me to fix this? > many thanks > > > > > RewriteEngine on > RewriteCond %{HTTP_HOST} ^www\.[^.]+\.mysite\.biz$ > RewriteRule ^(.+) %{HTTP_HOST}$1 [C] > RewriteRule ^www\.([^.]+)\.mysite\.biz(.*) http://www.mysite.biz/users/sites/$1 > RewriteCond %{HTTP_HOST} ^www\.[^.]+\.mysite\.ie$ > RewriteRule ^(.+) %{HTTP_HOST}$1 [C] > RewriteRule ^www\.([^.]+)\.mysite\.ie(.*) http://www.mysite.biz/users/sites/$1 > > > adrian. >

    Hi, According to your rewrites the following line makes no sense RewriteRule ^(.+) %{HTTP_HOST}$1 [C] so remove it....this does not solve your problem also modify your rewrite conds to read ^(www\.)?[^.]+mysite\.biz$ This also applies to www.username.mysite.ie Regards

    -- 
    Sameh Attia
    Senior System Engineer
    T.E. Data
    --
                    __  __  _
        _________ _/ /_/ /_(_)___ _
       / ___/ __ `/ __/ __/ / __ `/
      (__  ) /_/ / /_/ /_/ / /_/ /
    /____/\__,_/\__/\__/_/\__,_/
    

    attached mail follows:


    I'm really battling with this whole session thing. My first impressions are that cookies are OK, and really helps to make sessions workable and efficient, YET, from a developers point of view, I always play devils advocate, and I'm wondering about those stubbourne individuals out there who outright refuse cookies; rendering my application useless unless I code a "plan B" into my code; meaning I can just as well NOT use cookies from the start... "catch 22 dejavu..." What are the general feeling out there amongst developers about the use of cookies? I'm concerned about the following scenario specifically: I develop my great application using session controll - which uses cookies by default, or alternatively adds the sid to the relative URL's on the page, YET, from responses to my previous posting, I gather that the "alternative" url method is not 100% the same as the cookie method inthat it doesn't work with IFRAMES etc. Leaving me to think that there will potentially be people out there that will NOT be able to use the application, that could lead to messy discussions between developer and client...

    Before I started to read up on sessions, I simply used my own form of session management by sending all relevant variables either via URL or via form fields to the subsequent pages. Obviously this method leaves a bunch of holes as well, but I KNOW that my application is always pure and simple HTML, doesn't have browser issues, doesn't have cookie issues, so 100% of the internet community can use it.

    Does anyone out there have a view/practise when it comes to session/cookies? - basically I am still not convinced that using sessions/cookies is a good idea, but I would love to be educated as to why I should...

    attached mail follows:


    > Before I started to read up on sessions, I simply used my own form of > session management by sending all relevant variables either via URL or > via form fields to the subsequent pages. Obviously this method leaves a > bunch of holes as well, but I KNOW that my application is always pure > and simple HTML, doesn't have browser issues, doesn't have cookie > issues, so 100% of the internet community can use it. > > Does anyone out there have a view/practise when it comes to > session/cookies? - basically I am still not convinced that using > sessions/cookies is a good idea, but I would love to be educated as to > why I should... > The issue on Advantages and disadvantages of Cookies has been discussed numerous amounts of times... There was also debate on using I.P vs Cookies, I see from your address that you are based in S.A. meaning there is still numerous amounts of people set on dial up hence allocating someone a specific id via dial up would be totally out of the question (dial up IP changes)... Through the discussions I was convinced that Cookies are and ought to be the best way to go... Most people use IE/Netscape which does not ask if you want to accept or reject cookies like the browsers that are generic to Linux namely Konqueror and Lynx... Furthermore, I don't know too many people that scrimmage through their hard drive searching for Cookies to delete... besides most people (unless they have done a great deal of web programming) don't know what a Cookie is, so if they actually do get prompted to accept or reject a Cookie the odds of them Accepting are equal to the odds of them rejecting (probably even higher considering most prompts require a Yes)...

    I'd say Cookies and Sessions are quite reliable... Well, they are the safest method I know to go about the problem of monitoring ones surfing habits... If anyone can think of another please post her up, I'd be curious to learn of it...

    Regards, Kondwani

    attached mail follows:


    On Thu, Jul 18, 2002 at 03:38:51PM +0200, PHPCoder wrote:

    > What are the general feeling out there amongst developers about the use > of cookies?

    Cookies rely on client side. I never rely on the client for anything.

    When it comes to examples of how to do things "The Right Way," I say go take a look at amazon.com. No cookies. No Java'sCrap. Works flawlessly.

    --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 don't use cookies either due to the fact that some web browser block the cookies and some web browser's bug that affected the cookie. For example, if Internet Explorer have a bug with the cookie then it is gurantee that you'll never find MS to have this bug fix in a few days. It could take 6 months or a year. So, what's the point with using hte cookie?

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020718143540.GA28786panix.com... > On Thu, Jul 18, 2002 at 03:38:51PM +0200, PHPCoder wrote: > > > What are the general feeling out there amongst developers about the use > > of cookies? > > Cookies rely on client side. I never rely on the client for anything. > > When it comes to examples of how to do things "The Right Way," I say go > take a look at amazon.com. No cookies. No Java'sCrap. Works flawlessly. > > --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:


    "Phpcoder" <internetvsa.co.za> wrote in message news:3D36C4EB.3060900vsa.co.za... > I'm really battling with this whole session thing. > My first impressions are that cookies are OK, and really helps to make > sessions workable and efficient, YET, from a developers point of view, I [..snip..] > Does anyone out there have a view/practise when it comes to > session/cookies? - basically I am still not convinced that using > sessions/cookies is a good idea, but I would love to be educated as to > why I should...

    A number of people have offered their opinion why cookies are a bad idea. As a developer new to PHP, if cookies are such a big a big no-no, how does one do effective session management without storing anything client-side?? Bear in mind that the browser is stateless and, the user can disconnect and reconnect in between fetching pages from your site.

    Regards, Cord

    attached mail follows:


    Instead of Cookies, I use Sessions which is run on hte server side. So, I use the

    --snip-- $salt = strtoupper(md5(uniqid(rand()))); session_id($salt); session_start(); header("Location: https://xxx.yyy.zzz/index.php?".SID."&init_login=TRUE"); --snip--

    to create the identifer for an unique person. Then use the php script that take care of the session management such as logging the user out when time is up as an example. Another script was used to prevent the direct access attempt. Another script was used to detect whether the server have the user's identifier in the server, if not exist then would force the web browser to the login page.

    As for the newbie, well, sometime they had to learn it from the pro. Although it would be nice if there is documentation somewhere.

    "Cord Schneider" <oo6jmt8en001sneakemail.com> wrote in message news:20020718151831.8887.qmailpb1.pair.com... > "Phpcoder" <internetvsa.co.za> wrote in message > news:3D36C4EB.3060900vsa.co.za... > > I'm really battling with this whole session thing. > > My first impressions are that cookies are OK, and really helps to make > > sessions workable and efficient, YET, from a developers point of view, I > [..snip..] > > Does anyone out there have a view/practise when it comes to > > session/cookies? - basically I am still not convinced that using > > sessions/cookies is a good idea, but I would love to be educated as to > > why I should... > > A number of people have offered their opinion why cookies are a bad idea. As > a developer new to PHP, if cookies are such a big a big no-no, how does one > do effective session management without storing anything client-side?? Bear > in mind that the browser is stateless and, the user can disconnect and > reconnect in between fetching pages from your site. > > Regards, > Cord > > >

    attached mail follows:


    Awesome Scott... That's some wicked code... "Scott Fletcher" <scottabcoa.com> wrote in message news:20020718160532.48734.qmailpb1.pair.com... > Instead of Cookies, I use Sessions which is run on hte server side. So, I > use the > > --snip-- > $salt = strtoupper(md5(uniqid(rand()))); > session_id($salt); > session_start(); > header("Location: https://xxx.yyy.zzz/index.php?".SID."&init_login=TRUE"); > --snip-- > > to create the identifer for an unique person. Then use the php script that > take care of the session management such as logging the user out when time > is up as an example. Another script was used to prevent the direct access > attempt. Another script was used to detect whether the server have the > user's identifier in the server, if not exist then would force the web > browser to the login page. > > As for the newbie, well, sometime they had to learn it from the pro. > Although it would be nice if there is documentation somewhere. > > > "Cord Schneider" <oo6jmt8en001sneakemail.com> wrote in message > news:20020718151831.8887.qmailpb1.pair.com... > > "Phpcoder" <internetvsa.co.za> wrote in message > > news:3D36C4EB.3060900vsa.co.za... > > > I'm really battling with this whole session thing. > > > My first impressions are that cookies are OK, and really helps to make > > > sessions workable and efficient, YET, from a developers point of view, I > > [..snip..] > > > Does anyone out there have a view/practise when it comes to > > > session/cookies? - basically I am still not convinced that using > > > sessions/cookies is a good idea, but I would love to be educated as to > > > why I should... > > > > A number of people have offered their opinion why cookies are a bad idea. > As > > a developer new to PHP, if cookies are such a big a big no-no, how does > one > > do effective session management without storing anything client-side?? > Bear > > in mind that the browser is stateless and, the user can disconnect and > > reconnect in between fetching pages from your site. > > > > Regards, > > Cord > > > > > > > >

    attached mail follows:


    Well, I have to have to it becuase my company is a credit report reseller. I can't image if someone can easily break in. :-) As long as I don't work for CIA or FBI then I'll be fine!

    "Kondwani Spike Mkandawire" <kondwanics.mun.ca> wrote in message news:20020718163112.74036.qmailpb1.pair.com... > Awesome Scott... That's some wicked code... > "Scott Fletcher" <scottabcoa.com> wrote in message > news:20020718160532.48734.qmailpb1.pair.com... > > Instead of Cookies, I use Sessions which is run on hte server side. So, I > > use the > > > > --snip-- > > $salt = strtoupper(md5(uniqid(rand()))); > > session_id($salt); > > session_start(); > > header("Location: > https://xxx.yyy.zzz/index.php?".SID."&init_login=TRUE"); > > --snip-- > > > > to create the identifer for an unique person. Then use the php script > that > > take care of the session management such as logging the user out when time > > is up as an example. Another script was used to prevent the direct access > > attempt. Another script was used to detect whether the server have the > > user's identifier in the server, if not exist then would force the web > > browser to the login page. > > > > As for the newbie, well, sometime they had to learn it from the pro. > > Although it would be nice if there is documentation somewhere. > > > > > > "Cord Schneider" <oo6jmt8en001sneakemail.com> wrote in message > > news:20020718151831.8887.qmailpb1.pair.com... > > > "Phpcoder" <internetvsa.co.za> wrote in message > > > news:3D36C4EB.3060900vsa.co.za... > > > > I'm really battling with this whole session thing. > > > > My first impressions are that cookies are OK, and really helps to make > > > > sessions workable and efficient, YET, from a developers point of view, > I > > > [..snip..] > > > > Does anyone out there have a view/practise when it comes to > > > > session/cookies? - basically I am still not convinced that using > > > > sessions/cookies is a good idea, but I would love to be educated as to > > > > why I should... > > > > > > A number of people have offered their opinion why cookies are a bad > idea. > > As > > > a developer new to PHP, if cookies are such a big a big no-no, how does > > one > > > do effective session management without storing anything client-side?? > > Bear > > > in mind that the browser is stateless and, the user can disconnect and > > > reconnect in between fetching pages from your site. > > > > > > Regards, > > > Cord > > > > > > > > > > > > > > >

    attached mail follows:


    on 18/07/02 11:38 PM, PHPCoder (internetvsa.co.za) wrote:

    > What are the general feeling out there amongst developers about the use > of cookies?

    If you want to assure that you maintain session across the whole site, appealing to the lowest common denominator, then hard code the SID to all relative URLs across the whole site, or write a URL function which you can just pass variables:

    <A HREF="<?=link('page.php?stuff=things')?>">Click here</a>

    > I'm concerned about the following scenario specifically: > I develop my great application using session controll - which uses > cookies by default, or alternatively adds the sid to the relative URL's > on the page, YET, from responses to my previous posting, I gather that > the "alternative" url method is not 100% the same as the cookie method > inthat it doesn't work with IFRAMES etc.

    I should've clarified that statement a bit... I had a dig through the PHP source, trying to figure out what they were doing, and amongst the tags I *think* they were searching for, I couldn't see IFRAMEs... perhaps what they were doing with FRAME covered it -- I didn't dig deep enough, and haven't recompiled to test.

    > Leaving me to think that there > will potentially be people out there that will NOT be able to use the > application, that could lead to messy discussions between developer and > client...

    Yup. Developer should perhaps offer the two alternatives, clearly outline the difference, and make an estimate of the difference in cost. Let THEM decide if losing 1% (or 5%, or 10% -- whatever) of their users is acceptable, rather than resting it upon your shoulders.

    Same argument stands for relying on javascript, IFRAMEs, FRAMEs, whatever.

    > Before I started to read up on sessions, I simply used my own form of > session management by sending all relevant variables either via URL or > via form fields to the subsequent pages. Obviously this method leaves a > bunch of holes as well, but I KNOW that my application is always pure > and simple HTML, doesn't have browser issues, doesn't have cookie > issues, so 100% of the internet community can use it.

    Well, if you're used to passing stuff around in a URL, then why not:

    a) run some tests with enable-trans-sid b) develop a method you're comfortable with for passing SIDs around in the URL

    > Does anyone out there have a view/practise when it comes to > session/cookies? - basically I am still not convinced that using > sessions/cookies is a good idea, but I would love to be educated as to > why I should...

    If you want 100% accessability, forget cookies were ever invented :) While you're erasing stuff from your brain, throw out javascript too :D

    Justin French -------------------- Creative Director http://Indent.com.au --------------------

    attached mail follows:


    on 19/07/02 1:19 AM, Cord Schneider (oo6jmt8en001sneakemail.com) wrote:

    > A number of people have offered their opinion why cookies are a bad idea. As > a developer new to PHP, if cookies are such a big a big no-no, how does one > do effective session management without storing anything client-side?? Bear > in mind that the browser is stateless and, the user can disconnect and > reconnect in between fetching pages from your site.

    You pass the session around in the URL

    Something like <A HREF="page.php?SID">click here</a>, or you might build a wrapper function that does it for you:

    <A HREF="<?=link('page.php')?>">click here</a>.

    Yes, that's every internal (relative) URL on your whole site :)

    It becomes a trade-off between the convent but unreliable cookies, versus the 100% accessible, but perhaps time consuming/tricky URL method.

    As has been said on this list MANY times, just have a look at the big sites like amazon.com -- no cookies, no javascript, no reliance on client-side for anything. Take care of it all server-side, where you have a controlled environment.

    Justin French

    attached mail follows:


    ðÒÉ×ÅÔ!

    PHPCoder wrote: > application useless unless I code a "plan B" into my code; meaning I can > just as well NOT use cookies from the start... > "catch 22 dejavu..." > What are the general feeling out there amongst developers about the use > of cookies? --snip-- > I gather that > the "alternative" url method is not 100% the same as the cookie method > inthat it doesn't work with IFRAMES etc. Leaving me to think that there > will potentially be people out there that will NOT be able to use the > application, that could lead to messy discussions between developer and > client...

    We use but one cookie, for returning user recognition. That is, the sort of info your soft can survive without. As for passing values on the GET channel to iframes, we do it all the time and have never seen a single problem.

    Problems with iframes are in that you consciously loose all users working on Netscape 4 (once you have 7 interrelated iframes on a window you cannot really expect to have 7 indipendent windows open *and* your site still usable. Lynx people are cut out too. If you want to support *everybody* you should work one one single page.

    It's a customer's choice, obviously. Most customers do not give a damn about minorities (and so do not want to increase budgets to develop an alternate solution that will address a minor community).

    ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×

    -_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_-

    LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......

    attached mail follows:


    I never heard of this php function, "link()". Sound like a good function, I'm going to have to look it up!

    Thanks, FletchSOD "Justin French" <justinindent.com.au> wrote in message news:B95D3149.ACFE%justinindent.com.au... > on 19/07/02 1:19 AM, Cord Schneider (oo6jmt8en001sneakemail.com) wrote: > > > A number of people have offered their opinion why cookies are a bad idea. As > > a developer new to PHP, if cookies are such a big a big no-no, how does one > > do effective session management without storing anything client-side?? Bear > > in mind that the browser is stateless and, the user can disconnect and > > reconnect in between fetching pages from your site. > > You pass the session around in the URL > > Something like <A HREF="page.php?SID">click here</a>, or you might build a > wrapper function that does it for you: > > <A HREF="<?=link('page.php')?>">click here</a>. > > > Yes, that's every internal (relative) URL on your whole site :) > > > It becomes a trade-off between the convent but unreliable cookies, versus > the 100% accessible, but perhaps time consuming/tricky URL method. > > > As has been said on this list MANY times, just have a look at the big sites > like amazon.com -- no cookies, no javascript, no reliance on client-side for > anything. Take care of it all server-side, where you have a controlled > environment. > > > Justin French >

    attached mail follows:


    On Thu, Jul 18, 2002 at 08:47:45PM +0300, Alberto Serra wrote: > > It's a customer's choice, obviously. Most customers do not give a damn > about minorities (and so do not want to increase budgets to develop an > alternate solution that will address a minor community).

    What increased cost? If someone does the right thing in the first place, there's no cost. The developers are either gettting paid to develop something that works right in the first place or they're getting paid to develop something that doesn't.

    Let's use your Iframes example. My client was using them. I replaced such with proper layout for local content and importing remote content through implode('', file()). How does that cost more?

    Anyway, cutting out potential long term revenue by alienating potential customers is a bad business decision.

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

    > What increased cost? If someone does the right thing in the first place, > there's no cost. The developers are either gettting paid to develop > something that works right in the first place or they're getting paid to > develop something that doesn't.

    LOL, we are all but prostitutes, my dear :) we get paid to do exactly what the customer wants and *how* he wants it to be done. As for myself there are *many* of my customers choices that I would not use on a site of mine, but once I have written them a formal letter saying why I suggest doing something else in instead and have got a formal receipt I feel no longer interested in whatever they decide. I am only interested in another sort of *how*, that is *howmuch* :)

    > Let's use your Iframes example. My client was using them. I replaced > such with proper layout for local content and importing remote content > through implode('', file()). How does that cost more?

    Yes, since you have to replace something that is already in place. It means you spend mantime to do it. Besides, they love iframes, so let's give them iframes. All they want is a scrolling bar *within* a fixed graphical frame, and only an iframe can do that.

    > Anyway, cutting out potential long term revenue by alienating potential > customers is a bad business decision.

    A one year long log shown that we are talking about 0.2% of their potential audience (and we include *my* verifications, which amounts to half of the events). Such decisions are not taken just like that. They watched the data and decided that 0.2% isn't worth a dime (and a minute) of theirs. It's their right to decide it.

    Site targets a very specific audience (that is, the dental market). I don't think many a dentist will surf on Lynx, personally. And dentists just love to show their money, so I cannot think of a dentist using Netscape 4 and a 640x480 monitor.

    I do (sometimes), you do, but we belong in a minority. Linguistic minorities make much more profit than browser minorities will ever do, simply because they make larger numbers. Having a site translated in french is making *much* more money than having it work on Lynx, believe me :) The good thing for them to do is have their site translated in as many languages as they can. That's from a profit-oriented point of view (mine too, since I sell language repositories as well) :) Europe is *not* america. Browsers here aren't a commercial issue, but local cultures are.

    After all, if you and I are clever enough to use Lynx, we are also clever enough for us to download Mozilla and surf like standard people do, right? :)

    ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×

    -_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_-

    LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......

    attached mail follows:


    Anyone know of a quick script I can run to test the GD setup on my servers? I have multiple servers that I need to test where phpinfo() reveals various versions of the GD library. I can hack something together quickly if need be, but I was hoping that the gurus of the list would have a test that they run.

    Thanks!

    Jay

    "Who me? I just wander from room to room ..."

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    I am trying some code and it works except I get the following errors... Warning: Undefined offset: 5 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 4 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 3 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 2 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 1 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247

    Here is the code, could someone tell me what's wrong. I don't see anything wrong...

    function HistoricalStock($sym) { $LookupURL = "http://table.finance.yahoo.com/table.csv?a=7&b=1&c=2002&d=7&e=17&f=2002&s=$ sym&y=0&g=d&ignore=.csv"; $Results = implode('', file("$LookupURL")); $Data = explode("\n", $Results); print '<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#6699cc"><tr bgcolor="#FFFFFF">'; foreach($Data as $Line) { list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(",", $Line); print "<tr bgcolor=\"#FFFFFF\">

    <td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$ H_Close</td>\n<td>$H_Volume</td>\n</tr>"; } print '</table>'; }

    attached mail follows:


    Which line in the script you had provided to us is line 247?

    "Chris Crane" <ccraneinxdesign.com> wrote in message news:20020718141429.52411.qmailpb1.pair.com... > I am trying some code and it works except I get the following errors... > Warning: Undefined offset: 5 in > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > Warning: Undefined offset: 4 in > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > Warning: Undefined offset: 3 in > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > Warning: Undefined offset: 2 in > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > Warning: Undefined offset: 1 in > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > > > Here is the code, could someone tell me what's wrong. I don't see anything > wrong... > > function HistoricalStock($sym) { > $LookupURL = > "http://table.finance.yahoo.com/table.csv?a=7&b=1&c=2002&d=7&e=17&f=2002&s=$ > sym&y=0&g=d&ignore=.csv"; > $Results = implode('', file("$LookupURL")); > $Data = explode("\n", $Results); > print '<table width="100%" border="0" cellspacing="1" cellpadding="0" > bgcolor="#6699cc"><tr bgcolor="#FFFFFF">'; > foreach($Data as $Line) { > list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(",", > $Line); > print "<tr bgcolor=\"#FFFFFF\"> > > <td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$ > H_Close</td>\n<td>$H_Volume</td>\n</tr>"; > } > print '</table>'; > } > >

    attached mail follows:


    247: list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(",", $Line);

    "Scott Fletcher" <scottabcoa.com> wrote in message news:20020718143046.60104.qmailpb1.pair.com... > Which line in the script you had provided to us is line 247? > > "Chris Crane" <ccraneinxdesign.com> wrote in message > news:20020718141429.52411.qmailpb1.pair.com... > > I am trying some code and it works except I get the following errors... > > Warning: Undefined offset: 5 in > > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > > Warning: Undefined offset: 4 in > > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > > Warning: Undefined offset: 3 in > > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > > Warning: Undefined offset: 2 in > > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > > Warning: Undefined offset: 1 in > > c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 > > > > > > Here is the code, could someone tell me what's wrong. I don't see anything > > wrong... > > > > function HistoricalStock($sym) { > > $LookupURL = > > > "http://table.finance.yahoo.com/table.csv?a=7&b=1&c=2002&d=7&e=17&f=2002&s=$ > > sym&y=0&g=d&ignore=.csv"; > > $Results = implode('', file("$LookupURL")); > > $Data = explode("\n", $Results); > > print '<table width="100%" border="0" cellspacing="1" cellpadding="0" > > bgcolor="#6699cc"><tr bgcolor="#FFFFFF">'; > > foreach($Data as $Line) { > > list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = > split(",", > > $Line); > > print "<tr bgcolor=\"#FFFFFF\"> > > > > > <td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$ > > H_Close</td>\n<td>$H_Volume</td>\n</tr>"; > > } > > print '</table>'; > > } > > > > > >

    attached mail follows:


    On Thu, Jul 18, 2002 at 10:14:25AM -0400, Chris Crane wrote:

    > Warning: Undefined offset: 5 in

    Means your array doesn't have that key in it. I bet you're running into blank lines in your file.

    > $Results = implode('', file("$LookupURL")); > $Data = explode("\n", $Results);

    Uh, you do realize that you're flip flopping the data around here for no reason. file() already creates an array. But you go through the unnecessary steps of compressing that array into a string and then recreating a new array. Just do this:

    $Data = file($LookupURL);

    That will eliminate your errors by not adding extra blank lines.

    > foreach($Data as $Line) { > list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(",", > $Line); > print "<tr bgcolor=\"#FFFFFF\"> > <td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$ > H_Close</td>\n<td>$H_Volume</td>\n</tr>"; > }

    But, your whole approach is wasteful. As I said yesterday, use fopen() and then fgetcsv(). Forget the file() and split() calls.

    Then, you're wasting time and memory with the list(). Use the resulting array directly.

    while ( $Line = fgetcsv($fp, 500) ) { echo "<tr> <td>$Line[0]</td> <td>$Line[1]</td> ... etc ..."; }

    Or, since you're pringing everything out, you could just do this:

    while ( $Line = fgetcsv($fp, 500) ) { echo '<tr><td>' . implode('</td><td>', $Line) . '</td></tr>' }

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


    My guess is that there is no ',' in $Line, so split returns an array with one variable, so list() warns you parameter No. 1, 2 ,3 4 and 5 are not asigned any value.

    Chris Crane wrote:

    >247: list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = >split(",", $Line); > >"Scott Fletcher" <scottabcoa.com> wrote in message >news:20020718143046.60104.qmailpb1.pair.com... > > >>Which line in the script you had provided to us is line 247? >> >>"Chris Crane" <ccraneinxdesign.com> wrote in message >>news:20020718141429.52411.qmailpb1.pair.com... >> >> >>>I am trying some code and it works except I get the following errors... >>>Warning: Undefined offset: 5 in >>>c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 >>>Warning: Undefined offset: 4 in >>>c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 >>>Warning: Undefined offset: 3 in >>>c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 >>>Warning: Undefined offset: 2 in >>>c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 >>>Warning: Undefined offset: 1 in >>>c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 >>> >>> >>>Here is the code, could someone tell me what's wrong. I don't see >>> >>> >anything > > >>>wrong... >>> >>>function HistoricalStock($sym) { >>> $LookupURL = >>> >>> >>> >"http://table.finance.yahoo.com/table.csv?a=7&b=1&c=2002&d=7&e=17&f=2002&s=$ > > >>>sym&y=0&g=d&ignore=.csv"; >>> $Results = implode('', file("$LookupURL")); >>> $Data = explode("\n", $Results); >>> print '<table width="100%" border="0" cellspacing="1" cellpadding="0" >>>bgcolor="#6699cc"><tr bgcolor="#FFFFFF">'; >>> foreach($Data as $Line) { >>> list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = >>> >>> >>split(",", >> >> >>>$Line); >>> print "<tr bgcolor=\"#FFFFFF\"> >>> >>> >>> >>> ><td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$ > > >>>H_Close</td>\n<td>$H_Volume</td>\n</tr>"; >>> } >>> print '</table>'; >>>} >>> >>> >>> >>> >> >> > > > > >

    attached mail follows:


    Hey thank Dan, I will try this. Does List waste lots of time and memory?

    Normally, I create a function and global a bunch of variables to be used later on the HTML/PHP file. After I global the variables I split the string using the List function. I do that for stock quotes from YAHOO so I can code the layout in like Dreamweaver and place the varaibles where I would like instead of the function writing out the html for me. Is that bad?

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020718145953.GB28786panix.com... > On Thu, Jul 18, 2002 at 10:14:25AM -0400, Chris Crane wrote: > > > Warning: Undefined offset: 5 in > > Means your array doesn't have that key in it. I bet you're running into > blank lines in your file. > > > > $Results = implode('', file("$LookupURL")); > > $Data = explode("\n", $Results); > > Uh, you do realize that you're flip flopping the data around here for no > reason. file() already creates an array. But you go through the > unnecessary steps of compressing that array into a string and then > recreating a new array. Just do this: > > $Data = file($LookupURL); > > That will eliminate your errors by not adding extra blank lines. > > > > foreach($Data as $Line) { > > list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(",", > > $Line); > > print "<tr bgcolor=\"#FFFFFF\"> > > <td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$ > > H_Close</td>\n<td>$H_Volume</td>\n</tr>"; > > } > > But, your whole approach is wasteful. As I said yesterday, use fopen() > and then fgetcsv(). Forget the file() and split() calls. > > Then, you're wasting time and memory with the list(). Use the resulting > array directly. > > while ( $Line = fgetcsv($fp, 500) ) { > echo "<tr> <td>$Line[0]</td> <td>$Line[1]</td> ... etc ..."; > } > > Or, since you're pringing everything out, you could just do this: > > while ( $Line = fgetcsv($fp, 500) ) { > echo '<tr><td>' . implode('</td><td>', $Line) . '</td></tr>' > } > > --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:


    ok here is what I came up with: How's this? function HistoricalStock($sym) { $row = 1; $Data = fopen("http://table.finance.yahoo.com/table.csv?a=7&b=1&c=2002&d=7&e=17&f=20 02&s=$sym&y=0&g=d&ignore=.csv","r"); print '<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#6699cc"><tr bgcolor="#FFFFFF">';

    while ($Line = fgetcsv ($Data, 1000, ",")) { if($row == 1) { echo "<tr bgcolor=\"#FFFFFF\"> <td><b>$Line[0]</b></td> <td><b>$Line[1]</b></td> <td><b>$Line[2]</b></td> <td><b>$Line[3]</b></td> <td><b>$Line[4]</b></td> <td><b>$Line[5]</b></td></tr>"; } else { echo "<tr bgcolor=\"#FFFFFF\"> <td>$Line[0]</td> <td>Line[1]</td> <td>$Line[2]</td> <td>$Line[3]</td> <td>$Line[4]</td> <td>$Line[5]</td></tr>"; } $row++; }

    print '</table>'; fclose($Data); }

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020718145953.GB28786panix.com... > On Thu, Jul 18, 2002 at 10:14:25AM -0400, Chris Crane wrote: > > > Warning: Undefined offset: 5 in > > Means your array doesn't have that key in it. I bet you're running into > blank lines in your file. > > > > $Results = implode('', file("$LookupURL")); > > $Data = explode("\n", $Results); > > Uh, you do realize that you're flip flopping the data around here for no > reason. file() already creates an array. But you go through the > unnecessary steps of compressing that array into a string and then > recreating a new array. Just do this: > > $Data = file($LookupURL); > > That will eliminate your errors by not adding extra blank lines. > > > > foreach($Data as $Line) { > > list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(",", > > $Line); > > print "<tr bgcolor=\"#FFFFFF\"> > > <td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$ > > H_Close</td>\n<td>$H_Volume</td>\n</tr>"; > > } > > But, your whole approach is wasteful. As I said yesterday, use fopen() > and then fgetcsv(). Forget the file() and split() calls. > > Then, you're wasting time and memory with the list(). Use the resulting > array directly. > > while ( $Line = fgetcsv($fp, 500) ) { > echo "<tr> <td>$Line[0]</td> <td>$Line[1]</td> ... etc ..."; > } > > Or, since you're pringing everything out, you could just do this: > > while ( $Line = fgetcsv($fp, 500) ) { > echo '<tr><td>' . implode('</td><td>', $Line) . '</td></tr>' > } > > --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 Thu, Jul 18, 2002 at 11:35:55AM -0400, Chris Crane wrote: > Hey thank Dan, I will try this. > Does List waste lots of time and memory?

    It does if you don't need to do it.

    Just put the data you really need into memory. Forget about the rest.

    If you already have something in memory, don't duplicate it.

    > Normally, I create a function and global a bunch of variables to be used > later on the HTML/PHP file.

    If you're globaling the variables, why not just write the code without enclosing it in a function?

    > After I global the variables I split the string > using the List function. I do that for stock quotes from YAHOO so I can code > the layout in like Dreamweaver and place the varaibles where I would like > instead of the function writing out the html for me. Is that bad?

    In general, it makes sense, but, does it make the most sense. Depends on the situation.

    But, in this situation, you're printing out a whole table of the data, so your way doesn't make sense.

    A: No. Q: Is okay to top post and/or quote the entirety of the a post?

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


    [snip] Anyone know of a quick script I can run to test the GD setup on my servers? I have multiple servers that I need to test where phpinfo() reveals various versions of the GD library. I can hack something together quickly if need be, but I was hoping that the gurus of the list would have a test that they run. [/snip]

    Thanks, I got it done.

    Jay

    "Where there’s a will…I want to be in it"

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    Hi! I find it to be mind-boggling to try to make xml work with php and curl. What do anyone here think of it?

    attached mail follows:


    [snip] Hi! I find it to be mind-boggling to try to make xml work with php and curl. What do anyone here think of it? [/snip]

    More details about the problem would be nice. How exactly do you want this to work? I have had no problems with cURL and PHP.

    Jay

    "What was the best thing before sliced bread?"

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    On Thu, Jul 18, 2002 at 11:03:10AM -0400, Scott Fletcher wrote: > Hi! I find it to be mind-boggling to try to make xml work with php and > curl. What do anyone here think of it?

    Well, I can offer help on the XML: http://www.analysisandsolutions.com/code/phpxml.htm

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


    Cool! I'm just getting started on XML. I read the documentation about XML and it doesn't look too hard. Unfortunately, it is written for the client side script. So, I barely am starting writing the test script for the server side and have it work with php and curl. At least, I know how to use curl and php without a problem. Just trying to figure out to slide the xml data through curl to somewhere and vice versa. It involve 2 seperate URL address. The 1st for authentication and the 2nd for transmitting datas. Sigh!

    Alright! I'll read the post, http://www.analysisandsolutions.com/code/phpxml.htm and see what I can learn from.

    Thanks, FletchSOD

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020718150149.GC28786panix.com... > On Thu, Jul 18, 2002 at 11:03:10AM -0400, Scott Fletcher wrote: > > Hi! I find it to be mind-boggling to try to make xml work with php and > > curl. What do anyone here think of it? > > Well, I can offer help on the XML: > http://www.analysisandsolutions.com/code/phpxml.htm > > --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:


    More detail? I have successfully make the data transmission work through php and curl without xml. I just barely gotten started on xml. I read the documentation about how it work, but it is only for the client side. I'm going to have to read some documentation and figure out how to use xml in php then figure out how to use curl for xml transmission. It is not just setting up curl is the issue here since xml and transmit through and back without the problem as I read on the cURL website. I have two URLs to deal with. The 1st for authentication and the 2nd, a completely different URL address for transmitting data. The odd thing is I don't need to have the encryption packages since the letter said all I need to do is to issue the key to that website and it will provide the encryption to me. Must be related to the authentication stuffs.

    Thanks, FletchSOD

    Going to have to find "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message news:001401c22e6c$4843be20$8102a8c0niigziuo4ohhdt... > [snip] > Hi! I find it to be mind-boggling to try to make xml work with php and > curl. What do anyone here think of it? > [/snip] > > More details about the problem would be nice. How exactly do you want this > to work? I have had no problems with cURL and PHP. > > Jay > > "What was the best thing before sliced bread?" > > > ************************************* > * Want to meet other PHP developers * > * in your area? Check out: * > * http://php.meetup.com/ * > * No developer is an island ... * > ************************************* > >

    attached mail follows:


    Hi all,

    I just wanted to warn all those who post to the PHP newsgroups, and/or PHP HTML forums, that spammers are harvesting email address from these groups. If you want to avoid ending up on some spammers list, please consider using a SpamTrap (throwaway email address) or maybe a service like Sneakemail (http://sneakemail.com).

    Kind regards, Cord

    attached mail follows:


    Ha! They can have at it! If they are stupid enough to spam a bunch of programmers and network people they deserve what they get.

    Now it's *against the law* to harass spammers by tracking their malicious activity back to it's source and sending virus after virus : ), or hacking into their servers to delete things : ).

    So I would *never* recommend that course of action.

    But tempers do flare from time to time......... and there's no telling what a bunch of aggravated programmers can/would do.......

    Bret

    ----- Original Message ----- From: "Cord Schneider" <oo6jmt8en001sneakemail.com> To: <php-generallists.php.net> Sent: Thursday, July 18, 2002 11:04 AM Subject: [PHP] Warning: e-mails being harvested from PHP newsgroups

    > Hi all, > > I just wanted to warn all those who post to the PHP newsgroups, and/or PHP > HTML forums, that spammers are harvesting email address from these groups. > If you want to avoid ending up on some spammers list, please consider using > a SpamTrap (throwaway email address) or maybe a service like Sneakemail > (http://sneakemail.com). > > Kind regards, > Cord > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Well, I posted it the first time and no one responded so I figured the subject did not interest anyone. I changed it. I am not sure how the third one started.

    But hey thanks for watching and giving you unwanted opinion.

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020717204741.GC2165panix.com... > Chris: > > Geez, this is your third thread on this today... Lame. > > --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 Thu, Jul 18, 2002 at 11:06:11AM -0400, Chris Crane wrote: > Well, I posted it the first time and no one responded so I figured the > subject did not interest anyone. I changed it. I am not sure how the third > one started.

    We're all here volunteering, trying to help each other out. If you want an instant response, hire someone. Otherwise, you need to be patient.

    Sure, if you don't get a reply in a few days, your request probably slipped through the cracks, post again. But, in this case, you're being unreasonable: First post was at 10:00. Second at 11:58. Third at 13:16.

    Posting to the list multiple times makes the list less pleasant for the people trying to help and those trying to learn.

    --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 recently upgraded Apache to 1.3.26 and am currently configurating hte httpd.conf. I noticed that

    --snip-- AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps --snip--

    does not exist in this version as it does in the older version.

    Is it now automatic with the newer version??

    Thanks, FletchSOD

    attached mail follows:


    On Thursday 18 July 2002 23:58, Scott Fletcher wrote: > I recently upgraded Apache to 1.3.26 and am currently configurating hte > httpd.conf. I noticed that > > --snip-- > AddType application/x-httpd-php .php > AddType application/x-httpd-php-source .phps > --snip-- > > does not exist in this version as it does in the older version.

    Because someone or something inserted those lines in the older version.

    > Is it now automatic with the newer version??

    You still need those lines in the newer version if you want PHP to work.

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

    /* Insomnia isn't anything to lose sleep over. */

    attached mail follows:


    Apache 1.3.26 PHP 4.2.1 staticly built as a module.

    The configuration in php.ini seems not to be used by httpd. I've traced my httpd process and it opens the php.ini file in the expected directory, but variables set in there don't take effect (e.g. engine=On, display_errors=Off, etc.). I had PHP 4.1.1 running here before, and it used to work, PHP 4.2.1 has been built with exactly the same options that I used to build PHP 4.1.1. What could have I missed?

    attached mail follows:


    Andre wrote: > Apache 1.3.26 > PHP 4.2.1 staticly built as a module. > > The configuration in php.ini seems not to be used by httpd. > I've traced my httpd process and it opens the php.ini file in the expected > directory, but variables set in there don't take effect (e.g. engine=On, > display_errors=Off, etc.). > I had PHP 4.1.1 running here before, and it used to work, PHP 4.2.1 has been > built with exactly the same options that I used to build PHP 4.1.1. > What could have I missed? >

    I have a problem similar to urs but with engine only. I used to set engine=off in php.ini and in httpd.conf as per vhost I add the following php_flag engine on. Since I upgraded to Apache 2.0.36 and php 4.2.1 it breaks the apache and complains that there is type mistake. I changed it from php_flag to php_value but no help at all. My workaround was to comment the lines in conf.d/php.conf that handle the php files through the php module and to add them per vhost and it worked. Also I tested the old AddType and it is working too. Regards

    -- 
    Sameh Attia
    Senior System Engineer
    T.E. Data
    --
                    __  __  _
        _________ _/ /_/ /_(_)___ _
       / ___/ __ `/ __/ __/ / __ `/
      (__  ) /_/ / /_/ /_/ / /_/ /
    /____/\__,_/\__/\__/_/\__,_/
    

    attached mail follows:


    On Thu, Jul 18, 2002 at 12:55:34PM -0300, Andre wrote: > > The configuration in php.ini seems not to be used by httpd.

    Make a script with phpinfo() in it and examine which php.ini file is being used. Sounds like you may be accessing the wrong file, even though you're saying you're not.

    > I've traced my httpd process and it opens the php.ini file in the expected > directory, but variables set in there don't take effect (e.g. engine=On, > display_errors=Off, etc.).

    Are you making the changes in php.ini and _then_ restarting Apache? If not, you need to.

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


    Thank you for everyone who helped me. The problem was a php.ini file in the root (/) directory, PHP 4.2.1 was using that file instead of the one configured (--with-config-file-path=/usr/local/apache/conf).

    ---------- Forwarding ----------

    Subject: [PHP] php.ini problem Date: Thu, 18 Jul 2002 12:55:34 -0300 From: Andre <andrenetvision.com.br> To: php-generallists.php.net

    Apache 1.3.26 PHP 4.2.1 staticly built as a module.

    The configuration in php.ini seems not to be used by httpd. I've traced my httpd process and it opens the php.ini file in the expected directory, but variables set in there don't take effect (e.g. engine=On, display_errors=Off, etc.). I had PHP 4.1.1 running here before, and it used to work, PHP 4.2.1 has been built with exactly the same options that I used to build PHP 4.1.1. What could have I missed?

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

    -------------------------------------------------------

    attached mail follows:


    How can I look back Business Days. I would like to go back from a certain date, like 7 business days. Is there a simple way other then looping and checking for the day of the week?

    attached mail follows:


    [snip] How can I look back Business Days. I would like to go back from a certain date, like 7 business days. Is there a simple way other then looping and checking for the day of the week? [/snip]

    $sevendaysago = date("Y-m-d", mktime(date("h")-168));

    This will give you the date exactly seven days ago, then you can test what day (Mon - Fri). If it is Saturday then you could subtract 24 more hours, if Sunday, 48 more hours.

    HTH!

    Jay

    "Of all the things I’ve lost, I miss my mind the most"

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    sorry about last message I want to get a list of the last 7 business days so I would have to loop through this and get each day correct?

    "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message news:001701c22e78$4494c970$8102a8c0niigziuo4ohhdt... > [snip] > How can I look back Business Days. > I would like to go back from a certain date, like 7 business days. Is there > a simple way other then looping and checking for the day of the week? > [/snip] > > $sevendaysago = date("Y-m-d", mktime(date("h")-168)); > > This will give you the date exactly seven days ago, then you can test what > day (Mon - Fri). If it is Saturday then you could subtract 24 more hours, if > Sunday, 48 more hours. > > HTH! > > Jay > > "Of all the things I've lost, I miss my mind the most" > > ************************************* > * Want to meet other PHP developers * > * in your area? Check out: * > * http://php.meetup.com/ * > * No developer is an island ... * > ************************************* > >

    attached mail follows:


    [snip] sorry about last message I want to get a list of the last 7 business days so I would have to loop through this and get each day correct? [/snip]

    Yes, testing for Saturday and Sunday ...

    Jay

    "Vampires Suck"

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    I am running into a situation where I need some serious help. My environment is:

    Workstation - W2k, Frontpage Server - Cobalt RaQ4i, Linux, Apache

    Problem: I need to access MySQL to display inventory information on the web page. When I have modified the httpd.conf file to parse html files through php, the embedded php code works. However, FrontPage no longer works and a Web statisics application will not work (Webalizer). I know I am not setting something correctly, but dang if I know what it is.

    I really need some help on this. Please realize that I am relatively new to internet programming, linux, php, etc. I have done okay so far, but this is beyond me at this point. Any help will be greatly appreciated.

    attached mail follows:


    I am running into a situation where I need some serious help. My environment is:

    Workstation - W2k, Frontpage Server - Cobalt RaQ4i, Linux, Apache

    Problem: I need to access MySQL to display inventory information on the web page. When I have modified the httpd.conf file to parse html files through php, the embedded php code works. However, FrontPage no longer works and a Web statisics application will not work (Webalizer). I know I am not setting something correctly, but dang if I know what it is.

    I really need some help on this. Please realize that I am relatively new to internet programming, linux, php, etc. I have done okay so far, but this is beyond me at this point. Any help will be greatly appreciated.

    attached mail follows:


    "Keith Roberts" <keithgetadeal.com> wrote in message news:006401c22e78$a71723e0$48b5913fOperator1... > I am running into a situation where I need some serious help. My > environment is: > > Workstation - W2k, Frontpage > Server - Cobalt RaQ4i, Linux, Apache > > Problem: I need to access MySQL to display inventory information on the web > page. When I have modified the httpd.conf file to parse html files through > php, the embedded php code works. However, FrontPage no longer works and a > Web statisics application will not work (Webalizer). I know I am not > setting something correctly, but dang if I know what it is. > > I really need some help on this. Please realize that I am relatively new to > internet programming, linux, php, etc. I have done okay so far, but this is > beyond me at this point. Any help will be greatly appreciated. > Do you have access to the Server Settings i.e. were you doing this yourself? If so it might be wise to install PHP as an Apache Module (if you haven't already done so) - things tend to work much smoother... Secondly - not trying to offend you or be conceited but I have to ask this coz no one on these groups can guess the others comptency level in a particular aspect - are you using Front Page simply as an easy non-programmer-type style to create your pages or are you using the coding aspect to it (with line number list and all), if you are using it the former this won't work... You may also want to check whether files with extension php are set to viewable in Front Page, I believe this is under Tools... I personally wouldn't recommend using Front Page to create PHP ran Web Applications (but that might be coz I am slow to pickup on how MS products operate)...

    Good Luck... Spike

    attached mail follows:


    I am running into a situation where I need some serious help. My environment is:

    Workstation - W2k, Frontpage Server - Cobalt RaQ4i, Linux, Apache

    Problem: I need to access MySQL to display inventory information on the web page. When I have modified the httpd.conf file to parse html files through php, the embedded php code works. However, FrontPage no longer works and a Web statisics application will not work (Webalizer). I know I am not setting something correctly, but dang if I know what it is.

    I really need some help on this. Please realize that I am relatively new to internet programming, linux, php, etc. I have done okay so far, but this is beyond me at this point. Any help will be greatly appreciated.

    attached mail follows:


    I am running into a situation where I need some serious help. My environment is:

    Workstation - W2k, Frontpage Server - Cobalt RaQ4i, Linux, Apache

    Problem: I need to access MySQL to display inventory information on the web page. When I have modified the httpd.conf file to parse html files through php, the embedded php code works. However, FrontPage no longer works and a Web statisics application will not work (Webalizer). I know I am not setting something correctly, but dang if I know what it is.

    I really need some help on this. Please realize that I am relatively new to internet programming, linux, php, etc. I have done okay so far, but this is beyond me at this point. Any help will be greatly appreciated.

    attached mail follows:


    [snip] I am running into a situation where I need some serious help. My environment is:

    Workstation - W2k, Frontpage Server - Cobalt RaQ4i, Linux, Apache

    Problem: I need to access MySQL to display inventory information on the web page. When I have modified the httpd.conf file to parse html files through php, the embedded php code works. However, FrontPage no longer works and a Web statisics application will not work (Webalizer). I know I am not setting something correctly, but dang if I know what it is.

    I really need some help on this. Please realize that I am relatively new to internet programming, linux, php, etc. I have done okay so far, but this is beyond me at this point. Any help will be greatly appreciated. [/snip]

    Ahem ... we got it the first time... :^]

    What exactly did you modify in httpd.conf?

    Jay

    "Vegetarian: primitive word for lousy hunter "

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

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

    attached mail follows:


    > I have just installed apache+php4, but my php can not get > values from form? > what's wrong?

    Before you can use the variables, you have to make the accessible to PHP. Try putting this at the top of your welcome.php file:

    <? extract($HTTP_POST_VARS); ?>

    --
    The Health TV Channel, Inc.
    (a non - profit organization)
    3820 Lake Otis Pkwy.
    Anchorage, AK 99508
    907.770.6200 ext.220
    907.336.6205 (fax)
    Web: www.healthtvchannel.org
    

    attached mail follows:


    What's the best way to check for an Associative Array? There is no is_assoc() or similiar function listed in the manual (I don't think anyway).

    I'm using mysql_fetch_array() and I want to foreach only the assoc. part of the array without using mysql_fetch_assoc():

    foreach ($arr as $key=>$value) { echo "$key:$value"; }

    But of course it show both the indexed array and the assoc array contents. Is there an existing function to check this, or should I do one of these things inside the foreach loop:

    A) set $last=value and just check if $value = $lastval

    B) check if the $key is just a number or just a string

    C) $key += 1

    ?? Thanks,

    Henning Sittler www.inscriber.com

    attached mail follows:


    Try this:

    while($row = mysql_fetch_assoc($result)) { // code here }

    This way, the resulting array will ONLY be associative.

    HTH!

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> Henning Sittler <Henninginscriber.com> 07/18/02 12:57PM >>> What's the best way to check for an Associative Array? There is no is_assoc() or similiar function listed in the manual (I don't think anyway).

    I'm using mysql_fetch_array() and I want to foreach only the assoc. part of the array without using mysql_fetch_assoc():

    foreach ($arr as $key=>$value) { echo "$key:$value"; }

    But of course it show both the indexed array and the assoc array contents. Is there an existing function to check this, or should I do one of these things inside the foreach loop:

    A) set $last=value and just check if $value = $lastval

    B) check if the $key is just a number or just a string

    C) $key += 1

    ?? Thanks,

    Henning Sittler www.inscriber.com

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

    attached mail follows:


    Ya, except I want the whole array to exist (index and assoc. array), not just the assoc. array. So, for the time being, I'll just do this:

    foreach ($arr as $key=>$value) { if ( !is_int($key) ) { echo "$key:$value"; } }

    What is HTH ??

    Henning Sittler www.inscriber.com

    Try this:

    while($row = mysql_fetch_assoc($result)) { // code here }

    This way, the resulting array will ONLY be associative.

    HTH!

    attached mail follows:


    On Friday 19 July 2002 01:19, Martin Clifford wrote: > Try this: > > while($row = mysql_fetch_assoc($result)) { > // code here > } > > This way, the resulting array will ONLY be associative.

    For some unknown reason the OP specifically does not want to use mysql_fetch_assoc()!

    > I'm using mysql_fetch_array() and I want to foreach only the assoc. part of > the array without using mysql_fetch_assoc():

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

    /* People are beginning to notice you. Try dressing before you leave the house. */

    attached mail follows:


    Oh well. And HTH means "Hope to Help".

    > For some unknown reason the OP specifically does not want to use > mysql_fetch_assoc()!

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    attached mail follows:


    foreach ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { //... }

    Is this what you need? http://www.php.net/manual/en/function.mysql-fetch-array.php

    -Kevin

    ----- Original Message ----- From: "Henning Sittler" <Henninginscriber.com> To: <php-generallists.php.net> Sent: Thursday, July 18, 2002 10:57 AM Subject: [PHP] Check for Associative Array

    > What's the best way to check for an Associative Array? There is no > is_assoc() or similiar function listed in the manual (I don't think anyway). > > I'm using mysql_fetch_array() and I want to foreach only the assoc. part of > the array without using mysql_fetch_assoc(): > > foreach ($arr as $key=>$value) { > echo "$key:$value"; > } > > But of course it show both the indexed array and the assoc array contents. > Is there an existing function to check this, or should I do one of these > things inside the foreach loop: > > A) set $last=value and just check if $value = $lastval > > B) check if the $key is just a number or just a string > > C) $key += 1 > > > ?? Thanks, > > > Henning Sittler > www.inscriber.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    At 12:57 PM -0400 7/18/02, Henning Sittler wrote: >What's the best way to check for an Associative Array? There is no >is_assoc() or similiar function listed in the manual (I don't think anyway).

    No, because AFAIK all PHP arrays are associative; there is no distinction between arrays & hashes as in Perl.

    >I'm using mysql_fetch_array() and I want to foreach only the assoc. part of >the array without using mysql_fetch_assoc(): > >foreach ($arr as $key=>$value) { > echo "$key:$value"; >}

    If you really don't want to use mysql_fetch_assoc(), you can use the second parameter of mysql_fetch_array():

    $arr = mysql_fetch_array($ResultHandle, MYSQL_FETCH_ASSOC);

    This functions exactly like mysql_fetch_assoc(), and is available in PHP >= 3.0.7.

    See

    http://www.php.net/manual/en/function.mysql-fetch-array.php

    for more info.

    >But of course it show both the indexed array and the assoc array contents. >Is there an existing function to check this, or should I do one of these >things inside the foreach loop: > >A) set $last=value and just check if $value = $lastval > >B) check if the $key is just a number or just a string > >C) $key += 1

    Lastly, you _could_ just step through the array using each() in a loop, and use only every OTHER array entry...but this is really funky and you shouldn't do it this way anymore.

    -steve

    > >?? Thanks, > > >Henning Sittler >www.inscriber.com >

    -- 
    +------------------------------------------------------------------------+
    | Steve Edberg                                      sbedbergucdavis.edu |
    | University of California, Davis                          (530)754-9127 |
    | Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
    +------------------------------------------------------------------------+
    | The end to politics as usual:                                          |
    |                 The Monster Raving Loony Party (http://www.omrlp.com/) |
    +------------------------------------------------------------------------+
    

    attached mail follows:


    Can we reboot a linux server using a php page? And is it recommended?

    Regards, Harpreet Kaur

    _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com

    attached mail follows:


    On Thu, 18 Jul 2002, Harpreet Kaur wrote:

    >- >-Can we reboot a linux server using a php page?

    Yes.

    >-And is it recommended?

    No.

    >- >-Regards, >-Harpreet Kaur >- >- >-_________________________________________________________________ >-Join the world’s largest e-mail service with MSN Hotmail. >-http://www.hotmail.com >- >- >--- >-PHP General Mailing List (http://www.php.net/) >-To unsubscribe, visit: http://www.php.net/unsub.php >-

    **************************************

    John Huggins VANet

    jhugginsva.net http://www.va.net/

    **************************************

    attached mail follows:


    This can be done using the exec() function, the php.net doc will explain how it work. There are a few known problem as I can see if someone try to reboot the Linux/Unix.

    1) If the hacker break-in and take control of hte script. Who know what could have happen.

    2) If using encryption and use passphrase to start up Apache, it is a darn problem getting the passphrase be entered automatically.

    3) If people are online to that one website and the machine reboot, everyone would get cut off of that website.

    FletchSOD

    "John S. Huggins" <jhugginsva.net> wrote in message news:Pine.LNX.3.96.1020718183405.7224A-100000va.net... On Thu, 18 Jul 2002, Harpreet Kaur wrote:

    >- >-Can we reboot a linux server using a php page?

    Yes.

    >-And is it recommended?

    No.

    >- >-Regards, >-Harpreet Kaur >- >- >-_________________________________________________________________ >-Join the world's largest e-mail service with MSN Hotmail. >-http://www.hotmail.com >- >- >--- >-PHP General Mailing List (http://www.php.net/) >-To unsubscribe, visit: http://www.php.net/unsub.php >-

    **************************************

    John Huggins VANet

    jhugginsva.net http://www.va.net/

    **************************************

    attached mail follows:


    >>-Can we reboot a linux server using a php page? >Yes. >>-And is it recommended? >No.

    Can I get the URL of that page so I can put it in my cron file?

    ---John Holmes...

    attached mail follows:


    If you're going to use the cron file (or crontab) then php wouldn't work because it is a programming languages for the web pages. For cron files or crontab, you can use the bash shell or ksh or whatever you have. It's simple. All you had to do is to create a file on hte Unix/Linux machine and do the following ...

    --clip-- #!/usr/bash

    /usr/bin/shutdown -Fr now --clip--

    Then edit the crontab or cron to put in the time you want the machine to be rebooted.

    "1lt John W. Holmes" <holmes072000charter.net> wrote in message news:016201c22e91$ddb5a5c0$a529089bTB447CCO3... > >>-Can we reboot a linux server using a php page? > >Yes. > >>-And is it recommended? > >No. > > Can I get the URL of that page so I can put it in my cron file? > > ---John Holmes... >

    attached mail follows:


    Or you could do that using php:

    #!/usr/local/bin/php -q <? echo `/usr/bin/shutdown -Fr now`; ?>

    (Note those are backticks, not apostrophes)

    Jason Reid jasonachost.ca

    --
    AC Host Canada
    www.achost.ca
    

    "Scott Fletcher" <scottabcoa.com> wrote in message news:20020718202308.75157.qmailpb1.pair.com... > If you're going to use the cron file (or crontab) then php wouldn't work > because it is a programming languages for the web pages. For cron files or > crontab, you can use the bash shell or ksh or whatever you have. It's > simple. All you had to do is to create a file on hte Unix/Linux machine and > do the following ... > > --clip-- > #!/usr/bash > > /usr/bin/shutdown -Fr now > --clip-- > > Then edit the crontab or cron to put in the time you want the machine to be > rebooted. > > > "1lt John W. Holmes" <holmes072000charter.net> wrote in message > news:016201c22e91$ddb5a5c0$a529089bTB447CCO3... > > >>-Can we reboot a linux server using a php page? > > >Yes. > > >>-And is it recommended? > > >No. > > > > Can I get the URL of that page so I can put it in my cron file? > > > > ---John Holmes... > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    ðÒÉ×ÅÔ!

    Is there a way I can decide where to target my output from server side?

    suppose my page has two iframes

    +---++---+ ! A !! b ! +---++---+

    while executing a script that is called by A can I spawn another script that will output to "b"? And no, I cant' use any Jscript, but I do know from server side what my target names are (A and b, that is).

    Bear in mind that A and b might be even different windows, but I'd more than happy even if it worked with iframes on a single window.

    ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×

    -_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_-

    LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......

    attached mail follows:


    I would assume you just do it as if you didn't have any scripts in it in the first place.

    The link in frame A might be like below:

    <a href="content.php?show=TOC" target="b">Click here to see the content</a>

    Then, in frame b, content.php will show up and you can then use $show to decide what to do. I might be totally off on this one, but I only went on what it sounded like you wanted.

    The same applies to JavaScript.

    // This can be used to get the height and width of the browser window for any server-side needs.

    <script language="javascript"> <!-- hide me

    function getScreen() { var height = screen.height; var width = screen.width;

    document.location = "index.php?height=" + height + "&width=" + width; }

    <body onload="getScreen();">

    :babbles on and on and on...:

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> Alberto Serra <albertoserragala.net> 07/18/02 03:12PM >>> ??????!

    Is there a way I can decide where to target my output from server side?

    suppose my page has two iframes

    +---++---+ ! A !! b ! +---++---+

    while executing a script that is called by A can I spawn another script that will output to "b"? And no, I cant' use any Jscript, but I do know from server side what my target names are (A and b, that is).

    Bear in mind that A and b might be even different windows, but I'd more than happy even if it worked with iframes on a single window.

    ???? ???????? ????

    -_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_-

    LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......

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

    attached mail follows:


    ðÒÉ×ÅÔ!

    Martin Clifford wrote: > <a href="content.php?show=TOC" target="b">Click here to see the content</a>

    Looks like I was not clear in my question :) This way you just redirect *all* the outoput to another target. I need to output at more targets at the same time with one link. That is, since links cannot accept multiple targets, having my script spawn out a second script that will output to the second (third, and so on) target.

    > The same applies to JavaScript.

    Can't use Jscript at all in this context. The onload event on frame "A" would do fine, but what if jscript is not there? Besides, having this based an an Onload chain makes it quite slow and the user has the impression that only A is changing until the A load process is not over. Since b is almost always some sort of menu, this makes pages look weird for some seconds on slow connections (that is, one page has the "wrong" menu) I need something that will clear and reload both iframes at the same time with one single click (and no Jscript).

    ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×

    > >>>>Alberto Serra <albertoserragala.net> 07/18/02 03:12PM >>> >>> > ??????! > > Is there a way I can decide where to target my output from server side? > > suppose my page has two iframes > > +---++---+ > ! A !! b ! > +---++---+ > > while executing a script that is called by A can I spawn another script > that will output to "b"? And no, I cant' use any Jscript, but I do know > from server side what my target names are (A and b, that is). > > Bear in mind that A and b might be even different windows, but I'd more > than happy even if it worked with iframes on a single window.

    -_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_-

    LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......

    attached mail follows:


    I think you are SOL unless you use Javascript manage the display amongst the frames/windows.

    /dkm ----- Original Message ----- From: "Alberto Serra" <albertoserragala.net> Cc: <php-generallists.php.net> Sent: Thursday, July 18, 2002 3:31 PM Subject: Re: [PHP] spawning scripts to different graphical targets

    > ?OE?AO! > > Martin Clifford wrote: > > <a href="content.php?show=TOC" target="b">Click here to see the content</a> > > Looks like I was not clear in my question :) This way you just redirect > *all* the outoput to another target. I need to output at more targets at > the same time with one link. That is, since links cannot accept multiple > targets, having my script spawn out a second script that will output to > the second (third, and so on) target. > > > The same applies to JavaScript. > > Can't use Jscript at all in this context. The onload event on frame "A" > would do fine, but what if jscript is not there? Besides, having this > based an an Onload chain makes it quite slow and the user has the > impression that only A is changing until the A load process is not over. > Since b is almost always some sort of menu, this makes pages look weird > for some seconds on slow connections (that is, one page has the "wrong" > menu) I need something that will clear and reload both iframes at the > same time with one single click (and no Jscript). > > ?IEA > aIOAAOOI > eEA? > > > > >>>>Alberto Serra <albertoserragala.net> 07/18/02 03:12PM >>> > >>> > > ??????! > > > > Is there a way I can decide where to target my output from server side? > > > > suppose my page has two iframes > > > > +---++---+ > > ! A !! b ! > > +---++---+ > > > > while executing a script that is called by A can I spawn another script > > that will output to "b"? And no, I cant' use any Jscript, but I do know > > from server side what my target names are (A and b, that is). > > > > Bear in mind that A and b might be even different windows, but I'd more > > than happy even if it worked with iframes on a single window. > > -_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_- > > LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? > lOrD i'M sHiNiNg... > YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE > tHe TeSt, YeS iT iS > ThE tEsT, yEs It Is > tHe TeSt, YeS iT iS > ThE tEsT, yEs It Is....... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hey all, Does anybody know of a way to push an element onto an array with a specific key? What I am trying to do is create a dynamically created associative array. Here is a sample print_r of what an array would look like:

    Array ( [default] => css/default.css [forms] => css/forms.css )

    I have tried array_push, but can't seem to get the results I am looking for. i.e.:

    <? array_push($samp, "$key"=>"$value"); // this throws an error array_push($samp, array("$key"=>"$value")); // doesn't give the results i'm looking for

    /* output from second array_push Array ( [0] => Array ( [default] => css/default.css ) [1] => Array ( [forms] => css/forms.css ) )*/ ?>

    If anyone can point me in the right direction, I would appreciate any help you can give me.

    --
    Joshua E Minnie/Webmaster
    joshacsurf.net
    Phone: 616.276.9690
    Fax: 616.342.8750
    Nextel: 616.862.2847
    

    "Don't work for recognition, but always do work worthy of recognition."

    attached mail follows:


    On Thu, Jul 18, 2002 at 03:40:58PM -0400, Joshua E Minnie wrote: > Hey all, > Does anybody know of a way to push an element onto an array with a > specific key? What I am trying to do is create a dynamically created > associative array. Here is a sample print_r of what an array would look > like:

    I don't understand the value of array_push(). I just add new elements by something like:

    $Array[$Key] = $Value;

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


    LOL...... So after my last post about updating files i sat and thought about all the replies i got... and then a slap on the head solved the "DUH" problem ereg_replace("\r\n", "\n", $DBfile); I mean..... i am a dork as the best of times..

    but now.... there is another problem....

    the file length is 10 charactes but the new file length is 15.... I need to overright everything in the old file and somehow push the file length to 15 it truncates..... what now ???

    attached mail follows:


    you know what.... forget this whole thing.... I just need to know how do i clear the file contents.... set it 0 length.... I cannot delete the file.... no permission....

    "Vins" <vinswebonline.co.za> wrote in message news:20020718194117.31508.qmailpb1.pair.com... > LOL...... > So after my last post about updating files i sat and thought about all the > replies i got... and then a slap on the head solved the "DUH" problem > ereg_replace("\r\n", "\n", $DBfile); > I mean..... i am a dork as the best of times.. > > but now.... there is another problem.... > > the file length is 10 charactes but the new file length is 15.... > I need to overright everything in the old file and somehow push the file > length to 15 > it truncates..... what now ??? > >

    attached mail follows:


    nerver mind... i'm a moron.... i sorted it out.... sorry for bugging....

    next time i'll test much more before posting really am sorry

    "Vins" <vinswebonline.co.za> wrote in message news:20020718194117.31508.qmailpb1.pair.com... > LOL...... > So after my last post about updating files i sat and thought about all the > replies i got... and then a slap on the head solved the "DUH" problem > ereg_replace("\r\n", "\n", $DBfile); > I mean..... i am a dork as the best of times.. > > but now.... there is another problem.... > > the file length is 10 charactes but the new file length is 15.... > I need to overright everything in the old file and somehow push the file > length to 15 > it truncates..... what now ??? > >

    attached mail follows:


    Howdy,

    Just a performance question, if anyone knows for sure. Within a large array, would using numerical indices be quicker than associative? I'm talking about a *noticeable* difference in performance, here.

    Also, on Regular Expression replacements:

    $text = eregi_replace("([abc]+)", "<span style=\"color: red\">\\1</span>", $text);

    Would this replace any occurences of the pattern with the same pattern match in red text? I'm not sure exactly how the \\1, \\2, etc. works. So, does:

    $text = eregi_replace("(a)(b)(c)", "\\1", $text);

    Does this output only the 'a'? I find this confusing for some reason, hehe. Any help would be great!

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    attached mail follows:


    I know that it's pretty easy for a shell script to call a php page to do something.

    What's the best way to have a php page call a shell script?

    I'm trying to automate the creation of directories with certain files in them (people creating their own temporary websites..), and figured a simple shell script to copy the files (or symobolic links to these files) from a master directory to the appropriate directory for the customer would make the most sense.

    Am I barking up the wrong tree, or does this make sense?

    Thanks in advance,

    Kelly

    attached mail follows:


    [snip] I know that it's pretty easy for a shell script to call a php page to do something.

    What's the best way to have a php page call a shell script?

    I'm trying to automate the creation of directories with certain files in them (people creating their own temporary websites..), and figured a simple shell script to copy the files (or symobolic links to these files) from a master directory to the appropriate directory for the customer would make the most sense.

    Am I barking up the wrong tree, or does this make sense? [/snip]

    Use exec() or shell_exec() http://www.php.net/manual/en/function.exec.php

    HTH!

    Jay

    attached mail follows:


    I thought this would be fairly easy, but, I can't figure out how to load the contents of a file into a variable so I can output it later.

    The file to be loaded is in my include_path on the server and does contain some HTML.

    file_get_contents() is exactly what I need, but, it only works on a CVS version of PHP, whatever that is.

    I also tried the following function:

    function file_get_contents($filename) { $fd = fopen ($filename, "r", 1); $contents = fread($fd, filesize($filename)); fclose($fd); return $contents; }

    But it returns nothing. If I use readfile() the file contents is displayed, but, what I really want to do is store it in a string variable, not output it directly. How can I do this?

    Thanks,

    Monty

    attached mail follows:


    ðÒÉ×ÅÔ!

    Monty wrote: > But it returns nothing. If I use readfile() the file contents is displayed, > but, what I really want to do is store it in a string variable, not output > it directly. How can I do this?

    Look 4 implode() in the function list

    ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ×

    -_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_--_=}{=_-

    LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is.......

    attached mail follows:


    > Look 4 implode() in the function list

    Implode isn't really what I need, I just want to load an entire file into a single string variable.

    However, I figured out the problem shortly after posting that first message (of course). Because the file being opened is in the include_path, it seems filesize() doesn't see those files. So, if I replace the filesize($filename) command with a hard-coded number, it works.

    Monty

    attached mail follows:


    Hi Monty,

    I've been trying to do the same thing with no success. Would you be so kind as to show me how you finally did it? I'm not too clear what you meant by:

    "So, if I replace the filesize($filename) command with a hard-coded number, it works."

    Tia, Andre

    On Thursday 18 July 2002 04:28 pm, you wrote: > I just want to load an entire file into a > single string variable. > > However, I figured out the problem shortly after posting that first message > (of course). Because the file being opened is in the include_path, it seems > filesize() doesn't see those files. So, if I replace the > filesize($filename) command with a hard-coded number, it works. > > Monty

    attached mail follows:


    I think I've convinced my potential client that PHP will do the job at least as well if not better than Java, but being a Microsoft shop, they want us to consider a .Net solution.

    Can anyone with familiarity with both PHP and .Net comment on relative strengths and weaknesses?

    Is .Net still too immature a platform for large interactive web sites with heavy database IO? How will time to implement and performance compare between the two?

    Any other considerations?

    Thanks very much in advance.

    Jesse

    attached mail follows:


    When viewing examples of using if and elseif I often see the example ending with an else like ...

    if($a == '1'){ echo '1'; } elseif ($a == '2'){ echo '2'; } else { echo '0'; }

    Is there any problem with leaving out the last else and just ending it with an elseif such as ...

    if($a == '1'){ echo '1'; } elseif ($a == '2'){ echo '2'; }

    attached mail follows:


    On Thu, Jul 18, 2002 at 02:28:23PM -0700, Fargo Lee wrote: > When viewing examples of using if and elseif I often see the example ending > with an else like ... > > if($a == '1'){ > echo '1'; > } elseif ($a == '2'){ > echo '2'; > } else { > echo '0'; > }

    On a side note, switch would be more efficient:

    switch ($a) { case 1: echo '1'; break; case 2: echo '2'; break; default: echo 'other'; }

    Also use nesting / indenting to make your code more readable:

    if ($a == '1') { echo '1'; }

    > Is there any problem with leaving out the last else and just ending it with > an elseif such as ... > > if($a == '1'){ > echo '1'; > } elseif ($a == '2'){ > echo '2'; > }

    That all depends on the circumstances. Both have their places.

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


    > > Is there any problem with leaving out the last else and just ending it with > an elseif such as ... > > if($a == '1'){ > echo '1'; > } elseif ($a == '2'){ > echo '2'; > }

    Nothing syntactically, but surely you wouldn't want a rogue '3' or '0' to fall through the cracks... that wouldn't be very good, and depending on the circumstances, could be a serious breach of security. And it _will_ happen one day if you get in the habit of not using else _all the time_.

    P.

    attached mail follows:


    Hi guys,

    I got a problem with refreshing session variables. When the following code is run , for the first time both $z and $secretstring are showing same values.

    But when page is refreshed, the $secretstring variable is still having the old value no matter how many times I click refresh.

    Am I missing some thing ?

    <? $x = mt_rand (1000,10000); $y = mt_rand (1000,10000);

    $text = $x.$y; $secretstring =$x.$y;

    session_start(); if(session_is_registered("secretstring")){ session_unregister("secretstring"); } session_register("secretstring");

    echo "<BR>".$text; echo "<BR>".$secretstring;

    ?>