[PHP] Check if directory has changed

2003-01-25 Thread Carlos Fernando Scheidecker Antunes
I would like to write a function to check if the contents of a directory, its files, 
have been changed.
The idea is to check the directory every 2 minutes and take some actions if some files 
were updated
or new files added.

Does anyone has any ideas?

I was considering listing the files (name, date modified, size) on a variable array, 
then list again and compare both arrays. In case there are different, take some action.

Thank you,

C.F.



[PHP] Listing files and their details on a text file

2002-11-18 Thread Carlos Fernando Scheidecker Antunes
Hello all,

I need to do something that you might be able to advise me.

I would like to list all the contents (files) of a directory in a text file.
Each line/record must have the file name, date and size. Does anyone know
how to do it?

Thank you,

C.F.Scheidecker Antunes.


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




[PHP] Bcc with the mail command

2002-07-31 Thread Carlos Fernando Scheidecker Antunes

Hello all,

Just a question about PHP mail comand.

Usually I have something like this:

if (mail($to,$Subject,$Body,$MailHeaders)) {
return 1;
}
else {
return 0;
}

Is there any way to use a BCC instead of to?

I would like that the message sent did not have the address of the person it is 
sending it to.

Any ideas or suggestions?

Thank you,

Carlos Fernando.



[PHP] How to encode e-mail attachments, work with MIME

2002-05-19 Thread Carlos Fernando Scheidecker Antunes

Hello all,

I'm trying to write an script to fetch e-mail and save whatever attachments there are.

Are there any articles or anywhere I can read about it?

Thanks,

Carlos Fernando Scheidecker Antunes
Linux User #207984




[PHP] Problem with array

2002-04-30 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I've got a form that creates checkboxes based on the number of rows on a table. The 
user has to check some of the boxes and then click submit. The boxes are named RG1, 
RG2, RG3, 

If there are 4 checkboxes and the user selects them all or selects the first, second 
and fourth, or the first third and fourth my code works. But if the user selects the 
second, third and fourth (He does not checks the first one) no information is recorded 
on my array.

Here's the code that I have to search the $HTTP_POST_VARS and then fill a array 
variable called $RG.


function SearchRGs() {
global $HTTP_POST_VARS;
global $RGs;

// fills the array variable RGs with the values of checked checkboxes that start 
with the name RG# (where # goes from 1,2,3,).
   // returns the qty of checked RGs and size of the $RGs array.

$index = count($HTTP_POST_VARS);
$count = 0;

for ($i=1; $i  $index; $i++) {
if (isset($HTTP_POST_VARS[RG$i])) {
$RGs[] = $HTTP_POST_VARS[RG$i];
$count++;
}
}

return $count;

}


Can anyone help me with this?

Why if I do not check the first checkbox on the form the array  is not filled.

Thank you,

Carlos Fernando.



[PHP] Script to fetch email and save attachments

2002-04-30 Thread Carlos Fernando Scheidecker Antunes

Hello all,

I have an app that I wrote some time ago using Delphi and Kylix that retrieves e-mails 
from an account and save only .txt, .csv and .zip attachments to a directory and 
depending on the files it does some database processing such as updating records that 
are lated browsed with php scripts as well.

So, what I want is to rewrite that app but use PHP instead. The reason is that I will 
have this script running on a very reliable and stable Linux machine as a daemon.

I was browsing the PHP documentation and I've noticed  that there's a part dedicated 
to IMAP, POP and NMTP functions.

I've already wrote scripts that send e-mail zip attachments, end .txt and html 
content. As far as sending e-mail I believe that I've mastered the thing.

I would like to ask you some tips and path pointing on the following:

1) Connect to a POP server.

2) Retrieve messages and save .ZIP, .TXT ou .CSV attachments only.

3) If the attachments are not .ZIP, .TXT or .CSV just delete the e-mail message.

3) Delete messages from server after downloading them.

Can anyone share with me some experience on this or maybe point me out some of the 
built in functions that would do the job?

Thank you in advance,

Carlos Fernando Scheidecker Antunes.



[PHP] Help on dealing with arrays of HTTP_POST vars

2002-04-15 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I have developed a system to retrieve data from a table. The interface is a
dynamic list of orders created from a query on the database that shows all
the new orders. Next to each is a checkbox. Each checkbox has as its value
the order number and is called PED1, PED2, PED3,PEDn, depending on
how many new orders are available. If the user wants to access these orders
he has to check the orders he wants and click the submit button. Once it is
submited, it searches all the PED# variables on the HTTP_POST_VARS and
builds an array called $Orders. The $Orders array contains order numbers and
is later used to query a different table.

Ths code works almost great. But there is a problem, if the first checkbox,
say PED1 field is not checked, and some of the other checkboxes are (say
PED2, PED4), the $Orders array ends being empty. So, say that the form has 5
orders and the user selects orders 2, 4 and 5 and submit it. It does not
work. But if he selects 1,2, 4 and 5 it works. It works only if the first
checkbox is checked too.

What I wonder is why this code does not work if PED1 checkbox is not
checked. What if the user only wants other stuff but the first order PED1?

Could you help me on this?

Here's the code:

This is a function that searches for variables called PED1, PED2, PED3 that
are checkboxes on a submited form and have the order numbers. When this
checkbox is checked, the ordernumber is saved on an Array $Orders that is
later used to build a SQL statement.

function SearchOrders() {
global $Orders;
global $HTTP_POST_VARS;

 $index = count($HTTP_POST_VARS);

 for($i=1; $i = $index; $i++) {
 if (isset($HTTP_POST_VARS[PED$i]))
 $Orders[] = $HTTP_POST_VARS[PED$i];
 }
 $index = count($Orders);
 return $index;

}

This is a function that retrieves the array values that are order numbers
from the array $Orders and assembles a SQL statement $query.
This will later retrieve data from a MySQL table;

