php-general Digest 19 Dec 2003 15:24:13 -0000 Issue 2482

Topics (messages 172994 through 173020):

Re: Best way to store data.
        172994 by: John W. Holmes
        172995 by: Sn!per

Re: Countries, cities, states database
        172996 by: Thomas Svenson

Re: Post New Email to Website?
        172997 by: Manuel Lemos

Re: $_POST[]
        172998 by: Justin French
        173000 by: Burrito Warrior
        173006 by: Justin French
        173014 by: David T-G
        173015 by: Jay Blanchard

Re: PHP Template Function
        172999 by: dirk maetens
        173010 by: rush

[Newbie Guide] For the benefit of new members
        173001 by: Ma Siva Kumar

Request form duplicate names
        173002 by: Terence
        173003 by: Frédéric HARDY
        173007 by: Justin French
        173009 by: Wouter van Vliet

Re: Changing languages
        173004 by: Ford, Mike               [LSS]

Re: Script timeout Problem
        173005 by: Marek Kilimajer
        173008 by: Haseeb Iqbal
        173011 by: Jay Blanchard
        173013 by: Marek Kilimajer
        173020 by: Jas

Php Windows server
        173012 by: E. Ricardo Santos

CRON throws error, but no command line problems
        173016 by: Jay Blanchard
        173017 by: David OBrien
        173018 by: Jay Blanchard

Re: Where'd my session go??
        173019 by: Anthony

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Philip J. Newman wrote:

Hi, is the best way to store data in a mysql database in the text it was submitted, or 
in HTML
format ... changing all the \r's and things to <br>

Depends what you're going to be doing with it. If you know it's only going to go back out to web pages, then it'd make sense to do conversions only once instead of each time it's viewed. If this text can be put into text emails, then you don't want it converted.

I prefer to run htmlentities() before saving it in the database, but not nl2br(). htmlentities() helps when you place the data back into form input elements.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Quoting Justin French <[EMAIL PROTECTED]>:

> Theory 3:
> For more complex transformations (I have a library which performs heaps 
> of transformations for paragraphs, headings, line breaks, ol and ul 
> lists, and heaps more), ...


and where can we find that library ?

--



---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------

--- End Message ---
--- Begin Message ---
Hi Chris,

Chris Shiflett wrote:
> I like GeoIP:
>
> http://www.maxmind.com/

I'm in the search for something similar. Took a look at that site and it
seems they want cash for everything.

Is there any free resources available. It's of course possible to find the
info on www.ansi.org and other international standard organisations. Would
be nice though if there is any site with more ready to use data.

/Thomas

--- End Message ---
--- Begin Message --- Hello,

On 12/18/2003 03:10 PM, [EMAIL PROTECTED] wrote:
I do a website for a club I belong to and would like to post the
Subjects of new emails to our Announcements email list on the
website. Instead of manually adding the subjects to the website, I
thought there might be a way to automate it. If anyone could point me
to a script that can check an email list for new messages and then
include part of that message into a website, I would really
appreciate it.

If you subscribe an address to that mailing list that is associated to a mailbox that is accessible via POP3, you can check that mailbox regularly to extract the mailing list messages.

In that case you may want to try this POP3 client class:

http://www.phpclasses.org/pop3class

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message --- On Friday, December 19, 2003, at 01:35 PM, Philip J. Newman wrote:

<?php if ($_POST[formReviewBy]=="Cade Lloyd") { echo "selected"; } ?>

Should $_POST[formReviewBy] have quotes or dose it not matter?

Well, since you've obviously tested it and it works, then the simple answer is probably "it doesn't matter", however, all examples in the manual using string-keys that I can see (http://www.php.net/manual/en/language.types.array.php) use quote around the key.

You will DEFINITELY need them when the string key has a space or possibly other not-allowed characters, so my advice (which I follow myself) is to always include quotes around a string key.

$_POST['formReviewBy']=='Cade Lloyd') { echo 'selected'; }

No need for double quotes unless PHP needs to evaluate $vars or escaped chars (like \n or \t) either.


Justin French
--- End Message ---
--- Begin Message ---
That practice $_POST[formReviewBy] should be discouraged.  That kind
of practice is nearly as bad as magic numbers.

You *should* always put variables referenced by $_POST["formReviewBy"]
in quotes unless specifically designed.

Why??

If you run into a page with a mysterious error (usually missing data),
one strategy is to turn on all the debug output using

