php-general Digest 22 May 2006 00:22:54 -0000 Issue 4141

2006-05-21 Thread php-general-digest-help

php-general Digest 22 May 2006 00:22:54 - Issue 4141

Topics (messages 236570 through 236592):

Re: IP to country DB and script
236570 by: Kevin Davies
236571 by: Kevin Davies
236573 by: Ryan A
236577 by: tedd
236579 by: Ryan A
236581 by: tedd
236583 by: Ryan A
236587 by: tedd
236588 by: Ryan A

detect if file exist
236572 by: Alain Roger
236574 by: Ryan A
236575 by: Rabin Vincent
236576 by: Rabin Vincent
236578 by: Ryan A
236586 by: tedd

it don´t works fine.
236580 by: João Cândido de Souza Neto
236582 by: João Cândido de Souza Neto
236584 by: João Cândido de Souza Neto

Re: Date() finding yesterday
236585 by: Scott Hurring

Re: Uploading Files
236589 by: tedd

php transparent proxy
236590 by: IraqiGeek

Re: Uploading Files - Beginner
236591 by: P. Guethlein
236592 by: Jay Blanchard

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:
php-general@lists.php.net


--
---BeginMessage---
snip
Can anybody recommend a IP to country (or better still
IP-city) database and script?
/snip


Ryan,

I've used Tracewatch (a web stats package) on a couple of sites, and it
comes with a CSV of IP to Country conversions I believe.

URL: www.tracewatch.com

HTH,

Kev
---End Message---
---BeginMessage---
snip
URL: www.tracewatch.com
/snip

Seems like their data is sourced from here:
http://ip-to-country.webhosting.info/
---End Message---
---BeginMessage---
Thanks Kevin,

Will look into it, I think I found the same link via
the SEs...am not sure though.

Cheers!
Ryan

--- Kevin Davies [EMAIL PROTECTED] wrote:

 snip
 URL: www.tracewatch.com
 /snip
 
 Seems like their data is sourced from here:
 http://ip-to-country.webhosting.info/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
---End Message---
---BeginMessage---

At 4:59 AM -0700 5/21/06, Ryan A wrote:

Hey,

Can anybody recommend a IP to country (or better still
IP-city) database and script? I have found some leads
via google but would like to know what you guys are
using or can recommend.

Or just the DB would do, I can write the script if I
have to.

Thanks!
Ryan


Ryan:

You might want to review:

http://www.weberdev.com/get_example-3091.html

I also have:

http://xn--ovg.com/location

If you want that, please let me know and I'll provide. From reported 
tests, it appears to be correct most of the time.


hth's

tedd
--

http://sperling.com  http://ancientstones.com  http://earthstones.com
---End Message---
---BeginMessage---
Hey Tedd,

 Ryan:
 
 You might want to review:
 
 http://www.weberdev.com/get_example-3091.html

Thanks for the link.

 
 I also have:
 
 http://xn--ovg.com/location
 
 If you want that, please let me know and I'll
 provide.

As usual, most generious, thanks for the offer.
I'm still testing 3 that I found, if they dont go well
will take you up on your offer.

I have found quite a few ip- country scripts/DBs (one
extra with help from Kevin from the list) but unable
to find any ip-city that is not commercial...the only
one everyone seems to be promoting is ip2location
which is $199

Any idea of a free one? If no, will continue with the
ip-country instead of city.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
---End Message---
---BeginMessage---

At 10:43 AM -0700 5/21/06, Ryan A wrote:

Hey Tedd,


 Ryan:

 You might want to review:

 http://www.weberdev.com/get_example-3091.html


Thanks for the link.



 I also have:

 http://xn--ovg.com/location

 If you want that, please let me know and I'll
 provide.


As usual, most generious, thanks for the offer.
I'm still testing 3 that I found, if they dont go well
will take you up on your offer.

I have found quite a few ip- country scripts/DBs (one
extra with help from Kevin from the list) but unable
to find any ip-city that is not commercial...the only
one everyone seems to be promoting is ip2location
which is $199

Any idea of a free one? If no, will continue with the
ip-country instead of 

Re: [PHP] Captcha v1.0 (http://www.php.meezerk.com/index.php?page=captcha)

2006-05-21 Thread chris smith

On 5/21/06, Beauford [EMAIL PROTECTED] wrote:


The following are the errors I am getting - quite lengthy.

Thanks


$ make





gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/freetype2 -g -O2 -MT gdft.lo
-MD -MP -MF .deps/gdft.Tpo -c gdft.c  -fPIC -DPIC -o .libs/gdft.lo
gdft.c:1366:35: fontconfig/fontconfig.h: No such file or directory


You're missing a devel package. Don't know where that one comes from
'coz I don't know what configure switches you are using.

If it's freetype for example, you need the freetype-dev or
freetype-devel package to compile against.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] selecting current month from a database

2006-05-21 Thread Paul Goepfert

Hi all,

I know this might be trivial problem but I can't seem to figure it
out.  Here is my problem I have a drop down menu where I have the
months of year as menu items.  I want to be able to have the current
month be the selected month.  I have tried using the date function as
the way to set the current month as the selected value but it seems
that every value entered in the select box is set to selected.

Here is my code maybe someone can help me out

$month_query = mysql_query(SELECT m_id, months FROM Month);
while ($r = mysql_fetch_array($month_query))
{
$v = $r[m_id];
$out = $r[months];  
echo(option  selected= . date(F) . 
value=$v$out/option\n);
}

Just incase you want to know

m_id = 1..12
months = January..December

How do I set only the current month to selected ?

Thanks,
Paul

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



[PHP] Uploading Files

2006-05-21 Thread P. Guethlein
I'm at one of those frustration levels  can't seem to get a 
script working that will post and upload a file to the server.  Im 
working with the below.  Can you help?


?php
  $numoffile = 1;

  $file_dir  = d:/upload/;
  if ($_FILES['myfiles']) {
  print_r ($_FILES);
for ($i=0;$i$numoffile;$i++) {
  if (trim($_FILES['myfiles']['name'][$i])!=) {
$newfile = $file_dir.$_FILES['myfiles']['name'][$i];
move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile);
$j++;
  }
}
  }
  if (isset($j)$j0) print Your file(s) has been uploaded.br;

 echo '
form enctype=multipart/form-data action=__URL__ method=POST
!-- MAX_FILE_SIZE must precede the file input field --
input type=hidden name=MAX_FILE_SIZE value=3 /
!-- Name of input element determines name in $_FILES array --
Send this file: input name=myfiles type=file /
input type=submit value=Send File /
/form';

?  


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



Re: [PHP] selecting current month from a database

2006-05-21 Thread Paul Novitski

At 11:45 PM 5/20/2006, Paul Goepfert wrote:

I have a drop down menu where I have the
months of year as menu items.  I want to be able to have the current
month be the selected month.  I have tried using the date function as
the way to set the current month as the selected value but it seems
that every value entered in the select box is set to selected.

Here is my code maybe someone can help me out