function MontarOrdRel() {
global $Orders;

 $query = SELECT  *  FROM tbl_Ord ;

if (count($Orders)  0)
 $query .= WHERE ;

 for($index=0; $index  count($Orders); $index++) {

 if ($index  (count($Orders)-1)) {
  $query .=(NumPedido = '.$Orders[$index].') OR ;
 }
 else {
  $query .=(NumPedido = '.$Orders[$index].') ;
 }
 } // for loop
 $query .= ORDER BY NumOrd;

Then $query is used to query a table.

Thank you for your help,

Carlos Fernando Scheidecker Antunes.


Linux User #207984




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




[PHP] how to send a file to the user's browser?

2002-03-18 Thread Carlos Fernando Scheidecker Antunes

Hello all,

I've got a script that generates a txt file, compresses it into a Zip file and it all 
happens on a directory that is out of apache's web site.

This script generates the file based on MySQL server information and I have it then 
sent to the user's e-mail address. What I would like to do is to make the PHP script 
throw the file to the user's browser so that it would download it automatically. 
This file is created on a directory that is not the same as the web server where the 
pages and php scripts are located.

Anyone could help me with that?

Thanks.

regards,

Carlos Fernando Scheidecker Antunes
Linux User #207984




[PHP] More on: how to send a file to the user's browser?

2002-03-18 Thread Carlos Fernando Scheidecker Antunes

Hi Mark,

It does not work. What it does is to echo the thing to the screen.

How can I force the browser to download it with its original file name?



- Original Message -
From: Mark Heintz PHP Mailing Lists [EMAIL PROTECTED]
To: Carlos Fernando Scheidecker Antunes [EMAIL PROTECTED]
Cc: PHP-GENERAL [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 5:01 PM
Subject: Re: [PHP] how to send a file to the user's browser?



A couple more headers than absolutely necessary, but this should work:

?php
// open file and send to user
if($fp = fopen($downloadfile, r)){
  // output headers
  $downloadsize = filesize($downloadfile);
  header ( Expires: Mon, 1 Apr 1974 05:00:00 GMT );
  header ( Last-Modified:  . gmdate(D,d M YH:i:s T) );
  header ( Pragma: no-cache );
  header ( Content-type: application/octet-stream; name=$downloadfile );
  header ( Content-length: $downloadsize );
  header ( Content-Disposition: attachment; filename=$downloadfile );
  // read out file
  fpassthru($fp);
  fclose($fp);
} else {
  // can't open file
}
?


mh.


On Mon, 18 Mar 2002, Carlos Fernando Scheidecker Antunes wrote:

 Hello all,

 I've got a script that generates a txt file, compresses it into a Zip file
and it all happens on a directory that is out of apache's web site.

 This script generates the file based on MySQL server information and I
have it then sent to the user's e-mail address. What I would like to do is
to make the PHP script throw the file to the user's browser so that it
would download it automatically. This file is created on a directory that is
not the same as the web server where the pages and php scripts are located.

 Anyone could help me with that?

 Thanks.

 regards,

 Carlos Fernando Scheidecker Antunes
 Linux User #207984




--
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] shell_exec()

2002-03-15 Thread Carlos Fernando Scheidecker Antunes

Hello all,

Does anyone know if shell_exec waits to have whatever it was passed to 
be executed before returning to the script?

I am asking that because I need to write a script to compact files to a 
zip and then have it e-mailed to a predefined address.

The files it will compact might have a considerable size and since this 
script will be triggered by a web page I wonder if shell_exec would be 
executed as a separate thread or if it will be the same one.

For me, the ideal thing was to have it wait for the command to be over.

Any suggestions?

Thank you,

Carlos Fernando.


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




[PHP] How to run a PHP script on the UNIX command line

2002-01-07 Thread Carlos Fernando Scheidecker Antunes

Hello all,

I would like to have some PHP scripts to do DB maintanance. There are 
not intended for web CGI.

How can I run a script on my UNIX machine command line?

I want to include it on my crontab.

I know how to make it happen with Perl which is quite easy but I do not 
know how to do it in PHP.

Can anyone help me with that?

Thank you,

Carlos Fernando Scheidecker Antunes.


-- 
PHP General 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]




[PHP] How to clear a populated array

2002-01-04 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I have a populated array that stores user input errors.

I have been browsing the manual and some books and I couldn't find one 
thing.

I've got an array $Erros[] and I would like to be able to clear it 
entirely. Is there any builtin function that acomplishes that?

Thank you in advance.

Carlos Fernando S. Antunes.


-- 
PHP General 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]




Re: [PHP] How to clear a populated array

2002-01-04 Thread Carlos Fernando Scheidecker Antunes

Yeah Bogdan.

I have thought so too, but I also found it quite intuitive and I thought 
there might be something easier.

As usual you reply to my questions. And as usual I appreciate your help.

Thanks again.

regards,

Carlos Fernando.


Bogdan Stancescu wrote:

I don't know, does $Errors=array() work for you? Hope I understood your
problem...

Bogdan

Carlos Fernando Scheidecker Antunes wrote:

Hello All,

I have a populated array that stores user input errors.

I have been browsing the manual and some books and I couldn't find one
thing.

I've got an array $Erros[] and I would like to be able to clear it
entirely. Is there any builtin function that acomplishes that?

Thank you in advance.

Carlos Fernando S. Antunes.

--
PHP General 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]





-- 
PHP General 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]




[PHP] Date aritmetic

2002-01-02 Thread Carlos Fernando Scheidecker Antunes

Hello all,

I would like to know if anyone could help me with the following issue:

I have 6 variables, two holds a day, others the month and the last ones the year. They 
are entered through drop-down-menus where the user selects day, month and year for 
each date.