error_reporting(E_ALL)

to see if there are any clues about why your code isn't working.  I
tried this on a typical page, and here's what I got:

Notice: Use of undefined constant category_id - assumed 'category_id' in
/usr/home/devweb/madi/mods/autoresponder/src/index.php on line 24

and in this index.php on line 24:

24: $arr_list[category_id] = $db_cat_id;

I apologize if I am ranting, but I've spent time attempting to debug other
programmer's code when they're guilty of this.


-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 8:57 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] $_POST[]


On Friday, December 19, 2003, at 01:35  PM, Philip J. Newman wrote:

> <?php if ($_POST[formReviewBy]=="Cade Lloyd") { echo "selected"; } ?>
>
> Should $_POST[formReviewBy] have quotes or dose it not matter?

Well, since you've obviously tested it and it works, then the simple
answer is probably "it doesn't matter", however, all examples in the
manual using string-keys that I can see
(http://www.php.net/manual/en/language.types.array.php) use quote
around the key.

You will DEFINITELY need them when the string key has a space or
possibly other not-allowed characters, so my advice (which I follow
myself) is to always include quotes around a string key.

$_POST['formReviewBy']=='Cade Lloyd') { echo 'selected'; }

No need for double quotes unless PHP needs to evaluate $vars or escaped
chars (like \n or \t) either.


Justin French

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

--- End Message ---
--- Begin Message --- On Friday, December 19, 2003, at 05:44 PM, Burrito Warrior wrote:

That practice $_POST[formReviewBy] should be discouraged.  That kind
of practice is nearly as bad as magic numbers.

I think you'll find I *was* discouraging it.

Justin
--- End Message ---
--- Begin Message ---
Burrito Warrior --

...and then Burrito Warrior said...
% 
% That practice $_POST[formReviewBy] should be discouraged.  That kind
% of practice is nearly as bad as magic numbers.

What are magic numbers?  Surely you don't mean the file recognition codes
in /etc/magic for use by file(1) under *NIX...


TIA & HAND & Happy Holidays

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
[snip]
What are magic numbers?  Surely you don't mean the file recognition
codes
in /etc/magic for use by file(1) under *NIX...
[/snip]

Magic numbers are hard coded numbers that are not referrenced by a
variable i.e.

$thisNumber = (4 == $magic)? do stuff: do other stuff;

should be 

$var = 4;
$thisNumber = ($var == $magic)? do stuff: do other stuff;

--- End Message ---
--- Begin Message ---
Hi Cameron,

Seems like http://xaoza.net/software/phpmesh/ could be of some interest to you.
I'm checking it out myself as we speak, so I cannot confirm whether it gives you
template inheritance via subdirectories. It does provide a means to do away with
standard includes anywhere on your site...

HTH & good luck with the project,
dirk

ps: I welcome any insights you might gather on implementing template inheritance
without the need for includes (by any means), as I will be facing a similar
conversion project in the opening weeks of 2004.

--- End Message ---
--- Begin Message ---
"Cameron B. Prince" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Basically, a directory was defined within the webserver to have a
> PerlHandler, Embperl::Object. When any page in or under that directory is
> called, Embperl::Object would look for template files in the current
> directory and go upward in the tree until they are found and
prepend/append
> them. There was no code or includes required within the pages themselves.

In TemplateTamer, for each page you define the class that is responsible for
handling it. In typical site you use this to build a hierarchy of pages
something like below:

MySitePage
--UserPage
    --NewsPage
    --ArticlePage
    --ListPage
    ...
--ContributorPage
    --EditNewsPage
    ...
--AdminPage
    --AddUserPage
    --BackupPage
    ...

You catch my drift. Then NewsPage inhertis from the UserPage, and
overides/adds functinality specific to itself, while keeping most of the
implementation from the parent UserPage.

The organization is not per directory, like in your example, but TT lets you
keep your projects files in neat bundle, and helps you with house keeping
with template files. It also lets you see your templates in tree view, sith
all variables and subtemplates.

rush
--
http://www.templatetamer.com/

--- End Message ---
--- Begin Message ---
=======================================
This message is for the benefit of new subscribers 
and those new to PHP.  Please feel free to add 
more points and send to the list.
=======================================
1. If you have any queries/problems about PHP try 
http://www.php.net/manual/en first. You can 
download a copy and use it offline also. 