$month_query = mysql_query(SELECT m_id, months FROM Month);
while ($r = mysql_fetch_array($month_query))
{
$v = $r[m_id];
$out = $r[months];
echo(option  selected= . 
date(F) . value=$v$out/option\n);

}

Just incase you want to know

m_id = 1..12
months = January..December

How do I set only the current month to selected ?



Paul,

The syntax for pre-selected options is:

HTML:  option selected[1]
XHTML: option selected=selected [2]

Options that are not pre-selected simply omit the 
selected attribute altogether.


Therefore you'll want code something like this:

while ($r = mysql_fetch_array($month_query))
{
$v = $r[m_id];// numeric month
$out = $r[months];// verbal month

// select option for current month
if ($v == date(n))
{
$selected = 'selected=selected';
}else{
$selected = '';
}

echo option $selected value=$v$out/option\n;
}

Notes:

- date(F) is the verbal month; date(n) is 
numeric [3].  Therefore you'll want to compare $v 
with date(n) or $out with date(F).


- Adhering to XHTML syntax, I've put the attribute values in quotes. [2]

- FYI, you can harmlessly include parentheses in 
the echo statement but echo is actually not a 
function and doesn't require parens [4].


Regards,
Paul


[1]
W3C HTML 4.01 Specification
17 Forms
17.6.1 Pre-selected options
http://www.w3.org/TR/html4/interact/forms.html#h-17.6.1

[2]
XHTML™ 1.0 The Extensible HyperText Markup Language (Second Edition)
4. Differences with HTML 4
4.4. Attribute values must always be quoted
http://www.w3.org/TR/xhtml1/#h-4.4

[3]
PHP Manual
VI. Function Reference
CLI. String Functions
echo
http://php.net/echo

[4]
PHP Manual
VI. Function Reference
XXII. Date and Time Functions
date
http://php.net/date

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



Re: [PHP] Uploading Files

2006-05-21 Thread Rabin Vincent

On 5/21/06, P. Guethlein [EMAIL PROTECTED] wrote:

I'm at one of those frustration levels  can't seem to get a
script working that will post and upload a file to the server.  Im
working with the below.  Can you help?

?php
   $numoffile = 1;

   $file_dir  = d:/upload/;
   if ($_FILES['myfiles']) {
   print_r ($_FILES);
 for ($i=0;$i$numoffile;$i++) {
   if (trim($_FILES['myfiles']['name'][$i])!=) {
 $newfile = $file_dir.$_FILES['myfiles']['name'][$i];
 move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile);
 $j++;
   }
 }
   }
   if (isset($j)$j0) print Your file(s) has been uploaded.br;

  echo '
form enctype=multipart/form-data action=__URL__ method=POST

[snipped]

The form's action value should not be __URL__, it should be the
actual URL of the PHP file (eg. http://domain.com/upload.php).
You can also use the following line instead, which will put in the
URL to the current file:

form enctype=multipart/form-data action=?php echo
$_SERVER['PHP_SELF']; ? method=POST

Rabin

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



[PHP] IP to country DB and script

2006-05-21 Thread Ryan A
Hey,

Can anybody recommend a IP to country (or better still
IP-city) database and script? I have found some leads
via google but would like to know what you guys are
using or can recommend.

Or just the DB would do, I can write the script if I
have to.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: [PHP] IP to country DB and script

2006-05-21 Thread Kevin Davies
snip
Can anybody recommend a IP to country (or better still
IP-city) database and script?
/snip


Ryan,

I've used Tracewatch (a web stats package) on a couple of sites, and it
comes with a CSV of IP to Country conversions I believe.

URL: www.tracewatch.com

HTH,

Kev

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



RE: [PHP] IP to country DB and script

2006-05-21 Thread Kevin Davies
snip
URL: www.tracewatch.com
/snip

Seems like their data is sourced from here:
http://ip-to-country.webhosting.info/

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



[PHP] detect if file exist

2006-05-21 Thread Alain Roger

Hi,

i have 1 folder, in this folder sometime a file can be sometimes not...

1. i would like to detect if the folder contains a file or not.
only 1 file can be in this folder but i do not know the name of this file,
and the extension should be xls.


when this file exists, i want to display the contents of this file to my web
site, how can i do it ?
2. could you advise me on some good tutorial PHP+Excel ?

thanks a lot,
Alain


RE: [PHP] IP to country DB and script

2006-05-21 Thread Ryan A
Thanks Kevin,

Will look into it, I think I found the same link via
the SEs...am not sure though.

Cheers!
Ryan

--- Kevin Davies [EMAIL PROTECTED] wrote:

 snip
 URL: www.tracewatch.com
 /snip
 
 Seems like their data is sourced from here:
 http://ip-to-country.webhosting.info/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] detect if file exist

2006-05-21 Thread Ryan A
U file_exists() ?

A simple search on the search engines for php file
exists gave me loads of results...

Dude, dont be lazy and just post here or you are going
to get a lot of grief...do a search on web then come
back if you dont find anything or have questions...

And trust me, this is one of the more polite answer
you will get or would have gotten.

-Ryan


--- Alain Roger [EMAIL PROTECTED] wrote:

 Hi,
 
 i have 1 folder, in this folder sometime a file can
 be sometimes not...
 
 1. i would like to detect if the folder contains a
 file or not.
 only 1 file can be in this folder but i do not know
 the name of this file,
 and the extension should be xls.
 
 
 when this file exists, i want to display the
 contents of this file to my web
 site, how can i do it ?
 2. could you advise me on some good tutorial
 PHP+Excel ?
 
 thanks a lot,
 Alain
 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] detect if file exist

2006-05-21 Thread Rabin Vincent

On 5/21/06, Alain Roger [EMAIL PROTECTED] wrote:

i have 1 folder, in this folder sometime a file can be sometimes not...

1. i would like to detect if the folder contains a file or not.
only 1 file can be in this folder but i do not know the name of this file,
and the extension should be xls.


Use the glob function: php.net/glob. Something like:

$f = glob('*.xls');
if ( count($f) )
$file = $f[0];
else
 die('no file');

Rabin

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



Re: [PHP] detect if file exist

2006-05-21 Thread Rabin Vincent

On 5/21/06, Ryan A [EMAIL PROTECTED] wrote:

U file_exists() ?


file_exists doesn't help here since the filename of
the file is not known. glob or the *dir functions do
the trick.

Rabin

[please bottom-post...]

A simple search on the search engines for php file
exists gave me loads of results...

Dude, dont be lazy and just post here or you are going
to get a lot of grief...do a search on web then come
back if you dont find anything or have questions...

And trust me, this is one of the more polite answer
you will get or would have gotten.

-Ryan


--- Alain Roger [EMAIL PROTECTED] wrote:

 Hi,

 i have 1 folder, in this folder sometime a file can
 be sometimes not...

 1. i would like to detect if the folder contains a
 file or not.
 only 1 file can be in this folder but i do not know
 the name of this file,
 and the extension should be xls.


 when this file exists, i want to display the
 contents of this file to my web
 site, how can i do it ?
 2. could you advise me on some good tutorial
 PHP+Excel ?

 thanks a lot,
 Alain


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