I would like to know the difference in days between these two dates. Since the dates 
are separated and each value day, month and year are stored on separated variables I 
wonder who to proceed here. I need to know how many days of separate each dates. 

Thank you in advance,

Carlos Fernando
Salt Lake City, UT.
Linux User #207984




[PHP] How to convert integers representations of a date to a date format variable

2001-12-30 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I would like to convert integers like the day, month and year to a date representation 
to store it in a session variable.

There's a form where the user posts day, month and year. So then I run 
checkdate($month,$day,$year) and make sure the date is valid.

So, let's say I have 12 for month, 30 for day and 2001 as year. Do I have to create a 
timestamp? How to create a
TimeStamp?

I need to store it as 30/12/2001 (but not a string) not only on a session variable but 
also to make it easier to work with a MySQL table.

After that I want to play with it as a string so I will use the date() function, 
that's why it is important to save it as a validade date format value.

Any sugestions?

Thank you in advance,

Carlos Fernando.
Linux User #207984




[PHP] How to copy a substring of a string

2001-12-29 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I've been searching on the online documentation and I'm pretty sure I've done it 
before but I don't recall how.

The problem is. I have a string with 17 characteres and I want to copy from the fourth 
character 6 characteres. Under Pascal I usually do  copy(string,4,6). That means, 
copying from the fourth characters a quantity of 6 characteres.

Is there any built in function that does that?

Could anyone tell me that?

Thanks,

Carlos Fernando.



[PHP] Help on JavaScript Windows with PHP

2001-12-28 Thread Carlos Fernando Scheidecker Antunes

Hello all!

I've wrote to scripts that use Javascript too. The idea is to have a parent
window teste_popup.php4 and a child window pop.php4. When a link is clicked
on the parent window, the child window will open. After the user enters
information on the child window he must close it and that will update the
parent window.possibility to me.

But there's a little problem,though.

The only browser that it works is MS IE. It does not work on
Nestcape (Win or *NIX) or Konqueror (*NIX).

If I try it on a different browser, say Netscape or Konqueror, when I click
the main window to open the popup window it does work.
The thing that does not work is when you click close on the popup window. It
does not close the popup window and if I close the window it does not update
the parent window.

I've written two test PHP scripts teste_popup.php4 (the main window) and
pop.php4
that I am including below. Maybe someone can help me out by pointing where
it is
wrong.

teste_popup.php4 (parent window script)

?php
// teste_popup.php4
print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(function newWin(urlLoc) {\n);
print(_winName=\Janelateste\;\n);
print(_info = \toolbar=no\;\n);
print(_info += \,location=no\;\n);
print(_info += \,directories=no\;\n);
print(_info += \,status=yes\;\n);
print(_info += \,menubar=no\;\n);
print(_info += \,scrollbars=yes\;\n);
print(_info += \,resizable=yes\;\n);
print(_info += \,titlebar=no\;\n);
print(_info += \,dependent=no\;\n);
print(_info += \,channelmode=no\;\n);
print(_info += \,height=480\;\n);
print(_info += \,width=640\;\n);
print(_info += \,left=200\;\n);
print(_info += \,top=100\;\n);
print(DispWin=window.open(urlLoc,_winName,_info);\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body\n);
print(p\n);
print(Esse e um teste usando Javascript para montar as janelas\n);
print(a parte de numero de operacoes, pecas, etc de garantia.\n);
print(/p\n);
print(b\n);
print(Data : .date(d./.m./.Y. .H.:.i.:.s).\n);
print(b\n);
print(br\n);
print(br\n);
print(a href=\JavaScript:newWin('pop.php4?oper=1');\link/a\n);
print(br\n);
print(/body\n);
print(/html\n);
?

pop.php4 - child popup window

?php
// pop.php4

print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(self.menubar.visible=false\n);
print(self.tollbar.visible=false\n);
print(self.locationbar.visible=false\n);
print(self.personalbar.visible=false\n);
print(self.statusbar.visible=false\n);
print(function oldWin(urlLoc) {\n);
print(returnwin=window.opener.navigate(urlLoc);\n);
print(window.opener.focus();\n);
print(window.close();\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body onunload=\JavaScript:oldWin('teste_popup.php4?oper=1')\\n);
print(b\n);
print(Child window\n);
print(/b\n);
print(br\n);
print(Parametro oper = .$HTTP_GET_VARS[oper].\n);
print(br\n);
print(a href=\JavaScript:oldWin('teste_popup.php4?oper=1')\Close e
Update/a\n);
print(br\n);
print(/body\n);
print(/html\n);

?

Could anyone help me out to adapt it to any browser?

Thank you very much and merry christmas,

Carlos Fernando Scheidecker Antunes.
Salt Lake City, Utah - USA.


--
PHP General 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]



-- 
PHP General 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]




[PHP] Part II: Help on JavaScript Windows with PHP

2001-12-28 Thread Carlos Fernando Scheidecker Antunes

Hello Bogdan,

I greatly appreciated your help. Now it is way better but some behaviours are 
still weird as I describe below:

On Microsoft Internet Explorer:

- If you close the popup window by clicking the close icon, the onunload 
event works just fine.

- If you close the popup window by closing on the link it reloads the parent 
window twice, which is not good because the parent window that I need it to 
be done reads info from a database and this can be time consuming. What 
happens here is that it calls the oldWin function and then the onunload event.

On Netscape and Konqueror:

- if you close the popup window by clicking the close icon, the onunload 
event is not called or recoginized. I wonder if I need to register the events 
with captureEents. If so, how can I do it?

- If you close the popup window by closing on the link it reloads the parent 
window once since it does not recognize the onunload event.

There should be a way by creating a variable or whatever that would not call
the oldWin function twice if the onunload event is fired.

Do you know how to do it?

Could you help me with that?