Please also try http://www.php.net/manual/faq.php 
to get answers to frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for 
"php YOUR QUERY" may fetch you relevant results 
within the first 10 results, if you are lucky.

3. There is a searchable archive of the mailing 
list discussion at 
http://phparch.com/mailinglists. Many of the 
common topics are discussed repeatedly, and you 
may get answer to your query from the earlier 
discussions. 

For example: One of the repeatedly discussed 
question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. 
You can get all the opinions by going through the 
list archives. If you want a chosen list try this 
link : http://phpeditors.linuxbackup.co.uk/ 
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want find out 
what extensions are available to you?

Just put the following code into a file with a 
.php extension and access it through your 
webserver:

<?php
        phpinfo();
?> 

If PHP is installed you will see a page with a lot 
of information on it. If PHP is not installed (or 
not working correctly) your browser will try
to download the file.

(contributed by Teren and reworded by Chris W 
Parker)

5. If you are stuck with a script and do not 
understand what is wrong, instead 
of posting the whole script, try doing some 
research yourself. One useful trick is to print 
the variable/sql query using print or echo 
command and check whether you get what you 
expected. 

After diagnosing the problem, send the details of 
your efforts (following steps 1, 2 & 3) and ask 
for help.

6. PHP is a server side scripting language. 
Whatever processing PHP does takes 
place BEFORE the output reaches the client. 
Therefore, it is not possible to access the 
users'  computer related information (OS, screen 
size etc) using PHP. You need to go for 
JavaScript and ask the question in a JavaScript 
list.

On the other hand you can access the information 
that is SENT by the user's browser when a client 
requests a page from your server. You can
find details about browser, OS etc as reported by 
this request. - contributed by Wouter van Vliet 
and reworded by Chris W Parker.

7. Provide a clear descriptive subject line. Avoid 
general subjects like "Help!!", "A Question" etc.  
Especially avoid blank subjects. 

8. When you want to start a new topic, open a new 
mail composer and enter the mailing list address 
[EMAIL PROTECTED] instead of replying to 
an existing thread and replacing the subject and 
body with your message.

9. It's always a good idea to post back to the 
list once you've solved your problem. People 
usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your 
solution you're helping the next person with the 
same question. [contribued by Chris W Parker]

10. Ask smart questions  
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with PHP.

Best regards,

-- 
Integrated Management Tools for leather industry
----------------------------------
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

--- End Message ---
--- Begin Message ---
Dear All,

Is there a way to request form fields which have the same name using POST?

I generate dynamic checkboxes all with the same name, but with different
values

<input type'checkbox' name='id' value'1'>
<input type'checkbox' name='id' value'7'>
<input type'checkbox' name='id' value'78'>
etc

I could alternatively do it through GET and split the querystring, but i'd
prefer POST.

Thanks
Terence

--- End Message ---
--- Begin Message ---
Try <input type'checkbox' name='id[]' value='1'>

So in your script :

$ids = $POST['name'];
$first_id = $POST['name'][0];

Best regards, Fred
===================================================================
Frederic HARDY                        Email: [EMAIL PROTECTED]
HEXANET SARL                          URL: http://www.hexanet.fr/
ZAC Les Charmilles                    Tel: +33 (0)3 26 79 30 05
3, allée Thierry Sabine               Direct: +33 (0)3 26 61 77 84
BP 202 - 51686 REIMS CEDEX 2 FRANCE
===================================================================

----- Original Message ----- 
From: "Terence" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 19, 2003 10:41 AM
Subject: [PHP] Request form duplicate names


> 
> Dear All,
> 
> Is there a way to request form fields which have the same name using POST?
> 
> I generate dynamic checkboxes all with the same name, but with different
> values
> 
> <input type'checkbox' name='id' value'1'>
> <input type'checkbox' name='id' value'7'>
> <input type'checkbox' name='id' value'78'>
> etc
> 
> I could alternatively do it through GET and split the querystring, but i'd
> prefer POST.
> 
> Thanks
> Terence
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message --- On Friday, December 19, 2003, at 08:41 PM, Terence wrote:

Is there a way to request form fields which have the same name using POST?

I generate dynamic checkboxes all with the same name, but with different
values

<input type'checkbox' name='id' value'1'>
<input type'checkbox' name='id' value'7'>
<input type'checkbox' name='id' value'78'>

I think you change name='id' to name='id[]' -- but it's been so long since I've done anything with checkboxes that I'm not 100% sure. Test test test.
--- End Message ---
--- Begin Message ---
<input type='checkbox' name='id[]' value='1'>