Re: [PHP] IP to country DB and script

2006-05-21 Thread tedd

At 4:59 AM -0700 5/21/06, Ryan A wrote:

Hey,

Can anybody recommend a IP to country (or better still
IP-city) database and script? I have found some leads
via google but would like to know what you guys are
using or can recommend.

Or just the DB would do, I can write the script if I
have to.

Thanks!
Ryan


Ryan:

You might want to review:

http://www.weberdev.com/get_example-3091.html

I also have:

http://xn--ovg.com/location

If you want that, please let me know and I'll provide. From reported 
tests, it appears to be correct most of the time.


hth's

tedd
--

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] detect if file exist

2006-05-21 Thread Ryan A

 On 5/21/06, Ryan A [EMAIL PROTECTED] wrote:
  U file_exists() ?
 
 file_exists doesn't help here since the filename of
 the file is not known. glob or the *dir functions do
 the trick.
 
 Rabin
 

Its all connected, had you searched the SEs first,
your would have found file_exists(), then if you read
that functions page at php.net you would have seen
readdir() which is another way of doing exactly what
you want..

eg:
readdir, if the directory is populated you can then
check the extention (eg: .com, php, xls or whatever)

All I am saying is, try to use the list as pretty much
your last resort..



--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] IP to country DB and script

2006-05-21 Thread Ryan A
Hey Tedd,

 Ryan:
 
 You might want to review:
 
 http://www.weberdev.com/get_example-3091.html

Thanks for the link.

 
 I also have:
 
 http://xn--ovg.com/location
 
 If you want that, please let me know and I'll
 provide.

As usual, most generious, thanks for the offer.
I'm still testing 3 that I found, if they dont go well
will take you up on your offer.

I have found quite a few ip- country scripts/DBs (one
extra with help from Kevin from the list) but unable
to find any ip-city that is not commercial...the only
one everyone seems to be promoting is ip2location
which is $199

Any idea of a free one? If no, will continue with the
ip-country instead of city.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP] it don�t works fine.

2006-05-21 Thread Jo�o C�ndido de Souza Neto
Hi everyone.

I´m with a big trouble using php 5 + iis 5.1 in windows xp professional.

It was working fine, but suddenly stop working.
under my root folder i´ve got a system folder that run php-cgi.exe fine, but 
files under this folder (e.g. system/function/function1.php) isn´t 
recognised as a php file and the browse try to open it in dreamweaver or 
download it.

Saomeone here knows wath to do in this case?

Any tip´ll be appreciated.

Thanks

João Cândido de Souza Neto. 

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



Re: [PHP] IP to country DB and script

2006-05-21 Thread tedd

At 10:43 AM -0700 5/21/06, Ryan A wrote:

Hey Tedd,


 Ryan:

 You might want to review:

 http://www.weberdev.com/get_example-3091.html


Thanks for the link.



 I also have:

 http://xn--ovg.com/location

 If you want that, please let me know and I'll
 provide.


As usual, most generious, thanks for the offer.
I'm still testing 3 that I found, if they dont go well
will take you up on your offer.

I have found quite a few ip- country scripts/DBs (one
extra with help from Kevin from the list) but unable
to find any ip-city that is not commercial...the only
one everyone seems to be promoting is ip2location
which is $199

Any idea of a free one? If no, will continue with the
ip-country instead of city.

Thanks!
Ryan



Ryan:

As always in life, your choices are quick, good, and inexpensive -- 
but you can only pick two. :-)


In any event, if you find a free one better than what I provided, 
please share.


tedd
--

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] Re: it don�t works fine.

2006-05-21 Thread Jo�o C�ndido de Souza Neto
It´s incredible.

As soon as i wrote this message, it beguns to work fine.

thanks everyone.

João Cândido de Souza Neto [EMAIL PROTECTED] escreveu na 
mensagem news:[EMAIL PROTECTED]
 Hi everyone.

 I´m with a big trouble using php 5 + iis 5.1 in windows xp professional.

 It was working fine, but suddenly stop working.
 under my root folder i´ve got a system folder that run php-cgi.exe fine, 
 but files under this folder (e.g. system/function/function1.php) isn´t 
 recognised as a php file and the browse try to open it in dreamweaver or 
 download it.

 Saomeone here knows wath to do in this case?

 Any tip´ll be appreciated.

 Thanks

 João Cândido de Souza Neto. 


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



Re: [PHP] IP to country DB and script

2006-05-21 Thread Ryan A
Hey Tedd,

 
 As always in life, your choices are quick, good, and
 inexpensive -- 
 but you can only pick two. :-)

Hey! Thats a good one, am going to use it in other
places :-)
 Thanks!


 In any event, if you find a free one better than
 what I provided,  please share.

Will do, the problem is, when I visited that page it
tells me:
Your location:
city (unknown)
Country: EU

and gives me an option to identify myself below... I
did, so it will help you expand your db, but I cant
want to ask the visitors to my clients site to do the
same, it has to show them their correct country a high
percentage of the time.

After submitting my location details I went back there
and refreshed the page but it still shows me the same
old data

Cheers!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP] Re: it don�t works fine.

2006-05-21 Thread Jo�o C�ndido de Souza Neto
It´s incredible.

As soon as i wrote this message, it beguns to work fine.

thanks everyone.


João Cândido de Souza Neto [EMAIL PROTECTED] escreveu na 
mensagem news:[EMAIL PROTECTED]
 Hi everyone.

 I´m with a big trouble using php 5 + iis 5.1 in windows xp professional.

 It was working fine, but suddenly stop working.
 under my root folder i´ve got a system folder that run php-cgi.exe fine, 
 but files under this folder (e.g. system/function/function1.php) isn´t 
 recognised as a php file and the browse try to open it in dreamweaver or 
 download it.

 Saomeone here knows wath to do in this case?

 Any tip´ll be appreciated.

 Thanks

 João Cândido de Souza Neto. 

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



Re: [PHP] Date() finding yesterday

2006-05-21 Thread Scott Hurring

mktime also works: http://php.net/mktime:

date(Y-m-d, mktime( ... ))

On 5/21/06, Rabin Vincent [EMAIL PROTECTED] wrote:


On 5/21/06, John Taylor-Johnston
[EMAIL PROTECTED] wrote:
 I cannot seem to get this right. How can I produce yesterday?

 $today = date(Y-m-d);
 $yesterday = date(Y-m-) . date(d)-1;
 $yesterday = date(Y-m-d)-1;
 $yesterday = date(Y-m-.d-1);

 I've been looking at the manual :) ...

Use php.net/strtotime:

$yesterday = date('Y-m-d', strtotime('-1 day'));

Rabin

--
http://rab.in

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





--
Scott Hurring [scott dot hurring dot lists at gmail dot com]
http://hurring.com/


Re: [PHP] detect if file exist

2006-05-21 Thread tedd

At 3:52 PM +0200 5/21/06, Alain Roger wrote:

Hi,