Thanks again.

regards,

Carlos Fernando.




On Friday 28 December 2001 12:08 pm, Bogdan Stancescu wrote:
 I don't know if this is it, but you may:

 1. Replace
 print(returnwin=window.opener.navigate(urlLoc);\n);
 with
 print(window.opener.location='urlLoc';\n);

 2. Try opening the pop-up widow with Netscape allowing the location input
 box to appear, click on Close e Update and, if it doesn't work, type
 javascript: in the location bow -- then check for errors reported by
 Netscape. 9 cases out of 10, if you solve the problem with Netscape,
 Konqueror will work as well.

 Please let me know of your progress - I'm curious what the problem is.

 Bogdan

 Carlos Fernando Scheidecker Antunes wrote:
  Hello all!
 
  I've wrote to scripts that use Javascript too. The idea is to have a
  parent window teste_popup.php4 and a child window pop.php4. When a link
  is clicked on the parent window, the child window will open. After the
  user enters information on the child window he must close it and that
  will update the parent window.possibility to me.


Hello all!

I've wrote to scripts that use Javascript too. The idea is to have a parent
window teste_popup.php4 and a child window pop.php4. When a link is clicked
on the parent window, the child window will open. After the user enters
information on the child window he must close it and that will update the
parent window.possibility to me.

But there's a little problem,though.

The only browser that it works is MS IE. It does not work on
Nestcape (Win or *NIX) or Konqueror (*NIX).

If I try it on a different browser, say Netscape or Konqueror, when I click
the main window to open the popup window it does work.
The thing that does not work is when you click close on the popup window. It
does not close the popup window and if I close the window it does not update
the parent window.

I've written two test PHP scripts teste_popup.php4 (the main window) and
pop.php4
that I am including below. Maybe someone can help me out by pointing where
it is
wrong.

teste_popup.php4 (parent window script)