:P

On vrijdag 19 december 2003 11:10 Frédéric HARDY told the butterflies:
> Try <input type'checkbox' name='id[]' value='1'>
> 
> So in your script :
> 
> $ids = $POST['name'];
> $first_id = $POST['name'][0];
> 
> Best regards, Fred
> ===================================================================
> Frederic HARDY                        Email: [EMAIL PROTECTED]
> HEXANET SARL                          URL: http://www.hexanet.fr/
> ZAC Les Charmilles                    Tel: +33 (0)3 26 79 30 05
> 3, allée Thierry Sabine               Direct: +33 (0)3 26 61 77 84
> BP 202 - 51686 REIMS CEDEX 2 FRANCE
> ===================================================================
> 
> ----- Original Message -----
> From: "Terence" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 19, 2003 10:41 AM
> Subject: [PHP] Request form duplicate names
> 
> 
> > 
> > Dear All,
> > 
> > Is there a way to request form fields which have the same name
> > using POST? 
> > 
> > I generate dynamic checkboxes all with the same name, but with
> > different values 
> > 
> > <input type'checkbox' name='id' value'1'>
> > <input type'checkbox' name='id' value'7'>
> > <input type'checkbox' name='id' value'78'>
> > etc
> > 
> > I could alternatively do it through GET and split the querystring,
> > but i'd prefer POST. 
> > 
> > Thanks
> > Terence
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
On 19 December 2003 01:27, Cesar Aracena wrote:

> Hi all,
> 
> I have an issue here. I'm making a english/spanish site and want the
> browser to remember their preference with a cookie. The first time a
> visitor comes into the site, they will be taken to the english part
> (www.site.com/eng/) and when someone clicks over the "Spanish" link,
> I want the cookie that was setled to be erased and a new one to be
> placed instead. The thing is that is being done in two separate files
> because the problem with headers (one for deleting the cookie and the
> other to place the new one). The script I have (pretty mesy) doesn't
> erase the cookie OR places the same one over again instead of placing
> the new one. Here's what I've got so far: 
> 
> THE MAIN INDEX PAGE:
> 
> <?
> if (isset($_COOKIE['Languange']))
> {
> $relative_url = $_COOKIE['Language'];
> header("Location: http://localhost/icaam10/".$relative_url); }
> elseif(!isset($_COOKIE['Languange']) AND !isset($lan)) {
> $value = "eng";
> setcookie ("Language", $value, time()+31536000);
> header("Location: http://localhost/icaam10/eng";);
> }
> elseif(!isset($_COOKIE['Languange']) AND isset($lan)) {
> $value = $lan;
> setcookie ("Language", $value, time()+31536000);
> header("Location: http://localhost/icaam10/".$value);
> }

Just at a quick glance, you've got 3 occurrences of 'Language' and 2 occurrences of 
'Languange' (with an extra 'n').  Fix these to all be 'Language', try it again, and 
come back here if you've still got problems.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message --- Haseeb Iqbal wrote:
how can i do that?
btw the script runs on a local machine but updates the records on a
webserver i mean live server. this is also a factor for the timeout. the
script was running smoothly for 24000 recods before but now it suddenly
timeout after 800records. i dont know what is heppening


Try placing mysql_ping function just before $nConn->doQuery($strQuery); It will check the connection and reconect if it is lost.
--- End Message ---
--- Begin Message ---
i tried this but to noavail. anyother sugestion really this problem is
really annoying me now
Haseeb
----- Original Message ----- 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Haseeb Iqbal" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 19, 2003 10:23 PM
Subject: Re: [PHP] Re: Script timeout Problem


> Haseeb Iqbal wrote:
> > how can i do that?
> > btw the script runs on a local machine but updates the records on a
> > webserver i mean live server. this is also a factor for the timeout. the
> > script was running smoothly for 24000 recods before but now it suddenly
> > timeout after 800records. i dont know what is heppening
> >
>
> Try placing mysql_ping function just before $nConn->doQuery($strQuery);
> It will check the connection and reconect if it is lost.
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
[snip]
i tried this but to noavail. anyother sugestion really this problem is
really annoying me now
[/snip]

If it is the script timing out place this at the beginning of the
script. (I do this with scripts that update and insert millions of
records)

set_time_limit(0);

See http://www.php.net/set_time_limit

