php-windows Digest 23 Aug 2001 07:50:45 -0000 Issue 716 Topics (messages 8994 through 9009): Re: permission problem 8994 by: lolodev news php Re: Array 8995 by: Mike Flynn Re: Help with mysql rowpointer 8996 by: Mike Flynn 9002 by: Angie Tollerson Re: issue with undefined variables with PHP 4.06 8997 by: Mike Flynn 8998 by: Angie Tollerson 9000 by: Angie Tollerson PHP/VB/Byrefs 8999 by: Ryan Marrs Re: PHP sessions under Win2k AS 9001 by: Angie Tollerson Installer and missing OCX 9003 by: Carlo Borreo 9004 by: Phil Driscoll mail on windows 9005 by: P.Agenbag 9006 by: Angie Tollerson mail problem on win2K 9007 by: P.Agenbag managing bounced mail 9008 by: P.Agenbag Upload 9009 by: Sichta Daniel 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] ----------------------------------------------------------------------
i find respons: problem is because i forgot to pass file name parameter to copy function. a copy function can't create a dir Lolodev News Php <[EMAIL PROTECTED]> a écrit dans le message : [EMAIL PROTECTED] > i 've win 2ks, php4,iis5. > > i try to dev a upload program with a copy function. > > when i test, i've an error: > > Warning: Unable to create > 'D:\users\Apache\www-serveurs\cgpme-54\htdocs\Infos': Permission denied in > D:\users\Apache\www-serveurs\cgpme-54\htdocs\scripts\actu.php on line 53 > > i 've put right IUSR_server to my directory with write permission. > > i don"t no what to do ?? > >
You'll have to access the fields by element ID. document.theformname.elements[id].properties document.theformname.length is the number of elements in the form. The elements go in order starting at 0. -Mike At 09:07 AM 8/22/2001 +0200, you wrote: >This is easy. My problem is that I need to work with this variable (array) >also in JavaScript !! So I have test[1]........test[5] in PHP but how can I >get values from this variables in JavaScript ? I know this is little off >topic but I spent already whole day on this with no luck so far !! > >DAN > >-----Original Message----- >From: Mike Flynn [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 21, 2001 4:48 PM >To: [EMAIL PROTECTED] >Subject: [PHP-WIN] Re: Array > > >Alternately, though I think the array solution is probably the most >durable, you could also do it as such: > >for ($i = 1; $i<6; $i++) { > print "<input type=\"text\" name=\"test$i\">\n"; >} > >and then retrieve them as $test1 thru $test6, or if you want to use a loop >like this: >for ($i = 1; $i < 6; $i++) { > $thevariable = "test$i"; > $thevalue = $$thevariable; >} > >At 03:36 PM 8/21/2001 +0200, Darvin Andrioli wrote: > >Change your code in: > > > > <? > > for ($i=1; $i<6; $i++) { > ><input type="text" name="test[$i]"> > >} > >?> > > > >You will obtain an array, named test, with 5 elements. > > > >Bye > > > >Darvin > > > > > -----Messaggio originale----- > > > Da: Sichta Daniel [mailto:[EMAIL PROTECTED]] > > > Inviato: martedi 21 agosto 2001 15.15 > > > A: [EMAIL PROTECTED] > > > Oggetto: [PHP-WIN] Array > > > > > > > > > Hi there !! > > > cfg: php4.0.4pl1, w2k, apache 1.3.20 > > > Situation: > > > <? > > > for ($i=1; $i<6; $i++) { > > > <input type="text" name="test"> > > > } > > > ?> > > > This is all in one form. How can I get all five values of test from this > > > kind of code ? > > > > > > DAN > > > > > > >-- > >PHP Windows Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -=- Mike Flynn - Burlington, VT -=- >[EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood * >the classic example of liberal, consensus, win-win, >Clintonesque, spin doctor, sell-out, cultural appropriation, >commodification of dissent type event in the world today > (-BBB) > > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -=- Mike Flynn - Burlington, VT -=- [EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood * the classic example of liberal, consensus, win-win, Clintonesque, spin doctor, sell-out, cultural appropriation, commodification of dissent type event in the world today (-BBB)
To return the total amount of records in a table, just do: $query = 'SELECT COUNT(*) FROM tblName'; $result = mysql_query($query); $total_records = mysql_result($result, 0); Or, for short, $total_records = mysql_result(mysql_query($query), 0); To step through the records, just do a normal SELECT query: $query = 'SELECT stuff FROM tblName '; $query .= "WHERE intStuff=$stuff ORDER BY stuff"; $result = mysql_query($query); if ($row = mysql_fetch_row($result)) { do { while ($row = mysql_fetch_row($result)); } else { // stuff for if there are no records. } Does this answer your question? If not, please be more specific as to what I missed :) -Mike At 12:17 PM 8/22/2001 +0200, you wrote: >Hey there. I realize this is a forum for php-windows users,but knowing >that most of you guys run a mysql db as backend i have a question for >you.. > >I know there is a way to return the amount of records in the db by using >the mysql_num_rows($resultid). My problem is that it only returns the >total number of records from my query > >I have seen that there is a function called mysql_data_seel(par,par), >but i am not sure how it works. > >My problem is the following> >i want to do a print out of each record in the db , but the HTML code >(to be exact the positioning of the HTML table should be different >depending on the number of record printed out. > >To illustrate this is more or less what i want > > >i want to print out record 1 in one style , then i want to next record >to be printed out in a different way. Is there a way to do a check on >which number of record is printed out. >I realize i cannot use the id simply because if i do a printout of total >4 records and i want to use a record with id = 100 e.g then it won't do >me any good. > >Basically is there a way for me to check the number of record is printed >out on a page. If i want to print out 4 records then the first row >should be 1..Regardless of the ID stored in the db. > >I hope you understand me .if now i would be happy to reply with a more >detailed instruction on my problem. > >in ODBC db i know one can use the rs.next object and method, but is >there an equivalent to this in MYSQL.. > >Thanks everyone > >Lars Eirik > > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -=- Mike Flynn - Burlington, VT -=- [EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood * The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, the search for a superior moral justification for selfishness. -- James K. Galbraith
Lars, I'm not quite sure I understand why mysql_num_rows($result) would not work for you. You said that function would only tell you how many records that came from your query, but aren't the records that came from your query the only ones you want to count? So if you get 4 records from your query that need to be printed out to the page then doing num_rows on it will give you 4. Then you can say, ok..if number of rows equals 4, then do this, else print that. I must be misunderstanding what you want to do..sorry :( Angie >>> Lars Eirik Rønning <[EMAIL PROTECTED]> 08/22/01 05:17AM >>> Hey there. I realize this is a forum for php-windows users,but knowing that most of you guys run a mysql db as backend i have a question for you.. I know there is a way to return the amount of records in the db by using the mysql_num_rows($resultid). My problem is that it only returns the total number of records from my query I have seen that there is a function called mysql_data_seel(par,par), but i am not sure how it works. My problem is the following> i want to do a print out of each record in the db , but the HTML code (to be exact the positioning of the HTML table should be different depending on the number of record printed out. To illustrate this is more or less what i want > i want to print out record 1 in one style , then i want to next record to be printed out in a different way. Is there a way to do a check on which number of record is printed out. I realize i cannot use the id simply because if i do a printout of total 4 records and i want to use a record with id = 100 e.g then it won't do me any good. Basically is there a way for me to check the number of record is printed out on a page. If i want to print out 4 records then the first row should be 1..Regardless of the ID stored in the db. I hope you understand me .if now i would be happy to reply with a more detailed instruction on my problem. in ODBC db i know one can use the rs.next object and method, but is there an equivalent to this in MYSQL.. Thanks everyone Lars Eirik -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Set your error reporting to: E_ALL & ~E_NOTICE Having it just set to E_ALL is what's causing the problem in the first place. :) -Mike At 09:38 AM 8/22/2001 +0100, you wrote: >Hi > >I have just reinstalled my win2k system and installed the latest version of >PHP (4.06), now when I run a lot of my old scripts I get errors like the one >below, when I access the page before posting any data to it. The example >below is taken straight from a tutorial site. I'm not sure if this is a >change in PHP since 4.01 which I had been using or what ? > >Can anyone help please ?! > >Thanks > >Phil > >Warning: Undefined variable: name in u:\inetpub\wwwroot\php\form5.php on >line 7 > > > > > >My Example Form > > > >Name: Age: <?if($name):?> Hi <?echo $name?>, you are <?echo $age?> years >old <?endif?> > > > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -=- Mike Flynn - Burlington, VT -=- [EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood * The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, the search for a superior moral justification for selfishness. -- James K. Galbraith
Actually, that's not quite right either. I had the same problem as you Phil, I had to do E_ALL & ~E_NOTICE & ~E_WARNING that last one will remove the warnings. Does anyone know the exact differnce between a warning and a notice? Angie >>> Mike Flynn <[EMAIL PROTECTED]> 08/22/01 08:22AM >>> Set your error reporting to: E_ALL & ~E_NOTICE Having it just set to E_ALL is what's causing the problem in the first place. :) -Mike At 09:38 AM 8/22/2001 +0100, you wrote: >Hi > >I have just reinstalled my win2k system and installed the latest version of >PHP (4.06), now when I run a lot of my old scripts I get errors like the one >below, when I access the page before posting any data to it. The example >below is taken straight from a tutorial site. I'm not sure if this is a >change in PHP since 4.01 which I had been using or what ? > >Can anyone help please ?! > >Thanks > >Phil > >Warning: Undefined variable: name in u:\inetpub\wwwroot\php\form5.php on >line 7 > > > > > >My Example Form > > > >Name: Age: <?if($name):?> Hi <?echo $name?>, you are <?echo $age?> years >old <?endif?> > > > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -=- Mike Flynn - Burlington, VT -=- [EMAIL PROTECTED] http://www.mikeflynn.net/ * Give blood * The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, the search for a superior moral justification for selfishness. -- James K. Galbraith -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Phil, Besides just turning off Warnings, the warning is a tad valid. Here's what I learned when I spoke with some gurus at the php conference... They said that the proper way to test for the presence of a variable now is using the isset (or empty) functions. If you do the old way like I used to do: if($variable){ then do this } and variable doesn't exist..you'll get a warning pop up if you've left them on. The proper way to test for a variable is to say: if(isset($variable)){ then do this } or if(empty($variable)){ then do this } check the manual on php for the difference in those two, they can be quite useful. Angie :) >>> "Johannes Janson" <[EMAIL PROTECTED]> 08/22/01 07:14AM >>> hi, > I have just reinstalled my win2k system and installed the latest version of > PHP (4.06), now when I run a lot of my old scripts I get errors like the one > below, when I access the page before posting any data to it. The example > below is taken straight from a tutorial site. I'm not sure if this is a > change in PHP since 4.01 which I had been using or what ? > > Can anyone help please ?! > > Thanks > > Phil > > Warning: Undefined variable: name in u:\inetpub\wwwroot\php\form5.php on > line 7 That's just a warning not an error mesage. Change the error_reporting in the php.ini to E_ALL (I think it is) or put error_reporting(7) on top of the scripts. cheers johannes -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Anybody know if PHP can handle VB ByRef's when calling a COM object? I've searched the documentation and the web and have found nothing on it, so I'm going to assume it doesn't, but I just thought I'd check through the list before I declared the topic dead. Thanks! Ryan
hmmm, this is just a shot in the dark...but do your scripts have a die() statement on them? Somebody correct me if I'm wrong..but if I didn't have die's on all my possible errors or a die at the end of my scripts, sometimes they would open multiple instances. Especially when working with phpDOM where errors were happening and I didn't have them dying out. Give that a shot..IMHO Angie >>> "Mike Duin" <[EMAIL PROTECTED]> 08/22/01 02:31AM >>> Hi All, I am running PHP 4.0.4 on Win2k Advanced Server, but because of the huge amount of traffic the surfer stops working.... When I take a look @ the taskmanager I see an average of 70 php sessions.....hhhhmmm.....he doesnt like that. All the sessions are from one script that reads a file from filesystem and makes a connection to an Informix database. I tried to solve this bby using ifx_pconnect....but it wouldnt stop opening new sessions... How To? Greetz Mike -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi all, I installed PHP 4.0.6 using the Windows installer on two different machines: one is Win 2000 server with IIS 5, and the other is Win NT server with IIS 4. In both cases, the installer complained that, due to a missing OCX, I had to manually configure IIS. It didn't mention which OCX was missing. What am I doing wrong? Thanks in advance Amedeo
On Wednesday 22 August 2001 4:50 pm, Carlo Borreo wrote: > Hi all, > I installed PHP 4.0.6 using the Windows installer on two different > machines: one is Win 2000 server with IIS 5, and the other is Win NT server > with IIS 4. In both cases, the installer complained that, due to a missing > OCX, I had to manually configure IIS. It didn't mention which OCX was > missing. What am I doing wrong? Nothing. As the error message says, php is installed fine. The ocx control (mscomctl.oxc is only required by the installer in order to present you with the user interface for configuring iis. It's so easy to configure manually it's not worth downloading the thing from Microsoft's site. Cheers -- Phil Driscoll
Is there no one here who can help me with the mail problem experienced on Win2k server? I posted a question a couple of days ago, but no-one replied? Is there some other forum I can try maybe? Thanks
Would you mind posting your question again? I don't have an record of what it was. Thanks Angie >>> "P.Agenbag" <[EMAIL PROTECTED]> 08/22/01 03:23PM >>> Is there no one here who can help me with the mail problem experienced on Win2k server? I posted a question a couple of days ago, but no-one replied? Is there some other forum I can try maybe? Thanks -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
To Angie and Oliver Oliver, thanks for the reply, I will try your suggestion and see if it helps. Angie and all other interested parties (who might have the same problem as I do) I have PHP installed on win2k server running IIS5 php.ini is setup to use an SMTP server on the network ( the webserver does not run SMTP). What happens now, is that whenever I try to run a php page with a mail() function on, it says "cannot connect etc." Oliver suggested I make sure that the SMTP server can accept relay connections. I will try it and report back. Thanks all. PS, posing another thread regarding mail(), this time concerning the default user...
Hi, this problem isn't really Windows specific... I have a client on one of my webservers who is causing me great headaches. He wrote php mail function that reads approx 17 000 e-mail addresses out of a mysql table, and then mails them all a standard newsletter. Firstly, the page bombs out ( no wonder really...) but before it does, it sends out as many mails as it can loop through in the 30s. I have checked the script, and he does add headers,; reply-to, return-path, from etc., yet, when the mail he sends starts to bounce, they all end up in the "root" account mailbox, as sendmail sees at as mail sent by users nobody@mydomain. For some reason, the Return-path header is ignored. I would really like to route these errors to his mailbox so he can handle the bouncers. Furthermore, concerning this problem of the bulk mail. I've had several people tell me that PHP is not the right way to send bulk mail, yet, I know of no other way to read addresses from a mysql table and send it as easily as with PHP. I was just wondering if there is another way of doing it with PHP so my server won't get bombarded with all these sendmail calls, ie, some way of pausing the sending process after every nth mail so sendmail can catch up. I've heard people talk about "sending the process to the background", but that sounds way too loose a term... Can someone here help me out? Thanks a lot.
Hi there, cfg: w2k, Apache 1.3.20, php 4.04.pl1 I have his code: <form method="POST" action="<?=$PHP_SELF ?>" enctype="multipart/form-data"> <input type="file" name="media" size="40" maxlenght="150"> <input type="submit" value="Submit" name="upload"> </form> <? if ($upload) { copy ($media, "c:\tmp"); } ?> This works fine for files with jpg and gif extensions but gives me error on mp3 or wav. Should I set something different ? error: Warning: Unable to open 'none' for reading: No such file or directory in upload.php on line 103 - that is copy function Thank you Ing. Daniel Šichta SWH s.r.o. Bytčická 2 010 01 Žilina tel.: +421 41 505 5855 fax: +421 41 500 1376 mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> http://www.swh.sk <http://www.swh.sk/>