?php
// teste_popup.php4
print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(function newWin(urlLoc) {\n);
print(    _winName=\Janelateste\;\n);
print(    _info = \toolbar=no\;\n);
print(    _info += \,location=no\;\n);
print(    _info += \,directories=no\;\n);
print(    _info += \,status=yes\;\n);
print(    _info += \,menubar=no\;\n);
print(    _info += \,scrollbars=yes\;\n);
print(    _info += \,resizable=yes\;\n);
print(    _info += \,titlebar=no\;\n);
print(    _info += \,dependent=no\;\n);
print(    _info += \,channelmode=no\;\n);
print(    _info += \,height=480\;\n);
print(    _info += \,width=640\;\n);
print(    _info += \,left=200\;\n);
print(    _info += \,top=100\;\n);
print(    DispWin=window.open(urlLoc,_winName,_info);\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body\n);
print(p\n);
print(Esse e um teste usando Javascript para montar as janelas\n);
print(a parte de numero de operacoes, pecas, etc de garantia.\n);
print(/p\n);
print(b\n);
print(Data : .date(d./.m./.Y. .H.:.i.:.s).\n);
print(b\n);
print(br\n);
print(br\n);
print(a href=\JavaScript:newWin('pop.php4?oper=1');\link/a\n);
print(br\n);
print(/body\n);
print(/html\n);
?

pop.php4 - child popup window

?php
// pop.php4

print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(self.menubar.visible=false\n);
print(self.tollbar.visible=false\n);
print(self.locationbar.visible=false\n);
print(self.personalbar.visible=false\n);
print(self.statusbar.visible=false\n);
print(function oldWin(urlLoc) {\n);
print(    returnwin=window.opener.navigate(urlLoc);\n);
print(    window.opener.focus();\n);
print(    window.close();\n);
print(} \n);
print(//--/script

[PHP] More on Help on JavaScript Windows with PHP

2001-12-28 Thread Carlos Fernando Scheidecker Antunes

Hello Bogdan,

Before anything, thank you!

I've installed Netscape 6.2 on a Linux box and it works just like MS IE.

Just like I told you. The unload event does not work or is called by either
netscape 4.x or konqueror.

But it is called by Netscape 6.2 and MS IE 5.x  6.x.

I think that JS implementations on those browsers might be quite different.
I wonder how to make the onunload event work on Netscape 4.x and Konqueror.
That's why I thought creating a captureEvents.

Also a good thing would be creating a popup window without the close (X) and
minimize ( _ ) icons since I can only create it without the resize and
maximize buttons. Do you know how to create a java popup window without the
close icon? If it is possible the problem is solved since the only way a
user could close it is by clicking on the link.

Thank you,

Carlos Fernando Scheidecker Antunes.



- Original Message -
From: Bogdan Stancescu [EMAIL PROTECTED]
To: Carlos Fernando Scheidecker Antunes [EMAIL PROTECTED]
Cc: PHP-GENERAL [EMAIL PROTECTED]
Sent: Friday, December 28, 2001 5:31 PM
Subject: Re: [PHP] Part II: Help on JavaScript Windows with PHP


The way it looks to me, you do both the window opening sequence and the
closing
procedure twice:
- Window opening: you specify window options (toolbar, status bar etc) once
in the
window.open() call and once in the actual window code;
- Window closing: you perform the same actions once upon clicking on Close
e
Update and once upon actual window closing (via onUnload()).

Try implementing both procedures only once in a way that they're ran by both
types
of browsers.

AFAIK you don't need to implement any kind of captureEvents, but I may be
wrong
about it.

Only now did I read your final paragraph: I think you'd better leave the
onUnload() in place and only window.close() in the link, which should
trigger
onUnload(). Hope this works with NS 4.x!

I don't have any clue why closing the pop-up via Windows controls both
doesn't
trigger onUnload and reloads the parent window -- are you sure you're not
wrong
about this? I mean, if it reloads the parent window, doesn't this mean that
onUnload() works?

My suggestion is fiddling with the onUndload() function triggering it via a
link
(as suggested in the previous message -- with a href=javascript:oldWin())
until
you get no error messages when accessing javascript: in Netscape. You
didn't
tell me -- do you get any more error messages now upon accessing
javascript:?

Bogdan

Carlos Fernando Scheidecker Antunes wrote:

 Hello Bogdan,

 On Microsoft Internet Explorer:
 On Netscape and Konqueror:


-- 
PHP General 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]




[PHP] Multiple JavaScript Windows with PHP

2001-12-20 Thread Carlos Fernando Scheidecker Antunes


Hello all!

I've wrote to scripts that use Javascript too. The idea is to have a parent
window teste_popup.php4 and a child window pop.php4. When a link is clicked
on the parent window, the child window will open. After the user enters
information on the child window he must close it and that will update the
parent window.possibility to me.

But there's a little problem,though.

The only browser that it works is MS IE. It does not work on
Nestcape (Win or *NIX) or Konqueror (*NIX).

If I try it on a different browser, say Netscape or Konqueror, when I click
the main window to open the popup window it does work.
The thing that does not work is when you click close on the popup window. It
does not close the popup window and if I close the window it does not update
the parent window.

I've written two test PHP scripts teste_popup.php4 (the main window) and
pop.php4
that I am including below. Maybe someone can help me out by pointing where
it is
wrong.

teste_popup.php4 (parent window script)

?php
// teste_popup.php4
print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(function newWin(urlLoc) {\n);
print(_winName=\Janelateste\;\n);
print(_info = \toolbar=no\;\n);
print(_info += \,location=no\;\n);
print(_info += \,directories=no\;\n);
print(_info += \,status=yes\;\n);
print(_info += \,menubar=no\;\n);
print(_info += \,scrollbars=yes\;\n);
print(_info += \,resizable=yes\;\n);
print(_info += \,titlebar=no\;\n);
print(_info += \,dependent=no\;\n);
print(_info += \,channelmode=no\;\n);
print(_info += \,height=480\;\n);
print(_info += \,width=640\;\n);
print(_info += \,left=200\;\n);
print(_info += \,top=100\;\n);
print(DispWin=window.open(urlLoc,_winName,_info);\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body\n);
print(p\n);
print(Esse e um teste usando Javascript para montar as janelas\n);
print(a parte de numero de operacoes, pecas, etc de garantia.\n);
print(/p\n);
print(b\n);
print(Data : .date(d./.m./.Y. .H.:.i.:.s).\n);
print(b\n);
print(br\n);
print(br\n);
print(a href=\JavaScript:newWin('pop.php4?oper=1');\link/a\n);
print(br\n);
print(/body\n);
print(/html\n);
?

pop.php4 - child popup window

?php
// pop.php4

print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(self.menubar.visible=false\n);
print(self.tollbar.visible=false\n);
print(self.locationbar.visible=false\n);
print(self.personalbar.visible=false\n);
print(self.statusbar.visible=false\n);
print(function oldWin(urlLoc) {\n);
print(returnwin=window.opener.navigate(urlLoc);\n);
print(window.opener.focus();\n);
print(window.close();\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body onunload=\JavaScript:oldWin('teste_popup.php4?oper=1')\\n);
print(b\n);
print(Child window\n);
print(/b\n);
print(br\n);
print(Parametro oper = .$HTTP_GET_VARS[oper].\n);
print(br\n);
print(a href=\JavaScript:oldWin('teste_popup.php4?oper=1')\Close e
Update/a\n);
print(br\n);
print(/body\n);
print(/html\n);

?

Could anyone help me out to adapt it to any browser?

Thank you very much and merry christmas,

Carlos Fernando Scheidecker Antunes.
Salt Lake City, Utah - USA.


-- 
PHP General 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]




Re: [PHP] Multiple JavaScript Windows with PHP

2001-12-20 Thread Carlos Fernando Scheidecker Antunes

It still the same thing. It child does not close on Nestcape and Konqueror
and when it closes on IE now it refreshes teh parent window twice.


- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: 'Carlos Fernando Scheidecker Antunes' [EMAIL PROTECTED];
PHP-GENERAL [EMAIL PROTECTED]
Sent: Thursday, December 20, 2001 11:12 PM
Subject: RE: [PHP] Multiple JavaScript Windows with PHP


I haven't tried your code, but I'm thinking what's happening is that the
browsers that the code isn't working in is stopping at the
returnwin=window.opener.navigate(urlLoc); line - what happens if you
change it to returnwin=window.opener.location = urlLoc; ??

Original Message-
From: Carlos Fernando Scheidecker Antunes [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 21, 2001 3:02 PM
To: PHP-GENERAL
Subject: [PHP] Multiple JavaScript Windows with PHP
Importance: High



Hello all!

I've wrote to scripts that use Javascript too. The idea is to have a parent
window teste_popup.php4 and a child window pop.php4. When a link is clicked
on the parent window, the child window will open. After the user enters
information on the child window he must close it and that will update the
parent window.possibility to me.

But there's a little problem,though.

The only browser that it works is MS IE. It does not work on
Nestcape (Win or *NIX) or Konqueror (*NIX).

If I try it on a different browser, say Netscape or Konqueror, when I click
the main window to open the popup window it does work.
The thing that does not work is when you click close on the popup window. It
does not close the popup window and if I close the window it does not update
the parent window.

I've written two test PHP scripts teste_popup.php4 (the main window) and
pop.php4
that I am including below. Maybe someone can help me out by pointing where
it is
wrong.

teste_popup.php4 (parent window script)

?php
// teste_popup.php4
print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(function newWin(urlLoc) {\n);
print(_winName=\Janelateste\;\n);
print(_info = \toolbar=no\;\n);
print(_info += \,location=no\;\n);
print(_info += \,directories=no\;\n);
print(_info += \,status=yes\;\n);
print(_info += \,menubar=no\;\n);
print(_info += \,scrollbars=yes\;\n);
print(_info += \,resizable=yes\;\n);
print(_info += \,titlebar=no\;\n);
print(_info += \,dependent=no\;\n);
print(_info += \,channelmode=no\;\n);
print(_info += \,height=480\;\n);
print(_info += \,width=640\;\n);
print(_info += \,left=200\;\n);
print(_info += \,top=100\;\n);
print(DispWin=window.open(urlLoc,_winName,_info);\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body\n);
print(p\n);
print(Esse e um teste usando Javascript para montar as janelas\n);
print(a parte de numero de operacoes, pecas, etc de garantia.\n);
print(/p\n);
print(b\n);
print(Data : .date(d./.m./.Y. .H.:.i.:.s).\n);
print(b\n);
print(br\n);
print(br\n);
print(a href=\JavaScript:newWin('pop.php4?oper=1');\link/a\n);
print(br\n);
print(/body\n);
print(/html\n);
?

pop.php4 - child popup window

?php
// pop.php4

print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(self.menubar.visible=false\n);
print(self.tollbar.visible=false\n);
print(self.locationbar.visible=false\n);
print(self.personalbar.visible=false\n);
print(self.statusbar.visible=false\n);
print(function oldWin(urlLoc) {\n);
print(returnwin=window.opener.navigate(urlLoc);\n);
print(window.opener.focus();\n);
print(window.close();\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body onunload=\JavaScript:oldWin('teste_popup.php4?oper=1')\\n);
print(b\n);
print(Child window\n);
print(/b\n);
print(br\n);
print(Parametro oper = .$HTTP_GET_VARS[oper].\n);
print(br\n);
print(a href=\JavaScript:oldWin('teste_popup.php4?oper=1')\Close e
Update/a\n);
print(br\n);
print(/body\n);
print(/html\n);

?

Could anyone help me out to adapt it to any browser?

Thank you very much and merry christmas,

Carlos Fernando Scheidecker Antunes.
Salt Lake City, Utah - USA.


--
PHP General 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]



-- 
PHP General 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]




[PHP] JavaScript Windows with PHP

2001-12-20 Thread Carlos Fernando Scheidecker Antunes

Hello all!

I've wrote to scripts that use Javascript too. The idea is to have a parent
window teste_popup.php4 and a child window pop.php4. When a link is clicked
on the parent window, the child window will open. After the user enters
information on the child window he must close it and that will update the
parent window.possibility to me.

But there's a little problem,though.

The only browser that it works is MS IE. It does not work on
Nestcape (Win or *NIX) or Konqueror (*NIX).

If I try it on a different browser, say Netscape or Konqueror, when I click
the main window to open the popup window it does work.
The thing that does not work is when you click close on the popup window. It
does not close the popup window and if I close the window it does not update
the parent window.

I've written two test PHP scripts teste_popup.php4 (the main window) and
pop.php4
that I am including below. Maybe someone can help me out by pointing where
it is
wrong.

teste_popup.php4 (parent window script)

?php
// teste_popup.php4
print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(function newWin(urlLoc) {\n);
print(_winName=\Janelateste\;\n);
print(_info = \toolbar=no\;\n);
print(_info += \,location=no\;\n);
print(_info += \,directories=no\;\n);
print(_info += \,status=yes\;\n);
print(_info += \,menubar=no\;\n);
print(_info += \,scrollbars=yes\;\n);
print(_info += \,resizable=yes\;\n);
print(_info += \,titlebar=no\;\n);
print(_info += \,dependent=no\;\n);
print(_info += \,channelmode=no\;\n);
print(_info += \,height=480\;\n);
print(_info += \,width=640\;\n);
print(_info += \,left=200\;\n);
print(_info += \,top=100\;\n);
print(DispWin=window.open(urlLoc,_winName,_info);\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body\n);
print(p\n);
print(Esse e um teste usando Javascript para montar as janelas\n);
print(a parte de numero de operacoes, pecas, etc de garantia.\n);
print(/p\n);
print(b\n);
print(Data : .date(d./.m./.Y. .H.:.i.:.s).\n);
print(b\n);
print(br\n);
print(br\n);
print(a href=\JavaScript:newWin('pop.php4?oper=1');\link/a\n);
print(br\n);
print(/body\n);
print(/html\n);
?

pop.php4 - child popup window

?php
// pop.php4

print(html\n);
print(head\n);
//print(script type=\text/javascript\\n);
print(script language=\JavaScript\!--\n);
print(self.menubar.visible=false\n);
print(self.tollbar.visible=false\n);
print(self.locationbar.visible=false\n);
print(self.personalbar.visible=false\n);
print(self.statusbar.visible=false\n);
print(function oldWin(urlLoc) {\n);
print(returnwin=window.opener.navigate(urlLoc);\n);
print(window.opener.focus();\n);
print(window.close();\n);
print(} \n);
print(//--/script\n);
print(/head\n);
print(body onunload=\JavaScript:oldWin('teste_popup.php4?oper=1')\\n);
print(b\n);
print(Child window\n);
print(/b\n);
print(br\n);
print(Parametro oper = .$HTTP_GET_VARS[oper].\n);
print(br\n);
print(a href=\JavaScript:oldWin('teste_popup.php4?oper=1')\Close e
Update/a\n);
print(br\n);
print(/body\n);
print(/html\n);

?

Could anyone help me out to adapt it to any browser?

Thank you very much and merry christmas,

Carlos Fernando Scheidecker Antunes.
Salt Lake City, Utah - USA.


--
PHP General 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]


-- 
PHP General 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]




[PHP] Help on dealing with arrays of HTTP_POST vars

2001-12-19 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I have developed a system to retrieve data from a table. The interface is a
dynamic list of orders created from a query on the database that shows all
the new orders. Next to each is a checkbox. Each checkbox has as its value
the order number and is called PED1, PED2, PED3,PEDn, depending on
how many new orders are available. If the user wants to access these orders
he has to check the orders he wants and click the submit button. Once it is
submited, it searches all the PED# variables on the HTTP_POST_VARS and
builds an array called $Orders. The $Orders array contains order numbers and
is later used to query a different table.

Ths code works almost great. But there is a problem, if the first checkbox,
say PED1 field is not checked, and some of the other checkboxes are (say
PED2, PED4), the $Orders array ends being empty. So, say that the form has 5
orders and the user selects orders 2, 4 and 5 and submit it. It does not
work. But if he selects 1,2, 4 and 5 it works. It works only if the first
checkbox is checked too.

What I wonder is why this code does not work if PED1 checkbox is not
checked. What if the user only wants other stuff but the first order PED1?

Could you help me on this?

Here's the code:

This is a function that searches for variables called PED1, PED2, PED3 that
are checkboxes on a submited form and have the order numbers. When this
checkbox is checked, the ordernumber is saved on an Array $Orders that is
later used to build a SQL statement.

function SearchOrders() {
global $Orders;
global $HTTP_POST_VARS;

 $index = count($HTTP_POST_VARS);

 for($i=1; $i = $index; $i++) {
 if (isset($HTTP_POST_VARS[PED$i]))
 $Orders[] = $HTTP_POST_VARS[PED$i];
 }
 $index = count($Orders);
 return $index;

}

This is a function that retrieves the array values that are order numbers
from the array $Orders and assembles a SQL statement $query.
This will later retrieve data from a MySQL table;

function MontarOrdRel() {
global $Orders;

 $query = SELECT  *  FROM tbl_Ord ;

if (count($Orders)  0)
 $query .= WHERE ;

 for($index=0; $index  count($Orders); $index++) {

 if ($index  (count($Orders)-1)) {
  $query .=(NumPedido = '.$Orders[$index].') OR ;
 }
 else {
  $query .=(NumPedido = '.$Orders[$index].') ;
 }
 } // for loop
 $query .= ORDER BY NumOrd;

Then $query is used to query a table.

Thank you for your help,

Carlos Fernando Scheidecker Antunes.


Linux User #207984



-- 
PHP General 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]




[PHP] How to determine a valid Date

2001-10-28 Thread Carlos Fernando Scheidecker Antunes

Hello all,

Is there any built-in function to determine a valid date?

If there's not I will have to translate one that I've wrote with DrScheme to PHP.

I just want to save time :)

thanks again,

Carlos Fernando.


Linux User #207984




[PHP] Running a script with Crontab

2001-09-30 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I wrote an script to do database maintenance and I forgot how to run a script on the 
command line without opening it with a web browser. My idea is to add a crontab daily 
entry to run this script.

Can anyone enlight me on this

thank you very much,

C.F. Scheidecker Antunes.


Linux User #207984




[PHP] PHP versus ZOPE

2001-09-15 Thread Carlos Fernando Scheidecker Antunes

Hello all,

Does anyone here ever programmed in Zope? I have been doing PHP stuff for some time 
now and I am glad with it because it is faster than JSP para I am now listening to 
good opinions about Zope so I wonder if anyone here has already compared both on a 
real situation. Any comments are appreciated.

Thanks.

Carlos Fernando Scheidecker Antunes.


Linux User #207984




[PHP] Help on e-mail attachments retrieval adn ZIP uncompression.

2001-09-03 Thread Carlos Fernando Scheidecker Antunes

Hello Everybody,

I have a software writen in Delphi which I am migrating to Kylix but I would like to 
do it in PHP instead.

What the software does is to access an e-mail address and retrieve the messages saving 
the files ending with .zip to a local directory. After that, it decompresses the ZIP 
files and read their txt contents and import the contents to a MySQL database. Each 
ZIP file has a TXT file.

So what I need to know and the help I am asking you for is :

1) How to retrieve messages from a POP3 mailbox and save only the ZIP files 
attachments?

2) How to decompress the ZIP files?