i have 1 folder, in this folder sometime a file can be sometimes not...

1. i would like to detect if the folder contains a file or not.
only 1 file can be in this folder but i do not know the name of this file,
and the extension should be xls.


when this file exists, i want to display the contents of this file to my web
site, how can i do it ?
2. could you advise me on some good tutorial PHP+Excel ?

thanks a lot,



Alain:

I know you asked for a reference, but you might try this.

Replace tmp with path/to/your/folder.

The routine will look for files in the indicated folder. If there are 
no files present, then nothing happens -- however, if there are any 
files present, then it will fill the file_array with their names. 
From that, it will look at the files within that array and select out 
only those with the proper suffixes and fill the html array. Then it 
will read in from the html array and list the contents of those files 
to your web page.


This should do what you want.

?php

$path = tmp;
if ($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if ($file != .  $file != ..)
{
$file_array[] = $file;
if(eregi((\.xml|\.html|\.htm|\.php|\.txt), $file))
{
$html[] = $file;
}
}
}
closedir($handle);
}

if (isset($file_array))
{
echo (br/ all files in dir);
echo (pre);
print_r($file_array);
echo(/pre);

echo (br/ selected files in dir);
echo (pre);
print_r($html);
echo(/pre);

if($html != null)
{
sort($html);
foreach($html as $html = $value)
{
$filename = $path . / . $value;
$filesize = filesize($filename);
$file = fopen( $filename, r );
$text = fread( $file, $filesize );
fclose( $file );
echo( br/File read: $filenamebr/ );
echo( File Size: $filesize bytesbr/ );
echo( File Content:$textbr/ );
}
}
}
else
{
echo (br/ nothing to read);
}
?

hth's

tedd


--

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] IP to country DB and script

2006-05-21 Thread tedd

At 11:01 AM -0700 5/21/06, Ryan A wrote:

  As always in life, your choices are quick, good, and

 inexpensive --
 but you can only pick two. :-)


Hey! Thats a good one, am going to use it in other
places :-)
 Thanks!


No problem -- I met with a client yesterday where I told him that. He 
thought it a good quote as well, but let's see if he hires me. :-)



  In any event, if you find a free one better than

 what I provided,  please share.


Will do, the problem is, when I visited that page it
tells me:
Your location:
city (unknown)
Country: EU


That routine doesn't reference a dB-- it simply uses:

$location = get_location_xml( get_remote_ip() );
$city = parse_city( $location );
$country = parse_country( $location );

No big deal -- just something I found interesting.


and gives me an option to identify myself below... I
did, so it will help you expand your db, but I cant
want to ask the visitors to my clients site to do the
same, it has to show them their correct country a high
percentage of the time.

After submitting my location details I went back there
and refreshed the page but it still shows me the same
old data


Yep, but you're expecting more from me than what I deserve.

I could collect the data and build my own dB -- that sounds 
reasonable. But, my test here was simply to see how valid those calls 
were. I have no idea if the people who are submitting data to me are 
telling the truth or not. As such, it would be problematic to build a 
reliable dB from the few visitors I receive.


Plus, things change. Sometimes I access my site and it shows my 
correct location of Lansing, MI, then other times is shows 
Jackson, MI, and today it's showing Unknown, CA. So, even if I 
were being honest, what would I report?


I have seen some pretty accurate reporting systems, but I fear that 
they have to be kept current on a daily basis.


tedd

--

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] IP to country DB and script

2006-05-21 Thread Ryan A


--- tedd [EMAIL PROTECTED] wrote:
Hey,

 At 11:01 AM -0700 5/21/06, Ryan A wrote:
As always in life, your choices are quick,
 good, and
   inexpensive --
   but you can only pick two. :-)
 
 Hey! Thats a good one, am going to use it in other
 places :-)
   Thanks!
 
 No problem -- I met with a client yesterday where I
 told him that. He 
 thought it a good quote as well, but let's see if he
 hires me. :-)

Best of luck, I hope you get it.



 
 That routine doesn't reference a dB-- it simply
 uses:
 
 $location = get_location_xml( get_remote_ip() );
 $city = parse_city( $location );
 $country = parse_country( $location );


Interesting

 
 I have seen some pretty accurate reporting systems,
 but I fear that 
 they have to be kept current on a daily basis.

I guess so too, some companies are charging 199 for
the database (ip-country and city) and $280 for 1
year of updates.

The (free) package i downloaded references the DB and
so far its been pretty accurate (only ip- country
though), i also checked it with some known proxies
(Korea, Japan, China and the US) and its been spot on
so far.

I can send it to you if you want, I had to tweak the
script a bit due to inconsistant variable names and
globals being off on my machine but it works great
now. Feel free to reply to me if you want it. Its just
under 3mb with the country csv file.

Cheers!

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] Uploading Files

2006-05-21 Thread tedd

At 1:52 AM -0700 5/21/06, P. Guethlein wrote:
I'm at one of those frustration levels  can't seem to get a 
script working that will post and upload a file to the server.  Im 
working with the below.  Can you help?


Guethlein:

Yes, try this -- watch for line breaks. Also, create folders uploads/tmp.

The code works as is for me except that I have to give the tmp 
folder 0777 permissions* because the code runs as nobody. I haven't 
figured out how to get around that, but I can change the uploaded 
file's permissions without error. (If anyone wants to show me 
OFF-LIST how to do this without setting the tmp folder to 0777, I'm 
all ears, but don't beat me up because I'm trying to learn.)


Code follows:

?php

// This allows users to upload files to the server.

if (isset($_POST['submit'])) // handle the form --  start of main 
Submit conditional..

{

// Create the file name.

$filename = $_FILES['upload']['name'];
$file_loaded = 0;

// Move the file over.

	if (move_uploaded_file($_FILES['upload']['tmp_name'], 
uploads/tmp/$filename))

{
echo 'pThe file has been uploaded to the server./p';
chmod(uploads/tmp/$filename, 0755);
echo ( 'p' . $filename . '/p' );
}
else
{
		echo ('pfont color=redERROR: The file was not 
upload./font/p');

}
}
else
{

?

	form enctype=multipart/form-data action=?php echo 
$_SERVER['PHP_SELF']; ? method=post

p
input type=hidden name=MAX_FILE_SIZE value=3
/p
fieldset
legendSelect the file to upload:/legend
p
bFile:/b
input type=file name=upload /
/p
/fieldset
p
input type=submit name=submit value=Submit /
/p
/form

?php
}
?

hth's

tedd

* Larry Ullman in his books says to use 0777 permission for uploading 
files. However, he does say that it is less secure and should be 
placed outside of the web directory.

--

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] php transparent proxy

2006-05-21 Thread IraqiGeek

Hi all,

Is anyone aware of a php script that runs as a proxy (not a web proxy)? I 
have a hosting account with a dedicated IP, and I'm wondering if I can use 
this account to run a proxy where I enter my account's dedicated IP in the 
browser as a proxy, and use that to surf the net.


I am already running a web proxy, but want to expand to be able to use the 
proxy with other applications.



