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: Sat Jan 04 2003 - 00:20:30 CST

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

    php-general Digest 4 Jan 2003 06:20:30 -0000 Issue 1802

    Topics (messages 130139 through 130208):

    Re: File Modification Date/Time
            130139 by: Christopher J. Crane

    Re: Possible bug with PHP v4.1.1 and bits?
            130140 by: Tom Rogers

    Re: Baffling output
            130141 by: Ford, Mike [LSS]
            130144 by: Chris Shiflett

    Re: Session Question
            130142 by: Kevin Stone
            130143 by: Ford, Mike [LSS]
            130145 by: ed.home.homes2see.com
            130146 by: Michael J. Pawlowsky

    Variables that persist through reload?
            130147 by: David Chamberlin
            130148 by: Joseph W. Goff
            130149 by: Kevin Stone
            130150 by: Kevin Stone
            130151 by: David Chamberlin

    One more form question
            130152 by: David Chamberlin
            130153 by: Kevin Stone

    Excel to MySQL
            130154 by: Joe LoMoglio
            130156 by: Richard Baskett
            130157 by: Michael J. Pawlowsky
            130175 by: Joe LoMoglio
            130177 by: Sam

    Hello and help
            130155 by: Todd Barr
            130158 by: Richard Baskett
            130159 by: Joseph W. Goff

    Newbie Help
            130160 by: Erich Kolb
            130201 by: Jason Wong

    PHP post size question
            130161 by: David Jeffress
            130163 by: Michael J. Pawlowsky
            130200 by: Jason Wong

    Re: include/require vs performance
            130162 by: R. Z.

    Create Online Test Program
            130164 by: Devin Atencio
            130166 by: Michael J. Pawlowsky
            130171 by: Michael J. Pawlowsky
            130178 by: Hugh Danaher

    error
            130165 by: Ysrael Guzmán

    please help me, y have a error
            130167 by: Ysrael Guzmán

    Help Needed
            130168 by: Pushpinder Singh Garcha
            130170 by: Michael J. Pawlowsky

    Re: How to attach a file to mail()
            130169 by: Manuel Lemos

    query join 2 databases? or match up arrays?
            130172 by: Jeff Bluemel
            130173 by: Philip Hallstrom
            130174 by: Michael J. Pawlowsky
            130176 by: Jeff Bluemel
            130181 by: Philip Hallstrom
            130184 by: Jeff Bluemel
            130185 by: Michael J. Pawlowsky
            130186 by: Philip Hallstrom
            130195 by: Jeff Bluemel

    Sessions and AOL
            130179 by: Gerard Samuel
            130182 by: Mark Charette
            130194 by: Gerard Samuel

    Still executing afte die()?
            130180 by: Leif K-Brooks
            130197 by: Rick Emery
            130198 by: Leif K-Brooks
            130199 by: Mike Mannakee
            130205 by: Jason Wong
            130206 by: Leif K-Brooks
            130207 by: Leif K-Brooks

    Re: parse error
            130183 by: Greg Beaver

    Re: [PEAR-DEV] Announcing open CVS for phpDocumentor project
            130187 by: Jesus M. Castagnetto

    locally enabling register_globals?
            130188 by: Michael Greenspon
            130189 by: Justin French
            130190 by: Michael J. Pawlowsky
            130192 by: Michael Greenspon
            130202 by: electroteque

    PHP running perl running java OR PHP running java?
            130191 by: Sam
            130193 by: Andrew Brampton

    Bit of a logical question (what values to use for a graph)
            130196 by: Jeff Lewis

    true ip tracking
            130203 by: electroteque
            130204 by: Jason Wong

    exec() not exec-ing?
            130208 by: gilrain

    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:


    Doyou know how to compare time. I would like to get the difference in time
    from now to when the file was last accessed.

    I was thinking something like this:
    <?PHP
    $DirToCheck = "tempdata/";
    echo "$Now<br><br>\n";
    $TimeNow = time();
    if ($handle = opendir($DirToCheck)) {
        while (false !== ($file = readdir($handle))) {
      $FileTimeUnix = fileatime($DirToCheck . $file);
      $TimeDiff = $TimeNow - $FileTimeUnix;
            echo "&nbsp;&nbsp;$file - Last accessed: " . date("F d Y H:i:s.",
    fileatime($DirToCheck . $file)) . " - $TimeDiff<br>\n";
       if($TimeDiff > 10000) { unlink($DirToCheck . $file); }
      $TimeDiff = 0;
         }
        closedir($handle);
     }
    ?>

    "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message
    news:3E15BAD1.1020104webglobe.sk...
    > you must prepend $DirToCheck to $file:
    >
    > filemtime($DirToCheck . $file)
    >
    >
    >
    > Christopher J. Crane wrote:
    >
    > >I am trying to parse through a directory and get the modification dates
    of
    > >the file.
    > >
    > ><?PHP
    > >$DirToCheck = "tempdata/";
    > >if ($handle = opendir($DirToCheck)) {
    > > while (false !== ($file = readdir($handle))) {
    > > echo "&nbsp;&nbsp;$file - Last Modified: " . date("F d Y H:i:s.",
    > >filemtime($file)) . "<br>\n";
    > > }
    > > closedir($handle);
    > > }
    > >?>
    > >
    > >All the files are coming back with a date of December 31 1969 19:00:00.
    What
    > >am I doing wrong? The next step is I want to check if the file is older
    than
    > >30 minutes and if so, I want to delete it. How would I go about that?
    > >
    > >
    > >
    > >
    > >
    > >
    >

    attached mail follows:


    Hi,

    Saturday, January 4, 2003, 3:23:37 AM, you wrote:
    FML> -----Original Message-----
    FML> From: Daevid Vincent
    FML> To: php-generallists.php.net

    FML> echo "action = ".$_POST[action]."<BR>";
    FML> if ($_POST[action] == "1" || $_POST[action] == "0")
    FML> echo = "UPDATE Company SET Enabled = ".!(intval($_POST[action]))."
    FML> WHERE CompanyID = $id";

    FML> I cannot figure out how to simply make the 0 and 1 invert or negate or
    FML> toggle as it were.
    FML> --------------------------

    FML> echo = "UPDATE Company SET Enabled = ".(1-$_POST[action]) ...

    FML> Cheers!

    FML> Mike

    In mysql you can use the invert (tilde)operator like this:

    select 5 & ~1 returns 4 so you could do

    "UPDATE Company SET Enabled = (Enabled & ~1)" which will toggle bit 1 of
    Enabled.

    (Untested :)

    -- 
    regards,
    Tom
    

    attached mail follows:


    -----Original Message----- From: Steve Keller To: php-generallists.php.net

    At 1/3/2003 12:25 AM, Lightfirst wrote:

    Can someone explain to me why the loop that counts to 99 appears before the 5 by 5 grid in the following php code?

    Yes.

    ## else { ## echo "<td align=\"center\" valign=\"middle\" width=\"15%\" height=\"77\" border=\"1\" bordercolor=\"#000000\">"; ## echo "<div align=\"center\"><font size=\"1\"></font></div>"; ## echo "Hello" ; $i++; ## } //for else

    You start the <TD> tags, but whenever your conditional echoes "Hello," you're not echoing the </TD>. And when you come out of your loop, you never close your <TABLE> tag. I hope you also realize that you're opening and closing that <DIV> and <FONT> without putting the "Hello" inside of it.

    Here's a good tip someone gave me when I first started learning PHP: when you're dealing with HTML, it's a good idea to use \n at the end of your echoed lines and \t's at the beginnings to create staggered indentations, this makes it a little easier to read when you're testing the output. --------------------------

    When you have large blocks of (almost) pure HTML like this, I usually reckon it's a better bet still to jump out of PHP mode completely, and just write your HTML inline -- then it's *much* easier to see if it's malformed!

    A couple of other observations:

    * In "if ($c==0 || $c%7==0)", the first test is completely redundant, since 0 % anything == 0

    * Most of your <td> tag is the same in all three branches, so I'd strip that out and echo it before the first "if".

    * Speaking purely personally here, but whenever I see PHP code full of comments explaining what all its closing }s are for, I wonder why on earth the author doesn't just get into using the :-style syntax for block structures.

    So my take on this would go something like:

    <table border="1" align="center" width="100%" bgcolor="#FFFFFF" bordercolor="#FFFFFF"> <tr> <?php for ($r=0; $r<5; $r++): for ($c=0; $c<7; $c++): ?> <td align="center" valign="middle" height="77" bordercolor="#000000" width=<?php if ($c%7==0): ?>"15%"></td> <?php elseif ($c%6==0): ?>"14%"></td> </tr> <tr> <?php else: ?>"15%" border="1"> <div align="center"><font size="1"> Hello <?php echo $i++ ?></font></div> </td> <?php endif; // ($c) endfor; // ($c) endfor; // ($r) ?> </tr> </table>

    <?php for ($i=1; $i<100; $i++): echo "$i<br>\n"; endfor; ?>

    Yes, it is a slightly different way of thinking to code like this, and it may not suit you -- but I find it more convenient for pages that have a largish percentage of actual HTML on them. (And if you have an editor that can do syntax highlighting in different ranges of colours for HTML and PHP, it makes it really easy to pick one out from the other, and especially to follow their separate logic structures.)

    Cheers!

    Mike

    attached mail follows:


    --- Steve Keller <skellerhealthtvchannel.org> wrote: > Here's a good tip someone gave me when I first started > learning PHP: when you're dealing with HTML, it's a good > idea to use \n at the end of your echoed lines and \t's > at the beginnings to create staggered indentations, > this makes it a little easier to read when you're > testing the output.

    Proper HTML formatting is a great suggestion. Many novices write broken tables, simply because their markup is too sloppy for them to notice their errors.

    Aside from using \n and \t in your echo statements, consider that you can also switch in/out of PHP mode as appropriate. In many cases, there is very little (or no) dymanic data in your output, so it may be better just to write it in HTML. For example, consider this in lieu of your code snippet:

    else { ?> <td align="center" width="15%">Hello</td> <? $i++; }

    instead of:

    else { echo "<td align=\"center\" valign=\"middle\" width=\"15%\"

    height=\"77\" border=\"1\" bordercolor=\"#000000\">"; echo "<div align=\"center\"><font size=\"1\"></font></div>"; echo "Hello" ; $i++; } //for else

    Not only is this much easier to read, it also would have helped you notice the missing </td> tag that Steve pointed out for you.

    Chris

    attached mail follows:


    In most cases, Yes. Calling session_start() for the first time sets a cookie on the client's computer containing the session id. At the same time the function creates a matching session file on the server. You register whatever variables you want to this file so that when you call session_start() on another page it looks for the cookie, retrieves the session id, and makes the associated variables in the file available to your script.

    I suggest you read the manual. It's all there... http://www.php.net/manual/en/ref.session.php

    -Kevin

    ----- Original Message ----- From: <edhome.homes2see.com> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 11:10 AM Subject: [PHP] Session Question

    > > Does php use cookies for sessions even if you don't explicitly use cookie > functions to save session data server side? > > TIA, > > Ed > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    -----Original Message----- From: edhome.homes2see.com To: php-generallists.php.net

    Does php use cookies for sessions even if you don't explicitly use cookie functions to save session data server side? --------------------------

    That question doesn't even make sense to me -- cookie functions can't save data server side, for one thing! Can you try to explain exactly what it is you're trying to find out?

    Cheers!

    Mike

    attached mail follows:


    Sorry I didn't make myself more clear. I only want to use server side sessions. I don't want to have to rely on a client having cookies enabled in their browser. So far having trans_sid is just doing the trick. I can save values into sessions server side and not explicitly create a client side cookie with any values to retrieve the information.

    Thanks again,

    Ed

    On Fri, 3 Jan 2003, Ford, Mike [LSS] wrote:

    > -----Original Message----- > From: edhome.homes2see.com > To: php-generallists.php.net > > Does php use cookies for sessions even if you don't explicitly use > cookie > functions to save session data server side? > -------------------------- > > That question doesn't even make sense to me -- cookie functions can't save > data server side, for one thing! Can you try to explain exactly what it is > you're trying to find out? > > Cheers! > > Mike >

    attached mail follows:


    I use both... and the way I see PHP handling it is like this...

    First call in it will add the SESSID to the hrefs. Next call (page load) if it finds the cookie it will not append SESSID to URL. However if it doesn't it will.

    There are a few instance were I need to get the SESSION ID and append them myself.

    Redirects are a good example you need to add it yourself.

    header("Location: http://mysite.org/index.php?PHPSESSID=$sid");

    Cheers, Mike

    P.S. This is just from my obeservation....

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 1:52 PM edhome.homes2see.com wrote:

    >Sorry I didn't make myself more clear. I only want to use server side >sessions. I don't want to have to rely on a client having cookies enabled >in their browser. So far having trans_sid is just doing the trick. I can >save values into sessions server side and not explicitly create a client >side cookie with any values to retrieve the information. > >Thanks again, > >Ed > > >On Fri, 3 Jan 2003, Ford, Mike [LSS] wrote: > >> -----Original Message----- >> From: edhome.homes2see.com >> To: php-generallists.php.net >> >> Does php use cookies for sessions even if you don't explicitly use >> cookie >> functions to save session data server side? >> -------------------------- >> >> That question doesn't even make sense to me -- cookie functions can't >save >> data server side, for one thing! Can you try to explain exactly what it >is >> you're trying to find out? >> >> Cheers! >> >> Mike >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hey,

    I'm somewhat new to PHP and I'm doing a lot of forms stuff. Looking at some of the examples at:

    http://www.linuxguruz.org/z.php?id=33

    The variables seem to persist through a reload. For example, the first demo has:

    ----
    <?
    if (!isset($pick)) {
    echo "Fill out and submit the form below."; }
    else {
    $j = count($pick);
    for($i=0; $i<$j; $i++) {
    echo "Pick <b>$pick[$i]</b> is Checked<br />"; }
    }
    ?>
    

    <form action="<? echo $PHP_SELF; ?>"> <ol> <li>Painting<input name="pick[]" type=checkbox value="Painting" /></li> <li>Plumbing<input name="pick[]" type=checkbox value="Plumbing" /></li> <li>Electric<input name="pick[]" type=checkbox value="Electric" /></li> </ol>

    <input type="submit" value="Submit!" /> <input type="reset" value="Reset" /> </form> --------

    So the $pick variable is maitained through the submit. When I demo the script on that site, it works as advertised. When I use the same code on my web server, it doesn't work ($pick is never set after submitting). Is there some configuration option that dictates whether variables persist in this manner?

    Thanks, Dave

    attached mail follows:


    Your local version does not have register_globals turned on in php.ini. You can either set the value = on or access posted values by using $_POST or $HTTP_POST_VARS depending on your version of php. ----- Original Message ----- From: "David Chamberlin" <dwcnautiboy.com> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 1:58 PM Subject: [PHP] Variables that persist through reload?

    > Hey, > > I'm somewhat new to PHP and I'm doing a lot of forms stuff. Looking at > some of the examples at: > > http://www.linuxguruz.org/z.php?id=33 > > The variables seem to persist through a reload. For example, the first > demo has: > > ---- > <? > if (!isset($pick)) { > echo "Fill out and submit the form below."; } > else { > $j = count($pick); > for($i=0; $i<$j; $i++) { > echo "Pick <b>$pick[$i]</b> is Checked<br />"; } > } > ?> > > <form action="<? echo $PHP_SELF; ?>"> > <ol> > <li>Painting<input name="pick[]" type=checkbox value="Painting" /></li> > <li>Plumbing<input name="pick[]" type=checkbox value="Plumbing" /></li> > <li>Electric<input name="pick[]" type=checkbox value="Electric" /></li> > </ol> > > <input type="submit" value="Submit!" /> > <input type="reset" value="Reset" /> > </form> > -------- > > So the $pick variable is maitained through the submit. When I demo the > script on that site, it works as advertised. When I use the same code > on my web server, it doesn't work ($pick is never set after submitting). > Is there some configuration option that dictates whether variables > persist in this manner? > > Thanks, > Dave > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    That's just the browser's cache, nothing to do with PHP. Not all browsers will cache succesfully. If you want to guarentee that variables will be stored for later retrieval (or for repopulating a form) then you need to use sessions or store the content of the variables in a database.

    -Kevin

    ----- Original Message ----- From: "David Chamberlin" <dwcnautiboy.com> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 12:58 PM Subject: [PHP] Variables that persist through reload?

    > Hey, > > I'm somewhat new to PHP and I'm doing a lot of forms stuff. Looking at > some of the examples at: > > http://www.linuxguruz.org/z.php?id=33 > > The variables seem to persist through a reload. For example, the first > demo has: > > ---- > <? > if (!isset($pick)) { > echo "Fill out and submit the form below."; } > else { > $j = count($pick); > for($i=0; $i<$j; $i++) { > echo "Pick <b>$pick[$i]</b> is Checked<br />"; } > } > ?> > > <form action="<? echo $PHP_SELF; ?>"> > <ol> > <li>Painting<input name="pick[]" type=checkbox value="Painting" /></li> > <li>Plumbing<input name="pick[]" type=checkbox value="Plumbing" /></li> > <li>Electric<input name="pick[]" type=checkbox value="Electric" /></li> > </ol> > > <input type="submit" value="Submit!" /> > <input type="reset" value="Reset" /> > </form> > -------- > > So the $pick variable is maitained through the submit. When I demo the > script on that site, it works as advertised. When I use the same code > on my web server, it doesn't work ($pick is never set after submitting). > Is there some configuration option that dictates whether variables > persist in this manner? > > Thanks, > Dave > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Woops.. sorry I missed the crux of your post. I didn't read all the way down. :) -Kevin

    ----- Original Message ----- From: "Kevin Stone" <kevinhelpelf.com> To: <php-generallists.php.net>; "David Chamberlin" <dwcnautiboy.com> Sent: Friday, January 03, 2003 1:18 PM Subject: Re: [PHP] Variables that persist through reload?

    > That's just the browser's cache, nothing to do with PHP. Not all browsers > will cache succesfully. If you want to guarentee that variables will be > stored for later retrieval (or for repopulating a form) then you need to > use sessions or store the content of the variables in a database. > > -Kevin > > ----- Original Message ----- > From: "David Chamberlin" <dwcnautiboy.com> > To: <php-generallists.php.net> > Sent: Friday, January 03, 2003 12:58 PM > Subject: [PHP] Variables that persist through reload? > > > > Hey, > > > > I'm somewhat new to PHP and I'm doing a lot of forms stuff. Looking at > > some of the examples at: > > > > http://www.linuxguruz.org/z.php?id=33 > > > > The variables seem to persist through a reload. For example, the first > > demo has: > > > > ---- > > <? > > if (!isset($pick)) { > > echo "Fill out and submit the form below."; } > > else { > > $j = count($pick); > > for($i=0; $i<$j; $i++) { > > echo "Pick <b>$pick[$i]</b> is Checked<br />"; } > > } > > ?> > > > > <form action="<? echo $PHP_SELF; ?>"> > > <ol> > > <li>Painting<input name="pick[]" type=checkbox value="Painting" /></li> > > <li>Plumbing<input name="pick[]" type=checkbox value="Plumbing" /></li> > > <li>Electric<input name="pick[]" type=checkbox value="Electric" /></li> > > </ol> > > > > <input type="submit" value="Submit!" /> > > <input type="reset" value="Reset" /> > > </form> > > -------- > > > > So the $pick variable is maitained through the submit. When I demo the > > script on that site, it works as advertised. When I use the same code > > on my web server, it doesn't work ($pick is never set after submitting). > > Is there some configuration option that dictates whether variables > > persist in this manner? > > > > Thanks, > > Dave > > > > > > -- > > 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:


    Ahhh.....that explains it. Just read up on register_globals. I understand now.

    To make the script work with register_globals off I can just do:

    $pick = $_GET['pick'];

    And then the rest works. Thanks!

    -Dave

    Joseph W. Goff wrote: > Your local version does not have register_globals turned on in php.ini. > You can either set the value = on or access posted values by using $_POST or > $HTTP_POST_VARS depending on your version of php. > ----- Original Message ----- > From: "David Chamberlin" <dwcnautiboy.com> > To: <php-generallists.php.net> > Sent: Friday, January 03, 2003 1:58 PM > Subject: [PHP] Variables that persist through reload? > > > >>Hey, >> >>I'm somewhat new to PHP and I'm doing a lot of forms stuff. Looking at >>some of the examples at: >> >>http://www.linuxguruz.org/z.php?id=33 >> >>The variables seem to persist through a reload. For example, the first >>demo has: >> >>---- >><? >>if (!isset($pick)) { >>echo "Fill out and submit the form below."; } >>else { >>$j = count($pick); >>for($i=0; $i<$j; $i++) { >>echo "Pick <b>$pick[$i]</b> is Checked<br />"; } >>} >>?> >> >><form action="<? echo $PHP_SELF; ?>"> >><ol> >><li>Painting<input name="pick[]" type=checkbox value="Painting" /></li> >><li>Plumbing<input name="pick[]" type=checkbox value="Plumbing" /></li> >><li>Electric<input name="pick[]" type=checkbox value="Electric" /></li> >></ol> >> >><input type="submit" value="Submit!" /> >><input type="reset" value="Reset" /> >></form> >>-------- >> >>So the $pick variable is maitained through the submit. When I demo the >>script on that site, it works as advertised. When I use the same code >>on my web server, it doesn't work ($pick is never set after submitting). >> Is there some configuration option that dictates whether variables >>persist in this manner? >> >>Thanks, >>Dave >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> > >

    attached mail follows:


    OK, last one was answered quickly and successfully (thank you!), so here's another one.

    Is there an easy way to set something in a select list to be selected? Right now I'm doing a real brute-force method. e.g.,

    echo "<td><select name=\"disp_address\">"; $choices = array( 'pub' => 'On Public Page', 'members' => 'Only on Members Page', 'nodisp' => 'Do not Display' ); foreach ( $choices as $key => $choice ) { $selected = ''; if ( strcmp( $key, $member_info->display_address ) == 0 ) { $selected = 'selected'; } echo "<option value=\"$key\" $selected>$choice"; } echo '</select></td>';

    I've got to imagine there's a better way ....

    Thanks, Dave

    attached mail follows:


    ----- Original Message ----- From: "David Chamberlin" <dwcnautiboy.com> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 1:27 PM Subject: [PHP] One more form question

    > OK, last one was answered quickly and successfully (thank you!), so > here's another one. > > Is there an easy way to set something in a select list to be selected? > Right now I'm doing a real brute-force method. e.g., > > echo "<td><select name=\"disp_address\">"; > $choices = array( 'pub' => 'On Public Page', > 'members' => 'Only on Members Page', > 'nodisp' => 'Do not Display' ); > foreach ( $choices as $key => $choice ) { > $selected = ''; > if ( strcmp( $key, $member_info->display_address ) == 0 ) { > $selected = 'selected'; > } > echo "<option value=\"$key\" $selected>$choice"; > } > echo '</select></td>'; > > I've got to imagine there's a better way .... > > Thanks, > Dave

    Okay let me take another hack at one of your questions and maybe I won't screw up this time. ;-)

    PHP has no functional control over the HTML content. You could make it easier on yourself by writing a function that outputs 'selected' or null instead of coding a separate conditional for each form element, but other than that this is the only way to do it.

    -Kevin

    attached mail follows:


    Does anyone know of a FREE utility that will export data from an MS Excel file and import it to MySQL. I have found a bunch of nice utilities, but none of them are FREE. I'm in a bind and have to get over 2000 rows imported to my database by morning and don't have to order one of the other solutions.

    Joe LoMoglio

    attached mail follows:


    You could export, or save as a tab delimited text file, then go ahead and use phpMyAdmin or a custom script to pull all that data into the database. It really shouldnšt be much of a problem coming from Excel.

    Cheers!

    Rick

    "Finish each day and be done with it. You have done what you could; some blunders and absurdities have crept in; forget them as soon as you can. Tomorrow is a new day; you shall begin it serenely and with too high a spirit to be encumbered with your old nonsense." - Ralph Waldo Emerson

    > From: Joe LoMoglio <joejlcreative.net> > Date: Fri, 3 Jan 2003 14:20:02 -0700 > To: php-generallists.php.net > Subject: [PHP] Excel to MySQL > > Does anyone know of a FREE utility that will export data from an MS > Excel file and import it to MySQL. I have found a bunch of nice > utilities, but none of them are FREE. I'm in a bind and have to get > over 2000 rows imported to my database by morning and don't have to > order one of the other solutions. > > Joe LoMoglio > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    I think BiffWriter might do it...

    By why not simply output a comma delimited files from excel and import it in with a small php script.

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 2:20 PM Joe LoMoglio wrote:

    >Does anyone know of a FREE utility that will export data from an MS >Excel file and import it to MySQL. I have found a bunch of nice >utilities, but none of them are FREE. I'm in a bind and have to get >over 2000 rows imported to my database by morning and don't have to >order one of the other solutions. > >Joe LoMoglio > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Thanks Michael and Richard

    I took your advice and wrote a PHP script to import it. I was having a hard time getting Excel on my Mac to export to CSV and Tab Delim, but finally got it to give me a plain text file which worked fine with fopen().

    Joe

    On Friday, January 3, 2003, at 02:32 PM, Michael J. Pawlowsky wrote:

    > I think BiffWriter might do it... > > By why not simply output a comma delimited files from excel and import > it in with a small php script. > > Mike > > > > *********** REPLY SEPARATOR *********** > > On 03/01/2003 at 2:20 PM Joe LoMoglio wrote: > >> Does anyone know of a FREE utility that will export data from an MS >> Excel file and import it to MySQL. I have found a bunch of nice >> utilities, but none of them are FREE. I'm in a bind and have to get >> over 2000 rows imported to my database by morning and don't have to >> order one of the other solutions. >> >> Joe LoMoglio >> >> >> -- >> 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:


    > Does anyone know of a FREE utility that will export data from an MS > Excel file and import it to MySQL. I have found a bunch of nice > utilities, but none of them are FREE. I'm in a bind and have to get > over 2000 rows imported to my database by morning and don't have to > order one of the other solutions. >

    Maybe you can use this:

    Save the Excel document as tab delimited text and use the mysql command LOAD DATA or the mysqlimport utility.

    mysql> LOAD DATA INFILE 'data.txt' INTO TABLE table;

    <http://www.mysql.com/doc/en/LOAD_DATA.html>

    You'd better check out the stuff about "enclosed by".

    attached mail follows:


    I am a PHP newbie, and I am having difficulty in getting my records to display

    here is my code

    <?php $Host="localhost"; $User="us34992a"; $Password="*****"; $DBname="db34992a"; $Tablename="calendar"; $Link=mysql_pconnect($Host, $User, $Password) or die ("YOu suck1"); $db=mysql_select_db($DBname, $Link) or die ("ISUCKEGGS"); $result=mysql_query("SELECT * from calendar", $Link) or die ("YOu suck3"); print("<table width="53%" border="0" cellpadding="0" cellspacing="0">\n"); print ("<tr>\n"); print ("<td background="topbig.gif">\n"); print ("<div align="center"><font face="Arial, Helvetica, sans-serif"><b><font color="#FFFFFF">Calender</font></b></font></div> </td> </tr>\n"); print ("<tr bgcolor="#009ACE">\n"); print("<td>$result[meeting_name]</td>\n")or die ("you suck"); mysql_close ($Link); ?>

    any help?

    attached mail follows:


    Use this instead:

    <?php $Host="localhost"; $User="us34992a"; $Password="*****"; $DBname="db34992a"; $Tablename="calendar"; $Link=mysql_pconnect($Host, $User, $Password) or die ("YOu suck1"); $db=mysql_select_db($DBname, $Link) or die ("ISUCKEGGS"); $result=mysql_query("SELECT * from calendar", $Link) or die ("YOu suck3"); print("<table width=\"53%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"); print ("<tr>\n"); print ("<td background=\"topbig.gif\">\n"); print ("<div align=\"center\"><font face=\"Arial, Helvetica, sans-serif\"><b><font color=\"#FFFFFF\">Calender</font></b></font></div> </td> </tr>\n"); print ("<tr bgcolor=\"#009ACE\">\n"); print("<td>{$result['meeting_name']}</td>\n") or die ("you suck"); mysql_close ($Link); ?>

    So basically make sure you escape your double quotes within your print statements, plus you should use single quotes in your associative array.

    Cheers!

    Rick

    "Sir my concern is not whether God is on our side. My great concern is to be on God's side." - Abraham Lincoln

    > From: "Todd Barr" <tbarrgeo-imaging.com> > Date: Fri, 3 Jan 2003 16:32:08 -0800 > To: <php-generallists.php.net> > Subject: [PHP] Hello and help > > I am a PHP newbie, and I am having difficulty in getting my records to display > > here is my code > > <?php > $Host="localhost"; > $User="us34992a"; > $Password="*****"; > $DBname="db34992a"; > $Tablename="calendar"; > $Link=mysql_pconnect($Host, $User, $Password) > or die ("YOu suck1"); > $db=mysql_select_db($DBname, $Link) > or die ("ISUCKEGGS"); > $result=mysql_query("SELECT * from calendar", $Link) > or die ("YOu suck3"); > print("<table width="53%" border="0" cellpadding="0" cellspacing="0">\n"); > print ("<tr>\n"); > print ("<td background="topbig.gif">\n"); > print ("<div align="center"><font face="Arial, Helvetica, sans-serif"><b><font > color="#FFFFFF">Calender</font></b></font></div> > </td> > </tr>\n"); > print ("<tr bgcolor="#009ACE">\n"); > print("<td>$result[meeting_name]</td>\n")or die ("you suck"); > mysql_close ($Link); > ?> > > any help? >

    attached mail follows:


    You are on the right track, but missed one major thing. Anytime you want to retrieve information from a database result set you have to follow 3 basic steps. 1) Connect to the database *you got that one 2) Execute a query *you got that one 3) Retrieve the resultset ***missed this one

    See http://www.php.net/mysql_fetch_assoc for the appropriate syntax.

    ----- Original Message ----- From: "Todd Barr" <tbarrgeo-imaging.com> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 6:32 PM Subject: [PHP] Hello and help

    I am a PHP newbie, and I am having difficulty in getting my records to display

    here is my code

    <?php $Host="localhost"; $User="us34992a"; $Password="*****"; $DBname="db34992a"; $Tablename="calendar"; $Link=mysql_pconnect($Host, $User, $Password) or die ("YOu suck1"); $db=mysql_select_db($DBname, $Link) or die ("ISUCKEGGS"); $result=mysql_query("SELECT * from calendar", $Link) or die ("YOu suck3"); print("<table width="53%" border="0" cellpadding="0" cellspacing="0">\n"); print ("<tr>\n"); print ("<td background="topbig.gif">\n"); print ("<div align="center"><font face="Arial, Helvetica, sans-serif"><b><font color="#FFFFFF">Calender</font></b></font></div> </td> </tr>\n"); print ("<tr bgcolor="#009ACE">\n"); print("<td>$result[meeting_name]</td>\n")or die ("you suck"); mysql_close ($Link); ?>

    any help?

    attached mail follows:


    Does anyone have an example of how to download newsgroup headers from a NNTP server and insert them into a MySQL DB?

    attached mail follows:


    On Saturday 04 January 2003 06:07, Erich Kolb wrote:

    Please use a descriptive subject related to your problem. Imagine the confusion if everybody used "Newbie help" or just "Help" as the subject.

    > Does anyone have an example of how to download newsgroup headers from a > NNTP server and insert them into a MySQL DB?

    Try searching:

    www.phpclasses.org www.hotscripts.com www.phpbuilder.net

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

    /* One man's "magic" is another man's engineering. "Supernatural" is a null word. -- Robert Heinlein */

    attached mail follows:


    Hi,

    I'm using PHP to implement a contract database for a midrange hospital. I'm having trouble configuring (I assume) the post_max_size and upload_max_filesize to allow for pdf's to be uploaded.

    Presently, these are set to 1008M and 1006M respectively, and a file of size 620K still gives me a "413 Error - Request Entity Too Large."

    Are there any other settings that I need to look at in order to make this work? All of the other basic settings are in place (IE, file_uploads = on etc....)

    Any help would be greatly appreciated.

    Thanks, David M. Jeffress davidjeffressjsmc.org

    attached mail follows:


    Did you also set the file size in the HTML input tag?

    Also take a look at http://www.phpbuilder.com/columns/florian19991014.php3?page=4

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 4:15 PM David Jeffress wrote:

    >Hi, > >I'm using PHP to implement a contract database for a midrange hospital. >I'm >having trouble configuring (I assume) the post_max_size and >upload_max_filesize to allow for pdf's to be uploaded. > >Presently, these are set to 1008M and 1006M respectively, and a file of >size >620K still gives me a "413 Error - Request Entity Too Large." > >Are there any other settings that I need to look at in order to make this >work? All of the other basic settings are in place (IE, file_uploads = on >etc....) > >Any help would be greatly appreciated. > >Thanks, >David M. Jeffress >davidjeffressjsmc.org > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    On Saturday 04 January 2003 06:15, David Jeffress wrote: > Hi, > > I'm using PHP to implement a contract database for a midrange hospital. > I'm having trouble configuring (I assume) the post_max_size and > upload_max_filesize to allow for pdf's to be uploaded. > > Presently, these are set to 1008M and 1006M respectively, and a file of > size 620K still gives me a "413 Error - Request Entity Too Large."

    Search the archives for "Request Entity Too Large"

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

    /* Promptness is its own reward, if one lives by the clock instead of the sword. */

    attached mail follows:


    Sorry if this was not 100% clear. In a nutshell the app I'm making will be available for poeple to use. My feeling is that there will be users using shared servers, which under a stress tend to suck. The only thing in this one I'm doing that;s new to me is having some 20 includes loaded as I need them, sometimes up to 10 at a time, hence the concern.

    Thanks for all your responses, I got enough info to go on. ANother words, this should not be a problem.

    R>

    http://sourceforge.net/projects/athena-research

    >> Is there, was there ever issue around including a lot files via >> include(). I am running things on a local server so it's hard to gauge. > >I don't understand that comment. includes/requires are always (well >nearly anyway) local to the server regardless of where the request is >coming from. So if you have a test box and it is fast enough for you, >then go with it. > >-Rasmus > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    ___________________________________ Radoslaw Zajkowski http://www.finalbanana.com

    attached mail follows:


    Dear PHP Users,

    I am in the process of trying to create an Online Program that will give questions and possible answers then score the test. I was wondering if anyone has done this type of thing already and might be able to give me some pointers on what the best method of doing this might be?

    Devin

    attached mail follows:


    I've done a few... It all depends on how many question and how many answers. How often will they change. How many will you have.

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 2:47 PM Devin Atencio wrote:

    >Dear PHP Users, > >I am in the process of trying to create an Online Program that will >give questions and possible answers then score the test. I was wondering >if anyone has done this type of thing already and might be able to give >me some pointers on what the best method of doing this might be? > >Devin > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    What I have is in ColdFusion... And I don't own it (although I did write it). It was written for commercial clients. So I'm hesitant to send it. But this is not hard...

    Persoanlly what I would do is have 2 db tables...

    1-Questions 2-Answers (foreign key to questions). and if you want to save peoples answers you would have a third table 3-User_Answers

    This way you only have one template to build.

    If you are really good with DHTML and JavaScript, you can load all the data in to a JavaScript array and simply update the question and answers everytime the user submits an answer. Save the answers in a JavaScript array to deal with later. You can even have something where onUnload(Want to save answers to continue later?); This means no reloading for every question.

    With that many questions you only want them to see one question at a time. But let them know somewhere how many questions they've done and how many they have left to answer.

    On the last one you submit it all in a post, enter it in a database if you want and give them the results. Can even be the same page. Just look for

    if (isset($_POST['answers']) ) check the answer; } else { output form; }

    That's the way I would do it. This way it's easy to have many questionnairs, add questions, edit answers etc.

    If you are not great with DHTML or Javascript, simply insert and retrieve one question.user answer at a time. If you dont want to put answers in the database you can store it in a session.

    Cheers, Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 3:16 PM Devin Atencio wrote:

    >Mike, > >I would assume the questions would vary anywhere from 60-100 questions >with each question possibly having 4-5 answers. Do you have some code >I could look at? I have been trying to think about how to store the >customers response, then score that against the correct answers etc >in the database. > >Any help you could give me would be greatly appreciated. > >Devin Atencio. > > >On Fri, 2003-01-03 at 15:14, Michael J. Pawlowsky wrote: >> I've done a few... It all depends on how many question and how many >answers. >> How often will they change. >> How many will you have. >> >> >> Mike >> >> >> >> *********** REPLY SEPARATOR *********** >> >> On 03/01/2003 at 2:47 PM Devin Atencio wrote: >> >> >Dear PHP Users, >> > >> >I am in the process of trying to create an Online Program that will >> >give questions and possible answers then score the test. I was wondering >> >if anyone has done this type of thing already and might be able to give >> >me some pointers on what the best method of doing this might be? >> > >> >Devin >> > >> > >> >-- >> >PHP General Mailing List (http://www.php.net/) >> >To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >>

    attached mail follows:


    Devin, I did a 10 question quiz for a local museum which involved using radio buttons and automatic advance to the next question. At the end I summed the correct answers and gave a score. I've wanted to shorten the whole thing and use a mysql table, but... The following snip should give you a bit of knowledge on how to (or not to) do an online quiz. The quiz is located at http://www.museumoflocalhistory.org/pages/quiz.php Hope this helps, Hugh

    //snip <html> <head>

    <SCRIPT LANGUAGE="JavaScript"> function go(loc) { window.location.href = loc; } </script> </head> <body> <?php

    if (!isset($quest)) { print "<h3>10 Questions to Challenge<br>your knowledge of Washington Township</h3>"; print "<br><h5><b><a href=quiz.php?quest=1>Take the Quiz!</a></b></h5><br>"; print "<br><table align=center cellpadding=10><tr><td><img src=./postcard/pc1.jpg></td></tr></table>"; }

    // question 1 if ($quest=="1") { if (!isset($ans)) { $var=1; print "<form name=form>"; print "<h3>Question #$var</h3>"; print "<br>"; print "<h6>The City of Fremont was formed from the communities of Centerville, Irvington, Mission San Jose, Niles, and Warm Springs.</h6><br>"; print "<input type=\"radio\" name=\"loc\" onClick=\"go('quiz.php?quest=$quest&ans=1&var=$var&correct=$correct');\"> True<br>"; print "<input type=\"radio\" name=\"loc\" onClick=\"go('quiz.php?quest=$quest&ans=0&var=$var&correct=$correct');\"> False<br>"; print "</form>"; print "<br><table align=center cellpadding=10><tr><td><img src=./postcard/pc2.jpg></td></tr></table>"; } if (isset($ans)) { if ($ans=="1") { $correct=$correct+1; unset($ans); print "<h3>You are correct!</h3><br><h4>Fremont was formed by the incorporation of the 5 towns.</h4>"; } if ($ans=="0") { $correct=$correct+0; unset($ans); print "<h3>Sorry, the statement was true.</h3><br><h4>Fremont was formed by the incorporation of the 5 towns.</h4>"; } print "<br><h5><b><a href=quiz.php?quest=".($var+1)."&correct=$correct>Go to Question #".($var+1)."</a></b></h5><br>"; print "<br><table align=center cellpadding=10><tr><td><img src=./postcard/pc2.jpg></td></tr></table>"; } } //end snip

    ----- Original Message ----- From: "Devin Atencio" <dreamboyaros.net> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 2:47 PM Subject: [PHP] Create Online Test Program

    > > Dear PHP Users, > > I am in the process of trying to create an Online Program that will > give questions and possible answers then score the test. I was wondering > if anyone has done this type of thing already and might be able to give > me some pointers on what the best method of doing this might be? > > Devin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    w<FONT size=5><FONT size=3><FONT face="Courier New">h<SPAN class=887075722-03012003>at this error???</SPAN></FONT></FONT></FONT> <FONT face="Courier New"><SPAN class=887075722-03012003></SPAN></FONT><FONT color=#ff0000>PHP has encountered an Access Violation at 012B7DE7</FONT></FONT>

    Ysrael Guzmán Meza

    attached mail follows:


    this is the message of the ERROR: PHP has encountered an Access Violation at 012B7DE7 what this????

    Ysrael Guzmán Meza

    attached mail follows:


    hello all I am using php and mysql in my web application. I am making use of forms to accept data from the user and add it to the mysql database. I also have a login system in place. I need to create a way for the user to edit the information that he/she entered. Can you suggest a way I can do that.

    I want to be able to display a form to the user where his information is present ... and then he/she can go ahead and make updates.

    thanks --pS

    Pushpinder Singh Garcha _________________________________

    attached mail follows:


    Look at UPDATE at http://www.mysql.com/

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 6:37 PM Pushpinder Singh Garcha wrote:

    >hello all > I am using php and mysql in my web application. I am making use of >forms to accept data from the user and add it to the mysql database. I >also have a login system in place. I need to create a way for the user >to edit the information that he/she entered. Can you suggest a way I >can do that. > >I want to be able to display a form to the user where his information >is present ... and then he/she can go ahead and make updates. > >thanks >--pS > > >Pushpinder Singh Garcha >_________________________________

    attached mail follows:


    Hello,

    On 01/03/2003 11:40 AM, Föíö Öxî‰ęójînyóon wrote: > mail($to, $subject, $body, "From: $email"); > > how do I insert an attachment into this mail function, It would be > submitted with file field and would be called attachment.

    You may want to try this class. All you need to do is to pass the file name of the uploaded file to add as an attachment:

    http://www.phpclasses.org/mimemessage

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    ok - here's my problem. I have some data in mysql, and other data in informix.

    here is my application. this is for distributors of prepaid phone cards. prepaid phone cards have 3 numbers they can be identified by pin number (which is unique), or by batch & serial number. the batch number is basically the type of card, and the serial number & batch number for another unique identifier when used together.

    now - a batch can be given to several different distributors. therefore, when then are pulling various types of information on the batch they should only be able to see it for their cards, and not all of the cards in the batch.

    piece of cake right? well - the permissions information is kept in mysql, and the batch information its self is kept in an informix database. there is no way around this for me.

    the only way I can think of to work around this problem is to query 1 card at a time, and sum the info etc. together. however, there could be 400,000+ records, and this would be a slow tedious process. plus for each card I'd have to query the mysql database for permissions, and then in turn query the informix database in turn. this could take a long time to display the webpage.

    clear as mud??? recommendations?

    attached mail follows:


    Any chance you can do a somewhat frequent export from informix into mysql or the other way around so all your stuff is in one database?

    -philip

    On Fri, 3 Jan 2003, Jeff Bluemel wrote:

    > ok - here's my problem. I have some data in mysql, and other data in > informix. > > here is my application. this is for distributors of prepaid phone cards. > prepaid phone cards have 3 numbers they can be identified by pin number > (which is unique), or by batch & serial number. the batch number is > basically the type of card, and the serial number & batch number for another > unique identifier when used together. > > now - a batch can be given to several different distributors. therefore, > when then are pulling various types of information on the batch they should > only be able to see it for their cards, and not all of the cards in the > batch. > > piece of cake right? well - the permissions information is kept in mysql, > and the batch information its self is kept in an informix database. there > is no way around this for me. > > the only way I can think of to work around this problem is to query 1 card > at a time, and sum the info etc. together. however, there could be 400,000+ > records, and this would be a slow tedious process. plus for each card I'd > have to query the mysql database for permissions, and then in turn query the > informix database in turn. this could take a long time to display the > webpage. > > clear as mud??? recommendations? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    That's what I was thinking... or perhaps see it there's someway in Informix to have a trigger call a sql/c app to update your MySQL database.

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 3:49 PM Philip Hallstrom wrote:

    >Any chance you can do a somewhat frequent export from informix into mysql >or the other way around so all your stuff is in one database? > >-philip > >On Fri, 3 Jan 2003, Jeff Bluemel wrote: > >> ok - here's my problem. I have some data in mysql, and other data in >> informix. >> >> here is my application. this is for distributors of prepaid phone cards. >> prepaid phone cards have 3 numbers they can be identified by pin number >> (which is unique), or by batch & serial number. the batch number is >> basically the type of card, and the serial number & batch number for >another

    attached mail follows:


    well - the informix database will be running on another server (a telecom billing system). this is a web based front end, and I really want to leave the other system alone 100%. if I were to modify anything I would make the mysql permissions table inside of informix, but there are liability reason which would keep me from doing so.

    still - you bring up an interesting point. a php script file that ran on crontab may not be a bad answer. however, again I would run into a problem of volume. there are an average of 3-4 million card in the informix server so I couldn't do this in a export & import. too may records, and info has to be accurate within 15 minutes. shear volume I believe is going to kill that idea. I would be back to 1 record at a time running every 15 minutes. I would think too much load, and more practical to do it 1 record at a time upon request which won't be too frequent.

    hoping there's another solution I'm not aware of, or over looked.

    Jeff

    "Philip Hallstrom" <philipadhesivemedia.com> wrote in message news:20030103154832.O93864-100000cypress.adhesivemedia.com... > Any chance you can do a somewhat frequent export from informix into mysql > or the other way around so all your stuff is in one database? > > -philip > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > ok - here's my problem. I have some data in mysql, and other data in > > informix. > > > > here is my application. this is for distributors of prepaid phone cards. > > prepaid phone cards have 3 numbers they can be identified by pin number > > (which is unique), or by batch & serial number. the batch number is > > basically the type of card, and the serial number & batch number for another > > unique identifier when used together. > > > > now - a batch can be given to several different distributors. therefore, > > when then are pulling various types of information on the batch they should > > only be able to see it for their cards, and not all of the cards in the > > batch. > > > > piece of cake right? well - the permissions information is kept in mysql, > > and the batch information its self is kept in an informix database. there > > is no way around this for me. > > > > the only way I can think of to work around this problem is to query 1 card > > at a time, and sum the info etc. together. however, there could be 400,000+ > > records, and this would be a slow tedious process. plus for each card I'd > > have to query the mysql database for permissions, and then in turn query the > > informix database in turn. this could take a long time to display the > > webpage. > > > > clear as mud??? recommendations? > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Hmm... what about querying the informix database for the set of rows you want all at once, putting that into a temporary mysql table with a timestamp and then doing the rest of your work from there.

    Then the next time it happens check the timestamp on that mysql table and if it's out of date, delete it and go and fetch updated rows from informix, otherwise just use what's in that mysql table.

    This would act as a sort of replicated table, but only taking into account the records that are actually being hit...

    maybe?

    On Fri, 3 Jan 2003, Jeff Bluemel wrote:

    > well - the informix database will be running on another server (a telecom > billing system). this is a web based front end, and I really want to leave > the other system alone 100%. if I were to modify anything I would make the > mysql permissions table inside of informix, but there are liability reason > which would keep me from doing so. > > still - you bring up an interesting point. a php script file that ran on > crontab may not be a bad answer. however, again I would run into a problem > of volume. there are an average of 3-4 million card in the informix server > so I couldn't do this in a export & import. too may records, and info has > to be accurate within 15 minutes. shear volume I believe is going to kill > that idea. I would be back to 1 record at a time running every 15 minutes. > I would think too much load, and more practical to do it 1 record at a time > upon request which won't be too frequent. > > hoping there's another solution I'm not aware of, or over looked. > > Jeff > > "Philip Hallstrom" <philipadhesivemedia.com> wrote in message > news:20030103154832.O93864-100000cypress.adhesivemedia.com... > > Any chance you can do a somewhat frequent export from informix into mysql > > or the other way around so all your stuff is in one database? > > > > -philip > > > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > > > ok - here's my problem. I have some data in mysql, and other data in > > > informix. > > > > > > here is my application. this is for distributors of prepaid phone > cards. > > > prepaid phone cards have 3 numbers they can be identified by pin number > > > (which is unique), or by batch & serial number. the batch number is > > > basically the type of card, and the serial number & batch number for > another > > > unique identifier when used together. > > > > > > now - a batch can be given to several different distributors. > therefore, > > > when then are pulling various types of information on the batch they > should > > > only be able to see it for their cards, and not all of the cards in the > > > batch. > > > > > > piece of cake right? well - the permissions information is kept in > mysql, > > > and the batch information its self is kept in an informix database. > there > > > is no way around this for me. > > > > > > the only way I can think of to work around this problem is to query 1 > card > > > at a time, and sum the info etc. together. however, there could be > 400,000+ > > > records, and this would be a slow tedious process. plus for each card > I'd > > > have to query the mysql database for permissions, and then in turn query > the > > > informix database in turn. this could take a long time to display the > > > webpage. > > > > > > clear as mud??? recommendations? > > > > > > > > > > > > -- > > > 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:


    actually - I believe that may be a workable solution. you were mentioning checking the timestamp on a mysql table. how would I check the timestamp on a mysql table?

    even with this I'm betting it would be more time consuming to create the table then it would to pull the info from informix, and process validation 1 record at a time from mysql. that would be a simple query instead of an insert. this would also all take place on the server it's self instead of pulling it from another server. I could load it up with ram & let it run.

    at any rate that gives me a lot of option to think about, and I'll probably has to work with some samples of the stuff from here to see what way is going to be the fastest. it would probably depend if the user was pulling this info in a session. if it was once, or several times. all something to think about.

    the other option I'm thinking about is just not giving the distributors access to this information, but restricting it to users with permissions to the entire batch only.

    thanks,

    Jeff

    "Philip Hallstrom" <philipadhesivemedia.com> wrote in message news:20030103161100.E93864-100000cypress.adhesivemedia.com... > Hmm... what about querying the informix database for the set of rows you > want all at once, putting that into a temporary mysql table with a > timestamp and then doing the rest of your work from there. > > Then the next time it happens check the timestamp on that mysql table and > if it's out of date, delete it and go and fetch updated rows from > informix, otherwise just use what's in that mysql table. > > This would act as a sort of replicated table, but only taking into account > the records that are actually being hit... > > maybe? > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > well - the informix database will be running on another server (a telecom > > billing system). this is a web based front end, and I really want to leave > > the other system alone 100%. if I were to modify anything I would make the > > mysql permissions table inside of informix, but there are liability reason > > which would keep me from doing so. > > > > still - you bring up an interesting point. a php script file that ran on > > crontab may not be a bad answer. however, again I would run into a problem > > of volume. there are an average of 3-4 million card in the informix server > > so I couldn't do this in a export & import. too may records, and info has > > to be accurate within 15 minutes. shear volume I believe is going to kill > > that idea. I would be back to 1 record at a time running every 15 minutes. > > I would think too much load, and more practical to do it 1 record at a time > > upon request which won't be too frequent. > > > > hoping there's another solution I'm not aware of, or over looked. > > > > Jeff > > > > "Philip Hallstrom" <philipadhesivemedia.com> wrote in message > > news:20030103154832.O93864-100000cypress.adhesivemedia.com... > > > Any chance you can do a somewhat frequent export from informix into mysql > > > or the other way around so all your stuff is in one database? > > > > > > -philip > > > > > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > > > > > ok - here's my problem. I have some data in mysql, and other data in > > > > informix. > > > > > > > > here is my application. this is for distributors of prepaid phone > > cards. > > > > prepaid phone cards have 3 numbers they can be identified by pin number > > > > (which is unique), or by batch & serial number. the batch number is > > > > basically the type of card, and the serial number & batch number for > > another > > > > unique identifier when used together. > > > > > > > > now - a batch can be given to several different distributors. > > therefore, > > > > when then are pulling various types of information on the batch they > > should > > > > only be able to see it for their cards, and not all of the cards in the > > > > batch. > > > > > > > > piece of cake right? well - the permissions information is kept in > > mysql, > > > > and the batch information its self is kept in an informix database. > > there > > > > is no way around this for me. > > > > > > > > the only way I can think of to work around this problem is to query 1 > > card > > > > at a time, and sum the info etc. together. however, there could be > > 400,000+ > > > > records, and this would be a slow tedious process. plus for each card > > I'd > > > > have to query the mysql database for permissions, and then in turn query > > the > > > > informix database in turn. this could take a long time to display the > > > > webpage. > > > > > > > > clear as mud??? recommendations? > > > > > > > > > > > > > > > > -- > > > > 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:


    It's a field type called TIMESTAMP... just name it whatever you want and it will update anytime the row is altered.

    The just select that row item to get the timestamp.

    Mike

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 5:52 PM Jeff Bluemel wrote:

    >actually - I believe that may be a workable solution. you were mentioning >checking the timestamp on a mysql table. how would I check the timestamp >on >a mysql table? >

    attached mail follows:


    > actually - I believe that may be a workable solution. you were mentioning > checking the timestamp on a mysql table. how would I check the timestamp on > a mysql table?

    see the timestamp data type.

    > even with this I'm betting it would be more time consuming to create the > table then it would to pull the info from informix, and process validation 1 > record at a time from mysql. that would be a simple query instead of an

    Yeah, but only the first time... if you get a lot of repeat traffic on the same set of rows only the first "hit" will be slow since after that it will all be in mysql...

    > insert. this would also all take place on the server it's self instead of > pulling it from another server. I could load it up with ram & let it run. > > at any rate that gives me a lot of option to think about, and I'll probably > has to work with some samples of the stuff from here to see what way is > going to be the fastest. it would probably depend if the user was pulling > this info in a session. if it was once, or several times. all something to > think about. > > the other option I'm thinking about is just not giving the distributors > access to this information, but restricting it to users with permissions to > the entire batch only. > > thanks, > > Jeff > > "Philip Hallstrom" <philipadhesivemedia.com> wrote in message > news:20030103161100.E93864-100000cypress.adhesivemedia.com... > > Hmm... what about querying the informix database for the set of rows you > > want all at once, putting that into a temporary mysql table with a > > timestamp and then doing the rest of your work from there. > > > > Then the next time it happens check the timestamp on that mysql table and > > if it's out of date, delete it and go and fetch updated rows from > > informix, otherwise just use what's in that mysql table. > > > > This would act as a sort of replicated table, but only taking into account > > the records that are actually being hit... > > > > maybe? > > > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > > > well - the informix database will be running on another server (a > telecom > > > billing system). this is a web based front end, and I really want to > leave > > > the other system alone 100%. if I were to modify anything I would make > the > > > mysql permissions table inside of informix, but there are liability > reason > > > which would keep me from doing so. > > > > > > still - you bring up an interesting point. a php script file that ran > on > > > crontab may not be a bad answer. however, again I would run into a > problem > > > of volume. there are an average of 3-4 million card in the informix > server > > > so I couldn't do this in a export & import. too may records, and info > has > > > to be accurate within 15 minutes. shear volume I believe is going to > kill > > > that idea. I would be back to 1 record at a time running every 15 > minutes. > > > I would think too much load, and more practical to do it 1 record at a > time > > > upon request which won't be too frequent. > > > > > > hoping there's another solution I'm not aware of, or over looked. > > > > > > Jeff > > > > > > "Philip Hallstrom" <philipadhesivemedia.com> wrote in message > > > news:20030103154832.O93864-100000cypress.adhesivemedia.com... > > > > Any chance you can do a somewhat frequent export from informix into > mysql > > > > or the other way around so all your stuff is in one database? > > > > > > > > -philip > > > > > > > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > > > > > > > ok - here's my problem. I have some data in mysql, and other data > in > > > > > informix. > > > > > > > > > > here is my application. this is for distributors of prepaid phone > > > cards. > > > > > prepaid phone cards have 3 numbers they can be identified by pin > number > > > > > (which is unique), or by batch & serial number. the batch number is > > > > > basically the type of card, and the serial number & batch number for > > > another > > > > > unique identifier when used together. > > > > > > > > > > now - a batch can be given to several different distributors. > > > therefore, > > > > > when then are pulling various types of information on the batch they > > > should > > > > > only be able to see it for their cards, and not all of the cards in > the > > > > > batch. > > > > > > > > > > piece of cake right? well - the permissions information is kept in > > > mysql, > > > > > and the batch information its self is kept in an informix database. > > > there > > > > > is no way around this for me. > > > > > > > > > > the only way I can think of to work around this problem is to query > 1 > > > card > > > > > at a time, and sum the info etc. together. however, there could be > > > 400,000+ > > > > > records, and this would be a slow tedious process. plus for each > card > > > I'd > > > > > have to query the mysql database for permissions, and then in turn > query > > > the > > > > > informix database in turn. this could take a long time to display > the > > > > > webpage. > > > > > > > > > > clear as mud??? recommendations? > > > > > > > > > > > > > > > > > > > > -- > > > > > 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 > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I'll have to play with this. this is not a public website per say so multiple requests on this in a short period of time probably isn't going to be an issue. I'll have to look at this & decide how I want to do this. I'm assuming I either need to do away with this, or make both options selectable. this isn't a released product so if they didn't get the access to this feature it wouldn't be the end of the world. they are already getting a ton more features with this product then they would otherwise have, which is nothing.

    Jeff

    "Philip Hallstrom" <philipadhesivemedia.com> wrote in message news:20030103165848.E99721-100000cypress.adhesivemedia.com... > > actually - I believe that may be a workable solution. you were mentioning > > checking the timestamp on a mysql table. how would I check the timestamp on > > a mysql table? > > see the timestamp data type. > > > even with this I'm betting it would be more time consuming to create the > > table then it would to pull the info from informix, and process validation 1 > > record at a time from mysql. that would be a simple query instead of an > > Yeah, but only the first time... if you get a lot of repeat traffic on the > same set of rows only the first "hit" will be slow since after that it > will all be in mysql... > > > insert. this would also all take place on the server it's self instead of > > pulling it from another server. I could load it up with ram & let it run. > > > > at any rate that gives me a lot of option to think about, and I'll probably > > has to work with some samples of the stuff from here to see what way is > > going to be the fastest. it would probably depend if the user was pulling > > this info in a session. if it was once, or several times. all something to > > think about. > > > > the other option I'm thinking about is just not giving the distributors > > access to this information, but restricting it to users with permissions to > > the entire batch only. > > > > thanks, > > > > Jeff > > > > "Philip Hallstrom" <philipadhesivemedia.com> wrote in message > > news:20030103161100.E93864-100000cypress.adhesivemedia.com... > > > Hmm... what about querying the informix database for the set of rows you > > > want all at once, putting that into a temporary mysql table with a > > > timestamp and then doing the rest of your work from there. > > > > > > Then the next time it happens check the timestamp on that mysql table and > > > if it's out of date, delete it and go and fetch updated rows from > > > informix, otherwise just use what's in that mysql table. > > > > > > This would act as a sort of replicated table, but only taking into account > > > the records that are actually being hit... > > > > > > maybe? > > > > > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > > > > > well - the informix database will be running on another server (a > > telecom > > > > billing system). this is a web based front end, and I really want to > > leave > > > > the other system alone 100%. if I were to modify anything I would make > > the > > > > mysql permissions table inside of informix, but there are liability > > reason > > > > which would keep me from doing so. > > > > > > > > still - you bring up an interesting point. a php script file that ran > > on > > > > crontab may not be a bad answer. however, again I would run into a > > problem > > > > of volume. there are an average of 3-4 million card in the informix > > server > > > > so I couldn't do this in a export & import. too may records, and info > > has > > > > to be accurate within 15 minutes. shear volume I believe is going to > > kill > > > > that idea. I would be back to 1 record at a time running every 15 > > minutes. > > > > I would think too much load, and more practical to do it 1 record at a > > time > > > > upon request which won't be too frequent. > > > > > > > > hoping there's another solution I'm not aware of, or over looked. > > > > > > > > Jeff > > > > > > > > "Philip Hallstrom" <philipadhesivemedia.com> wrote in message > > > > news:20030103154832.O93864-100000cypress.adhesivemedia.com... > > > > > Any chance you can do a somewhat frequent export from informix into > > mysql > > > > > or the other way around so all your stuff is in one database? > > > > > > > > > > -philip > > > > > > > > > > On Fri, 3 Jan 2003, Jeff Bluemel wrote: > > > > > > > > > > > ok - here's my problem. I have some data in mysql, and other data > > in > > > > > > informix. > > > > > > > > > > > > here is my application. this is for distributors of prepaid phone > > > > cards. > > > > > > prepaid phone cards have 3 numbers they can be identified by pin > > number > > > > > > (which is unique), or by batch & serial number. the batch number is > > > > > > basically the type of card, and the serial number & batch number for > > > > another > > > > > > unique identifier when used together. > > > > > > > > > > > > now - a batch can be given to several different distributors. > > > > therefore, > > > > > > when then are pulling various types of information on the batch they > > > > should > > > > > > only be able to see it for their cards, and not all of the cards in > > the > > > > > > batch. > > > > > > > > > > > > piece of cake right? well - the permissions information is kept in > > > > mysql, > > > > > > and the batch information its self is kept in an informix database. > > > > there > > > > > > is no way around this for me. > > > > > > > > > > > > the only way I can think of to work around this problem is to query > > 1 > > > > card > > > > > > at a time, and sum the info etc. together. however, there could be > > > > 400,000+ > > > > > > records, and this would be a slow tedious process. plus for each > > card > > > > I'd > > > > > > have to query the mysql database for permissions, and then in turn > > query > > > > the > > > > > > informix database in turn. this could take a long time to display > > the > > > > > > webpage. > > > > > > > > > > > > clear as mud??? recommendations? > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > 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 > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    I was wondering, if for example, an AOL user browses your site that uses php sessions, do the session ids change when they hop ip addresses? Im looking for a better way to counteract AOL's ip jumping.

    Thanks

    -- 
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    > From: Gerard Samuel [mailto:gsamtrini0.org > > I was wondering, if for example, an AOL user browses your site that uses > php sessions, > do the session ids change when they hop ip addresses?

    No. Sessions are not (or should not be!) tied to IP numbers.

    > Im looking for a better way to counteract AOL's ip jumping.

    Why? It's not just AOL!

    Mark C.

    attached mail follows:


    No its not a matter of tying a session to an ip address. Im modifiying some code that works as a "whosonline" on a site at any given time. Currently, it mainly works off ip address, of which we all know isn't accurate. As far as my usage of the word "AOL", that only represents my personal experience, with the ip address jumping phenomena.

    Mark Charette wrote:

    >>From: Gerard Samuel [mailto:gsamtrini0.org >> >>I was wondering, if for example, an AOL user browses your site that uses >>php sessions, >>do the session ids change when they hop ip addresses? >> >> > >No. Sessions are not (or should not be!) tied to IP numbers. > > > >>Im looking for a better way to counteract AOL's ip jumping. >> >> > >Why? It's not just AOL! > >Mark C. > > > >

    -- 
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    I have a page called 404.php which is set as the 404 page in a .htaccess file. At the top of this file, it has this: if(strtolower($_SERVER['REQUEST_URI']) != $_SERVER['REQUEST_URI']){ header("Location: http://{$_SERVER['HTTP_HOST']}".strtolower($_SERVER['REQUEST_URI'])); die; } which redirects to the same page with a lowercase URL if there are any uppercase characters. After that, it inserts the 404 into the database for checking later. But, when I test it with something like PaGeTHATSHOULDBELOWERCASE.php, it redirects to pagethatshouldbelowercase.php but still inserts it into the database (with the uppercase page name) even though the redirected page is 404-free. What am I doing wrong?

    -- 
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
    

    attached mail follows:


    You'll never get to the die() statement, because you redirected with the header() statement.

    ----- Original Message ----- From: "Leif K-Brooks" <eurleifbuyer-brokerage.com> To: <php-generallists.php.net> Sent: Friday, January 03, 2003 6:14 PM Subject: [PHP] Still executing afte die()?

    I have a page called 404.php which is set as the 404 page in a .htaccess file. At the top of this file, it has this: if(strtolower($_SERVER['REQUEST_URI']) != $_SERVER['REQUEST_URI']){ header("Location: http://{$_SERVER['HTTP_HOST']}".strtolower($_SERVER['REQUEST_URI'])); die; } which redirects to the same page with a lowercase URL if there are any uppercase characters. After that, it inserts the 404 into the database for checking later. But, when I test it with something like PaGeTHATSHOULDBELOWERCASE.php, it redirects to pagethatshouldbelowercase.php but still inserts it into the database (with the uppercase page name) even though the redirected page is 404-free. What am I doing wrong?

    --
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it
    will be prosecuted to the full extent of the law.
    

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

    attached mail follows:


    But it shouldn't get to the database insert because of the redirect either... I only added the die; when it still inserted with the redirect.

    Rick Emery wrote:

    >You'll never get to the die() statement, because you redirected with the header() statement. > >----- Original Message ----- >From: "Leif K-Brooks" <eurleifbuyer-brokerage.com> >To: <php-generallists.php.net> >Sent: Friday, January 03, 2003 6:14 PM >Subject: [PHP] Still executing afte die()? > > >I have a page called 404.php which is set as the 404 page in a .htaccess >file. At the top of this file, it has this: >if(strtolower($_SERVER['REQUEST_URI']) != $_SERVER['REQUEST_URI']){ > header("Location: >http://{$_SERVER['HTTP_HOST']}".strtolower($_SERVER['REQUEST_URI'])); > die; >} >which redirects to the same page with a lowercase URL if there are any >uppercase characters. After that, it inserts the 404 into the database >for checking later. But, when I test it with something like >PaGeTHATSHOULDBELOWERCASE.php, it redirects to >pagethatshouldbelowercase.php but still inserts it into the database >(with the uppercase page name) even though the redirected page is >404-free. What am I doing wrong? > >-- >The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it >will be prosecuted to the full extent of the law. > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > >

    -- 
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
    

    attached mail follows:


    My question would be what's the point? Why have it redirect to itself at all? You could more easily just convert it to lowercase and insert that value. I can't figure what possible advantage there is to doing the redirect to a custom error page. Only difference is what the user would see in the URL, no?

    Mike

    "Leif K-Brooks" <eurleifbuyer-brokerage.com> wrote in message news:3E164E53.1030209buyer-brokerage.com... > But it shouldn't get to the database insert because of the redirect > either... I only added the die; when it still inserted with the redirect. > > Rick Emery wrote: > > >You'll never get to the die() statement, because you redirected with the header() statement. > > > >----- Original Message ----- > >From: "Leif K-Brooks" <eurleifbuyer-brokerage.com> > >To: <php-generallists.php.net> > >Sent: Friday, January 03, 2003 6:14 PM > >Subject: [PHP] Still executing afte die()? > > > > > >I have a page called 404.php which is set as the 404 page in a .htaccess > >file. At the top of this file, it has this: > >if(strtolower($_SERVER['REQUEST_URI']) != $_SERVER['REQUEST_URI']){ > > header("Location: > >http://{$_SERVER['HTTP_HOST']}".strtolower($_SERVER['REQUEST_URI'])); > > die; > >} > >which redirects to the same page with a lowercase URL if there are any > >uppercase characters. After that, it inserts the 404 into the database > >for checking later. But, when I test it with something like > >PaGeTHATSHOULDBELOWERCASE.php, it redirects to > >pagethatshouldbelowercase.php but still inserts it into the database > >(with the uppercase page name) even though the redirected page is > >404-free. What am I doing wrong? > > > >-- > >The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it > >will be prosecuted to the full extent of the law. > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > >

    attached mail follows:


    On Saturday 04 January 2003 11:00, Leif K-Brooks wrote: > But it shouldn't get to the database insert because of the redirect > either... I only added the die; when it still inserted with the redirect.

    As you have already found out, the code _does_ continue to execute after the header() redirect.

    Try this:

    if (not_lowercase) { insert_into_db(); header(); die(); }

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

    /* because of network lag due to too many people playing deathmatch */

    attached mail follows:


    Because URLs are case-sensitive. A user may have cap lock on and go to something like MYPAGE.PHP, but the 404 page is supposed to redirect them to mypage.php.

    Mike Mannakee wrote:

    >My question would be what's the point? Why have it redirect to itself at >all? You could more easily just convert it to lowercase and insert that >value. I can't figure what possible advantage there is to doing the >redirect to a custom error page. Only difference is what the user would see >in the URL, no? > >Mike > > >"Leif K-Brooks" <eurleifbuyer-brokerage.com> wrote in message >news:3E164E53.1030209buyer-brokerage.com... > > >>But it shouldn't get to the database insert because of the redirect >>either... I only added the die; when it still inserted with the redirect. >> >>Rick Emery wrote: >> >> >> >>>You'll never get to the die() statement, because you redirected with the >>> >>> >header() statement. > > >>>----- Original Message ----- >>>From: "Leif K-Brooks" <eurleifbuyer-brokerage.com> >>>To: <php-generallists.php.net> >>>Sent: Friday, January 03, 2003 6:14 PM >>>Subject: [PHP] Still executing afte die()? >>> >>> >>>I have a page called 404.php which is set as the 404 page in a .htaccess >>>file. At the top of this file, it has this: >>>if(strtolower($_SERVER['REQUEST_URI']) != $_SERVER['REQUEST_URI']){ >>> header("Location: >>>http://{$_SERVER['HTTP_HOST']}".strtolower($_SERVER['REQUEST_URI'])); >>> die; >>>} >>>which redirects to the same page with a lowercase URL if there are any >>>uppercase characters. After that, it inserts the 404 into the database >>>for checking later. But, when I test it with something like >>>PaGeTHATSHOULDBELOWERCASE.php, it redirects to >>>pagethatshouldbelowercase.php but still inserts it into the database >>>(with the uppercase page name) even though the redirected page is >>>404-free. What am I doing wrong? >>> >>>-- >>>The above message is encrypted with double rot13 encoding. Any >>> >>> >unauthorized attempt to decrypt it > > >>>will be prosecuted to the full extent of the law. >>> >>> >>> >>>-- >>>PHP General Mailing List (http://www.php.net/) >>>To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >>> >>> >>> >>> >>> >>> >>-- >>The above message is encrypted with double rot13 encoding. Any >> >> >unauthorized attempt to decrypt it will be prosecuted to the full extent of >the law. > > >> >> >> > > > > >

    -- 
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
    

    attached mail follows:


    But I only want it to insert if the page was all lowercase when they went to it. I understand it continuing after redirecting, but why after die()ing too? Putting the insert code into an else statment solved the problem, but it's ugly, and the question still remains... why does it do this?

    Jason Wong wrote:

    >On Saturday 04 January 2003 11:00, Leif K-Brooks wrote: > > >>But it shouldn't get to the database insert because of the redirect >>either... I only added the die; when it still inserted with the redirect. >> >> > >As you have already found out, the code _does_ continue to execute after the >header() redirect. > >Try this: > > if (not_lowercase) { > insert_into_db(); > header(); > die(); > } > > >

    -- 
    The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
    

    attached mail follows:


    In addition to the other errors pointed out...

    I assume you want a loop. change

    while($row = mysql_fetch_array($response));

    to

    while($row = mysql_fetch_array($response)) {

    Take care, Greg

    --
    phpDocumentor
    http://www.phpdoc.org
    

    > while($row = mysql_fetch_array($response)); > > > echo("<p align="center"><img border="0" src="images/banner_chico_bio.jpg" > width="274" height="43"></p>"); > print "<img src=\" " . $row["banner_nombre"] . "\">"; > echo("<div align="center">"); > echo("<center>"); > echo("<table border="1" width="500" height="25">"); > echo("<tr>"); > echo("<td width="500" height="25">"); > echo("<div align="left">"); > echo("<table border="0" width="125" height="27">"); > echo("<tr>"); > echo("<td width="125" height="27"></td>"); > echo("</tr>"); > echo("</table>"); > echo("</div>"); > echo("<p>"); > > print($row["texto"] ."<br>\n"); > > echo("</td>"); > echo("</tr>"); > echo("</table>"); > echo("</center>"); > echo("</div>"); > } > > ?> > > > </div> > > </html> > >

    attached mail follows:


    It does not seem to be working at the moment.

    --- Greg Beaver <gregchiaraquartet.net> wrote: > Hello all, > > Josh Eichorn has just finished setting up an open cvs for the phpDocumentor > project (http://www.phpdoc.org). To get a current cvs build, use this > command: > > cvs -d :pserver:anonymousphpdoc.org:/opt/cvsroot login > > don't enter a password, then > > cvs -z 3 -d :pserver:anonymousphpdoc.org:/opt/cvsroot co phpdoc

    I got:

    ... U phpdoc/Documentation/Release-old/Release-1.1.0rc1 U phpdoc/Documentation/Release-old/Release-1.1.0rc2 cvs server: Updating phpdoc/Documentation/old cvs server: failed to create lock directory for `/opt/cvsroot/phpdoc/Documentation/old' (/opt/cvsroot/phpdoc/Documentation/old/#cvs.lock): Permission denied cvs server: failed to obtain dir lock in repository `/opt/cvsroot/phpdoc/Documentation/old' cvs [server aborted]: read lock failed - giving up ...

    Seems like the repository is messed up.

    ===== --- Jesus M. Castagnetto (jcastagnettoyahoo.com)

    Research: http://metallo.scripps.edu/ Personal: http://www.castagnetto.org/

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

    attached mail follows:


    Our hosting provider installed PHP 4.2 and thus disabled register_globals by default which our scripts depend on. We don't have access to php.ini to change this. This is with Apache. I tried putting

    php_flags register_globals on

    into .htaccess in the directory(s) with pages that need this but it does not seem to work. How can I enable register_globals selectively for some directories of pages so that our old scripts work again?

    Thanks Michael

    attached mail follows:


    Well, I have this in my .htaccess file, so it SHOULD work, but this will depend if your host allows things to changed via .htaccess.

    <IfModule mod_php4.c> php_flag register_globals on </IfModule>

    You can place this in your root directory, and it will work for your whole site, or place it further down the file hierarchy to only work from a certain directory down.

    Once you've done that, I'd recommend doing the OPPOSITE on your local test server:

    <IfModule mod_php4.c> php_flag register_globals off </IfModule>

    And spending some time updating your scripts and libraries to suit the "new" way -- I had heaps of stuff that didn't work, updated it all, and I really do prefer the "new" way, because I know where every var comes from.

    Justin

    on 04/01/03 11:50 AM, Michael Greenspon (mcgsequin.com) wrote:

    > Our hosting provider installed PHP 4.2 and thus disabled > register_globals by default which our scripts depend on. We don't have > access to php.ini to change this. This is with Apache. I tried putting > > php_flags register_globals on > > into .htaccess in the directory(s) with pages that need this but it does > not seem to work. How can I enable register_globals selectively for some > directories of pages so that our old scripts work again? > > Thanks > Michael

    attached mail follows:


    Why not just fix your code?

    *********** REPLY SEPARATOR ***********

    On 03/01/2003 at 2:50 PM Michael Greenspon wrote:

    >Our hosting provider installed PHP 4.2 and thus disabled >register_globals by default which our scripts depend on. We don't have >access to php.ini to change this. This is with Apache. I tried putting > >php_flags register_globals on > >into .htaccess in the directory(s) with pages that need this but it does >not seem to work. How can I enable register_globals selectively for some >directories of pages so that our old scripts work again? > >Thanks >Michael > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Thanks. This is what we've chosen to do-- 'fix' the code. Unfortunately this was all written 'old style' by novices, so 'fixing' it by putting in references to $_GET, $_POST etc. doesn't really lend any clarity to it. Values are still splayed out across multiple pages with no structure. But at least it works now. Still uncertain why the php_flag in htaccess didn't do it-- perhaps not enabled with Apache. Cheers M.

    "Michael J. Pawlowsky" wrote: > > Why not just fix your code? > > *********** REPLY SEPARATOR *********** > > On 03/01/2003 at 2:50 PM Michael Greenspon wrote: > > >Our hosting provider installed PHP 4.2 and thus disabled > >register_globals by default which our scripts depend on. We don't have > >access to php.ini to change this. This is with Apache. I tried putting > > > >php_flags register_globals on > > > >into .htaccess in the directory(s) with pages that need this but it does > >not seem to work. How can I enable register_globals selectively for some > >directories of pages so that our old scripts work again? > > > >Thanks > >Michael > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    personally i'd ask for a credit to your account for "damages" as that was bad practice for your provider to upgrade without testing sites first and at least consulting the ppl who sites will break with register globals off

    "Michael Greenspon" <mcgsequin.com> wrote in message news:3E163DFB.695195A9sequin.com... > Thanks. This is what we've chosen to do-- 'fix' the code. > Unfortunately this was all written 'old style' by novices, so 'fixing' > it by putting in references to $_GET, $_POST etc. doesn't really lend > any clarity to it. Values are still splayed out across multiple pages > with no structure. But at least it works now. Still uncertain why the > php_flag in htaccess didn't do it-- perhaps not enabled with Apache. > Cheers > M. > > > "Michael J. Pawlowsky" wrote: > > > > Why not just fix your code? > > > > *********** REPLY SEPARATOR *********** > > > > On 03/01/2003 at 2:50 PM Michael Greenspon wrote: > > > > >Our hosting provider installed PHP 4.2 and thus disabled > > >register_globals by default which our scripts depend on. We don't have > > >access to php.ini to change this. This is with Apache. I tried putting > > > > > >php_flags register_globals on > > > > > >into .htaccess in the directory(s) with pages that need this but it does > > >not seem to work. How can I enable register_globals selectively for some > > >directories of pages so that our old scripts work again? > > > > > >Thanks > > >Michael > > > > > >-- > > >PHP General Mailing List (http://www.php.net/) > > >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I'm in way over my head.

    the "..." below are where I chopped stuff out for clarity.

    The perl script "javatest.pl":

    $ENV{LD_LIBRARY_PATH} .=":.:..:../lib"; $ENV{CLASSPATH} .= ":Verisign.jar:."; print `javac PFProJava.java`; print `java PFProJava test-payflow.verisign.com 443 ... 30;`;

    me% perl javatest.pl RESULT= ... Approved&AUTHCODE ...

    AND

    % java PFProJava test-payflow.verisign.com 443 ... 30

    Works at the command line IF the perl script has been ran at least once from the same shell. (Must need to have those environments set maybe.)

    STUPID things I've tried in PHP.

    <? $yo = exec("./testjava.pl); echo $yo ; ?> Returns nothing.

    <? $yo = passthru("perl testjava.pl); echo $yo ; ?> Nada.

    <? $cmd = "java PFProJava test-payflow.verisign.com 443 ... 30"; $yo = exec($cmd); echo $yo ; ?> zip.

    Any help would be greatly appreciated.

    Sam

    attached mail follows:


    Try backticks $yo = `java PFProJava test-payflow.verisign.com 443 ... 30`; echo $yo;

    Andrew ----- Original Message ----- From: "Sam" <phpitab.com> To: "PHP" <php-generallists.php.net> Sent: Saturday, January 04, 2003 1:37 AM Subject: [PHP] PHP running perl running java OR PHP running java?

    > > I'm in way over my head. > > the "..." below are where I chopped stuff out for clarity. > > The perl script "javatest.pl": > > $ENV{LD_LIBRARY_PATH} .=":.:..:../lib"; > $ENV{CLASSPATH} .= ":Verisign.jar:."; > print `javac PFProJava.java`; > print `java PFProJava test-payflow.verisign.com 443 ... 30;`; > > me% perl javatest.pl > RESULT= ... Approved&AUTHCODE ... > > AND > > % java PFProJava test-payflow.verisign.com 443 ... 30 > > Works at the command line IF the perl script has been ran at least once from > the same shell. (Must need to have those environments set maybe.) > > STUPID things I've tried in PHP. > > <? $yo = exec("./testjava.pl); echo $yo ; ?> > Returns nothing. > > <? $yo = passthru("perl testjava.pl); echo $yo ; ?> > Nada. > > <? > $cmd = "java PFProJava test-payflow.verisign.com 443 ... 30"; > $yo = exec($cmd); > echo $yo ; > ?> > zip. > > Any help would be greatly appreciated. > > Sam > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    I am creating a graph using jpgraph and it is based on values grabbed every 15 minutes. So for the first graph I want to report the values for the last 24 hours. Would it make sense to report 96 points or what is everyones suggestion?

    The time is stored as a Unix timestamp...the values are server loads.

    Jeff

    attached mail follows:


    hi i was wondering if there was a way to get the clients ip's behind proxies that hide the HTTP_X_FORWARDED_FOR header ? this is most important for checking ips for polls except some proxies dont send this important header ??

    attached mail follows:


    On Saturday 04 January 2003 12:38, electroteque wrote: > hi i was wondering if there was a way to get the clients ip's behind > proxies that hide the HTTP_X_FORWARDED_FOR header ?

    No.

    > this is most important > for checking ips for polls except some proxies dont send this important > header ??

    It's not that important. In many cases it could very well be a private IP address and hence of dubious value.

    If the accuracy of the poll is important then only let registered and logged in users take part in the poll. Even then, depending on your registration procedures, you may have people registering multiple times to cast multiple votes.

    In short there is no surefire way of preventing people from voting more than once.

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

    /* "From there to here, from here to there, funny things are everywhere." -- Dr. Seuss */

    attached mail follows:


    Hi folks,

    On previous (good) advice given in my "Timeout during SMTP operation." thread, I've offloaded some work in my function to an external Python script. The script works beautifully when I execute it myself, from the shell, but I can't get my PHP script to execute it for me. My new function is:

    // Sends e-mail to the specified list of member e-mail addresses. function ncSendMail($addresses, $subject, $body) { // Delete last mailing file. $ftp = ftp_connect("ftp.somewhere.net"); ftp_login($ftp, "someone", "something"); ftp_delete($ftp, "www/ncmail/mailing.txt"); ftp_quit($ftp);

    // Create new mailing file. $mailing = fopen("ftp.somewhere.net/www/ncmail/mailing.txt">ftp://someone:somethingftp.somewhere.net/www/ncmail/mailing.txt", "w");

    // Get the automail 'footer' from the 'automail' table and append it to the body. $body .= ncGetAutomail("footer");

    // Load addresses, comma seperated and terminated by a newline, into the mailing file. foreach($addresses as $address) { $string .= $address.","; } $string = substr($string, 0, strlen($string)-1); // Strip last comma. fwrite($mailing, $string."\n");

    // Write subject, then body, seperated by newlines, into the mailing file. fwrite($mailing, $subject."\n"); fwrite($mailing, $body);

    // Close file, call script in background, return. fclose($mailing); exec("python ncMailer.py >/dev/null &"); return true; }

    The mailing file is written fine, and the Python script parses the file and e-mails fine, as long as I run it myself from the shell. However, the exec() call appears to do nothing at all, least of all run my script. I've tried a number of different things, but nothing seems to work.

    Any help would be greatly appreciated,

    gilrain