You have three factors, the query time (which should be OK), 
the PHP time limit (you can set this in php.ini with max_execution_time,
the web server time limit (in httpd.conf for Apache, I am not sure where
for IIS)

--- End Message ---
--- Begin Message --- Haseeb Iqbal wrote:
i tried this but to noavail. anyother sugestion really this problem is
really annoying me now
Haseeb

The browser might be timing out. You should regulary send out some dummy output and flush()
--- End Message ---
--- Begin Message --- Ok, I posted an example in the body of this for your time out limits but here it is again...

At the end of each of your SQL statements for UPDATE or INSERT simply add ...LIMIT 2000";
That should limit the updating or inserting of database records until the page is refreshed to add more...
HTH
Jas


Haseeb Iqbal wrote:
how can i do that?
btw the script runs on a local machine but updates the records on a
webserver i mean live server. this is also a factor for the timeout. the
script was running smoothly for 24000 recods before but now it suddenly
timeout after 800records. i dont know what is heppening

Haseeb
----- Original Message ----- From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 19, 2003 3:16 AM
Subject: [PHP] Re: Script timeout Problem



Have you tried setting a limit on your MySQL insert and update
statements to limit the amount trying to be processed?

Haseeb Iqbal wrote:

hi,
i need to update a mysql table with a dbf file, the dbf file contains

more then 160000 records. i knew that the script will not be able to update 160000 records in 1 go so i am refreshing the page after speacific no of records. but still the same problem. the script timeout.i tried changing the timeout limit to 300 secs but to noavail. i am pasting the code here.plz take a look may by you can tell me what i am doing wrong


<? define("strPath","./");

define("_MySqlEnable",TRUE);

set_time_limit(0);

require_once(strPath."paths.php");

$strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf";

$DBPointer=dbase_open($strDBName,0) or die("Cannot open file for

reading");

$nNoOfRecs=dbase_numrecords($DBPointer);

$nLoopBreak=1500;

$nConn=GetCon();

if (empty($nLoopStart)) { $nLoopStart=1; }

if ($nNoOfRecs > $nLoopBreak)
 {
  $nLoopTill=$nLoopStart + $nLoopBreak;
  $nFinal=FALSE;
 }
else
 {
  $nLoopTill=$nLoopBreak;
  $nFinal=TRUE;
 }

for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++)
 {
  $arrData=dbase_get_record($DBPointer,$nCount);

  $GRP=CheckString($arrData[0]);
  $CAT=CheckString($arrData[1]);
  $SUB=CheckString($arrData[2]);
  $VEND_CODE=CheckString($arrData[3]);
  $MANU_PART=CheckString($arrData[4]);
  $PART_NUM=CheckString($arrData[5]);
  $DESCR=CheckString($arrData[6]);
  $COST=CheckString($arrData[7]);
  $RETAIL=CheckString($arrData[8]);
  $QTY=CheckString($arrData[9]);
  $LIST_PRICE=CheckString($arrData[10]);
  $EFF_DATE=CheckString($arrData[11]);
  $TECH_FAX=CheckString($arrData[12]);
  $STATUS=CheckString($arrData[13]);
  $UPC=CheckString($arrData[14]);

$strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND

cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";

$nConn->doQuery($strQuery);

  if ($nConn->cntResult()==0)
   $strQuery="INSERT INTO

products(products.grp,products.cat,products.sub,products.vend_code,products. manu_part,products.part_num,products.desc,products.cost,products.retail,prod ucts.qty,products.list_price,products.eff_date,products.tech_fax,products.st atus,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','" $PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRI CE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')";

$strQuery="INSERT INTO


products(products.grp,products.cat,products.sub,products.vend_code,products. manu_part,products.part_num,products.desc,products.cost,products.retail,prod ucts.qty,products.list_price,products.eff_date,products.tech_fax,products.st atus,products.upc)

VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','"
$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRI
CE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."'

LIMIT 200)";

  else
   $strQuery="UPDATE products SET

products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$R ETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$T ECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";

$strQuery="UPDATE products SET


products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$R ETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$T ECH_FAX',status='$STATUS',upc='$UPC'

WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND
vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND
part_num='".$PART_NUM."'LIMIT 200";

  //echo "<br>nCOunt - > $nCount -----".$strQuery;
  $nConn->doQuery($strQuery);
 }
$nCount++;
$nLoopStart=$nCount;
if ($nFinal==FALSE)
 {
   //1500 records updated so refresh the page
?>
<meta http-equiv="Refresh" content="2;

URL=mypage.php?nLoopStart=<?=$nLoopStart;?>">

<?
 }
else
 {
   // all records updated so redirst to calling page.
?>
<meta http-equiv="Refresh" content="2; URL=main.php?nStatus=1">
<?
 }
?>

Haseeb

That might help out with the timeouts too. Jas

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



--- End Message ---
--- Begin Message ---
Somebody could say to me if something special exists to form for the
treatment of the sessions in a Php Windows server?



I have   a code  that works perfectly in Apache, nevertheless, when
executing it  in a Windows server the sessions do not activate.





 I am using php 4.3.3 like ISAPI. There is something I must define in
php.ini?


Thanks

--- End Message ---
--- Begin Message ---
Good morning group!

I am running PHP 4.3.4RC1 on a FreeBSD sevrer that recently came online
as an upgrade from another server. (previous PHP version was 4.1.n) Via
a CRON job I am running a script that was working fine to ftp another
server, download some files, and then process those files. Here is the
code snippet where the failure occurs...

// ftp variables
$ftp_server = "rc.foo.com";
$ftp_user = "foo";
$ftp_pass = "foopass";

// connect to ftp server
$ftpc = ftp_connect($ftp_server); <--LINE 36
if(!ftp_login($ftpc, $ftp_user, $ftp_pass)){
        echo "Could not login to $ftp_server";
        exit();
}

The CRON reports this

PHP Warning:  ftp_connect(): php_network_getaddresses: getaddrinfo
failed: No address associated with hostname in
/usr/local/www/data.default/crm/parsecdr.php on line 36

The only reference I could find to this problem was in
http://www.php.net/fopen which said that Apache should be restarted. I
have done the restart and I am for the CRON job to run again in the next
few minutes. While I am waiting has anyone ever seen this error? If so,
can you give me an idea of what I may need to do to fix the problem? I
would be so appreciative and will put in a good word with Santa for you.

Thanks!

--- End Message ---
--- Begin Message --- This is usually a DNS error. It's telling you it can't find an IP address for the given hostname
-Dave


At 08:57 AM 12/19/2003, Jay Blanchard wrote:
Good morning group!

I am running PHP 4.3.4RC1 on a FreeBSD sevrer that recently came online
as an upgrade from another server. (previous PHP version was 4.1.n) Via
a CRON job I am running a script that was working fine to ftp another
server, download some files, and then process those files. Here is the
code snippet where the failure occurs...

// ftp variables
$ftp_server = "rc.foo.com";
$ftp_user = "foo";
$ftp_pass = "foopass";

// connect to ftp server
$ftpc = ftp_connect($ftp_server); <--LINE 36
if(!ftp_login($ftpc, $ftp_user, $ftp_pass)){
        echo "Could not login to $ftp_server";
        exit();
}

The CRON reports this

PHP Warning:  ftp_connect(): php_network_getaddresses: getaddrinfo
failed: No address associated with hostname in
/usr/local/www/data.default/crm/parsecdr.php on line 36

The only reference I could find to this problem was in
http://www.php.net/fopen which said that Apache should be restarted. I
have done the restart and I am for the CRON job to run again in the next
few minutes. While I am waiting has anyone ever seen this error? If so,
can you give me an idea of what I may need to do to fix the problem? I
would be so appreciative and will put in a good word with Santa for you.

Thanks!

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

--- End Message ---
--- Begin Message ---
[snip]
This is usually a DNS error. It's telling you it can't find an IP
address 
for the given hostname
[/snip]

I knew that, but it does just fine if I run the script from the command
line. No errors at all.

--- End Message ---
--- Begin Message ---
That was it! ... Thanks a lot bro.

- Anthony


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It's the garbage collector - session.gc_maxlifetime setting. The setting
> is server wide, unless you use your own session storage functions.
>
> Anthony wrote:
>
> > I've got an issue with an app I wrote.  I store some information about
the
> > user and if they are logged into the app in session variables.  The
problem
> > is that if they leave the app idle for a while ( about an hour) the
session
> > information is lost, so the user is prompted to log back into the
> > application.  I checked session.cookie_lifetime and it's set to 0.  The
> > client side is IE 5.5 or 6.  What could be causing the session to be
lost?
> > Thanks for your help :)
> >
> > - Anthony
> >

--- End Message ---

Reply via email to