Regards,
IraqiGeek
www.iraqigeek.com

Whoever undertakes to set himself up as judge in the field of truth and 
knowledge is shipwrecked by the laughter of the Gods.
Albert Einstein 


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



Re: [PHP] Uploading Files - Beginner

2006-05-21 Thread P. Guethlein
I'm still very frustrated trying to figure out how to upload a 
file.  I must have tried 15 different coding examples and none of them work.


When I try and debug and do a
print_r($_FILES);

All I'm getting back is array() with no data.

File upload is allowed in my php.ini

Can anyone offer any other insight before my laptop sails into the 
wall ?smile


Thanks, -Pete




At 02:03 PM 05/21/2006, tedd wrote:

At 1:52 AM -0700 5/21/06, P. Guethlein wrote:
I'm at one of those frustration levels  can't seem to get a 
script working that will post and upload a file to the server.  Im 
working with the below.  Can you help?


Guethlein:

Yes, try this -- watch for line breaks. Also, create folders uploads/tmp.

The code works as is for me except that I have to give the tmp 
folder 0777 permissions* because the code runs as nobody. I 
haven't figured out how to get around that, but I can change the 
uploaded file's permissions without error. (If anyone wants to show 
me OFF-LIST how to do this without setting the tmp folder to 0777, 
I'm all ears, but don't beat me up because I'm trying to learn.)


Code follows:

?php

// This allows users to upload files to the server.

if (isset($_POST['submit'])) // handle the form --  start of main 
Submit conditional..

{

// Create the file name.

$filename = $_FILES['upload']['name'];
$file_loaded = 0;

// Move the file over.

if (move_uploaded_file($_FILES['upload']['tmp_name'], 
uploads/tmp/$filename))

 {
 echo 'pThe file has been uploaded to the server./p';
 chmod(uploads/tmp/$filename, 0755);
 echo ( 'p' . $filename . '/p' );
 }
else
 {
 echo ('pfont color=redERROR: The file was not upload./font/p');
 }
}
else
{

?

form enctype=multipart/form-data action=?php echo 
$_SERVER['PHP_SELF']; ? method=post

 p
 input type=hidden name=MAX_FILE_SIZE value=3
 /p
 fieldset
 legendSelect the file to upload:/legend
 p
 bFile:/b
 input type=file name=upload /
 /p
 /fieldset
 p
 input type=submit name=submit value=Submit /
 /p
/form

?php
}
?

hth's

tedd

* Larry Ullman in his books says to use 0777 permission for 
uploading files. However, he does say that it is less secure and 
should be placed outside of the web directory.

--

http://sperling.com  http://ancientstones.com  http://earthstones.com


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



RE: [PHP] Uploading Files - Beginner

2006-05-21 Thread Jay Blanchard
[snip]
I'm still very frustrated trying to figure out how to upload a 
file.  I must have tried 15 different coding examples and none of them
work.

When I try and debug and do a
print_r($_FILES);

All I'm getting back is array() with no data.

File upload is allowed in my php.ini

Can anyone offer any other insight before my laptop sails into the 
wall ?smile
[/snip]

Have you tried the very simple example shown in the manual?
http://us3.php.net/manual/en/features.file-upload.php

I will be right by my computer for a while, so make sure to reply to the
list. Pay particular attention to MAX_FILE_SIZE. Even if file upload is
allowed in you php.in are you running in safe mode?

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



Re: [PHP] Uploading Files - SOLVED

2006-05-21 Thread P. Guethlein

It worked perfectly!

ES Simple Uploader Script located at
http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/Upload_Systems/index.html

If anyone else is on their learning curve...

-Pete



At 04:56 PM 05/21/2006, P. Guethlein wrote:
I'm still very frustrated trying to figure out how to upload a 
file.  I must have tried 15 different coding examples and none of them work.


When I try and debug and do a
print_r($_FILES);

All I'm getting back is array() with no data.

File upload is allowed in my php.ini

Can anyone offer any other insight before my laptop sails into the 
wall ?smile


Thanks, -Pete




At 02:03 PM 05/21/2006, tedd wrote:

At 1:52 AM -0700 5/21/06, P. Guethlein wrote:
I'm at one of those frustration levels  can't seem to get a 
script working that will post and upload a file to the 
server.  Im working with the below.  Can you help?


Guethlein:

Yes, try this -- watch for line breaks. Also, create folders uploads/tmp.

The code works as is for me except that I have to give the tmp 
folder 0777 permissions* because the code runs as nobody. I 
haven't figured out how to get around that, but I can change the 
uploaded file's permissions without error. (If anyone wants to show 
me OFF-LIST how to do this without setting the tmp folder to 0777, 
I'm all ears, but don't beat me up because I'm trying to learn.)


Code follows:

?php

// This allows users to upload files to the server.

if (isset($_POST['submit'])) // handle the form --  start of main 
Submit conditional..

{

// Create the file name.

$filename = $_FILES['upload']['name'];
$file_loaded = 0;

// Move the file over.

if (move_uploaded_file($_FILES['upload']['tmp_name'], 
uploads/tmp/$filename))

 {
 echo 'pThe file has been uploaded to the server./p';
 chmod(uploads/tmp/$filename, 0755);
 echo ( 'p' . $filename . '/p' );
 }
else
 {
 echo ('pfont color=redERROR: The file was not upload./font/p');
 }
}
else
{

?

form enctype=multipart/form-data action=?php echo 
$_SERVER['PHP_SELF']; ? method=post

 p
 input type=hidden name=MAX_FILE_SIZE value=3
 /p
 fieldset
 legendSelect the file to upload:/legend
 p
 bFile:/b
 input type=file name=upload /
 /p
 /fieldset
 p
 input type=submit name=submit value=Submit /
 /p
/form

?php
}
?

hth's

tedd

* Larry Ullman in his books says to use 0777 permission for 
uploading files. However, he does say that it is less secure and 
should be placed outside of the web directory.

--

http://sperling.com  http://ancientstones.com  http://earthstones.com


--
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



Re: [PHP] Problem after migration of script from Fedora Core to RHEL

2006-05-21 Thread Chris

benmoreassynt wrote:

Hi,

This has me confused. Have just moved servers from FC4 box to RHEL box.
Basically all the settings seem to be the same. PHP5.0.4, MySQL 5.0.20



So it is telling that the script is trying to insert duplicate entries. The
exact same script works fine on the old box without entering duplicate
entries.


It has nothing to do with the script and everything to do with the database.