Thank you,

Carlos Fernando.

Linux User #207984




[PHP] Multiple JavaScript Windows

2001-08-27 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I need to have multiple JavaScripts windows with my database PHP script.

The idea is to have a main Page and links to pop-up JavaScript Windows to enter 
information on the database. Once these windows are closed the main PHP page need to 
be automaticaly updated.

The Database is a Report system that depends on 4 tables. One main table and 3 other 
tables that contain information for that report such as part number, procedures taken 
and repairs made. Each report can have none to several parts, none to several 
procedures and one to several repairs.

Once the user starts a new report a lot od stuff is add to the main table such as 
CustomerNo, ReportNo, ReportDate, etc. Then, the other three tables lists parts, 
procedures and repairs for a Report using the ReportNo as common field.

The help and advice I need consist of beeing able to call pop up windows with 
JavaScript from the main page to add Parts, Repairs and Procedures. Once the user 
finish adding stuff on a Pop Up window he would close it by clicking a link and the 
main Page of the Report would be reloaded to reflect the changes he did.

Can anyone help me with this task?

Thank you very much,

Carlos Fernando   [EMAIL PROTECTED]





[PHP] Multiple JavaScript Windows

2001-06-22 Thread Carlos Fernando Scheidecker Antunes



Hello All,

I need to have multiple JavaScripts windows with my 
database PHP script.

