OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Sat Aug 25 2001 - 14:27:57 CDT

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

    php-general Digest 25 Aug 2001 19:27:57 -0000 Issue 837

    Topics (messages 64404 through 64448):

    Re: The future of PHP
            64404 by: Rasmus Lerdorf
            64406 by: Cristopher Daniluk
            64408 by: Greg Beaver
            64425 by: hassan el forkani
            64432 by: Christopher CM Allen
            64435 by: Miles Thompson

    Re: HELP!!!
            64405 by: Greg Beaver
            64417 by: BRACK

    Displaying all variables currently set?
            64407 by: Ken
            64412 by: CC Zona

    Error
            64409 by: Martin Kampherbeek
            64410 by: Don Read
            64411 by: Martin Kampherbeek

    global variable.
            64413 by: nafiseh saberi
            64430 by: Hugh Bothwell

    Re: send mail to mailing list using mail() or smtp?
            64414 by: Niklas Lampen
            64428 by: hassan el forkani

    Re: File Upload and NT...
            64415 by: Adrian D'Costa

    Re: text wrap in table
            64416 by: Adrian D'Costa
            64421 by: nafiseh saberi

    global variable again?
            64418 by: nafiseh saberi
            64422 by: Chris Hayes

    re:help!!!
            64419 by: nafiseh saberi

    ImageCopyResampled() versus ImageCopyResized()
            64420 by: dgoddard

    PHP Install Problem - Please Help
            64423 by: Martin Stephenson

    How can I read the value of an existing cookie?
            64424 by: Pere
            64436 by: mike cullerton
            64440 by: Pere

    Re: AudioGalaxy-like stuff
            64426 by: Christian Dechery
            64429 by: Andrew Brampton

    sizeof(int)
            64427 by: Saurabh Kapoor
            64431 by: Hugh Bothwell

    source of global variable
            64433 by: nafiseh saberi

    Re: local time v.s. server time
            64434 by: James, Yz
            64437 by: Joe Sheble \(Wizaerd\)

    Re: & help
            64438 by: Tyler Longren
            64447 by: Hugh Bothwell

    Images Download
            64439 by: Pereira Romulo

    regenerate variables?
            64441 by: Christian Springub
            64443 by: Rasmus Lerdorf
            64445 by: Christian Springub

    $i % 2 ? 0:
            64442 by: BRACK
            64444 by: mike cullerton
            64446 by: Hugh Bothwell

    Stripping line break characters
            64448 by: Rory O'Connor

    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:


    > So, it is very hard to convince the anybody to bet all the farm in PHP.
    > You may have the technical arguments, but is not enough, I'm afraid.
    >
    > You in particular, may not need to convince others to bet on PHP, but it
    > is nothing like that for most people that want to live from software
    > development. They have to put up with work/business opportunities that
    > the market offers to live from it. So, today, I'm afraid that you
    > already still have an hard time to convince people to dedicate only to
    > PHP, even those that know and believe PHP is that great.

    PHP is represented at every important technical conference right alongside
    Perl and Python. When you hear someone talk about scripting languages,
    they will usually say Perl, Python and PHP. I don't see any problem with
    the current state of PHP "marketing" in the technical community.

    PHP is not marketed the way Java and .NET is. There are no multi-billion
    dollar corporations behind PHP and asking us, and apparently me
    personally, to make that happen is unrealistic. Like Linux 5 years ago,
    PHP is adopted by the techies and somewhat shunned by the suits because
    they haven't read about it in their latest advertisement-sponsored
    magazine.

    We can't possibly hope to compete with Sun and Microsoft when it comes to
    suit-oriented marketing drivel. What we can do is concentrate on what we
    do best. Writing a solid and very focused tool. Building the grassroot
    community and being visible at all relevant technical conferences. If we
    continue to do this, I see no reason for any dropoff in PHP popularity
    which leads directly to more and more corporate acceptance.

    -Rasmus

    attached mail follows:


    After following this thread for a while, it seems like there is a lot of
    discrepancy between what is "success" and what isn't for PHP. I do not
    believe PHP will ever become the ubiquitous web language, if for no other
    reason than because it isn't always the right choice for your web based
    project. PHP is already a strong option in many corporate environments.
    Really from what I've seen lately, the only reason it loses out to Java, ASP
    (uggh), or other similar options is that it is difficult to find a team of
    qualified PHP developers. Even if you can get the project off the ground,
    the continual maintenance is a problem. Simply put, I think this means we
    have great potential to have long term success, as far as penetrating the
    corporate market. As employers start finding the qualified people out there,
    and as people re-train/relearn, and as fresh meat comes out, the job market
    will sustain our growth. I would say we don't need the multi-billion dollar
    backing to be successful as well. Linux, as you particularly mentioned, is
    shunned by a lot of suits, but it has grown - and that growth has sustained
    itself over the last 10 years, more relevantly the last 4-5. It's starting
    to get a little more attractive to suits as bigger and bigger and bigger
    companies sponsor or use it. I envision PHP going down this road as well,
    though I obviously don't expect the same grandeur that Linux has received.
    We will achieve this by doing exactly what Rasmus said - developing a good
    product. Though I must digress on the subject of technical conferences.
    While they're valuable and by all means we should be there, I believe the
    true value will come when people do our work for us - we need to prove to
    the world that it is cool to use PHP, and they'll make sure all their
    friends are cool too :)

    Regards,

    Cristopher Daniluk
    President & CEO
    email: crisdsnet.net
    direct: 330/530-2373

    Digital Services Network, Inc
    Unleashing Your Potential
    voice: 800/845-4822
    web: http://www.dsnet.net/

    -----Original Message-----
    From: Rasmus Lerdorf [mailto:rasmusphp.net]
    Sent: Saturday, August 25, 2001 1:52 AM
    To: Manuel Lemos
    Cc: php-generallists.php.net
    Subject: Re: [PHP] The future of PHP

    > So, it is very hard to convince the anybody to bet all the farm in PHP.
    > You may have the technical arguments, but is not enough, I'm afraid.
    >
    > You in particular, may not need to convince others to bet on PHP, but it
    > is nothing like that for most people that want to live from software
    > development. They have to put up with work/business opportunities that
    > the market offers to live from it. So, today, I'm afraid that you
    > already still have an hard time to convince people to dedicate only to
    > PHP, even those that know and believe PHP is that great.

    PHP is represented at every important technical conference right alongside
    Perl and Python. When you hear someone talk about scripting languages,
    they will usually say Perl, Python and PHP. I don't see any problem with
    the current state of PHP "marketing" in the technical community.

    PHP is not marketed the way Java and .NET is. There are no multi-billion
    dollar corporations behind PHP and asking us, and apparently me
    personally, to make that happen is unrealistic. Like Linux 5 years ago,
    PHP is adopted by the techies and somewhat shunned by the suits because
    they haven't read about it in their latest advertisement-sponsored
    magazine.

    We can't possibly hope to compete with Sun and Microsoft when it comes to
    suit-oriented marketing drivel. What we can do is concentrate on what we
    do best. Writing a solid and very focused tool. Building the grassroot
    community and being visible at all relevant technical conferences. If we
    continue to do this, I see no reason for any dropoff in PHP popularity
    which leads directly to more and more corporate acceptance.

    -Rasmus

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    As a small business owner (partner, actually), I can address this question below:

    "Manuel Lemos" <mlemosacm.org> wrote in message news:3B871DF5.77142696acm.org... > AFAIK, it costs a lot more money to have any start and operate a > e-commerce business than a telephone. What is the motivation to spend > that much money? Internet hype?

    On our website, we use PHP/MySQL to serve up our complete schedule plus juggle event requests from different kinds of people, maintain the look of the site, and serve up audio clips. There's also a large backend component, including maintaining our contact lists (very important for a quartet), a database of all music we know and composers, in order to generate a quick program, our press kit, etc. The PHP end has over 4000 lines of code and MySQL has hundreds of tables. We aren't involved in retail, but that may change.

    To start up the website for my string quartet, there were a few sunk costs. The computer to develop on, the audio equipment to convert audio clips from recordings to streaming content, and then there is the monthly fee for hosting.

    I already owned the computer, as I use it for other things like having a computer in the house :).

    total extra cost: $0

    I bought the audio equipment in order to enable the quartet to master our own CDs

    total relevant cost: $0 (in fact, we saved over what it would cost to go to a big studio)

    The hosting fee is $10/month. The registration fee for 2 domains (chiaraquartet.net/chiaraquartet.com) is $70/year internet access is free through the university we're in residence at. cost: $0

    Total cost: $70+120=$190/year

    Total cost for phone line: $30/month without long distance.

    Total phone cost: $30*12 = $360/year

    There you have it. $360 is most definitely > $190.

    Have we gotten any benefit off of the website? After a year of hosting (and not directly selling anything other than the quartet), several presenters have approached us through the website to offer concerts that paid much more than the cost of maintaining the website. We've gotten the same benefit from having a phone.

    So, it is definitely worth it, even for a business completely unrelated to technology or even retail sales.

    Regards, Greg Beaver

    --
    The Chiara String Quartet
    http://www.chiaraquartet.net
    

    attached mail follows:


    hi >rasmus: "PHP is not marketed the way Java and .NET is. There are no >multi-billion >dollar corporations behind PHP and asking us, and apparently me >personally, to make that happen is unrealistic";

    true, but who can afford java and .net? oracle..., certainly not the small and medium size companies certainly not african companies certainly not south american companies...and i really belive that's where promotional efforts should go; technology awareness is still low there but the potential is huge and we africans are looking just for this: "cheap and reliable technology, that we can learn from" which is exactly what open source is about...

    regards

    attached mail follows:


    Good Morning(CST USA here :)) > > PHP is represented at every important technical conference right alongside > Perl and Python. When you hear someone talk about scripting languages, > they will usually say Perl, Python and PHP. I don't see any problem with > the current state of PHP "marketing" in the technical community.

    Is there any marketing done at various universitys? Beyond the the tech market these are new recruits to the arena. Has there ever been a poll done on where the people have picked up PHP? How many people are exposed thru conferences-educational-facilities-book stores etc?

    Thanks,

    CCMA

    attached mail follows:


    This is an aside ...

    At 02:08 AM 8/25/01 -0400, Cristopher Daniluk wrote: >After following this thread for a while, it seems like there is a lot of >discrepancy between what is "success" and what isn't for PHP. I do not >believe PHP will ever become the ubiquitous web language, if for no other >reason than because it isn't always the right choice for your web based >project.

    Ubiquity comes from having a hammer, and treating everything like a nail. A person uses the tool he's comfortable with, and knows its quirks and shortcuts. I do not believe, despite periodic resurgence, that there will ever be one "master" language. Past candidates were ... Modula, ADA, Smalltalk ... others? Remember the "fifth generation" computers?

    The competent craftsman either uses the right tool, or knows how to quickly bodge something together with what is at hand. Same for programmers, of whatever sex.

    >PHP is already a strong option in many corporate environments. >Really from what I've seen lately, the only reason it loses out to Java, ASP >(uggh), or other similar options is that it is difficult to find a team of >qualified PHP developers. Even if you can get the project off the ground, >the continual maintenance is a problem.

    I believe this does a great injustice to the many fine programmers who have mastered one or more languages, but have not yet encountered PHP. Anyone who has a sound working knowledge of Java, ASP, Python or Perl, and is a competent programmer, would become productive very quickly in PHP. T'aint that difficult. Even a VB user may come to appreciate its brevity and conciseness. <g>

    As for the maintenance issue, that relates more to design and judicious use of comments. It is very easy, particularly with PHP or ASP, to produce pages with a horrible, hard-to-follow commingling of straight HTML and scripting language, so that maintenance, for anyone, is very difficult. It is also easy to end up with obfuscated code in any of the main line, structured, languages.

    Miles Thompson

    >Simply put, I think this means we >have great potential to have long term success, as far as penetrating the >corporate market. As employers start finding the qualified people out there, >and as people re-train/relearn, and as fresh meat comes out, the job market >will sustain our growth. I would say we don't need the multi-billion dollar >backing to be successful as well. Linux, as you particularly mentioned, is >shunned by a lot of suits, but it has grown - and that growth has sustained >itself over the last 10 years, more relevantly the last 4-5. It's starting >to get a little more attractive to suits as bigger and bigger and bigger >companies sponsor or use it. I envision PHP going down this road as well, >though I obviously don't expect the same grandeur that Linux has received. >We will achieve this by doing exactly what Rasmus said - developing a good >product. Though I must digress on the subject of technical conferences. >While they're valuable and by all means we should be there, I believe the >true value will come when people do our work for us - we need to prove to >the world that it is cool to use PHP, and they'll make sure all their >friends are cool too :) > >Regards, > > >Cristopher Daniluk >President & CEO >email: crisdsnet.net >direct: 330/530-2373 > >Digital Services Network, Inc >Unleashing Your Potential >voice: 800/845-4822 >web: http://www.dsnet.net/ > > >-----Original Message----- >From: Rasmus Lerdorf [mailto:rasmusphp.net] >Sent: Saturday, August 25, 2001 1:52 AM >To: Manuel Lemos >Cc: php-generallists.php.net >Subject: Re: [PHP] The future of PHP > > > > So, it is very hard to convince the anybody to bet all the farm in PHP. > > You may have the technical arguments, but is not enough, I'm afraid. > > > > You in particular, may not need to convince others to bet on PHP, but it > > is nothing like that for most people that want to live from software > > development. They have to put up with work/business opportunities that > > the market offers to live from it. So, today, I'm afraid that you > > already still have an hard time to convince people to dedicate only to > > PHP, even those that know and believe PHP is that great. > >PHP is represented at every important technical conference right alongside >Perl and Python. When you hear someone talk about scripting languages, >they will usually say Perl, Python and PHP. I don't see any problem with >the current state of PHP "marketing" in the technical community. > >PHP is not marketed the way Java and .NET is. There are no multi-billion >dollar corporations behind PHP and asking us, and apparently me >personally, to make that happen is unrealistic. Like Linux 5 years ago, >PHP is adopted by the techies and somewhat shunned by the suits because >they haven't read about it in their latest advertisement-sponsored >magazine. > >We can't possibly hope to compete with Sun and Microsoft when it comes to >suit-oriented marketing drivel. What we can do is concentrate on what we >do best. Writing a solid and very focused tool. Building the grassroot >community and being visible at all relevant technical conferences. If we >continue to do this, I see no reason for any dropoff in PHP popularity >which leads directly to more and more corporate acceptance. > >-Rasmus > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Make sure that there is a table named "users" with the same fields as in your local database. use mysql_error() to retrieve the error message for debugging purposes if you're going to use

    Greg

    --
    The Chiara String Quartet
    http://www.chiaraquartet.net
    

    "Brack" <braknettaxi.com> wrote in message news:3B86D43E.30904.77959Elocalhost... > I have a script with combination: > $ins_u = mysql_query("INSERT INTO users (name,email) > VALUES ('$u_name','$u_email')"); > $userid = mysql_insert_id($ins_u); > > It's working fine on local server but now I put it on the web and it > sais: > Warning: Supplied argument is not a valid MySQL-Link resource in > /home/sites/site21/web/incr/submition.inc on line 30 > (which is line above) > Youri >

    attached mail follows:


    I'm not sure if it's right solution but I did this -

    $ins_u = mysql_query("INSERT INTO users (name,email) VALUES ('$u_name','$u_email')"); $userid = mysql_insert_id();

    instead for this -

    $ins_u = mysql_query("INSERT INTO users (name,email) VALUES ('$u_name','$u_email')"); $userid = mysql_insert_id($ins_u);

    And it works perfectly

    Youri On 24 Aug 2001, at 20:51, Richard Lynch wrote:

    > Your mysql_connect is wrong. > > Stop using just to suppress errors, and start doing something useful with > http://php.net/mysql_error like sending it to http://php.net/error_log or > something. > > -- > WARNING richardzend.com address is an endangered species -- Use > ceol-i-e.com > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > ----- Original Message ----- > From: Brack <braknettaxi.com> > Newsgroups: php.general > To: <php-generallists.php.net> > Sent: Friday, August 24, 2001 3:25 PM > Subject: HELP!!! > > > > I have a script with combination: > > $ins_u = mysql_query("INSERT INTO users (name,email) > > VALUES ('$u_name','$u_email')");

    > > $userid = mysql_insert_id($ins_u);

    > > > > It's working fine on local server but now I put it on the web and it > > sais: > > Warning: Supplied argument is not a valid MySQL-Link resource in > > /home/sites/site21/web/incr/submition.inc on line 30

    > > (which is line above) > > Youri > > >

    attached mail follows:


    Is there a way to get PHP to list the names and/or contents of all variables?

    phpinfo() shows environment variables, server variables, and form variables, but doesn't actually show what variables you may have in scope, like $myvar.

    Is there any way to get this information? It would be ridiculously useful for debugging.

    - Ken kenzofree-music.com

    attached mail follows:


    In article <2.76007950305939.92.77233552932741.00012950878663>, kenzofree-music.com (Ken) wrote:

    > Is there a way to get PHP to list the names and/or contents of all variables?

    http://php.net/manual/en/function.get-defined-vars.php

    -- 
    CC
    

    attached mail follows:


    I still get this error. Can someone help me to solve this? MySQL Query Failed. Error 1030: Got error -1 from table handler

    $query = "SELECT * FROM question WHERE answer<>'1' AND id>250 ORDER BY id";

    $result = mysql_query($query) or die('MySQL Query Failed. Error '.mysql_errno().': '.mysql_error());

    $number = mysql_num_rows($result);

    attached mail follows:


    On 25-Aug-2001 Martin Kampherbeek wrote: > I still get this error. Can someone help me to solve this? > MySQL Query Failed. Error 1030: Got error -1 from table handler > > > $query = "SELECT * FROM question WHERE answer<>'1' AND id>250 ORDER BY id"; > > $result = mysql_query($query) or die('MySQL Query Failed. Error > '.mysql_errno().': > '.mysql_error()); > > $number = mysql_num_rows($result); > >

    run: repair table question

    Regards,

    -- 
    Don Read                                       dreadtexas.net
    -- It's always darkest before the dawn. So if you are going to 
       steal the neighbor's newspaper, that's the time to do it.
    

    attached mail follows:


    This is what I get: allach.question repair error The handler for the table doesn't support check/repair

    ----- Original Message ----- From: Don Read <dreadtexas.net> To: Martin Kampherbeek <m.kampherbeekhome.nl> Cc: <php-generallists.php.net> Sent: Saturday, August 25, 2001 9:32 AM Subject: RE: [PHP] Error

    > > On 25-Aug-2001 Martin Kampherbeek wrote: > > I still get this error. Can someone help me to solve this? > > MySQL Query Failed. Error 1030: Got error -1 from table handler > > > > > > $query = "SELECT * FROM question WHERE answer<>'1' AND id>250 ORDER BY id"; > > > > $result = mysql_query($query) or die('MySQL Query Failed. Error > > '.mysql_errno().': > > '.mysql_error()); > > > > $number = mysql_num_rows($result); > > > > > > run: > repair table question > > Regards, > -- > Don Read dreadtexas.net > -- It's always darkest before the dawn. So if you are going to > steal the neighbor's newspaper, that's the time to do it. >

    attached mail follows:


    hi.

    I want to use glabal variable.

    <? global $a;

    ?> but it doesnot work??

    thanks.

    attached mail follows:


    "Nafiseh Saberi" <nsaberiiraninfocenter.net> wrote in message news:200108260756.f7Q7up228742persia.iraninfocenter.net... > > hi. > > I want to use glabal variable. > > <? > global $a; > > ?> > but it doesnot work??

    ... why do you think you need to use global here?

    global is used *in a function* to let it see external variables. You are not in a function, so I don't see why you think you need it.

    attached mail follows:


    I'm sending a huge amount of mails with php. How can I send mail directly to the smtp server? Right now I'm using pipe to send each mail to sendmail. Works fine with about 35 000 mails, but it takes ages to run.

    What would be the smartest way?

    Thanks!

    -----Original Message----- From: Richard Lynch [mailto:ceol-i-e.com] Sent: 25. elokuuta 2001 3:54 To: php-generallists.php.net Subject: [PHP] Re: send mail to mailing list using mail() or smtp?

    > My question - is this going to work for a few thousand emails?

    Depends on your server.

    > What > about 100,000?

    No way.

    > Would it be better to send the mail directly to the > smtp server?

    Yes.

    > Can you foresee any problems?

    Several. The first one is you didn't read the archives or look for pre-existing code to talk to SMTP directly. :-)

    Manuel's upperdesign.com has one, and there are plenty of others. You could roll your own -- I did, so it can't be too tricky. :-)

    Also, at that volume, I think you're going to run into trouble just in talking to the all the SMTP servers. I *BELIEVE* one major speed-up can be achieved by sorting the outgoing emails by their recipient's domains...

    You may want to research how "real" mailing list software deals with this if you actually expect to hit 100K addresses.

    If they're all the same email, you'd be *WAY* better off just interfacing to majordomo, ezmlm, SmartList, or whatever other mailing list software was designed to handle this.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    use php for everything from subscription management to email authoring and use a perl script to effectively send the emails

    At 10:08 25/08/01, Niklas Lampen wrote: >I'm sending a huge amount of mails with php. How can I send mail directly to >the smtp server? Right now I'm using pipe to send each mail to sendmail. >Works fine with about 35 000 mails, but it takes ages to run. > >What would be the smartest way? > > >Thanks! > > >-----Original Message----- >From: Richard Lynch [mailto:ceol-i-e.com] >Sent: 25. elokuuta 2001 3:54 >To: php-generallists.php.net >Subject: [PHP] Re: send mail to mailing list using mail() or smtp? > > > > My question - is this going to work for a few thousand emails? > >Depends on your server. > > > What > > about 100,000? > >No way. > > > Would it be better to send the mail directly to the > > smtp server? > >Yes. > > > Can you foresee any problems? > >Several. The first one is you didn't read the archives or look for >pre-existing code to talk to SMTP directly. :-) > >Manuel's upperdesign.com has one, and there are plenty of others. You could >roll your own -- I did, so it can't be too tricky. :-) > >Also, at that volume, I think you're going to run into trouble just in >talking to the all the SMTP servers. I *BELIEVE* one major speed-up can be >achieved by sorting the outgoing emails by their recipient's domains... > >You may want to research how "real" mailing list software deals with this if >you actually expect to hit 100K addresses. > >If they're all the same email, you'd be *WAY* better off just interfacing to >majordomo, ezmlm, SmartList, or whatever other mailing list software was >designed to handle this. > >-- >WARNING richardzend.com address is an endangered species -- Use >ceol-i-e.com >Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm >Volunteer a little time: http://chatmusic.com/volunteer.htm > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Hi,

    I had this problem. If you say that even without the getimagesize() it is not being uploaded. Then try this. If you declared $the_image in the <input type="file" name="the_image"> try using $the_image_name. From the manual this is what I figured out and it works (on linux)

    In PHP, the following variables will be defined within the destination script upon a successful upload, assuming that register_globals is turned on in php.ini. If track_vars is turned on, they will also be available in PHP within the global array $HTTP_POST_VARS. Note that the following variable names assume the use of the file upload name 'userfile', as used in the example above:

    * $userfile - The temporary filename in which the uploaded file was stored on the server machine. * $userfile_name - The original name or path of the file on the sender's system.

    Adrian

    On Fri, 24 Aug 2001, Joseph Koenig wrote:

    > Sorry, I know file uploads are asked about all the time... > > I'm having an odd problem on a WinNT system. > > When I try to do my upload, I test the file to see the type of it: > $image_info = GetImageSize($the_image); > > However, that line gives me: > Warning: getimagesize: Unable to open > '/Joe1/Desktop%20Folder/device_eval.gif' for reading. in > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > line 22 > > At first I had thought this would be a permissions issue, but the file > it can't open is the one being uploaded. If I echo the file being > uploaded, i get: > Image Name: /Joe1/Desktop%20Folder/device_eval.gif > > I swear I looked at the archive and I've done this plenty of times > before (but on Unix). This project is being done on NT, which I'm fairly > unfamiliar with though. Any help would be much appreciated. > > Thanks, > > Joe >

    attached mail follows:


    Hi,

    I got the answer from one earlier mail. I used nl2br(). It does just what I want.

    Adrian

    On Fri, 24 Aug 2001, Adrian D'Costa wrote:

    > Hi, > > I am creating a program for a newspaper to publish their article > online. There is a form what allows them to cut and past from their > editors (word, pagemaker, staroffice). The data is being entered > correctly. > > The problem is when I try and get the data from the table the whole matter > scrolls off the screen. I need it to be formatted as the client cut and > pastes it (headings, paras, etc). Below is my table and part of my > program. > > mysql> desc newsarticles; > +----------+--------------+------+-----+------------+----------------+ > | Field | Type | Null | Key | Default | Extra | > +----------+--------------+------+-----+------------+----------------+ > | id | int(5) | | PRI | NULL | auto_increment | > | nid | int(5) | | MUL | 0 | | > | headline | varchar(100) | | | | | > | article | mediumtext | | | | | > | date | date | | | 0000-00-00 | | > | imgpath | varchar(200) | YES | | NULL | | > +----------+--------------+------+-----+------------+----------------+ > > <html> > <head> > <title><? echo $row->headline; ?></title> > </head> > > <body bgcolor="white"> > <h1 align="center"><? echo $row->headline; ?></h1> > <h3 align="center"><? echo $row->description; ?></h3> > <table width="600" border="1"> > <tr> > <td valign="top" width="70%"><font > face="Arial" size="2" color="blue"><strong><? echo $sd ."-". $sm > ."-". $sy; ?></strong><br><pre><? echo $row->article; ?></pre></font></td> > <td valign="top" width="30%"><img src="<? echo > $row->imgpath; ?>" <? echo $iwh[3]; ?> ></td> > </tr> > </table> > </body> > </html> > > > I use the <pre></pre> to display with the line breaks. If I take of the > <pre> it does not wrap but does not give the breaks. To my thinking maybe > while entering the data we should give break the lines physically. This > is part of my entry form. > > <tr> > <td><font face="Arial" size="2">HeadLine</font></td> > <td><input type="text" name="headline" size="30"> > </tr> > > <tr> > <td><font face="Arial" size="2">Article</font></td> > <td><textarea name="article" cols="60" rows="10"></textarea></td> > </tr> > > <tr> > <td><font face="Arial" size="2">Upload Image</font></td> > <td><input type="file" name="userfile" size="30" wrap=ON></td> > </tr> > <tr align="center"> > <td colspan="2"><input type="submit" value="Submit"></td> > </tr> > > > How do I get the text not to wrap and to preserve the formatting given by > the client. > > Adrian > >

    attached mail follows:


    you must change the session setting to get ride of it. option>session option..>emulation>logical column>

    you must increase the number of it.

    attached mail follows:


    hi. I use global in this form:

    <? global $a; $a=strtotime('now'); . . . echo $a; but in this line dont echo $a I dont know why??

    thanks.

    attached mail follows:


    Look in the manual:

    language.variables.scope.html

    'global' is meant to use inside a function for accessing vars that are not in a function (the main part).

    > I use global in this form: > > <? > global $a; > $a=strtotime('now'); > . > . > . > echo $a; but in this line dont echo $a

    Using global this way does not make sense. Or you are not telling us about functions on this page.

    Chris H.

    -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------

    attached mail follows:


    you must define port or connection. for example in postgres:

    $conn = pg_connect(" host=localhost dbname=big user=postgres password=123"); result = pg_exec($conn,"select * from personel where name='$ID' and date='now'");

    I wish your problem solve. nafiseh.

    attached mail follows:


    Has anyone out there used ImageCopyResampled()? This function was added in PHP 4.0.6 and requires GD 2.0.1 or later. So I haven't been able to try it out yed.

    I'm just wondering if it will deliver better image quality when you use it to render a shrunk-version of a graphic than ImageCopyResized(), which has been available for some time.

    Thanks,

    -D

    attached mail follows:


    Hi All,

    I'm running Suse Linux 7.1, Kernet 2.4

    I have downloaded and installed the latest version of Apache and it's up and running OK

    It is installed in :

    /usr/local/apache

    To Install PHP, i have downloaded the Source and put it in:

    /usr/local/src/php-4.0.6

    To Install PHP I have done this ( ihave specified the location of apxs as Suse Installed an Apache server also, but I want the one I've installed to /usr/local/apache):

    ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs

    Then I type:

    make

    make install

    Then I edit /usr/local/apache/conf/httpd.conf

    The required lines ARE there, ie.

    LoadModule php4_module libexec/libphp4.so AddModule mod_php4.c

    AddType application/x-httpd-php .php

    I have also copied /usr/local/src/php-4.0.6/php.ini-dist to /usr/local/lib/php.ini

    Now the problem : I then go to start my Server as follows:

    cd /usr/local/apache/bin ./httpd

    BUT Then I get this:

    "Syntax error on line 236 of /usr/local/apache/conf/httpd.conf: API module structure `php4_module' in file /usr/local/apache/libexec/libphp4.so is garbled - perhaps this is not an Apache module DSO? "

    Line 236 of /usr/local/apache/conf/httpd.conf is :

    LoadModule php4_module libexec/libphp4.so

    And If I check the file type of libphp4.so as follows: cd /usr/local/apache/libexec/ file libphp4.so

    I get : "libphp4.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not stripped "

    So....Can anybody Help ???

    I don't have MySQL installed yet - do I need to have that first ???

    Thanks,

    Martin Stephenson.

    attached mail follows:


    I am new to PHP (probably the question itself shows it...).

    I am setting up a cookie stating the language the user wishes to have the site written with. No problem up to here.

    Next time the user goes back to the site I want to read the cookie and, provided it exists, set up the site with the requested language.

    How can I retrieve the existing value of the cookie? (My cookie looks "language","spanish or english or german","time()+1 year").

    Thank you for your support.

    Pere

    attached mail follows:


    on 8/25/01 6:20 AM, Pere at alvitroniaretemail.es wrote:

    > I am setting up a cookie stating the language the user wishes to have the > site written with. No problem up to here. > > Next time the user goes back to the site I want to read the cookie and, > provided it exists, set up the site with the requested language. > > How can I retrieve the existing value of the cookie? (My cookie looks > "language","spanish or english or german","time()+1 year").

    $HTTP_COOKIE_VARS["language"]

    if register_globals is on, you should be able to use $language

    mike

    > Thank you for your support. > > Pere > >

    -- mike cullerton

    attached mail follows:


    Thanks, Mike, for your help. Best regards, Pere

    "Mike Cullerton" <php-lbakednotfried.com> escribió en el mensaje news:B7AD1A0B.12C33%php-lbakednotfried.com... > on 8/25/01 6:20 AM, Pere at alvitroniaretemail.es wrote: > > > I am setting up a cookie stating the language the user wishes to have the > > site written with. No problem up to here. > > > > Next time the user goes back to the site I want to read the cookie and, > > provided it exists, set up the site with the requested language. > > > > How can I retrieve the existing value of the cookie? (My cookie looks > > "language","spanish or english or german","time()+1 year"). > > $HTTP_COOKIE_VARS["language"] > > if register_globals is on, you should be able to use $language > > mike > > > Thank you for your support. > > > > Pere > > > > > > > -- mike cullerton > >

    attached mail follows:


    yeah... but other then returning the image, can it do stuff with DB and all?

    BTW.. I saw how it's done... it's Javascript all the way... and there's no call to a php script to switch the image...

    At 03:35 23/8/2001 +0100, you wrote: >See this is the lack of my explaining powers :) > >U click the image, and JScript loads a new image named (image.php) this is >infact a php script which returns a image... >So it like doing ><img src="myscript.php"> >where myscript.php will do some GD or something and return a image. > >That make sense? > >Bramp >----- Original Message ----- >From: "Christian Dechery" <cdecherybrfree.com.br> >To: "Andrew Brampton" <andrewbramp.freeserve.co.uk> >Sent: Wednesday, August 22, 2001 12:57 PM >Subject: Re: [PHP] AudioGalaxy-like stuff > > > > At 04:22 22/8/2001 +0100, you wrote: > > >When you click on the image it reloads the image which is really a PHP >page > > >which returns a image. > > > > > >That way when it loads the image, it can actually run some PHP and do > > >whatever is required, once done it returns the approiate image > > > > > >That make sense? > > > > > > well, it could, if PHP was client-side... but it isn't... how is it gonna > > call a PHP function to return something without having to call a PHP >script > > to do that? Even if it is on the same script the page would still have to > > be reloaded... right? > > Or wrong? Can u give me some dumb example? > > > > ____________________________ > > . Christian Dechery (lemming) > > . http://www.tanamesa.com.br > > . Gaita-L Owner / Web Developer > > > > > >

    ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer

    attached mail follows:


    well i've not looked how its done... but the PHP script that generates a image, will do DB stuff as well..

    But I will go look how its done After looking its just how I said...

    They use a JSCript call to load a new image.. namly: www.AudioGalaxy.com/satQueue/" + SongID + "?" + SID (Where SongID & SID are used for something)

    Where this is actually calling a PHP script, that returns a image to be displayed while also doing some DB stuff...

    Does this clear it up for you?

    Andrew

    ----- Original Message ----- From: "Christian Dechery" <cdecherybrfree.com.br> To: "Andrew Brampton" <andrewbramp.freeserve.co.uk> Cc: <php-generallists.php.net> Sent: Saturday, August 25, 2001 1:44 PM Subject: Re: [PHP] AudioGalaxy-like stuff

    > yeah... but other then returning the image, can it do stuff with DB and all? > > BTW.. I saw how it's done... it's Javascript all the way... and there's no > call to a php script to switch the image... > > At 03:35 23/8/2001 +0100, you wrote: > >See this is the lack of my explaining powers :) > > > >U click the image, and JScript loads a new image named (image.php) this is > >infact a php script which returns a image... > >So it like doing > ><img src="myscript.php"> > >where myscript.php will do some GD or something and return a image. > > > >That make sense? > > > >Bramp > >----- Original Message ----- > >From: "Christian Dechery" <cdecherybrfree.com.br> > >To: "Andrew Brampton" <andrewbramp.freeserve.co.uk> > >Sent: Wednesday, August 22, 2001 12:57 PM > >Subject: Re: [PHP] AudioGalaxy-like stuff > > > > > > > At 04:22 22/8/2001 +0100, you wrote: > > > >When you click on the image it reloads the image which is really a PHP > >page > > > >which returns a image. > > > > > > > >That way when it loads the image, it can actually run some PHP and do > > > >whatever is required, once done it returns the approiate image > > > > > > > >That make sense? > > > > > > > > > well, it could, if PHP was client-side... but it isn't... how is it gonna > > > call a PHP function to return something without having to call a PHP > >script > > > to do that? Even if it is on the same script the page would still have to > > > be reloaded... right? > > > Or wrong? Can u give me some dumb example? > > > > > > ____________________________ > > > . Christian Dechery (lemming) > > > . http://www.tanamesa.com.br > > > . Gaita-L Owner / Web Developer > > > > > > > > > > > ____________________________ > . Christian Dechery (lemming) > . http://www.tanamesa.com.br > . Gaita-L Owner / Web Developer > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    I am a C programmer, looking to migrate some code to PHP (Unusual, but my colleagues request it).

    Can someone tell me the size (in bytes) of the type int in PHP.

    I need a 16 bit (2 byte) storage unit (I use a lot of bitwise operations)

    Thanx...

    attached mail follows:


    "Saurabh Kapoor" <saurabh.kbbtinternet.com> wrote in message news:001901c12d63$b1b62100$9e2823d9killer666... > I am a C programmer, looking to migrate some code to PHP (Unusual, but my > colleagues request it). > > Can someone tell me the size (in bytes) of the type int in PHP. > > I need a 16 bit (2 byte) storage unit (I use a lot of bitwise operations)

    Try this:

    <?php

    $val = 2; $last = 1; $pow = 1;

    echo "<pre>\n(0) 1\n(1) 2"; while ($val > $last) { $last = $val; $val = $val << 1; $pow++;

    echo "\n($pow) $val"; } echo "</pre>"; ?>

    Running PHP 4.0.6 on WinMe, I get 32 bits.

    attached mail follows:


    hi. I write program with php,then for build table I must to close it, write html tag and then open php and continue,...

    I ask time in one line and in another line I want to show it. but I want the first line doesnot run in all condition.

    I think my problem will solve with static variables.??? thanks.

    attached mail follows:


    Hi Joe,

    GMT isn't affected by daylight savings (altough in the UK we are using British Summer Time at the moment, which is GMT +1), so that's the constant you can work from if you're not experiencing daylight savings schemes where you are. I have written out an example for you below.

    We get the Y-m-d H:i:s format of time using gmdate() (which Mysql likes). We convert that lot to a timestamp. The function I've created takes two arguments: whether to add or take time from the timestamp that is generated, and the offset in hours. So, to emulate what Mysql's now() function does, you can do something like this

    <?

    $now = GenerateOffset("-", "6"); // takes off 6 hours. $query = mysql_query("INSERT INTO table (datetime) VALUES ('$now')", $connection);

    ?>

    And you should get correct datetime formats for your timezone into your table (providing you have put your correct offset from GMT).

    <?

    function GenerateOffset($plusminus, $offset) {

    $datetime = gmdate("Y-m-d H:i:s"); list($date, $time) = explode(" ", $datetime); list($year, $month, $day) = explode("-", $date); list($hour, $minute, $second) = explode(":", $time);

    $timestamp = mktime($hour, $minute, $second, $month, $year, $day);

    if ($plusminus == "+") { $newtime = $timestamp + (3600 * $offset); } else { $newtime = $timestamp - (3600 * $offset); }

    $newdate = date("Y-m-d H:i:s", $newtime);

    return $newdate; }

    ?>

    Hope this helps.

    James

    "Joe Sheble )" <JustForMailingListswizaerd.com> wrote in message > Alas, I don't have this luxury since it's not my server, but one that is > hosted with a web hosting provider. They control the setup and > configuration of the machines... since it's a shared server I doubt I'll > convince them to set the timezone to my location, thus throwing everyone > else on the same server out of whack... > > I can use the putenv() function though for use in PHP and then when saving > the date and time into mySQL actually use the PHP date and time functions > instead of the mySQL Now() function... > > Where would I find the TZ codes to use for my area? > > thanx > > > -----Original Message----- > > From: Don Read [mailto:dreadtexas.net] > > Sent: Friday, August 24, 2001 8:39 PM > > To: Joe Sheble (Wizaerd) > > Cc: General PHP List > > Subject: RE: [PHP] local time v.s. server time > > > > > > > > On 25-Aug-2001 Joe Sheble \(Wizaerd\) wrote: > > > My website is hosted with a provider, and there is a three hour > > difference > > > in timezones, so when saving date and times to the database, > > they reflect > > > the server time and not my own local time. The clincher is I > > know I could > > > do some time math and just substract 3 hours, but I live in > > Arizona, so we > > > do not go through daylight savings time. So right now it's a three hour > > > difference, but when the time change happens, I'll only be two > > hours behind. > > > > > > Because of this, what is the best method to get my local date and time > > > entered into the database instead of the server date and time?? > > > > > > > In my case the server is in Atlanta, but I have to sync with my > > credit-card > > processor on the left coast. > > > > So first i start the database (MySQL) on Pacific time with: > > ----- > > TZ=PST8PDT > > export TZ > > /usr/local/bin/safe_mysqld --user=mysql > /dev/null & > > > > ---- > > To make PHP date/time functions jive, during initialization: > > > > > > putenv('TZ=PST8PDT'); // Server on Pacific time > > > > No matter that i'm in Texas (CST), everything is now reported on Pac time. > > > > Regards, > > -- > > Don Read dreadtexas.net > > -- It's always darkest before the dawn. So if you are going to > > steal the neighbor's newspaper, that's the time to do it. > > > > >

    attached mail follows:


    Thanx James for your answers... perhaps I'm missing a piece of the puzzle, but here is how I corrected or fixed it.

    In my included file that gets included in every app and every page, I placed: putenv( "TZ=America/Phoenix" );

    and all my dates are now local time. SO saving to a mySQL database now I merely pass in: $now = date( "Y-m-d H:i:s" ); $result = mysql_query( "INSERT INTO table ( datetime ) values( '$now' )", $dbConn );

    If I ever distribute this app (doubtful) I'll include a fairly extensive listing of timezones so the putenv() could be appropriately changed... the list I found and would most likely include is here: http://www.theprojects.org/dev/zone.txt

    > -----Original Message----- > From: James, Yz [mailto:liljimbtconnect.com] > Sent: Saturday, August 25, 2001 8:11 AM > To: php-generallists.php.net > Subject: Re: [PHP] local time v.s. server time > > > Hi Joe, > > GMT isn't affected by daylight savings (altough in the UK we are using > British Summer Time at the moment, which is GMT +1), so that's > the constant > you can work from if you're not experiencing daylight savings > schemes where > you are. I have written out an example for you below. > > We get the Y-m-d H:i:s format of time using gmdate() (which Mysql likes). > We convert that lot to a timestamp. The function I've created takes two > arguments: whether to add or take time from the timestamp that is > generated, > and the offset in hours. So, to emulate what Mysql's now() function does, > you can do something like this > > <? > > $now = GenerateOffset("-", "6"); // takes off 6 hours. > $query = mysql_query("INSERT INTO table (datetime) VALUES ('$now')", > $connection); > > ?> > > And you should get correct datetime formats for your timezone into your > table (providing you have put your correct offset from GMT). > > > <? > > function GenerateOffset($plusminus, $offset) { > > $datetime = gmdate("Y-m-d H:i:s"); > list($date, $time) = explode(" ", $datetime); > list($year, $month, $day) = explode("-", $date); > list($hour, $minute, $second) = explode(":", $time); > > $timestamp = mktime($hour, $minute, $second, $month, $year, $day); > > if ($plusminus == "+") { > $newtime = $timestamp + (3600 * $offset); > } else { > $newtime = $timestamp - (3600 * $offset); > } > > $newdate = date("Y-m-d H:i:s", $newtime); > > return $newdate; > } > > ?> > > Hope this helps. > > James > > "Joe Sheble )" <JustForMailingListswizaerd.com> wrote in message > > Alas, I don't have this luxury since it's not my server, but one that is > > hosted with a web hosting provider. They control the setup and > > configuration of the machines... since it's a shared server I doubt I'll > > convince them to set the timezone to my location, thus throwing everyone > > else on the same server out of whack... > > > > I can use the putenv() function though for use in PHP and then > when saving > > the date and time into mySQL actually use the PHP date and time > functions > > instead of the mySQL Now() function... > > > > Where would I find the TZ codes to use for my area? > > > > thanx > > > > > -----Original Message----- > > > From: Don Read [mailto:dreadtexas.net] > > > Sent: Friday, August 24, 2001 8:39 PM > > > To: Joe Sheble (Wizaerd) > > > Cc: General PHP List > > > Subject: RE: [PHP] local time v.s. server time > > > > > > > > > > > > On 25-Aug-2001 Joe Sheble \(Wizaerd\) wrote: > > > > My website is hosted with a provider, and there is a three hour > > > difference > > > > in timezones, so when saving date and times to the database, > > > they reflect > > > > the server time and not my own local time. The clincher is I > > > know I could > > > > do some time math and just substract 3 hours, but I live in > > > Arizona, so we > > > > do not go through daylight savings time. So right now it's a three > hour > > > > difference, but when the time change happens, I'll only be two > > > hours behind. > > > > > > > > Because of this, what is the best method to get my local > date and time > > > > entered into the database instead of the server date and time?? > > > > > > > > > > In my case the server is in Atlanta, but I have to sync with my > > > credit-card > > > processor on the left coast. > > > > > > So first i start the database (MySQL) on Pacific time with: > > > ----- > > > TZ=PST8PDT > > > export TZ > > > /usr/local/bin/safe_mysqld --user=mysql > /dev/null & > > > > > > ---- > > > To make PHP date/time functions jive, during initialization: > > > > > > > > > putenv('TZ=PST8PDT'); // Server on Pacific time > > > > > > No matter that i'm in Texas (CST), everything is now reported on Pac > time. > > > > > > Regards, > > > -- > > > Don Read dreadtexas.net > > > -- It's always darkest before the dawn. So if you are going to > > > steal the neighbor's newspaper, that's the time to do it. > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > >

    attached mail follows:


    That will stop fread from producing errors. So, if you don't want to see any error's from fread, put a & in front of it. This can also be done with other functions:

    $db = &mysql_select_db("dbname");

    Tyler Longren

    On Sat, 25 Aug 2001 15:03:49 +1000 "GaM3R" <gamroutworld.cx> wrote:

    > can anyone explain to me exactly what this would do differently? > > $data = fread($fp, filesize($file)); > > $data = &fread($fp, filesize($file)); > > ... > > > Cameron > outworld.cx >

    attached mail follows:


    "Tyler Longren" <tyler.longrenmidiowa.net> wrote in message news:20010825105552.1c393f2b.tyler.longrenmidiowa.net... > > On Sat, 25 Aug 2001 15:03:49 +1000 > "GaM3R" <gamroutworld.cx> wrote: > > > can anyone explain to me exactly what this would do differently? > > > > $data = fread($fp, filesize($file)); > > > > $data = &fread($fp, filesize($file)); > > That will stop fread from producing errors. So, if you don't want to see > any error's from fread, put a & in front of it. This can also be done > with other functions: > > $db = &mysql_select_db("dbname");

    You're thinking of the error-control operator. '=&' is 'get a reference to the returned array'.

    attached mail follows:


    Hello,

    I want to create a script that would read the contents of an HTML file (I can use Snoopy class for that) and then, download some respective type of files from a page (let's say .zip files)...

    Any ideas how do I start or if anyone create something like that?

    Thank you and please, reply to romulo_roberto_pereirayahoo.com

    Rom

    __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/

    attached mail follows:


    Hi,

    I know, the topic looks freaky, let me explain. I have a formular with many input fields called for example "firm[0]", "firm[1] etc. Now I submit and have the values of this variables. But I have so many input fields, that I want to generate the variables by reading the names from a mysql table. I have an table with a field called "firm". Now I read the name "firm" from the table in a variable called $field, put in in a loop an do like this: echo "$" . $field[$counter]; Now I have back my "$firm[0]". But how can I generate from this a variable to get back my value of this?

    I hope you understand me, great thanks for any help, because I get nearly crazy from this problem.

    best regards, Christian Springub

    attached mail follows:


    http://www.php.net/manual/de/language.variables.variable.php

    On Fri, 24 Aug 2001, Christian Springub wrote:

    > Hi, > > I know, the topic looks freaky, let me explain. > I have a formular with many input fields called for example "firm[0]", > "firm[1] etc. > Now I submit and have the values of this variables. But I have so many > input fields, that I want to generate the variables by reading the > names from a mysql table. > I have an table with a field called "firm". Now I read the name "firm" > from the table in a variable called $field, put in in a loop an do > like this: echo "$" . $field[$counter]; Now I have back my "$firm[0]". > But how can I generate from this a variable to get back my value of > this? > > I hope you understand me, great thanks for any help, because I get > nearly crazy from this problem. > > best regards, > Christian Springub > >

    attached mail follows:


    Hi,

    >http://www.php.net/manual/de/language.variables.variable.php Thanks!! Thats really embarrassed me :) So simple and I don't get it for so many hours.

    Greetings, Christian Springub

    attached mail follows:


    Hi

    Can someone explain to me what "$i % 2 ? 0:" means or what it does step by step? I was looking in PHP docs for "?" and ":" and didn't find it there. I use this line in my script to assign different value for $bgcolor variable to color rows in result, but I want to understand what does it mean.

    Thank you in advance,

    Youri <>< <>< <>< <>< God is our provider ><> ><> ><> ><> http://www.body-builders.org

    attached mail follows:


    it's an if/else shortcut.

    the part before the '?' is tested. '$i % 2' in your case.

    the part after the '?' is returned if the test evals to true. '0' in your case.

    the part after the ':' is returned if the test evels to false. i've never tried it with nothing after the ':' like in your case. guess it could be the same as an if without an else.

    hope this helps, mike

    on 8/25/01 10:38 AM, BRACK at braknettaxi.com wrote:

    > Hi > > Can someone explain to me what "$i % 2 ? 0:" means or what it > does step by step? I was looking in PHP docs for "?" and ":" and > didn't find it there. I use this line in my script to assign different > value for $bgcolor variable to color rows in result, but I want to > understand what does it mean. > > Thank you in advance, > > Youri > <>< <>< <>< <>< God is our provider ><> ><> ><> ><> > http://www.body-builders.org

    -- mike cullerton

    attached mail follows:


    "Mike Cullerton" <php-lbakednotfried.com> wrote in message news:B7AD32BC.12C46%php-lbakednotfried.com... > it's an if/else shortcut. > > the part before the '?' is tested. '$i % 2' in your case. > > the part after the '?' is returned if the test evals to true. '0' in your > case.

    Documentation at http://www.php.net/manual/en/language.operators.comparison.php

    Think of ( A ? B : C ) as

    if (A) return B; else return C;

    For example, $a = 2; echo "The value of a is" . ($a == 2 ? "" : " not" ) . " 2";

    attached mail follows:


    I need to strip line break characters (or whatever the character is that results from users hitting their "enter" key inside a TEXTAREA form input) from a string. These characters will appear anywhere in the string, not just at the end. In perl, the regex would look something like this...

    $a="a\nb\nc\nd\n\n\n"; $b=$/; $a =~ s/$b//g; # produces "abcd"

    but i'm a newbie and i don't know how I can translate this to PHP syntax to do the same thing. Any help is appreciated!

    Thanks!

    providing the finest in midget technology