You might need to reset the auto_increment count (search the archives, 
there have been lots of examples on how to do this posted - otherwise 
search http://dev.mysql.com).


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Problem after migration of script from Fedora Core to RHEL

2006-05-21 Thread Chris

Chris wrote:

benmoreassynt wrote:


Hi,

This has me confused. Have just moved servers from FC4 box to RHEL box.
Basically all the settings seem to be the same. PHP5.0.4, MySQL 5.0.20




So it is telling that the script is trying to insert duplicate 
entries. The

exact same script works fine on the old box without entering duplicate
entries.



It has nothing to do with the script and everything to do with the 
database.


You might need to reset the auto_increment count (search the archives, 
there have been lots of examples on how to do this posted - otherwise 
search http://dev.mysql.com).




Forgot to add.. this is especially true if you have copied data from one 
server to the other. A database dump should do this for you, if you've 
done it by hand then you're on your own..


--
Postgresql  php tutorials
http://www.designmagick.com/

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



RE: [PHP] Uploading Files - Beginner

2006-05-21 Thread P. Guethlein

Jay,

Thanks for the response.  I finally found a script that actually 
worked immediately.  I posted the link in an earlier message.  I 
found the authors directly link

here http://www.energyscripts.com/Products/product2.html
for others that may need help.

-Pete


At 05:23 PM 05/21/2006, you wrote:

[snip]
I'm still very frustrated trying to figure out how to upload a
file.  I must have tried 15 different coding examples and none of them
work.

When I try and debug and do a
print_r($_FILES);

All I'm getting back is array() with no data.

File upload is allowed in my php.ini

Can anyone offer any other insight before my laptop sails into the
wall ?smile
[/snip]

Have you tried the very simple example shown in the manual?
http://us3.php.net/manual/en/features.file-upload.php

I will be right by my computer for a while, so make sure to reply to the
list. Pay particular attention to MAX_FILE_SIZE. Even if file upload is
allowed in you php.in are you running in safe mode?

--
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] Need Help Please

2006-05-21 Thread marvin hunkin

Hi.
doing an assignment, for my Certificate Four In Website Administration.
now got a couple of problems.
will explain what i have to do.
create a html form, which i have done.
in textpad.
now, when i open the form, it does not set focus to the first form field 
which is the user name.

goes to the login button.
why is this?
can any one help me?
okay, will explain.
and to create a script for a login page, on a network.
and using php, and now got the user to enter their username and password, 
and then to display a message, saying the person logged in, and to display 
the date.
if the user, types in the wrong user name and password, then a error message 
is displayed, and a link back to the form, is displayed.
now got the problem of a error, when checking to see if the error happened 
or not, and whether to let them in or not.

so will paste the html form, and the php code below.
if any one can help me how to fix these problems, then let me know asap.
cheers Marvin.


Html Form:


Code Starts Here:

html
head
script language=text/javascript
function SetFocus
{
document.forms[0].username.focus();
}
/script
titleUser Login Form/title
/head
body onload=SetFocus();
form action=UserDetails.php method=post
pUser Name: input type=text name=username /p br
pPassword: input type=password name=password /p br
pinput type=submit value=Login /p
/form
/body
/html


Php Code:


Code Starts Here:

?php
$_POST['username'];
$_POST['password'];
if ('username'='username')  ('password'='password')
{
echo Letting you login into the tafe network. br\n;
echo Marvin Hunkin has successfully logged into the Tafe network. br\n;
echo Please Wait ... Loading Your Personal Settings ... br\n;
gmdate('d-m-Y', time()+(10*60*60));
}
else
{
echo Not letting you login into the tafe network. br\n;
echo Error! You did not type in a correct username! Please try again... 
br\n;
echo Click on the link below to return back to the login form and enter 
your correct user name and password. br\n;

echo'a href=UserDetails.htmlReturn To Login Form/a';
}
?

Code Error:

Code Starts Here:

Parse error: parse error in c:\program files\easyphp1-8\www\userdetails.php 
on line 4


I am Using Easy Php 1-8, and using http://localhost in the browser, and 
sending my files to the www folder of easy php.

Have A Great Day.
Marvin.

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



Re: [PHP] Need Help Please

2006-05-21 Thread Wolf
Sure we can...  Go back and read your manual.  Then surf Google.

Then tell us where you are getting the certificate from since some of us
might be wasting our time taking a class some place that teaches you so
poorly.

Wolf

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



Re: [PHP] Need Help Please

2006-05-21 Thread Chris

marvin hunkin wrote:

Hi.
doing an assignment, for my Certificate Four In Website Administration.


Wow someone doing an assignment has written some code :) Good stuff!


$_POST['username'];
$_POST['password'];
if ('username'='username')  ('password'='password')


This little bit of code is your problem.

Firstly you want to assign the username and password to some variables:

$posted_username = $_POST['username'];
$posted_password = $_POST['password'];

http://www.php.net/manual/en/language.variables.php#language.variables.basics

Then you want to check them:

if ($posted_username == 'username'  $posted_password == 'password')
{


in php, one = means assignment

http://www.php.net/manual/en/language.operators.assignment.php

to check a variable, use two - ==.

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


Lastly for some extra credit, you should read http://phpsec.org/projects/.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Need Help Please

2006-05-21 Thread Chris

Wolf wrote:

Sure we can...  Go back and read your manual.  Then surf Google.

Then tell us where you are getting the certificate from since some of us
might be wasting our time taking a class some place that teaches you so
poorly.


At least there were attempts at code which makes a nice change.. ;)

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Need Help Please

2006-05-21 Thread John Nichel

marvin hunkin wrote:

Hi.
doing an assignment, for my Certificate Four In Website Administration.


The tutor list is down the hall.


now got a couple of problems.
will explain what i have to do.
create a html form, which i have done.
in textpad.
now, when i open the form, it does not set focus to the first form field 
which is the user name.

goes to the login button.
why is this?
can any one help me?


Yes.  Buy a book on Javascript.


okay, will explain.
and to create a script for a login page, on a network.
and using php, and now got the user to enter their username and 
password, and then to display a message, saying the person logged in, 
and to display the date.
if the user, types in the wrong user name and password, then a error 
message is displayed, and a link back to the form, is displayed.
now got the problem of a error, when checking to see if the error 
happened or not, and whether to let them in or not.

so will paste the html form, and the php code below.
if any one can help me how to fix these problems, then let me know asap.
cheers Marvin.


Html Form:


Code Starts Here:

html
head
script language=text/javascript
function SetFocus
{
document.forms[0].username.focus();
}
/script
titleUser Login Form/title
/head
body onload=SetFocus();
form action=UserDetails.php method=post
pUser Name: input type=text name=username /p br
pPassword: input type=password name=password /p br
pinput type=submit value=Login /p
/form
/body
/html


Php Code:


Code Starts Here:

?php
$_POST['username'];
$_POST['password'];
if ('username'='username')  ('password'='password')
{
echo Letting you login into the tafe network. br\n;
echo Marvin Hunkin has successfully logged into the Tafe network. br\n;
echo Please Wait ... Loading Your Personal Settings ... br\n;
gmdate('d-m-Y', time()+(10*60*60));
}
else
{
echo Not letting you login into the tafe network. br\n;
echo Error! You did not type in a correct username! Please try again... 
br\n;
echo Click on the link below to return back to the login form and enter 
your correct user name and password. br\n;

echo'a href=UserDetails.htmlReturn To Login Form/a';
}
?

Code Error:

Code Starts Here:

Parse error: parse error in c:\program 
files\easyphp1-8\www\userdetails.php on line 4