The idea is to have a main Page and links to pop-up 
JavaScript Windows to enter information on the database. Once these windows are 
closed the main PHP page need to be automaticaly updated.

The Database is a Report system that depends on 4 
tables.One main table and 3 other tables that contain information for that 
report such as part number, procedures taken and repairs made. Each report can 
have none to several parts, none to several procedures and one to several 
repairs.

Once the user starts a new report a lot od stuff is 
add to the main table such as CustomerNo, ReportNo, ReportDate, etc. Then, the 
other three tables lists parts, procedures and repairs for a Report using the 
ReportNo as common field.

The helpand adviceI need consist of 
beeing able to call pop up windows with JavaScript from the main page to add 
Parts, Repairs and Procedures. Once the user finish adding stuff on a Pop Up 
window he would close it by clicking a link and the main Page of the Report 
would be reloaded to reflect the changes he did.

Can anyone help me with this task?

Thank you very much,

Carlos Fernando [EMAIL PROTECTED]




Re: [PHP] How to loop the HTTP_POST_VARS array?

2001-05-21 Thread Carlos Fernando Scheidecker Antunes

Maxim,

This is great. Thank you very much !!

I really appreciate your explanation since I did not get anything this good
in any of my books.

Since all the values that I need to retrieve are CheckBoxes that are Named
C1,C2,C3,C... I have done the following and it worked :