I am Using Easy Php 1-8, and using http://localhost in the browser, and 
sending my files to the www folder of easy php.

Have A Great Day.
Marvin.



Instead of cutting and pasting, RTFM and understand what your code is 
(not) doing.


If this is level four, Most of us here would be a Grand Poobah.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

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



[PHP] /usr/local/libexec/apache22/libphp4.so not installed

2006-05-21 Thread Noah
FreeBSD-4.11

After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 I no longer
and finding that /usr/local/libexec/apache22/libphp4.so is getting installed.

Any clues as to what I am doing wrong?  I cant figure it out at the moment.  


--- snip ---

# /usr/local/etc/rc.d/apache22.sh restart
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 101 of /usr/local/etc/apache22/httpd.conf: Cannot
load /usr/local/libexec/apache22/libphp4.so into server: Cannot open
/usr/local/libexec/apache22/libphp4.so

# grep php4 /usr/local/etc/apache/httpd.conf
LoadModule php4_modulelibexec/apache22/libphp4.so

# pkg_info | grep apache
apache-2.2.2Version 2.2 of Apache web server with prefork MPM.

# pkg_info | grep php
php4-4.4.2_2PHP Scripting Language (Apache Module and CLI)
php4-bz2-4.4.2_2The bz2 shared extension for php
php4-ctype-4.4.2_2  The ctype shared extension for php
php4-domxml-4.4.2_2 The domxml shared extension for php
php4-ftp-4.4.2_2The ftp shared extension for php
php4-gd-4.4.2_2 The gd shared extension for php
php4-gettext-4.4.2_2 The gettext shared extension for php
php4-iconv-4.4.2_2  The iconv shared extension for php
php4-imap-4.4.2_2   The imap shared extension for php
php4-ldap-4.4.2_2   The ldap shared extension for php
php4-mbstring-4.4.2_2 The mbstring shared extension for php
php4-mcal-4.4.2_2   The mcal shared extension for php
php4-mcrypt-4.4.2_2 The mcrypt shared extension for php
php4-mysql-4.4.2_2  The mysql shared extension for php
php4-openssl-4.4.2_2 The openssl shared extension for php
php4-pcre-4.4.2_2   The pcre shared extension for php
php4-session-4.4.2_2 The session shared extension for php
php4-xml-4.4.2_2The xml shared extension for php
php4-xmlrpc-4.4.2_1 The xmlrpc shared extension for php
php4-zlib-4.4.2_2   The zlib shared extension for php


# ls /usr/local/libexec/apache22
httpd.exp   mod_cache.somod_log_config.so
mod_actions.so  mod_cern_meta.somod_logio.so
mod_alias.somod_cgi.so  mod_mime.so
mod_asis.so mod_charset_lite.so mod_mime_magic.so
mod_auth_basic.so   mod_dav.so  mod_negotiation.so
mod_auth_digest.so  mod_dav_fs.so   mod_rewrite.so
mod_authn_anon.so   mod_deflate.so  mod_setenvif.so
mod_authn_dbm.somod_dir.so  mod_speling.so
mod_authn_default.somod_disk_cache.so   mod_ssl.so
mod_authn_file.so   mod_env.so  mod_status.so
mod_authz_dbm.somod_expires.so  mod_unique_id.so
mod_authz_default.somod_file_cache.so   mod_userdir.so
mod_authz_groupfile.so  mod_filter.so   mod_usertrack.so
mod_authz_host.so   mod_headers.so  mod_version.so
mod_authz_owner.so  mod_imagemap.so mod_vhost_alias.so
mod_authz_user.so   mod_include.so
mod_autoindex.somod_info.so

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



Re: [PHP] Need Help Please

2006-05-21 Thread Paul Novitski

At 07:38 PM 5/21/2006, marvin hunkin wrote:
now, when i open the form, it does not set focus to the first form 
field which is the user name.

goes to the login button.
why is this?



Marvin,

Although someone else has suggested you use JavaScript to set the 
focus on a particular form field, I urge you instead to use HTML 
tabindex property:


pUser Name: input tabindex=1 type=text name=username /p br
pPassword: input tabindex=2 type=password name=password /p br
pinput tabindex=3 type=submit value=Login /p

HTML 4.01 Specification
17 Forms
17.11 Giving focus to an element
17.11.1 Tabbing navigation
http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1

Simplistic JavaScript solutions place focus on an input field after 
the page has completely loaded, often after the user has begun 
interacting with the form, causing irritating focus jumps in mid-input.


Regards,
Paul 


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



[PHP] /usr/local/libexec/apache22/libphp4.so not installed

2006-05-21 Thread Noah
FreeBSD-4.11

After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 from
/usr/ports - I no longer am finding that
/usr/local/libexec/apache22/libphp4.so is getting installed.

Any clues as to what I am doing wrong?  I cant figure it out at the moment.  


--- snip ---

# /usr/local/etc/rc.d/apache22.sh restart
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 101 of /usr/local/etc/apache22/httpd.conf: Cannot
load /usr/local/libexec/apache22/libphp4.so into server: Cannot open
/usr/local/libexec/apache22/libphp4.so

# grep php4 /usr/local/etc/apache/httpd.conf
LoadModule php4_modulelibexec/apache22/libphp4.so

# pkg_info | grep apache
apache-2.2.2Version 2.2 of Apache web server with prefork MPM.

# pkg_info | grep php
php4-4.4.2_2PHP Scripting Language (Apache Module and CLI)
php4-bz2-4.4.2_2The bz2 shared extension for php
php4-ctype-4.4.2_2  The ctype shared extension for php
php4-domxml-4.4.2_2 The domxml shared extension for php
php4-ftp-4.4.2_2The ftp shared extension for php
php4-gd-4.4.2_2 The gd shared extension for php
php4-gettext-4.4.2_2 The gettext shared extension for php
php4-iconv-4.4.2_2  The iconv shared extension for php
php4-imap-4.4.2_2   The imap shared extension for php
php4-ldap-4.4.2_2   The ldap shared extension for php
php4-mbstring-4.4.2_2 The mbstring shared extension for php
php4-mcal-4.4.2_2   The mcal shared extension for php
php4-mcrypt-4.4.2_2 The mcrypt shared extension for php
php4-mysql-4.4.2_2  The mysql shared extension for php
php4-openssl-4.4.2_2 The openssl shared extension for php
php4-pcre-4.4.2_2   The pcre shared extension for php
php4-session-4.4.2_2 The session shared extension for php
php4-xml-4.4.2_2The xml shared extension for php
php4-xmlrpc-4.4.2_1 The xmlrpc shared extension for php
php4-zlib-4.4.2_2   The zlib shared extension for php


# ls /usr/local/libexec/apache22
httpd.exp   mod_cache.somod_log_config.so
mod_actions.so  mod_cern_meta.somod_logio.so
mod_alias.somod_cgi.so  mod_mime.so
mod_asis.so mod_charset_lite.so mod_mime_magic.so
mod_auth_basic.so   mod_dav.so  mod_negotiation.so
mod_auth_digest.so  mod_dav_fs.so   mod_rewrite.so
mod_authn_anon.so   mod_deflate.so  mod_setenvif.so
mod_authn_dbm.somod_dir.so  mod_speling.so
mod_authn_default.somod_disk_cache.so   mod_ssl.so
mod_authn_file.so   mod_env.so  mod_status.so
mod_authz_dbm.somod_expires.so  mod_unique_id.so
mod_authz_default.somod_file_cache.so   mod_userdir.so
mod_authz_groupfile.so  mod_filter.so   mod_usertrack.so
mod_authz_host.so   mod_headers.so  mod_version.so
mod_authz_owner.so  mod_imagemap.so mod_vhost_alias.so
mod_authz_user.so   mod_include.so
mod_autoindex.somod_info.so

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



Re: [PHP] /usr/local/libexec/apache22/libphp4.so not installed

2006-05-21 Thread Chris

Noah wrote:

FreeBSD-4.11

After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 from
/usr/ports - I no longer am finding that
/usr/local/libexec/apache22/libphp4.so is getting installed.

Any clues as to what I am doing wrong?  I cant figure it out at the moment.  


The error makes perfect sense - there is no file.

Apache2 has no idea what php is, so you need to re-compile php4 against 
the new apache2.


You can't just copy the existing one because things would be quite 
different internally between apache1 and apache2.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] Thank You for Helping Me

2006-05-21 Thread marvin hunkin

Hi.
would like to give a big thanks for helping me with my php problems.
have resolved them, and just tested it, and works fine.
thanks for chris, john and paul with their help.
now have just uploaded my assignment.
and now it works fine, when i tested it.
typing in the correct username and password, and getting the message, i have 
logged in..., and reran the form, if it is not the correct username and 
password, a error message, a link back to the form, which it goes back 
there, setting focus on the first edit field.

thanks for all your great help.
cheers Marvin.

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



[PHP] Getting the right path output from $_SERVER

2006-05-21 Thread Dave M G

PHP General,

What I am trying to achieve is to output the path in which the current 
script is executing, without having the name of the file attached. I'm 
hoping to be able to do this without complicated code to truncate path 
names and whatnot.


Either of these two variables do what I want, except that they include 
the name of the file:


$_SERVER[PHP_SELF]
$_SERVER[SCRIPT_NAME]

For example, if create file called test.php and I echo the output of 
$_SERVER[PHP_SELF], I get:

/web_sites/gutteridge.info/web/test.php

But all I want is:
/web_sites/gutteridge.info/web

(It's important that the last forward slash not be there).

I would have thought that an existing global variable would exist to do 
this, but I can't find it in the php manual:

http://www.php.net/manual/en/reserved.variables.php

$_SERVER[DOCUMENT_ROOT] provides a path without the file name, but it's 
not the path I need. In my case, the output is:

/var/www

$_SERVER[PATH_TRANSLATED] also provides a different path, and also 
attaches the file name:

/var/www/web_sites/gutteridge.info/web/test.php

The bottom line is, how can I get the same path as $_SERVER[PHP_SELF] or 
$_SERVER[SCRIPT_NAME], but without including the file name?


Thank you for any advice.

--
Dave M G

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



Re: [PHP] Getting the right path output from $_SERVER

2006-05-21 Thread Chris

Dave M G wrote:

PHP General,

What I am trying to achieve is to output the path in which the current 
script is executing, without having the name of the file attached. I'm 
hoping to be able to do this without complicated code to truncate path 
names and whatnot.


Either of these two variables do what I want, except that they include 
the name of the file:


$_SERVER[PHP_SELF]
$_SERVER[SCRIPT_NAME]

For example, if create file called test.php and I echo the output of 
$_SERVER[PHP_SELF], I get:

/web_sites/gutteridge.info/web/test.php

But all I want is:
/web_sites/gutteridge.info/web

(It's important that the last forward slash not be there).

I would have thought that an existing global variable would exist to do 
this, but I can't find it in the php manual:

http://www.php.net/manual/en/reserved.variables.php

$_SERVER[DOCUMENT_ROOT] provides a path without the file name, but it's 
not the path I need. In my case, the output is:

/var/www

$_SERVER[PATH_TRANSLATED] also provides a different path, and also 
attaches the file name:

/var/www/web_sites/gutteridge.info/web/test.php

The bottom line is, how can I get the same path as $_SERVER[PHP_SELF] or 
$_SERVER[SCRIPT_NAME], but without including the file name?


use dirname().

http://www.php.net/dirname

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] /usr/local/libexec/apache22/libphp4.so not installed

2006-05-21 Thread Noah
On Mon, 22 May 2006 14:24:33 +1000, Chris wrote
 Noah wrote:
  FreeBSD-4.11
  
  After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 from
  /usr/ports - I no longer am finding that
  /usr/local/libexec/apache22/libphp4.so is getting installed.
  
  Any clues as to what I am doing wrong?  I cant figure it out at the moment.
 
 The error makes perfect sense - there is no file.
 
 Apache2 has no idea what php is, so you need to re-compile php4 
 against the new apache2.


Hi there,

Okay I am not really understanding you here.  what are you suggesting I do
here?  I did the following

1) uninstalled php4 and apache2
2) rebuilt and installed apache2 fresh from /usr/ports
3) then rebuilt and installed php4 fresh from /usr/ports with apache module
created.
4) still the same error:  # /usr/local/etc/rc.d/apache22.sh restart
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 101 of /usr/local/etc/apache22/httpd.conf: Cannot
load /usr/local/libexec/apache22/libphp4.so into server: Cannot open
/usr/local/libexec/apache22/libphp4.so
5) Also php4 and apache2.2 was working something just broke since the last usr
ports upgrade.

I need steps for what exactly to do next because I dont know what else to try.

cheers,

Noah
 


 
 You can't just copy the existing one because things would be quite 
 different internally between apache1 and apache2.
 
 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/
 
 -- 
 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



Re: [PHP] /usr/local/libexec/apache22/libphp4.so not installed

2006-05-21 Thread Chris

Noah wrote:

On Mon, 22 May 2006 14:24:33 +1000, Chris wrote


Noah wrote:


FreeBSD-4.11

After rebuilding php4-4.4.2_2 with Apache Module and apache-2.2.2 from
/usr/ports - I no longer am finding that
/usr/local/libexec/apache22/libphp4.so is getting installed.

Any clues as to what I am doing wrong?  I cant figure it out at the moment.


The error makes perfect sense - there is no file.

Apache2 has no idea what php is, so you need to re-compile php4 
against the new apache2.




Hi there,

Okay I am not really understanding you here.  what are you suggesting I do
here?  I did the following

1) uninstalled php4 and apache2
2) rebuilt and installed apache2 fresh from /usr/ports
3) then rebuilt and installed php4 fresh from /usr/ports with apache module
created.


apache or apache2 ?

They are different modules and you need to explicitly say apache2.

--
Postgresql  php tutorials
http://www.designmagick.com/

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