function RetrieveItens() {
global $Itens;
global $HTTP_POST_VARS;



$index = count($HTTP_POST_VARS);

for($i=1; $i = $index; $i++) {
if (isset($HTTP_POST_VARS[C$i]))
$Itens[] = $HTTP_POST_VARS[C$i];
}
$index = count($Itens);
return $index;

} // function RetrieveItens



- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: 'Carlos Fernando Scheidecker Antunes' [EMAIL PROTECTED];
PHP-GENERAL [EMAIL PROTECTED]
Sent: Monday, May 21, 2001 1:00 AM
Subject: RE: [PHP] How to loop the HTTP_POST_VARS array?


no, you are trying to get an $HTTP_POST_VAR[integer]... it is not there. The
keys are your variable names, therefore this is correct:

foreach($HTTP_POST_VARS as $key=$val) {
$itens[] = $val;
}

will fit everything form ..POST_VARS into $itens array. BUT you'll loose all
the key names, knowing nothing of where these values came from.

try rather do this:

foreach($HTTP_POST_VARS as $key=$val) {
$itens[$key] = $val;
}

this will result you true:

if($HTTP_POST_VARS['var_name'] == $itens['var_name']) {}


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-Original Message-
From: Carlos Fernando Scheidecker Antunes [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 21, 2001 12:43 PM
To: PHP-GENERAL
Subject: [PHP] How to loop the HTTP_POST_VARS array?
Importance: High


Oops. I've got a typo : $itens[]
Here's the correct code :

Hello all,

I'm trying to loop the $HTTP_POST_VARS variable like an array like this :

$index = count($HTTP_POST_VARS);

for($i=0; i  $index; i++) {
$itens[] = $HTTP_POST_VARS[$i];
}

But it is not working.

Can anoyone tell me how to do it?

Thanks,

Carlos Fernando.



--
PHP General 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]

--
PHP General 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]


-- 
PHP General 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]




[PHP] function to complete strings with white spaces on the left

2001-05-20 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I need to output a string that must always be 17 characters even if the inside value 
is not.

Supose a have the HELLO word that is a 5 character string and I need to output HELLO  
   which is 17 characters.

How can I accomplish this in PHP4 ?

Has anyone ever did it?

Thanks,

Carlos Fernando.



[PHP] How to loop the HTTP_POST_VARS array?

2001-05-20 Thread Carlos Fernando Scheidecker Antunes

Hello all,

I'm trying to loop the $HTTP_POST_VARS variable like an array like this :

$index = count($HTTP_POST_VARS);

for($i=0; i  $index; i++) {
$itens = $HTTP_POST_VARS[$i];
}

But it is not working.

Can anoyone tell me how to do it?

Thanks,

Carlos Fernando.



[PHP] How to loop the HTTP_POST_VARS array?

2001-05-20 Thread Carlos Fernando Scheidecker Antunes

Oops. I've got a typo : $itens[] 
Here's the correct code :

Hello all,

I'm trying to loop the $HTTP_POST_VARS variable like an array like this :

$index = count($HTTP_POST_VARS);

for($i=0; i  $index; i++) {
$itens[] = $HTTP_POST_VARS[$i];
}

But it is not working.

Can anoyone tell me how to do it?

Thanks,

Carlos Fernando.



-- 
PHP General 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]




[PHP] how to have a print button on a PHP generated page

2001-05-18 Thread Carlos Fernando Scheidecker Antunes

Hello All!

I have a page that was generated by PHP4 and is the result of a query.

I would like to enable a button to have the page printed.

Does anyone knows how to do it with either PHP or javascript?

Thanks,

C.F.



[PHP] how to format a date variable

2001-05-17 Thread Carlos Fernando Scheidecker Antunes

Hello All,

If I issue the comand date(d./.m./.Y. .H.:.i.:.s)
I get the Today's date and time formated accordingly.

I can do the same with MySQL by using an internal function on the SQL select statement.

I've got a variable that is a MySQL native Date field but it was not and cannot be 
formated during the SELECT statement. This statement fills a variable called 
$OrderDate which is them used for lots of operations.

So what I need is to format variable $OrderDate to Day/Month/year Hour:Min:Sec.. How 
can I do it the same way as the Date() function above?

Thank you all!



[PHP] checking if e-mail address and syntax are valid

2001-04-24 Thread Carlos Fernando Scheidecker Antunes

Hello all!

I would like to know if anyone has or know any PHP code to verify if a form entered 
e-mail address is valid?

I would like that things like 4$%^%$@@.com.br could not be sent. I only has to verify 
the syntax of it, the existance I believe should be harder to verify but if it is 
possible I would be glad if anyone could point me the way.

Thanks,

Carlos Fernando.