Re: [PHP] mssql_* overhead

2007-01-11 Thread Sancar Saran
On Wednesday 10 January 2007 17:47, Philip Thompson wrote:
 Hi.

 Does anyone know if the mssql_connect/_init/_bind/etc require a lot
 of overhead?

 I have a page that requires multiple function calls and each of those
 opens a new connection to the database, performs the necessary
 actions in stored procedure(s), and then closes the connection.
 However, I found this to be slower than I was wanting. So I thought,
 just create one connection and assign it to the SESSION (a global),
 and in each function that requires a connection, call that SESSION
 variable. At the end of the page, close the connection and nullify
 the variable.

 Does anyone see a problem with doing it this way? Security concerns?
 Anything?

 Thanks in advance,
 ~Philip


Using pconnect solves your problem (if I understood correctly (I had liddle 
English knowladge). Putting data into $_SESSION may bit slower because every 
time you nullf the variable and that means php have to serialize $_SESSION 
and wrote into disk. (You may use SQL or Memcached base sessions)

just generate for example $_db variable and make it global, call every 
function. if your regenerate your db connection data every time you init the 
script, you don't need to store int $_SESSION. 

$_SESSION gives you state, not security. Actually it stores data into disk (or 
sql or memory (depends your config)) per connection state (PHPSESSID).

and if you bored declaring global $_db in ever function you may use 
$GLOBALS['_db'] = $_db 

then call in other functions

and if you want speed  use Memcached.  Using SQL for state like using Tractor 
in F1 Race.

Regards

Sancar

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



Re: [PHP] Extending 'include' behavior in a function

2007-01-11 Thread Jochem Maas
Eli wrote:
 Jochem Maas wrote:
 short of playing around with the global keyword
 (which won't work when you call includeIt() from
 another function)) your pretty much stuck.

 basically imho you need to rethink what it is your trying to do.

 function have their own scope for a reason; maybe consider using
 an array argument like so:

 function incIt($file, $args = array())
 {
 extract((array)$args);
 include $file; // don't forget some error checking
 }

 function includeIt($file, $args = array())
 {
 // bla
 incIt($file, $args);
 // more bla
 }

 I broke it down into 2 functions to avoid local variables
 being overridden in includeIt() [by the call to extract].
 
 In addition to your solution, it is needed to transfer the variables by
 reference.
 
 Your solution is good when you know what variables you want to transfer
 ahead, and then make a list of them. But if I want to transfer all the
 variables in the current environment scope?

I can't see a way of doing that, especially if you want/need everything by 
reference.

I can't help wondering what it is that your trying to do and why.
maybe if you explained the exact problem your trying to solve the list could
offer alternative solutions/strategies.

as it stands I get the feeling your on the road to nowhere regarding
this particular idea, php just doesn't offer the functionality you
require.

 
 -thanks, Eli.
 

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



[PHP] readfile()

2007-01-11 Thread Steven Macintyre
HI all 

I'm currently using this function to read a remove address to create a
mailbox ... 

However - It ALWAYS displays the output of that file to the user screen ...
all I wish to do is something like ...


$status = Readfile(warra warra warra);

If ($status === MailBox Created) { 

Do more stuff 
} else {
Tell user that there was a problem
}

How is this done ...

At current - the MailBox Created and error message if there is always
displays raw on the screen as if its outputting that buffer

Kind Regards,


Steven Macintyre
http://steven.macintyre.name
--

http://www.friends4friends.co.za




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



[PHP] web analytics

2007-01-11 Thread Kencana

Hi all,

I am planning to do web analytics of user access while they are accessing my
web site.
any recommendation on how it can be done?
i am using php 5.0.5 and windows server 2003.
I have heard about phpmyvisites anybody try it before?

Thank you

Regards,
Kencana
-- 
View this message in context: 
http://www.nabble.com/web-analytics-tf2957837.html#a8274456
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] readfile()

2007-01-11 Thread Jochem Maas
Steven Macintyre wrote:
 HI all 
 
 I'm currently using this function to read a remove address to create a
 mailbox ... 
 
 However - It ALWAYS displays the output of that file to the user screen ...
 all I wish to do is something like ...

use a different file function. e.g. file_get_contents()

if you read the relevant manual page it might become clear why
readfile() always display the output to the user:

http://php.net/readfile

 
 
 $status = Readfile(warra warra warra);
 
 If ($status === MailBox Created) { 
 
   Do more stuff 
 } else {
   Tell user that there was a problem
 }
 
 How is this done ...
 
 At current - the MailBox Created and error message if there is always
 displays raw on the screen as if its outputting that buffer
 
 Kind Regards,
 
 
 Steven Macintyre
 http://steven.macintyre.name
 --
 
 http://www.friends4friends.co.za
 
 
 
 

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



RE: [PHP] web analytics

2007-01-11 Thread Edward Kay
Have a look at Google Analytics.

Edward

 -Original Message-
 From: Kencana [mailto:[EMAIL PROTECTED]
 Sent: 11 January 2007 09:50
 To: php-general@lists.php.net
 Subject: [PHP] web analytics
 
 
 
 Hi all,
 
 I am planning to do web analytics of user access while they are 
 accessing my
 web site.
 any recommendation on how it can be done?
 i am using php 5.0.5 and windows server 2003.
 I have heard about phpmyvisites anybody try it before?
 
 Thank you
 
 Regards,
 Kencana
 -- 
 View this message in context: 
 http://www.nabble.com/web-analytics-tf2957837.html#a8274456
 Sent from the PHP - General mailing list archive at Nabble.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] Security with dbHost, dbUser, dbPassword

2007-01-11 Thread Satyam


- Original Message - 
From: Jochem Maas [EMAIL PROTECTED]

To: Satyam [EMAIL PROTECTED]
Cc: php-general@lists.php.net; Otto Wyss [EMAIL PROTECTED]
Sent: Thursday, January 11, 2007 12:16 AM
Subject: Re: [PHP] Security with dbHost, dbUser, dbPassword



Satyam wrote:


- Original Message - From: Otto Wyss [EMAIL PROTECTED]


What is the usual save way to store/use DB access info in a script. I
currently just use some PHP variables in a file which I include in all
other scripts.

config.php
?PHP
  if (!defined (config_include)) die (Error...);
  $dbhost = localhost;
  $dbuser = name;
  $dbpass = password;
  $dbname = database;
  $dbcoll = utf8_unicode_ci;
?

Is this save enough or are there better ways? Where should I store
this file so it isn't accessible via the net but inside scripts?

O. Wyss



Besides what Jochem has already sugested, I would add that I usually
have in the include file, in an unaccessible path as he said, a function
that returns a connection. The function has all the connection
information local, so that they are neither global variables nor
constants, just local literal values within the function.


I'm sure most people end up with some kind of abstraction in the form
of a class or function to do all the 'heavy lifting' regarding connecting
to the DB, etc - but when projects get rather large and/or your faced with 
a

situation where you want/need to run your project on different systems
(e.g. local-dev, test/staging, live) it often most handy to place all 
installation

specific configuration values in a single file that is specific to the
given installation and therefore usually not included as part of the
version control (e.g. CVS or SVN) module that stores the projects files.


No problem there, the include in my DB abstraction layer includes and calls 
the separate file with the function to make the connection to the database. 
Though the main application source doesn't know about the include file with 
the connection data in it, the DB layer include does.   In this way, I have 
the db include file under CVS and can refresh it at the production server 
without a problem, while the include file with the connection is separate, 
so that I have one for the test machine (this one) where the server is 
'localhost' which I never copy to the production server.


Nevertheless, I admit that the important issue here is to have the 
connection data out of the public folders, mine is just a useless paranoid 
complication.  Does anyone have an expression evaluator in an application 
open to the public?  Does anyone make a var_dump of $_GLOBALS on error (and 
then forgets to strip it out on production code)?  I sure hope not.





In the same
function I put the call to mysql_select_db.  Though I check the return
values for errors, I usually ignore them since unless you have either
more than one database engine or more than one database, the default
link resource does not need to me explicitly passed to other functions.

Satyam





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



[PHP] reg globals

2007-01-11 Thread Ross
In a very old site of mine and not knowing any better I never used $_POST.

The server it has on has now decided to turn change it;s config...fair 
enough but I am having problems with an attahcment in  form. I have change 
all the other varible to $_POST but the attachment is causing me trouble.


It is called

input name=userfile type=file id=userfile


but when I try and attach it (phpmailer)

 $userfile= $_POST['userfile'];
$mail-AddAttachment($userfile, $_FILES['userfile']['name']);

it now doesn't attach. any ideas?



R.

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



Re: [PHP] reg globals

2007-01-11 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-11 10:08:07 -:
  $userfile= $_POST['userfile'];
 $mail-AddAttachment($userfile, $_FILES['userfile']['name']);
 
 it now doesn't attach. any ideas?

Check the description of $_FILES at
http://www.php.net/manual/en/features.file-upload.php#features.file-upload.post-method

It says:

$_FILES['userfile']['name']
The original name of the file on the client machine.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



[PHP] RE: web analytics

2007-01-11 Thread Kencana

hi Edward,

thanks for the recommendation. will google analytics affect my web
performance?
did you try it before?

thank you

Regards,
Kencana


Edward Kay wrote:
 
 Have a look at Google Analytics.
 
 Edward
 
 -Original Message-
 From: Kencana [mailto:[EMAIL PROTECTED]
 Sent: 11 January 2007 09:50
 To: php-general@lists.php.net
 Subject: [PHP] web analytics
 
 
 
 Hi all,
 
 I am planning to do web analytics of user access while they are 
 accessing my
 web site.
 any recommendation on how it can be done?
 i am using php 5.0.5 and windows server 2003.
 I have heard about phpmyvisites anybody try it before?
 
 Thank you
 
 Regards,
 Kencana
 -- 
 View this message in context: 
 http://www.nabble.com/web-analytics-tf2957837.html#a8274456
 Sent from the PHP - General mailing list archive at Nabble.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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/web-analytics-tf2957837.html#a8274831
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] Extending 'include' behavior in a function

2007-01-11 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-11 09:47:04 +0100:
 Eli wrote:
  [extending include]
 
  Your solution is good when you know what variables you want to transfer
  ahead, and then make a list of them. But if I want to transfer all the
  variables in the current environment scope?

 as it stands I get the feeling your on the road to nowhere regarding
 this particular idea, php just doesn't offer the functionality you
 require.

Besides being technically infeasible, it wouldn't even be very useful
AFAICS (put bluntly: smells like a hackaround for a very bad design).

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



RE: [PHP] RE: web analytics

2007-01-11 Thread Edward Kay
It depends what you mean by web performance. Do you mean your visitors or
your web server?

Google analytics (like all hosted analytics services) works by inserting
some code that gets the visitor's browser to connect to their servers. These
requests therefore has no impact on your web server.

If you implement something on your own server, e.g. by tracking their path
in a session variable and/or storing stuff in a DB then yes, this will
consume resources.

We use Google analytics and are very happy with the results.

Edward

 hi Edward,

 thanks for the recommendation. will google analytics affect my web
 performance?
 did you try it before?

 thank you

 Regards,
 Kencana



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



Re: [PHP] Security with dbHost, dbUser, dbPassword

2007-01-11 Thread Jochem Maas
Satyam wrote:
 




 No problem there, the include in my DB abstraction layer includes and
 calls the separate file with the function to make the connection to the
 database. Though the main application source doesn't know about the
 include file with the connection data in it, the DB layer include
 does.   In this way, I have the db include file under CVS and can
 refresh it at the production server without a problem, while the include
 file with the connection is separate, so that I have one for the test
 machine (this one) where the server is 'localhost' which I never copy to
 the production server.

there are many way to skin the cat :-)

 
 Nevertheless, I admit that the important issue here is to have the
 connection data out of the public folders, mine is just a useless
 paranoid complication.  Does anyone have an expression evaluator in an
 application open to the public?  Does anyone make a var_dump of
 $_GLOBALS on error (and then forgets to strip it out on production
 code)?  I sure hope not.

been there, done that, got the T-Shirt. :-P

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



Re: [PHP] Extending 'include' behavior in a function

2007-01-11 Thread Jochem Maas
Roman Neuhauser wrote:
 # [EMAIL PROTECTED] / 2007-01-11 09:47:04 +0100:
 Eli wrote:
 [extending include]

 Your solution is good when you know what variables you want to transfer
 ahead, and then make a list of them. But if I want to transfer all the
 variables in the current environment scope?
 
 as it stands I get the feeling your on the road to nowhere regarding
 this particular idea, php just doesn't offer the functionality you
 require.
 
 Besides being technically infeasible, it wouldn't even be very useful
 AFAICS (put bluntly: smells like a hackaround for a very bad design).

I would tend to agree, all the more reason for the OP to explain wtf he is
actually trying to accomplish and why - then we can spread the goodness with
regard to jimmying up a better strategy :-)

 

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



Re: [PHP] RE: web analytics

2007-01-11 Thread Jochem Maas
Kencana wrote:
 hi Edward,
 
 thanks for the recommendation. will google analytics affect my web
 performance?

in short, no.
in contrast to a small site that's being well indexed - a double edged
sword whereby you want the search engines robots to spider your site as
often as possible but you'd rather they didn't index so hard that the load
on your server goes through the roof (and the site becomes liek molasses);
not much you can do about that (and has nothing much to do with GA)

 did you try it before?

half the planet seems to be using it, works for them - I'm pretty
sure it'll work for you.

 
 thank you
 
 Regards,
 Kencana
 
 
 Edward Kay wrote:
 Have a look at Google Analytics.

 Edward

 -Original Message-
 From: Kencana [mailto:[EMAIL PROTECTED]
 Sent: 11 January 2007 09:50
 To: php-general@lists.php.net
 Subject: [PHP] web analytics



 Hi all,

 I am planning to do web analytics of user access while they are 
 accessing my
 web site.
 any recommendation on how it can be done?
 i am using php 5.0.5 and windows server 2003.
 I have heard about phpmyvisites anybody try it before?

 Thank you

 Regards,
 Kencana
 -- 
 View this message in context: 
 http://www.nabble.com/web-analytics-tf2957837.html#a8274456
 Sent from the PHP - General mailing list archive at Nabble.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



 

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



Re: [PHP] Unable to compile php with MSSQL support / configure: error: Directory /usr is not a FreeTDS installation directory

2007-01-11 Thread mbneto

Hi Frank,

Thanks for the reply but  the tds.h is located under /usr/include/freetds
but the error persists.

Any other ideas?

On 1/10/07, Frank M. Kromann [EMAIL PROTECTED] wrote:


Hi,

--with-mssql=/usr or --with-mssql=shared,/user should work with your
configuration. It's looking for /usr/include/tds.h or
/usr/include/freetds/tds.h. If the file was not found in any of those
locations you will get the error you are describing here.

- Frank





RE: [PHP] PHP/Apache configuration failure

2007-01-11 Thread Ford, Mike
On 10 January 2007 16:28, Bruce A. Julseth wrote:

 I can't get Apache to restart after I've configured for PHP.
 I've upgraded my installation to
 5.2.
 Now, Apache 2.2.3 runs fine without any PHP additions.
[...]
 4) I made the following changes to Httpd.conf
 After the last entry in the LoadModule section:
 
   LoadModule php5_module c:/php5/php5apache.dll

My memory may be failing here, but I believe that's the .dll for Apache 1. For 
Apache 2.2, you should have a php5apache2_2.dll.

Cheers!

Mike

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


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



Re: [PHP] newbie question regarding URL parameters

2007-01-11 Thread Jochem Maas
Dave Goodchild wrote:
 Wow, there are some really bitchy, unattractive people here. No wonder some

not to mention some very judgemental people as well. :-) it's pretty funny
that someone who purports to aspire to buddhahood is so stuck in complaining
about other people's bitchiness and unattractiveness. thanks for the smile, 
Dave.

[buddha has thicker skin, and his feet are dirty.]

I wouldn't bother with a hypocracy argument in reply - I already know about my 
own
hypocracy. :-)

 people bail out of IT. 

most people bail out of IT because of the peanuts being paid, the
completely ungrateful management they work for, the crazy hours their expected
to work and the severe lack of goodlooking women walking around in the
average data bunker.

selling crack, making porn  writing a few rap lyrics is so much easier -
just ask SnoopDog.

 Don't confuse knowledge for wisdom.

whoahoo, a racecar heh?

 
 On 1/9/07, tedd [EMAIL PROTECTED] wrote:

 At 9:17 PM -0500 1/5/07, [EMAIL PROTECTED] wrote:
 You'll probably get 50 answers to this, but here's probably what
 happened.
 
 There's a setting called register globals that will turn your
 name=me and age=27 into $name = me and $age = 27.  It used to be
 turned ON by default.  This was generally considered to be bad
 security, so it now defaults to OFF.
 
 To get these variables, just use the $_GET system variable.
 
 $name = $_GET['name'];
 $age = $_GET['age'];
 
 Easy!
 
 Best of luck!
 
 -TG

 Just to add to -TG advice, you should also clean those inputs. IWO,
 make sure the values fall within what you expect. Basic security.

 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP/Apache configuration failure

2007-01-11 Thread Mark


Bruce A. Julseth [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

I can't get Apache to restart after I've configured for PHP. I've upgraded
my installation to
5.2. 
Now, Apache 2.2.3 runs fine without any PHP additions.

1) I added my PHP directory, C:/PHP5, to my PATH
2) I copied php.ini-recommended to my C:/windows directory and renamed
it php.ini
3) I made the following changes to PHP.ini
   doc_root = c:/inetpub/wwwroot
extension_dir = c:/php5/ext
4) I made the following changes to Httpd.conf
After the last entry in the LoadModule section:

  LoadModule php5_module c:/php5/php5apache.dll
 AddModule mod_php5.c

NOTE: If I comment out the above two statemens, Apache will start.

   In the IfModule mime_module Section, I added

  AddType application/x-httpd-php .php
  Action application/x-httpd-php /php/php.exe

And that's it.

When I restart Apache, I get an error dialog with the message:

  The requested operation has failed.

What have I missed or done wrong?

Thanks for the help...

Bruce


Hello Bruce. I think your problem lies in the file name you are using. I use
this line and have no problems.

LoadModule php5_module c:/Program Files/PHP/php5apache2_2.dll
I do not have the AddModule line.
I use AddType application/x-httpd-php .php .html. (I want to parse .html
files as well.)
I do not use the Action line.

Try taking out the Addmodule and Action lines. Change the LoadModule line. I
forget where I bumped into the documentation that explained it to me. I
still haven't forgotten how much time it took me to find it though. ;-)

Mark

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



Re: [PHP] Re: PHP/Apache configuration failure

2007-01-11 Thread Miguel J. Jiménez
El Thu, 11 Jan 2007 08:15:49 -0500
Mark [EMAIL PROTECTED] escribió:

 LoadModule php5_module c:/Program Files/PHP/php5apache2_2.dll
 I do not have the AddModule line.
 I use AddType application/x-httpd-php .php .html. (I want to
 parse .html files as well.)
 I do not use the Action line.

The action line is to execute scripts as CGI I think it's no use
nowdays...


-- 
Miguel J. Jiménez
Área de Internet/XSL
[EMAIL PROTECTED]



ISOTROL
Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.
Parque Tecnológico Cartuja '93, 41092 Sevilla.
Teléfono: 955 036 800 - Fax: 955 036 849
http://www.isotrol.com

Siempre intento salvar una vida al día. Normalmente es la mía
(John Crichton, FARSCAPE 1x07)

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



Re: [PHP] Stored Procedure returns nothing on ROLLBACK

2007-01-11 Thread Philip Thompson

On Jan 10, 2007, at 6:36 PM, Chris wrote:


Philip Thompson wrote:

Hi.
I have been experiencing MSSQL woes lately. I have a stored  
procedure that I call in PHP using mssql_* functions. In my  
procedure, I have a transaction that rolls back on failure and  
commits on success (of course). If it commits, I get the proper  
return value (int) and the appropriate output parameters. However,  
if it rolls back, I get NOTHING... even if I try to return an  
error code (int) after the ROLLBACK TRANSACTION statement. The  
output parameter also does not get set upon rollback.
Is there a way to grab the error even in a rollback? or at least  
return something besides an empty string/int? I would like to know  
what error message to provide the user/admin.

SQL Server 2000, PHP 5.1.6, ntwdblib.dll version 8.00.194


Does it work outside of php? That is - you run it manually in mssql  
(whatever tools that has) you get the proper codes?



Yes, it works perfectly from the server and returns the expected  
outcome. It's as though PHP sees the 'rollback' and automatically  
assumes that the whole thing failed... so why return a value or  
output parameters. Weird, I know. Any other suggestions?


Thanks,
~Philip

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



[PHP] file_get_contents gets 404 error

2007-01-11 Thread Németh Zoltán
Hi all,

I have some php websites, for example http://www.alterationx.hu/

Now I'm trying to get the site with file_get_contents, and I'm getting
this error:

Warning: file_get_contents(http://www.alterationx.hu/): failed to open
stream: HTTP request failed! HTTP/1.1 404 Not Found

can anyone tell me why?

The site otherwise is working, and also getting other sites (not php) on
the same server with file_get_contents is working.

Thanks in advance
Zoltán Németh

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



[PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds
Hello all. I seem to be having a terrible tim ewith something that is so 
simple it makes me sick.  I have a server running FC2.  it has Apache 
2.x.x on it and it came installed with php-4.x.x.  Sorry I don't have 
the exact versions but fatigue and frustration has taken over.  I can 
get them if you really need them.  Here's the major problem.  When I try 
and view a simple php page in the browser, it doesn't display anything 
that has to do with the php tags.  By that I mean it won't recognize the 
 php directives (I guess).  I made a simple page (the infamous phpinfo 
()  page) right out of the books.  Saved it as test.php just like it 
said.  Made sure that apache is running and browsed to the page. 
Nothing, no errors, no nothing.  I have made up some other pages (mostly 
from some php books - real simple ones) to view and they all display the 
same action.


Now when these machines (I actually have a couple of these servers and 
they all act the same) were installed, it was from FC2 CD's with the 
webserver full package.  There were all kinds of php files installed, 
etc.  In my httpd.conf file it calls the php.ini file, etc.  So it seems 
to be all there.


Can anyone out there help me figure out how to make this work?  I would 
be truly indebted to you, put you on my Christmas card list, etc.


Thanks in advance to all of you kind and wonderful people.

Scott

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



Re: [PHP] file_get_contents gets 404 error

2007-01-11 Thread Jochem Maas
Németh Zoltán wrote:
 Hi all,
 
 I have some php websites, for example http://www.alterationx.hu/
 
 Now I'm trying to get the site with file_get_contents, and I'm getting
 this error:
 
 Warning: file_get_contents(http://www.alterationx.hu/): failed to open
 stream: HTTP request failed! HTTP/1.1 404 Not Found

try this?:

file_get_contents(http://www.alterationx.hu/index.php;);

(it works for me. that said it works for me without the 'index.php' at the end 
also.)

also check you logs on the site in question to figure out what exactly is going
on (i.e. what is being requested, if anything).

 
 can anyone tell me why?
 
 The site otherwise is working, and also getting other sites (not php) on
 the same server with file_get_contents is working.
 
 Thanks in advance
 Zoltán Németh
 

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Stut

Scott Bounds wrote:

 Hello all. I seem to be having a terrible tim ewith something that is
 so simple it makes me sick.  I have a server running FC2.  it has
 Apache 2.x.x on it and it came installed with php-4.x.x.  Sorry I
 don't have the exact versions but fatigue and frustration has taken
 over.  I can get them if you really need them.  Here's the major
 problem.  When I try and view a simple php page in the browser, it
 doesn't display anything that has to do with the php tags.  By that I
 mean it won't recognize the  php directives (I guess).  I made a
 simple page (the infamous phpinfo ()  page) right out of the books.
 Saved it as test.php just like it said.  Made sure that apache is
 running and browsed to the page. Nothing, no errors, no nothing.  I
 have made up some other pages (mostly from some php books - real
 simple ones) to view and they all display the same action.

 Now when these machines (I actually have a couple of these servers
 and they all act the same) were installed, it was from FC2 CD's with
 the webserver full package.  There were all kinds of php files
 installed, etc.  In my httpd.conf file it calls the php.ini file,
 etc.  So it seems to be all there.

 Can anyone out there help me figure out how to make this work?  I
 would be truly indebted to you, put you on my Christmas card list,
 etc.


View the source of your page in the browser. If you see the PHP code 
chances are you haven't told Apache about PHP. Read the manual (yes, 
there is a manual: http://php.net/install.unix.apache2) for specific 
instructions, but your httpd.conf needs at least the following two lines 
(paths on your system may differ)...


LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .phtml

-Stut

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Jochem Maas
Scott Bounds wrote:
 Hello all. I seem to be having a terrible tim ewith something that is so
 simple it makes me sick.  I have a server running FC2.  it has Apache
 2.x.x on it and it came installed with php-4.x.x.  Sorry I don't have
 the exact versions but fatigue and frustration has taken over.  I can
 get them if you really need them.  Here's the major problem.  When I try
 and view a simple php page in the browser, it doesn't display anything
 that has to do with the php tags.  By that I mean it won't recognize the
  php directives (I guess). 

does that mean your seeing the text '?php phpinfo(); ?' (or similar)
in your browser? if so then your apache setup is broken with regard to
php - the php apache module is not being loaded or the mapping to
.php files is borked (or non-existent).

 I made a simple page (the infamous phpinfo
 ()  page) right out of the books.  Saved it as test.php just like it
 said.  Made sure that apache is running and browsed to the page.
 Nothing, no errors, no nothing.  I have made up some other pages (mostly
 from some php books - real simple ones) to view and they all display the
 same action.
 
 Now when these machines (I actually have a couple of these servers and
 they all act the same) were installed, it was from FC2 CD's with the
 webserver full package.  There were all kinds of php files installed,
 etc.  In my httpd.conf file it calls the php.ini file, etc.  So it seems
 to be all there.

start by tailing the apache access_log and the apache error_log,
a cmdline something like this:

tail -f /var/log/apache2/access_log /var/log/apache2/error_log

and see what kind of errors appear when you surf to the problem pages.
also check for apache start up errors that a related to php.

 
 Can anyone out there help me figure out how to make this work?  I would
 be truly indebted to you, put you on my Christmas card list, etc.

please don't waste trees.

 
 Thanks in advance to all of you kind and wonderful people.
 
 Scott
 

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Miles Thompson

At 11:39 AM 1/11/2007, Scott Bounds wrote:

Hello all. I seem to be having a terrible tim ewith something that is so 
simple it makes me sick.  I have a server running FC2.  it has Apache 
2.x.x on it and it came installed with php-4.x.x.  Sorry I don't have the 
exact versions but fatigue and frustration has taken over.  I can get them 
if you really need them.  Here's the major problem.  When I try and view a 
simple php page in the browser, it doesn't display anything that has to do 
with the php tags.  By that I mean it won't recognize the  php directives 
(I guess).  I made a simple page (the infamous phpinfo ()  page) right out 
of the books.  Saved it as test.php just like it said.  Made sure that 
apache is running and browsed to the page. Nothing, no errors, no 
nothing.  I have made up some other pages (mostly from some php books - 
real simple ones) to view and they all display the same action.


Now when these machines (I actually have a couple of these servers and 
they all act the same) were installed, it was from FC2 CD's with the 
webserver full package.  There were all kinds of php files installed, 
etc.  In my httpd.conf file it calls the php.ini file, etc.  So it seems 
to be all there.


Can anyone out there help me figure out how to make this work?  I would be 
truly indebted to you, put you on my Christmas card list, etc.


Thanks in advance to all of you kind and wonderful people.

Scott


Scott,

Have a look at the instructions for setting up PHP. (It's been such a long 
time I do not remember where the different bits are.)


I do remember, however, that the php.ini file has to be in the right place, 
and that in httpd.conf you have to recognize the .php extension along with 
.htm, and .html.


Finally, you have to stop and rstart Apache so httpd.conf will be read again.

This is v. sketchy, but hope it helps.

Cheers - Miles 



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.410 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007

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



Re: [PHP] file_get_contents gets 404 error

2007-01-11 Thread Németh Zoltán
2007. 01. 11, csütörtök keltezéssel 16.55-kor Jochem Maas ezt írta:
 Németh Zoltán wrote:
  Hi all,
  
  I have some php websites, for example http://www.alterationx.hu/
  
  Now I'm trying to get the site with file_get_contents, and I'm getting
  this error:
  
  Warning: file_get_contents(http://www.alterationx.hu/): failed to open
  stream: HTTP request failed! HTTP/1.1 404 Not Found
 
 try this?:
 
 file_get_contents(http://www.alterationx.hu/index.php;);
 
 (it works for me. that said it works for me without the 'index.php' at the 
 end also.)

I tried this also, and get the same error still...

 
 also check you logs on the site in question to figure out what exactly is 
 going
 on (i.e. what is being requested, if anything).

Yes, I'll contact our system administrator to check the apache logs

Thanks
Zoltán Németh

 
  
  can anyone tell me why?
  
  The site otherwise is working, and also getting other sites (not php) on
  the same server with file_get_contents is working.
  
  Thanks in advance
  Zoltán Németh
  
 

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



[PHP] Progressiv display with IE7

2007-01-11 Thread 131
Hi
I was wondering if there was a way, firefox like, to show progressiv data in 
IE7 ( flush())
 ( i hearded there's a ~250 chars buffer limit before displaying smthing but 
it don't seem to be working )
Thx

131 

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



[PHP] Re: Progressiv display with IE7

2007-01-11 Thread 131
Btw, why is there those so ugly dbls quotes at each side of my so sweet 
nickname ?

131 

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds

Jochem Maas wrote:

Scott Bounds wrote:


Hello all. I seem to be having a terrible tim ewith something that is so
simple it makes me sick.  I have a server running FC2.  it has Apache
2.x.x on it and it came installed with php-4.x.x.  Sorry I don't have
the exact versions but fatigue and frustration has taken over.  I can
get them if you really need them.  Here's the major problem.  When I try
and view a simple php page in the browser, it doesn't display anything
that has to do with the php tags.  By that I mean it won't recognize the
php directives (I guess). 



does that mean your seeing the text '?php phpinfo(); ?' (or similar)
in your browser? if so then your apache setup is broken with regard to
php - the php apache module is not being loaded or the mapping to
.php files is borked (or non-existent).

 I made a simple page (the infamous phpinfo


()  page) right out of the books.  Saved it as test.php just like it
said.  Made sure that apache is running and browsed to the page.
Nothing, no errors, no nothing.  I have made up some other pages (mostly
from some php books - real simple ones) to view and they all display the
same action.

Now when these machines (I actually have a couple of these servers and
they all act the same) were installed, it was from FC2 CD's with the
webserver full package.  There were all kinds of php files installed,
etc.  In my httpd.conf file it calls the php.ini file, etc.  So it seems
to be all there.



start by tailing the apache access_log and the apache error_log,
a cmdline something like this:

tail -f /var/log/apache2/access_log /var/log/apache2/error_log

and see what kind of errors appear when you surf to the problem pages.
also check for apache start up errors that a related to php.



Can anyone out there help me figure out how to make this work?  I would
be truly indebted to you, put you on my Christmas card list, etc.



please don't waste trees.



Thanks in advance to all of you kind and wonderful people.

Scott

Well, actually I don't see anything.  Nothing at all (in the case of the 
 phpinfo() page.  All the page has in it is just ?php phpinfo() ?. 
It was saved as test.php.  How can I tell if something is broken and 
where do I look for the files?  I haven't done any dorking around with 
the links, etc.  Just done the complete install, etc.  Then wanted to 
play around with things to to get the feel of everything.  And I get 
nothing.


Thanks!

Scott

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Dave Goodchild

Why not check php.ini to see whether display_errors is set to off and switch
it on until you are back in business? Check the httpd.conf file to make sure
Apache is parsing .php files correctly.


Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread David Giragosian


Well, actually I don't see anything.  Nothing at all (in the case of the
phpinfo() page.  All the page has in it is just ?php phpinfo() ?.
It was saved as test.php.  How can I tell if something is broken and
where do I look for the files?  I haven't done any dorking around with
the links, etc.  Just done the complete install, etc.  Then wanted to
play around with things to to get the feel of everything.  And I get
nothing.

Thanks!




Scott,

Have you restarted the server (or the machine), as Miles has suggested?

David


Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds

Scott Bounds wrote:

Jochem Maas wrote:


Scott Bounds wrote:


Hello all. I seem to be having a terrible tim ewith something that is so
simple it makes me sick.  I have a server running FC2.  it has Apache
2.x.x on it and it came installed with php-4.x.x.  Sorry I don't have
the exact versions but fatigue and frustration has taken over.  I can
get them if you really need them.  Here's the major problem.  When I try
and view a simple php page in the browser, it doesn't display anything
that has to do with the php tags.  By that I mean it won't recognize the
php directives (I guess). 




does that mean your seeing the text '?php phpinfo(); ?' (or similar)
in your browser? if so then your apache setup is broken with regard to
php - the php apache module is not being loaded or the mapping to
.php files is borked (or non-existent).

 I made a simple page (the infamous phpinfo


()  page) right out of the books.  Saved it as test.php just like it
said.  Made sure that apache is running and browsed to the page.
Nothing, no errors, no nothing.  I have made up some other pages (mostly
from some php books - real simple ones) to view and they all display the
same action.

Now when these machines (I actually have a couple of these servers and
they all act the same) were installed, it was from FC2 CD's with the
webserver full package.  There were all kinds of php files installed,
etc.  In my httpd.conf file it calls the php.ini file, etc.  So it seems
to be all there.




start by tailing the apache access_log and the apache error_log,
a cmdline something like this:

tail -f /var/log/apache2/access_log /var/log/apache2/error_log

and see what kind of errors appear when you surf to the problem pages.
also check for apache start up errors that a related to php.



Can anyone out there help me figure out how to make this work?  I would
be truly indebted to you, put you on my Christmas card list, etc.




please don't waste trees.



Thanks in advance to all of you kind and wonderful people.

Scott

Well, actually I don't see anything.  Nothing at all (in the case of the 
 phpinfo() page.  All the page has in it is just ?php phpinfo() ?. It 
was saved as test.php.  How can I tell if something is broken and where 
do I look for the files?  I haven't done any dorking around with the 
links, etc.  Just done the complete install, etc.  Then wanted to play 
around with things to to get the feel of everything.  And I get nothing.


Thanks!

Scott


When I tailed the access_log and surfed to the file I got nothing.  When 
I tailed the error_log, I got the following:


[EMAIL PROTECTED] httpd]# tail -f error_log
[Thu Jan 11 08:57:12 2007] [error] jk2_init() Can't find child 14360 in 
scoreboard
[Thu Jan 11 08:57:12 2007] [notice] workerEnv.init() ok 
/etc/httpd/conf/workers2.properties

[Thu Jan 11 08:57:12 2007] [error] mod_jk child init 1 -2
[Thu Jan 11 08:57:12 2007] [error] jk2_init() Can't find child 14361 in 
scoreboard
[Thu Jan 11 08:57:12 2007] [notice] workerEnv.init() ok 
/etc/httpd/conf/workers2.properties

[Thu Jan 11 08:57:12 2007] [error] mod_jk child init 1 -2
[Thu Jan 11 08:57:12 2007] [error] jk2_init() Can't find child 14362 in 
scoreboard
[Thu Jan 11 08:57:12 2007] [notice] workerEnv.init() ok 
/etc/httpd/conf/workers2.properties

[Thu Jan 11 08:57:12 2007] [error] mod_jk child init 1 -2
[Thu Jan 11 08:57:12 2007] [notice] Apache/2.0.51 (Fedora) configured -- 
resuming normal operations


I have no idea what this is telling me.

Scott

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds

David Giragosian wrote:


Well, actually I don't see anything.  Nothing at all (in the case of the
phpinfo() page.  All the page has in it is just ?php phpinfo() ?.
It was saved as test.php.  How can I tell if something is broken and
where do I look for the files?  I haven't done any dorking around with
the links, etc.  Just done the complete install, etc.  Then wanted to
play around with things to to get the feel of everything.  And I get
nothing.

Thanks!





Scott,

Have you restarted the server (or the machine), as Miles has suggested?

David

Hi David.  yes, many times.  I'm ready to put it on a crontab to restart 
it like every minute.


Scott

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds

Dave Goodchild wrote:
Why not check php.ini to see whether display_errors is set to off and 
switch
it on until you are back in business? Check the httpd.conf file to make 
sure

Apache is parsing .php files correctly.



hi Dave.  let me check in the ini file and see.  I'll reply as soon as I 
can determine.


Scott

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



RE: [PHP] Please Help with simple Noob problem

2007-01-11 Thread bruce
hi scott.

tell us, have you been able to generate a simple html test page on the
server that you can see from your browser.

for test purposes (i'm assuming this is your on test server), rename the
apache error/access log files. no need to trek through old garbage in the
files. when you restart apache, it'll recreate the files.

from a short perusal of your posts, i'm of the opinion that something is
screwing up apache from running.

so let's see if we get apache starting correctly.
 -lets see is we get a basic test html file to be served
 -we'll tackle getting php files served...



-Original Message-
From: Scott Bounds [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 11, 2007 8:30 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Please Help with simple Noob problem


David Giragosian wrote:

 Well, actually I don't see anything.  Nothing at all (in the case of the
 phpinfo() page.  All the page has in it is just ?php phpinfo() ?.
 It was saved as test.php.  How can I tell if something is broken and
 where do I look for the files?  I haven't done any dorking around with
 the links, etc.  Just done the complete install, etc.  Then wanted to
 play around with things to to get the feel of everything.  And I get
 nothing.

 Thanks!




 Scott,

 Have you restarted the server (or the machine), as Miles has suggested?

 David

Hi David.  yes, many times.  I'm ready to put it on a crontab to restart
it like every minute.

Scott

--
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] php_ldap.dll - specified module could not be found

2007-01-11 Thread Anton . Hughes
Hi
I am having a lot of trouble trying to load php_ldap.dll.
I am using:
IIS6
windows 2003
I have tried copying ALL php module dlls to the WINDOWS\system32 
directory, including libeay32.dll and ssleay32.dll but not joy.
I have of course uncommented it from php.ini.
What am I doing wrong?

Thanks
Anton

Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Stut

Please keep it on-list.

Scott Bounds wrote:

 by the way, I did view source and it seemed to recognize the opening
 php tag (?php) but didn't recognize the closing tag (?).  I am
 assuming that in that evidently FC2 likes to color code the tags (php
 is with purple) and it had the opening tag colored purple, but the
 closing tag was black.  It also (in the web page) displayed the
 closing tag like regular text.


Are you saying that you see the ?php and ? when you view the source of 
the page? If so then your configuration in Apache is wrong. Please do as 
I said and read the manual page regarding installing PHP4 on Apache2, 
following the instructions and check the Apache error log.



 I tried to put the line in about loading the module (mine is php4)
 and apache complained saying that it had already been called (from
 the conf.d file).  I did however add the following:


 # Filters allow you to process content before it is sent to the client.
 #
 # To parse .shtml files for server-side includes (SSI):
 # (You will also need to add Includes to the Options directive.)
 #
 AddType text/html .shtml
 AddOutputFilter INCLUDES .shtml
 AddType application/x-httpd-php .php
 AddType application/x-httpd-php-source .phps
 AddType application/x-httpd-php  .phtml


 I then restarted apache (service httpd restart) and tried viewing the
 pages again; same outcome.


Check the Apache error log - I'm guessing it's failing to initialise the 
PHP module.


-Stut


 On Thu, 2007-01-11 at 09:59, Stut wrote:
 Scott Bounds wrote:
 Hello all. I seem to be having a terrible tim ewith something
 that is so simple it makes me sick.  I have a server running FC2.
  it has Apache 2.x.x on it and it came installed with php-4.x.x.
  Sorry I don't have the exact versions but fatigue and
 frustration has taken over.  I can get them if you really need
 them.  Here's the major problem.  When I try and view a simple
 php page in the browser, it doesn't display anything that has to
 do with the php tags.  By that I mean it won't recognize the  php
 directives (I guess).  I made a simple page (the infamous phpinfo
 ()  page) right out of the books. Saved it as test.php just like
 it said. Made sure that apache is running and browsed to the
 page. Nothing, no errors, no nothing.  I have made up some other
 pages (mostly from some php books - real simple ones) to view and
 they all display the same action.

 Now when these machines (I actually have a couple of these
 servers and they all act the same) were installed, it was from
 FC2 CD's with the webserver full package.  There were all kinds
 of php files installed, etc.  In my httpd.conf file it calls the
  php.ini file, etc.  So it seems to be all there.

 Can anyone out there help me figure out how to make this work?  I
  would be truly indebted to you, put you on my Christmas card
 list, etc.
 View the source of your page in the browser. If you see the PHP
 code chances are you haven't told Apache about PHP. Read the manual
  (yes, there is a manual: http://php.net/install.unix.apache2) for
  specific instructions, but your httpd.conf needs at least the
 following two lines (paths on your system may differ)...

 LoadModule php5_module modules/libphp5.so AddType
 application/x-httpd-php .php .phtml

 -Stut


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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds

bruce wrote:

hi scott.

tell us, have you been able to generate a simple html test page on the
server that you can see from your browser.

for test purposes (i'm assuming this is your on test server), rename the
apache error/access log files. no need to trek through old garbage in the
files. when you restart apache, it'll recreate the files.

from a short perusal of your posts, i'm of the opinion that something is
screwing up apache from running.

so let's see if we get apache starting correctly.
 -lets see is we get a basic test html file to be served
 -we'll tackle getting php files served...



-Original Message-
From: Scott Bounds [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 11, 2007 8:30 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Please Help with simple Noob problem


David Giragosian wrote:


Well, actually I don't see anything.  Nothing at all (in the case of the
phpinfo() page.  All the page has in it is just ?php phpinfo() ?.
It was saved as test.php.  How can I tell if something is broken and
where do I look for the files?  I haven't done any dorking around with
the links, etc.  Just done the complete install, etc.  Then wanted to
play around with things to to get the feel of everything.  And I get
nothing.

Thanks!





Scott,

Have you restarted the server (or the machine), as Miles has suggested?

David



Hi David.  yes, many times.  I'm ready to put it on a crontab to restart
it like every minute.

Scott

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Bruce.  I created a simple test.html page and had the following in 
the page:


font color=redThis is a test page to see if the html is working/font

The page did present with the text in red.  I then checked the error_log 
and it had no entries beyond just  the startup stuff.  it seems that it 
is doing the html just fine.  I do have a production server running 
(same configuration) and it presents html pages just fine.  Just no php 
pages.


Scott

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



[PHP] Weird behaviour with IE

2007-01-11 Thread André Medeiros

Hi list.

I know this may be a bit out of topic, but I've decided to try.

This website I'm maintaining opens just fine in firefox, and loads
everything. However, the same doesn't happen in IE, since the status
bar reads 1 item(s) remaining on most of the pages.

That issue raises another problem, because I really need that onLoad
event to be fired ;)

Has anyone had problems like this? What did you do to solve them?

Thanks in advance,
André

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



RE: [PHP] Please Help with simple Noob problem

2007-01-11 Thread bruce
hi scott...

ok.. good.. so we know apache works/simple html works..

can you post your apache conf file

can you also create a simple php file to be served, and run that from your
php cmdline.. just want to make sure that php is actually running, and that
the test php file will run... remember to include #!/usr/bin/php as the
1st line...



-Original Message-
From: Scott Bounds [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 11, 2007 8:50 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Please Help with simple Noob problem


bruce wrote:
 hi scott.

 tell us, have you been able to generate a simple html test page on the
 server that you can see from your browser.

 for test purposes (i'm assuming this is your on test server), rename the
 apache error/access log files. no need to trek through old garbage in the
 files. when you restart apache, it'll recreate the files.

 from a short perusal of your posts, i'm of the opinion that something is
 screwing up apache from running.

 so let's see if we get apache starting correctly.
  -lets see is we get a basic test html file to be served
  -we'll tackle getting php files served...



 -Original Message-
 From: Scott Bounds [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 11, 2007 8:30 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Please Help with simple Noob problem


 David Giragosian wrote:

Well, actually I don't see anything.  Nothing at all (in the case of the
phpinfo() page.  All the page has in it is just ?php phpinfo() ?.
It was saved as test.php.  How can I tell if something is broken and
where do I look for the files?  I haven't done any dorking around with
the links, etc.  Just done the complete install, etc.  Then wanted to
play around with things to to get the feel of everything.  And I get
nothing.

Thanks!




Scott,

Have you restarted the server (or the machine), as Miles has suggested?

David


 Hi David.  yes, many times.  I'm ready to put it on a crontab to restart
 it like every minute.

 Scott

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
Hi Bruce.  I created a simple test.html page and had the following in
the page:

font color=redThis is a test page to see if the html is working/font

The page did present with the text in red.  I then checked the error_log
and it had no entries beyond just  the startup stuff.  it seems that it
is doing the html just fine.  I do have a production server running
(same configuration) and it presents html pages just fine.  Just no php
pages.

Scott

--
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] Re: Please Help with simple Noob problem (Problem Solved)

2007-01-11 Thread Scott Bounds

Scott Bounds wrote:
Hello all. I seem to be having a terrible tim ewith something that is so 
simple it makes me sick.  I have a server running FC2.  it has Apache 
2.x.x on it and it came installed with php-4.x.x.  Sorry I don't have 
the exact versions but fatigue and frustration has taken over.  I can 
get them if you really need them.  Here's the major problem.  When I try 
and view a simple php page in the browser, it doesn't display anything 
that has to do with the php tags.  By that I mean it won't recognize the 
 php directives (I guess).  I made a simple page (the infamous phpinfo 
()  page) right out of the books.  Saved it as test.php just like it 
said.  Made sure that apache is running and browsed to the page. 
Nothing, no errors, no nothing.  I have made up some other pages (mostly 
from some php books - real simple ones) to view and they all display the 
same action.


Now when these machines (I actually have a couple of these servers and 
they all act the same) were installed, it was from FC2 CD's with the 
webserver full package.  There were all kinds of php files installed, 
etc.  In my httpd.conf file it calls the php.ini file, etc.  So it seems 
to be all there.


Can anyone out there help me figure out how to make this work?  I would 
be truly indebted to you, put you on my Christmas card list, etc.


Thanks in advance to all of you kind and wonderful people.

Scott
Thanks everyone for your help.  I got a reply from Janet who informed me 
that I couldn't access the page from File/Open/test.php.  I actually had 
to do the http://localhost/test.php for the browser to present the php. 
  it presented correctly then.  I am sorry, but I am a noob here. 
Thanks for all of your wonderful help.  I apologize for not being more 
experienced.  I should have known this.  But there is a bright spot:  I 
won't ever forget this point!


Thanks again!

Scott

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



RE: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Arno Kuhl
-Original Message-
From: Scott Bounds [mailto:[EMAIL PROTECTED]
Sent: 11 January 2007 06:21
To: php-general@lists.php.net
Subject: Re: [PHP] Please Help with simple Noob problem


Jochem Maas wrote:
 Scott Bounds wrote:

Hello all. I seem to be having a terrible tim ewith something that is so
simple it makes me sick.  I have a server running FC2.  it has Apache
2.x.x on it and it came installed with php-4.x.x.  Sorry I don't have
the exact versions but fatigue and frustration has taken over.  I can
get them if you really need them.  Here's the major problem.  When I try
and view a simple php page in the browser, it doesn't display anything
that has to do with the php tags.  By that I mean it won't recognize the
 php directives (I guess).


 does that mean your seeing the text '?php phpinfo(); ?' (or similar)
 in your browser? if so then your apache setup is broken with regard to
 php - the php apache module is not being loaded or the mapping to
 .php files is borked (or non-existent).

  I made a simple page (the infamous phpinfo

()  page) right out of the books.  Saved it as test.php just like it
said.  Made sure that apache is running and browsed to the page.
Nothing, no errors, no nothing.  I have made up some other pages (mostly
from some php books - real simple ones) to view and they all display the
same action.

Now when these machines (I actually have a couple of these servers and
they all act the same) were installed, it was from FC2 CD's with the
webserver full package.  There were all kinds of php files installed,
etc.  In my httpd.conf file it calls the php.ini file, etc.  So it seems
to be all there.


 start by tailing the apache access_log and the apache error_log,
 a cmdline something like this:

 tail -f /var/log/apache2/access_log /var/log/apache2/error_log

 and see what kind of errors appear when you surf to the problem pages.
 also check for apache start up errors that a related to php.


Can anyone out there help me figure out how to make this work?  I would
be truly indebted to you, put you on my Christmas card list, etc.


 please don't waste trees.


Thanks in advance to all of you kind and wonderful people.

Scott

Well, actually I don't see anything.  Nothing at all (in the case of the
  phpinfo() page.  All the page has in it is just ?php phpinfo() ?.
It was saved as test.php.  How can I tell if something is broken and
where do I look for the files?  I haven't done any dorking around with
the links, etc.  Just done the complete install, etc.  Then wanted to
play around with things to to get the feel of everything.  And I get
nothing.

Thanks!

Scott

--

Might be a silly question, but in the browser address bar did you type
http://localhost/test.php
because if you just viewed a php file in the browser you see the contents as
you described. You can most times view an html file successfully in a
browser but not a php file, that needs the webserver to process it. (sorry
if I'm being over-simple but you did say you were a noob)

If you're loading the page properly then check your php.ini to see if it's
outputing to an error log and what that error log is, then check the log
file. Apache also has an error log, look in the conf file to see what it's
called and check that too.

Arno

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



[PHP] uploaded fiel size limitiation

2007-01-11 Thread afan
Hi,
I have a little script that was working fine when uploaded files up tp 16MB.
I moved to other hosting company and use the same form/script. Not, I
can't upload eitherr 2MB file.

Where to look for limitation first?

According to phpinfo() post_max_size in php.ini is 8M.

Thanks.

-afan

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Raphael Martins

Use ?php phpinfo()? instead of ?phpinfo()?, or try to add some space
after the ? .

The php usually comes with the short_tags directive turned off.

Good Luck

Scott Bounds wrote:

Hello all. I seem to be having a terrible tim ewith something that is
so simple it makes me sick.  I have a server running FC2.  it has
Apache 2.x.x on it and it came installed with php-4.x.x.  Sorry I
don't have the exact versions but fatigue and frustration has taken
over.  I can get them if you really need them.  Here's the major
problem.  When I try and view a simple php page in the browser, it
doesn't display anything that has to do with the php tags.  By that I
mean it won't recognize the  php directives (I guess).  I made a
simple page (the infamous phpinfo ()  page) right out of the books.
Saved it as test.php just like it said.  Made sure that apache is
running and browsed to the page. Nothing, no errors, no nothing.  I
have made up some other pages (mostly from some php books - real
simple ones) to view and they all display the same action.

Now when these machines (I actually have a couple of these servers and
they all act the same) were installed, it was from FC2 CD's with the
webserver full package.  There were all kinds of php files installed,
etc.  In my httpd.conf file it calls the php.ini file, etc.  So it
seems to be all there.

Can anyone out there help me figure out how to make this work?  I
would be truly indebted to you, put you on my Christmas card list, etc.

Thanks in advance to all of you kind and wonderful people.

Scott



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds
Arno, you nailed it right on the head.  You and someone else told me 
that.  I am glad that you did because that is exactly what the problem 
was.  Thanks for being patient and understanding.


Scott

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



Re: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Scott Bounds
Bruce, thanks fro your help but I found out what stupid noob thing I was 
doing.  I had been doing the File/Open File/test.php  Janet had gotten 
to me and do http://localhost/test.php.  Big world of difference. 
trying to learn why but that made all the difference.  Worked great 
then.  Thanks for your help.


Signed,

The really, really noob

Scott

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



[PHP] Re: web analytics

2007-01-11 Thread Colin Guthrie
Jochem Maas wrote:
 did you try it before?
 
 half the planet seems to be using it, works for them - I'm pretty
 sure it'll work for you.

I thnk the OP was referring to phpanalitics rather than Google Analytics
which is what I think you are referring to?

Col.

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



RE: [PHP] Please Help with simple Noob problem

2007-01-11 Thread Arno Kuhl
-Original Message-
From: Scott Bounds [mailto:[EMAIL PROTECTED]
Sent: 11 January 2007 07:16
To: php-general@lists.php.net
Subject: Re: [PHP] Please Help with simple Noob problem

Arno, you nailed it right on the head.  You and someone else told me
that.  I am glad that you did because that is exactly what the problem
was.  Thanks for being patient and understanding.

Scott

--
Sure, all part of the learning experience.

Understanding why you can view an html file in a browser but not a php file
is essential: when viewing an html file, it's the browser (client-side)
that's processing and rendering the html code, but the browser can't process
php code. For that you need the webserver (server-side). Browsers are built
to understand and process html and javascript, but only a webserver can
understand and process php script. Unless you're developing or learning, the
browser and the webserver are almost always on different machines (that's
the whole point of the internet!). In your case (and most cases) the
webserver is Apache.

Apache treats html files and php files differently. In the case of html
files it just gets the file and sends it back to the browser, as it was
requested to do. But in the case of php files it opens the file and starts
processing it, i.e. running it as a program.

Apache processes (runs) the php script which generates the html script,
which Apache then sends back to the browser. The browser then processes that
html script and displays the result. It's basically the same concept for all
server-side scripting.

When you type http:// in the browser address bar, you're telling the browser
to communicate with a webserver, using the hypertext protocol. When you type
file:// in the browser address bar, you're telling the browser to
communicate with your local file system. Try
http://local-directory/file.html and you'll see it won't work, whereas
file://local-directory/file.html will work just fine (assuming you've got
file.html in local-directory).

Hope that makes sense.

Arno

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



[PHP] CSV date issue

2007-01-11 Thread Danny Brow
Hi,

It's been a while since I've used php and I'm trying to organize some data
by date. The problem I'm having is that when the data changes from say
2006 to 2005 the first few rows of 2005 data goes into my 2006 data and
the date for 2006 is lost. My code for separating dates is below with some
sample data. I'm sure I'm missing something simple here. The date within
the 3rd column can be ignored.

TIA


 $num = count($data);
   for ($c=0; $c  $num; $c++) {
  if ($c == 5) {
 $data[5] = strftime(%m/%d/%G,strtotime('-1 Day',
strtotime($data[5]))); //Fix date, data is off by 1 day.
  }
  $date = strftime(%G,strtotime($data[5]));
 if ($date == ) { //Skip row if date field is empty.
// Skip
 } else {
if ($date == 2006) {
   $data2006 .= \ . $data[$c] .\,;
}  elseif ($date == 2005) {
   $data2005 .= \ . $data[$c] .\,;
}  elseif ($date == 2004) {
   $data2004 .= \ . $data[$c] .\,;
}  elseif ($date == 2003) {
   $data2003 .= \ . $data[$c] .\,;
}  elseif ($date == 2002) {
   $data2002 .= \ . $data[$c] .\,;
}  elseif ($date == 2001) {
   $data2001 .= \ . $data[$c] .\,;
}  elseif ($date  2000) {
   $data1999pre .= \ . $data[$c] .\,;
}
  }
   }


Sample data
60609C49.PCX,PG 1,BLUEWATER HEALTH, LAB, 04/06/06,10003533S,BUNNY
BUGS,06/10/2006
60609C50.PCX,PG 1,Cake walk, other, 04/06/06,10003533T,Tweedy
Bird,06/11/2006
50609C49.PCX,PG 1,HEALTH, LAB, 04/06/06,10003533g,Smurf
Grumpy,06/10/2005
50699C55.PCX,PG 1,Lab 101, 04/06/06,10003533p,Smurf
Pappy,04/10/2005

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



[PHP] Handling SimpleXMLElements

2007-01-11 Thread Satyam

I have a problem trying to handle SimpleXml objects.  Though I can manage
some workaround the problem, I would like to understand it better.

This is a section of the XML file I'm trying to read (it is not complete,
just a section)

 tr
   tdBERMUDA/td
   tdBermudian Dollar (customarily
 known as Bermuda Dollar) /td
   tdBMD/td
   td060/td
 /tr
 tr
   tdBHUTAN/td
   td
 pIndian Rupee/p
 pNgultrum/p
   /td
   td
 pINR/p
 pBTN/p
   /td
   td
 p356/p
 p064/p
   /td
 /tr

It is part of a table with currency codes.   Each row has 4 cells containing
the country name, the currency description, the currency code and the
numeric code, as seen in the first row.  Nevertheless, with countries that
have more than one currency, it still has a single row with the first cell
containing the country name (see BHUTAN) but then in the following cells it
has several lines, one for each currency, as simple paragraphs.

When I get to the row for BHUTAN, I do a foreach to see what's in each cell.
Function dump() just does a var_dump() of whatever is given in the first
argument within a pre tag and uses the second argument as a heading,
surrounded by dashes.  In this case I copied the expression of what I am
dumping as the title (within single quotes so it does not expand).

 foreach($row as $cell) {
   dump($cell,'$cell);
   dump($cell-p,'$cell-p');
   dump((array)$cell-p,'(array)$cell-p');
   dump($cell-p[1],'$cell-p[1]');
  }

The section in question is shown below.  Though $cell is shown as a
SimpleXMLElement containing one 'p' property which contains an array of two
elements:
$cell-
object(SimpleXMLElement)#8 (1) {
 [p]=
 array(2) {
   [0]=
   string(12) Indian Rupee
   [1]=
   string(8) Ngultrum
 }
}


If I dump that 'p' element, I don't get an array but an object with just
one element, the first value in the array
$cell-p-
object(SimpleXMLElement)#7 (1) {
 [0]=
 string(12) Indian Rupee
}


If I typecast it to an array, I still get a single element
(array)$cell-p-
array(1) {
 [0]=
 string(12) Indian Rupee
}

Nevertheless, if I explicitly index into the 'p' element, without even
typecasting it into an array, the second element is there.
$cell-p[1]-
object(SimpleXMLElement)#10 (1) {
 [0]=
 string(8) Ngultrum
}


So, now you see it, now you don't, or do you?  What's happening?

Satyam

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



Re: [PHP] Security with dbHost, dbUser, dbPassword

2007-01-11 Thread Otto Wyss

Jochem Maas wrote:
  this file outside of the webroot ...
 
I thought so too but wasn't sure if possible.

if (!defined (config_include)) die (Error...);
 
It helps me a little if I make mistakes.

  granted define() is slower than creating a var - which is why some
  people would recommend against using it.
 
Defines are certainly better in this case even if I don't like them very
much.

  ?
 
  I never include the closing php tag in include files to avoid
  stray empty lines being output - which can cause any headers
  that you try to send after the offending include file is included
  to fail.
 
I'm used to code everything as correct as possible.  ;-)

  Is this save enough or are there better ways? Where should I 
store this

  file so it isn't accessible via the net but inside scripts?
 
  outside the webroot. what people often do is create an include dir
  at the same level as the webroot dir and add this directory to the 
include_path

  ini setting.
 
  e.g.
 
Thanks for the sample. IMO it would be a good idea if the PHP
documentation had a common or best practice section, which contains
such samples. I know there are samples in other places yet these samples
tend to be outdated. I looked through some simple authentication samples
at Zend but all were from year 2001, 2002. I'd prefer just one sample
but up to date.


O. Wyss

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



Re: [PHP] Unable to compile php with MSSQL support / configure: error: Directory /usr is not a FreeTDS installation directory

2007-01-11 Thread Frank M. Kromann
The only other thing I can think of is permissions, but that would be too
simple.

- Frank

 Hi Frank,
 
 Thanks for the reply but  the tds.h is located under
/usr/include/freetds
 but the error persists.
 
 Any other ideas?
 
 On 1/10/07, Frank M. Kromann [EMAIL PROTECTED] wrote:
 
  Hi,
 
  --with-mssql=/usr or --with-mssql=shared,/user should work with your
  configuration. It's looking for /usr/include/tds.h or
  /usr/include/freetds/tds.h. If the file was not found in any of those
  locations you will get the error you are describing here.
 
  - Frank
 
 
 
 

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



[PHP] Downloading a binary file

2007-01-11 Thread Sugrue, Sean
I need download a binary file in php. I don't need to read the contents
just download the whole file to a browsed directory.
I know you can use the header function, does anyone know the syntax.

Sean

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



Re: [PHP] Downloading a binary file

2007-01-11 Thread Stut

Sugrue, Sean wrote:

I need download a binary file in php. I don't need to read the contents
just download the whole file to a browsed directory.
I know you can use the header function, does anyone know the syntax.


Please, for the love of $DEITY, check the archives before posting. This 
particular topic is covered *a lot*.


-Stut

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



Re: [PHP] Downloading a binary file

2007-01-11 Thread Stut

Sugrue, Sean wrote:
Don't worry I won't ask again! 


Don't be like that. A lot of smart people give their time freely to 
assist people like you on this list, the least you could do is a bit of 
research before you post to ensure you're not getting them to answer the 
same question for the tenth time this month.


That's all I'm saying.

-Stut


-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 11, 2007 3:03 PM

To: Sugrue, Sean
Cc: php-general@lists.php.net
Subject: Re: [PHP] Downloading a binary file

Sugrue, Sean wrote:
I need download a binary file in php. I don't need to read the 
contents just download the whole file to a browsed directory.

I know you can use the header function, does anyone know the syntax.


Please, for the love of $DEITY, check the archives before posting. This
particular topic is covered *a lot*.

-Stut


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



[PHP] Anybody have any experience with outsite-in? [Quite a bit 0T]

2007-01-11 Thread Ryan A
Hey all!

This is a bit OT as its not really php programming, but it does involve PHP and 
MySql etc so 

The company I work for has decided to use the software from outsite-in.com,
for those of you who dont know (and i'm guessing a lot of you dont, as I kinda 
just found out about it myself) their software allows you to run php+mysql etc 
on a CD/DVD.

Just curious to know if anybody has had any experience with their software?
I have tried their free demo's and it looks pretty good.

Note: Others on this list have in the past advised me on how to do this using 
different methods, but my company wants to go with this... needless to say I am 
in NO way connected to outsite-in.com and i have *nothing* to gain if you visit 
their site, buy anything from them, shoot them, kiss them or whatever. :)

Thanks!
Ryan





--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
 
-
Everyone is raving about the all-new Yahoo! Mail beta.

Re: [PHP] CSV date issue - Solved

2007-01-11 Thread Danny Brow
Seems my problem was a data issue and I needed to compensate for missing
dates.

thanks,
Dan

On Thu, January 11, 2007 2:31 pm, Danny Brow wrote:
 Hi,


 It's been a while since I've used php and I'm trying to organize some
 data by date. The problem I'm having is that when the data changes from
 say 2006 to 2005 the first few rows of 2005 data goes into my 2006 data
 and the date for 2006 is lost. My code for separating dates is below with
 some sample data. I'm sure I'm missing something simple here. The date
 within the 3rd column can be ignored.

 TIA



 $num = count($data);
 for ($c=0; $c  $num; $c++) { if ($c == 5) { $data[5] =
 strftime(%m/%d/%G,strtotime('-1 Day', strtotime($data[5]))); //Fix date,
 data is off by 1 day. }
 $date = strftime(%G,strtotime($data[5]));
 if ($date == ) { //Skip row if date field is empty. // Skip
 } else {
 if ($date == 2006) { $data2006 .= \ . $data[$c] .\,;
 }  elseif ($date == 2005) {
 $data2005 .= \ . $data[$c] .\,;
 }  elseif ($date == 2004) {
 $data2004 .= \ . $data[$c] .\,;
 }  elseif ($date == 2003) {
 $data2003 .= \ . $data[$c] .\,;
 }  elseif ($date == 2002) {
 $data2002 .= \ . $data[$c] .\,;
 }  elseif ($date == 2001) {
 $data2001 .= \ . $data[$c] .\,;
 }  elseif ($date  2000) {
 $data1999pre .= \ . $data[$c] .\,;
 }
 }
 }



 Sample data
 60609C49.PCX,PG 1,BLUEWATER HEALTH, LAB, 04/06/06,10003533S,BUNNY
  BUGS,06/10/2006
 60609C50.PCX,PG 1,Cake walk, other, 04/06/06,10003533T,Tweedy
 Bird,06/11/2006
 50609C49.PCX,PG 1,HEALTH, LAB, 04/06/06,10003533g,Smurf
 Grumpy,06/10/2005
 50699C55.PCX,PG 1,Lab 101, 04/06/06,10003533p,Smurf
 Pappy,04/10/2005


 --
 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] file_get_contents gets 404 error

2007-01-11 Thread Frank Arensmeier

In the manual it says:

You can use a URL as a filename with this function if the fopen  
wrappers have been enabled


First of all, I would check your php.ini file. If everything is ok  
(fopen wrappers are on), maybe you could post some code. The last  
option would be to use an other way round by using e.g. curl or  
anything else. If anybody else is able to open the URL you provided,  
it must be either you code or your server / PHP config that is  
messing things up.


//frank
11 jan 2007 kl. 17.01 skrev Németh Zoltán:


2007. 01. 11, csütörtök keltezéssel 16.55-kor Jochem Maas ezt írta:

Németh Zoltán wrote:

Hi all,

I have some php websites, for example http://www.alterationx.hu/

Now I'm trying to get the site with file_get_contents, and I'm  
getting

this error:

Warning: file_get_contents(http://www.alterationx.hu/): failed to  
open

stream: HTTP request failed! HTTP/1.1 404 Not Found


try this?:

file_get_contents(http://www.alterationx.hu/index.php;);

(it works for me. that said it works for me without the  
'index.php' at the end also.)


I tried this also, and get the same error still...



also check you logs on the site in question to figure out what  
exactly is going

on (i.e. what is being requested, if anything).


Yes, I'll contact our system administrator to check the apache logs

Thanks
Zoltán Németh





can anyone tell me why?

The site otherwise is working, and also getting other sites (not  
php) on

the same server with file_get_contents is working.

Thanks in advance
Zoltán Németh





--
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] Weird behaviour with IE

2007-01-11 Thread Frank Arensmeier
And where does PHP come in here? The issue you describe could be  
anything - CSS related, html related, server related, php / asp /  
java you name it - maybe it is MS Explorer that sucks. Do some more  
research first and then - if you still feel that this might be  
related to PHP, you are welcome back again.


//frank

11 jan 2007 kl. 17.54 skrev André Medeiros:


Hi list.

I know this may be a bit out of topic, but I've decided to try.

This website I'm maintaining opens just fine in firefox, and loads
everything. However, the same doesn't happen in IE, since the status
bar reads 1 item(s) remaining on most of the pages.

That issue raises another problem, because I really need that onLoad
event to be fired ;)

Has anyone had problems like this? What did you do to solve them?

Thanks in advance,
André

--
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] Anybody have any experience with outsite-in? [Quite a bit 0T]

2007-01-11 Thread Skip Evans

Hey all,

When you say it lets you run it off a CD does that 
mean the CD is totally self contained, as in you 
can pop it into any machine, sans web server DB, 
etc, and it runs just peachy?


Skip

Ryan A wrote:

Hey all!

This is a bit OT as its not really php programming, but it does involve PHP and MySql etc so 


The company I work for has decided to use the software from outsite-in.com,
for those of you who dont know (and i'm guessing a lot of you dont, as I kinda 
just found out about it myself) their software allows you to run php+mysql etc 
on a CD/DVD.

Just curious to know if anybody has had any experience with their software?
I have tried their free demo's and it looks pretty good.

Note: Others on this list have in the past advised me on how to do this using 
different methods, but my company wants to go with this... needless to say I am 
in NO way connected to outsite-in.com and i have *nothing* to gain if you visit 
their site, buy anything from them, shoot them, kiss them or whatever. :)

Thanks!
Ryan





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

Everyone is raving about the all-new Yahoo! Mail beta.


--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/

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



[PHP] Variance Function

2007-01-11 Thread Richard Lynch
It's been 20+ years since I took a stats class...

I didn't enjoy that class, and doubt if I remember 1% of what was
covered.

Given an input Unix date like:
1132565360

And an array of Unix dates like:
array(3) {
  [0]=
  int(1132565342)
  [1]=
  int(1132565360)
  [2]=
  int(1132565359)
}

I would like to return the input date *IF* it is reasonable in its
variance from the date values in the array.

E.g, the above would output: 1132565360

If, however, the input date was 0 for the same array of dates, I'd
want to get, errr... Well, okay, the values in the array...

One of those might *ALSO* be wildly wrong. :-(

So I want the most likely candidate for a correct date out of all
this mess, where any of the date values might be wrong.

Any ideas?

Is there a nice built-in sort out this variance mess for me function
in PHP? :-)

The somewhat maybe obvious candidate of stats_variance is a bit
under-documented...

I'm not sure I'd even understand the numbers that came out of it, even
if I experimented with it and *THOUGHT* I understood the numbers
coming out of it.

And the sheer number of functions in the stats package is making my
head spin.

And I dunno if I could get statistics into the shared server anyway.

Maybe I should explain the Big Picture, eh?

Okay, so the Big Picture is 14,000 emails in an Inbox, that need to
be processed, and tagged with their date.
[And a whole lot more, but not relevant to this post...]

Seems simple enough, with that Date: header.

Except when it's not there. :-(

Okay, so take the Sent: header if there's no Date: header.

Okay.

No, wait...  Damn!

Some fools have their PC clock set to, like, 1970 or whatever.  So
let's be generous and assume their CMOS battery has died, and they
haven't had a chance to change it.  Fine.  Deal with it.

Okay, so *NOW* the algorithm is to do this:

Take the Date: header, or Sent: header if no Date: header - $whatdate

Parse the Received: headers for the MTA date-stamps - $fromdates[]

Compare the values in $fromdates array with $whatdate.

If the variance is too high, then ignore the $whatdate, and take
the, errr, first?, average?, $fromdates[].

No, wait, maybe I should do a variance within the $fromdates in case
some stupid MTA server has a bad clock?

Any advice?

Anybody got a good variance function to do what I'm trying to do?

Am I on the entirely wrong path here?

Sheesh!

We may just ignore any obviously wrong dates, and process those by
hand...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] IMPORTANT: PHP does NOT cause browser issues.

2007-01-11 Thread Raphael Martins

Hi everybody.

Due some recent messages in this list and other CSS/XHTML list, I´ve decided
to post this to clarify a very common question: PHP is compatible with ALL
browsers. Why? Because PHP runs at the server, aside from the browser. The
only thing the browser will see is the response (in plain text or html
code). The response code may be incompatible, but not the PHP code. So,
again: PHP is compatible with ALL browsers because PHP does not run at the
browser.

The other issue is: I would like to run some PHP code when the user click a
link or press a button. Sorry pal... unless you use AJAX or iFrames, it
will not gonna happen. Consider post this types of questions in Javascript
or AJAX lists.
As said before, PHP runs at the server and this kind of problem require
client-side scripting.

Questions about rendering bugs in HTML should be posted at CSS or HTML
Lists.

Sorry if I sounded too cranky. But it´s for a good reason.

Good PHPíng.

P.S.: My suggestion is to send a message explaining that to every member
that joins the list.

--
Love all. Trust a few. Do wrong to none.


[PHP] Normalized Numbers

2007-01-11 Thread Brian P. Giroux
I am just learning PHP and as a practical exercise I've been working on
a set of functions to process and manipulate what I call normalized
number (ISBNs, EANs, UPCs, etc...)

My ultimate goal is to create a normnum class and child classes for the
different types of numbers.

Because of my line of work, I am mostly interested in ISBN-10s,
ISBN-13s, EANs and UPCs, but it can also be expanded to credit card
numbers, Canadian Social Insurance Numbers, and many more.

So far I have functions to validate ISBN-10s and EANs although I've run
into a bit of a wall with the digit_sum function as explained in the B:
section of that functions header comments.

If anyone can help me out with that or provide any other advice about
the rest of it, I'd be grateful.

The file can be found at http://www.senecal.ca/normnums.php.txt

Thanks.
-- 
Brian P. Giroux

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



Re: [PHP] Stored Procedure returns nothing on ROLLBACK

2007-01-11 Thread Chris

Philip Thompson wrote:

On Jan 10, 2007, at 6:36 PM, Chris wrote:


Philip Thompson wrote:

Hi.
I have been experiencing MSSQL woes lately. I have a stored procedure 
that I call in PHP using mssql_* functions. In my procedure, I have a 
transaction that rolls back on failure and commits on success (of 
course). If it commits, I get the proper return value (int) and the 
appropriate output parameters. However, if it rolls back, I get 
NOTHING... even if I try to return an error code (int) after the 
ROLLBACK TRANSACTION statement. The output parameter also does not 
get set upon rollback.
Is there a way to grab the error even in a rollback? or at least 
return something besides an empty string/int? I would like to know 
what error message to provide the user/admin.

SQL Server 2000, PHP 5.1.6, ntwdblib.dll version 8.00.194


Does it work outside of php? That is - you run it manually in mssql 
(whatever tools that has) you get the proper codes?



Yes, it works perfectly from the server and returns the expected 
outcome. It's as though PHP sees the 'rollback' and automatically 
assumes that the whole thing failed... so why return a value or output 
parameters. Weird, I know. Any other suggestions?


Can you show us the part of the code that deals with the rollback?

If you are issuing a rollback yourself:

$result = mssql_query(rollback transaction);

then you need to handle that yourself because that's treated as a 
separate query.


If you're not doing that (the transaction is rolling itself back), then 
I'm out of ideas :)


--
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] uploaded fiel size limitiation

2007-01-11 Thread Jochem Maas
[EMAIL PROTECTED] wrote:
 Hi,
 I have a little script that was working fine when uploaded files up tp 16MB.
 I moved to other hosting company and use the same form/script. Not, I
 can't upload eitherr 2MB file.
 
 Where to look for limitation first?
 
 According to phpinfo() post_max_size in php.ini is 8M.

memory_limit, post_max_size and upload_max_filesize.

the third one is biting you AFAICT. note that upload_max_filesize should be
set somewhat smaller than post_max_size because a file upload forms *part*
of the total data posted.

(someone please correct me if I've been living under an incorrect assumption)

 Thanks.
 
 -afan
 

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



Re: [PHP] uploaded fiel size limitiation

2007-01-11 Thread Jochem Maas
[EMAIL PROTECTED] wrote:
 Hi,
 I have a little script that was working fine when uploaded files up tp 16MB.
 I moved to other hosting company and use the same form/script. Not, I
 can't upload eitherr 2MB file.
 
 Where to look for limitation first?
 
 According to phpinfo() post_max_size in php.ini is 8M.

as an aside - do yourself a favour. grab a copy of the default php.ini
(whatever it's called these days) and read it top to bottom. It will take
you a little while but I'm sure you will, by the end of it, have learned
about some previously unknown ini settings and probably picked up quite a
bit of useful info from the extensive comments that it contains.

it can't hurt right?

 
 Thanks.
 
 -afan
 

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



Re: [PHP] Handling SimpleXMLElements

2007-01-11 Thread Jochem Maas
I'm guessing you have php5.0.x running - you really want a php5.1.x
version if your going to use XML - it will avoid *alot* headaches with
regarding to using var_dump() (or print_r() or even echo) to figure out
what the simpleXML objects are/contain.

Satyam wrote:
 I have a problem trying to handle SimpleXml objects.  Though I can manage
 some workaround the problem, I would like to understand it better.
 



 cell.
 Function dump() just does a var_dump() of whatever is given in the first
 argument within a pre tag and uses the second argument as a heading,
 surrounded by dashes.  In this case I copied the expression of what I am
 dumping as the title (within single quotes so it does not expand).
 
  foreach($row as $cell) {
dump($cell,'$cell);
dump($cell-p,'$cell-p');
dump((array)$cell-p,'(array)$cell-p');
dump($cell-p[1],'$cell-p[1]');
   }
 
 The section in question is shown below.  Though $cell is shown as a
 SimpleXMLElement containing one 'p' property which contains an array of two
 elements:
 $cell-
 object(SimpleXMLElement)#8 (1) {
  [p]=
  array(2) {
[0]=
string(12) Indian Rupee
[1]=
string(8) Ngultrum
  }
 }
 
 
 If I dump that 'p' element, I don't get an array but an object with just
 one element, the first value in the array
 $cell-p-
 object(SimpleXMLElement)#7 (1) {
  [0]=
  string(12) Indian Rupee
 }
 
 
 If I typecast it to an array, I still get a single element
 (array)$cell-p-
 array(1) {
  [0]=
  string(12) Indian Rupee
 }
 
 Nevertheless, if I explicitly index into the 'p' element, without even
 typecasting it into an array, the second element is there.
 $cell-p[1]-
 object(SimpleXMLElement)#10 (1) {
  [0]=
  string(8) Ngultrum
 }
 
 
 So, now you see it, now you don't, or do you?  What's happening?
 
 Satyam
 

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



Re: [PHP] Anybody have any experience with outsite-in? [Quite a bit 0T]

2007-01-11 Thread Satyam

It is not a new concept, even Wikipedia has a long list of them:

http://en.wikipedia.org/wiki/List_of_LiveDistros

Most of those distros have individual articles ... not the one mentioned 
below, though.


Satyam

- Original Message - 
From: Skip Evans [EMAIL PROTECTED]

To: Ryan A [EMAIL PROTECTED]
Cc: php php php-general@lists.php.net
Sent: Thursday, January 11, 2007 10:35 PM
Subject: Re: [PHP] Anybody have any experience with outsite-in? [Quite a bit 
0T]




Hey all,

When you say it lets you run it off a CD does that mean the CD is totally 
self contained, as in you can pop it into any machine, sans web server DB, 
etc, and it runs just peachy?


Skip

Ryan A wrote:

Hey all!

This is a bit OT as its not really php programming, but it does involve 
PHP and MySql etc so The company I work for has decided to use the 
software from outsite-in.com,
for those of you who dont know (and i'm guessing a lot of you dont, as I 
kinda just found out about it myself) their software allows you to run 
php+mysql etc on a CD/DVD.


Just curious to know if anybody has had any experience with their 
software?

I have tried their free demo's and it looks pretty good.

Note: Others on this list have in the past advised me on how to do this 
using different methods, but my company wants to go with this... needless 
to say I am in NO way connected to outsite-in.com and i have *nothing* to 
gain if you visit their site, buy anything from them, shoot them, kiss 
them or whatever. :)


Thanks!
Ryan





--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
 -
Everyone is raving about the all-new Yahoo! Mail beta.


--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.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] IMPORTANT: PHP does NOT cause browser issues.

2007-01-11 Thread Jochem Maas
it can never hurt to repeat this kind of thing!

Raphael Martins wrote:
 Hi everybody.
 
 Due some recent messages in this list and other CSS/XHTML list, I´ve
 decided
 to post this to clarify a very common question: PHP is compatible with ALL
 browsers. Why? Because PHP runs at the server, aside from the browser. The
 only thing the browser will see is the response (in plain text or html
 code). The response code may be incompatible, but not the PHP code. So,
 again: PHP is compatible with ALL browsers because PHP does not run at the
 browser.
 
 The other issue is: I would like to run some PHP code when the user
 click a
 link or press a button. Sorry pal... unless you use AJAX or iFrames, it
 will not gonna happen. Consider post this types of questions in Javascript
 or AJAX lists.
 As said before, PHP runs at the server and this kind of problem require
 client-side scripting.
 
 Questions about rendering bugs in HTML should be posted at CSS or HTML
 Lists.
 
 Sorry if I sounded too cranky. But it´s for a good reason.

most us who are faced with such repeated questions occassionally lose it,
the frustration caused is a real reason for people to become cranky in the face
of the never ending barrage of questions (of the ilk you pointed out)

... but it's not a *good* reason - it's never a good thing to let oneself get
stressed out by the thing that one is confronted with - that said I certainly
understand your sentiment ;-)
 
 Good PHPíng.
 
 P.S.: My suggestion is to send a message explaining that to every member
 that joins the list.

it wouldn't be the first or last suggestion of it's kind - unfortunately I'm 
quite sure
that such a thing will not be implemented, mostly because the list is neither 
admin'ed nor
moderated by anyone (IIRC Rasmus Lerdorf occasionally steps in to fix some 
techincal issues
when the list goes completely tits up - other than that the list 'just is' - 
and I don't
think anyone is expecting Rasmus or someone with a similar level of karma [in 
the php group's
server/system] to take on such tasks as your suggestion implies, unfortunately 
they too only
have 24 hours in each day :-P)

such is life - onwards and upwards to the next newbie post about trying to run a
php function when he/she clicks a link :-)

 

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



Re: [PHP] Normalized Numbers

2007-01-11 Thread Jochem Maas
Brian P. Giroux wrote:
 I am just learning PHP and as a practical exercise I've been working on
 a set of functions to process and manipulate what I call normalized
 number (ISBNs, EANs, UPCs, etc...)
 
 My ultimate goal is to create a normnum class and child classes for the
 different types of numbers.
 
 Because of my line of work, I am mostly interested in ISBN-10s,
 ISBN-13s, EANs and UPCs, but it can also be expanded to credit card
 numbers, Canadian Social Insurance Numbers, and many more.
 
 So far I have functions to validate ISBN-10s and EANs although I've run
 into a bit of a wall with the digit_sum function as explained in the B:
 section of that functions header comments.

if you want to turn the direction around reverse the string before
you start the loop:
http://php.net/manual/en/function.strrev.php

personally I would turn the string into an array of chars (which you can then 
also
reverse as need be) and then do a foreach loop on it ('array index'+1 can be 
used
to determine position) ... personal preference. anyway take a look at these 
functions:

http://php.net/manual/en/function.str-split.php
http://php.net/array_reverse
http://php.net/foreach
 
 If anyone can help me out with that or provide any other advice about
 the rest of it, I'd be grateful.

keep commenting all your code to that extent! you do us proud :-)

 
 The file can be found at http://www.senecal.ca/normnums.php.txt
 
 Thanks.

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



[PHP] CHMOD a file in windows server 2003

2007-01-11 Thread Kencana

Hi all,

anybody knows how to CHMOD a file to 777 or 666 or etc. in windows server
2003?

thank you

Regards,
Kencana
-- 
View this message in context: 
http://www.nabble.com/CHMOD-a-file-in-windows-server-2003-tf2962953.html#a8290007
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] Variance Function

2007-01-11 Thread Jochem Maas
hi Richard,

your email was hard to follow, and I don't have real answers for
you but maybe my simpleton's view of the situation might offer
you new avenues of thought to consider.

Richard Lynch wrote:
 It's been 20+ years since I took a stats class...

20 years ago I was mostly riding a push bike ... and I've never
taken a stats class as such (bare this in mind :-)

 
 I didn't enjoy that class, and doubt if I remember 1% of what was
 covered.

you'd be 1 up on me ;-)

 


...

 
 And the sheer number of functions in the stats package is making my
 head spin.
 

...

 
 Some fools have their PC clock set to, like, 1970 or whatever.  So
 let's be generous and assume their CMOS battery has died, and they
 haven't had a chance to change it.  Fine.  Deal with it.
 
 Okay, so *NOW* the algorithm is to do this:
 
 Take the Date: header, or Sent: header if no Date: header - $whatdate
 
 Parse the Received: headers for the MTA date-stamps - $fromdates[]
 
 Compare the values in $fromdates array with $whatdate.
 
 If the variance is too high, then ignore the $whatdate, and take
 the, errr, first?, average?, $fromdates[].

does it matter so long as your consistent in what you pick/use/calculate?

I would tend to go for the oldest date in any given array of processed dates
as this would seem to be the closest to the likely actual send date.

 
 No, wait, maybe I should do a variance within the $fromdates in case
 some stupid MTA server has a bad clock?

I would start by setting out a few acceptable boundaries and 'knowns'
for instance:

1. the first mail was sent no earlier than timestampX
(so any timestamp encountered that is earlier than this is bogus.)  
2. a maximum time an email could be expected to hang out at any given MTA whilst
waiting to be moved on.
(could be used to drop an outer timestamps [oldest  newest] from a 
given array of
timestamps extracted from mail whose difference is to it's 'neighbour' 
is
greater than this agreed maximum period.)

 
 Any advice?

1. don't forget to normalize all found dates in a given mails array of dates
into UTC (if that is even an issue) before doing any actual processing/analysis 
of
the collected dates.

2. I would consider the date's found in the Date: and/or Sent: headers with the 
same
brush as any dates found in the Recieved headers - your explanation suggest 
than no one
header could be construed as being more reliable than another.

3. er there is no 3, unless you consider 'buy a bigger brain' real advice ;-)

 
 Anybody got a good variance function to do what I'm trying to do?
 
 Am I on the entirely wrong path here?

dunno - but it's another typical Lynch problem that was just too interesting
for me to let slide :-) please do keep us posted as to your progress!

 Sheesh!
 
 We may just ignore any obviously wrong dates, and process those by
 hand...

indeed anything that is blatantly 'dodgy' with regard to dates is probably 
easier
to (and more accurately) processed by hand than it is to create some wizzo 
algo. for
it - it's a matter of getting the number of 'dodgy' down to an acceptable level 
of course.

 

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



Re: [PHP] CHMOD a file in windows server 2003

2007-01-11 Thread Jochem Maas
Kencana wrote:
 Hi all,
 
 anybody knows how to CHMOD a file to 777 or 666 or etc. in windows server
 2003?

windows server 2003 (et al) uses a completely different mechanism to the std 
linux
way of doing things with regard to file permissions.

other than opening lots of dialogs and checking lots of boxs I don't really 
know ;-)

SingTFW didn't offer any obvious results regarding setting NTFS file permissions
directly from php.

maybe you can load a .NET module that has this capability?:
http://php.net/manual/en/ref.dotnet.php

or likewise using the COM extension to gain access to something usable?
http://php.net/manual/en/ref.com.php

or maybe this?:
http://php.net/manual/en/ref.w32api.php

or this?:
http://php.net/manual/en/ref.iisfunc.php


I would probably figure out what commandline functionality windows offers
to do this kind of thing and then call the relevant cmd using the functions
provided here:
http://php.net/manual/en/ref.exec.php


of course a cynic might ask what the point was of bothering with permissions
on a windows system - but I'll restrain myself ;-)

 
 thank you
 
 Regards,
 Kencana

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



Re: [PHP] CHMOD a file in windows server 2003

2007-01-11 Thread John Comerford

Check out the CACLS command

HTH,
 JC


Kencana wrote:

Hi all,

anybody knows how to CHMOD a file to 777 or 666 or etc. in windows server
2003?

thank you

Regards,
Kencana
  


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



Re: [PHP] uploaded fiel size limitiation

2007-01-11 Thread Chris

[EMAIL PROTECTED] wrote:

Hi,
I have a little script that was working fine when uploaded files up tp 16MB.
I moved to other hosting company and use the same form/script. Not, I
can't upload eitherr 2MB file.


If you can't upload *any* files check that the upload_tmp_dir is set and 
see if that's writable by php (see php.net/is_writable).


--
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] Re: Progressiv display with IE7

2007-01-11 Thread Chris

131 wrote:
Btw, why is there those so ugly dbls quotes at each side of my so sweet 
nickname ?


Your mail program is doing that.

No idea about answering your original question.

--
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] Variance Function

2007-01-11 Thread Andrew Brampton
- Original Message - 
From: Richard Lynch [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Thursday, January 11, 2007 11:29 PM
Subject: [PHP] Variance Function


Any advice?

Anybody got a good variance function to do what I'm trying to do?



Hey,
I've seen you solve many questions on this list, and I feel honour to be 
able to try and help :)


Well the solution that pops into my head is clustering. Since you have a set 
of numbers and 1 or more of them may be abnormal, then you can cluster them 
into one or more groups of similar values.


I quickly read up on clustering and coded a function to do something you 
might find useful.


 cluster.php 
?php

function mean($arr) {
return array_sum($arr) / count($arr);
}

function find_k_clusters($arr, $k) {

if ($k = 1)
 return array($arr);

// Setup n clusters (and their means)
$cluster = array();
$clusterMean = array();
foreach ($arr as $a) {
 $cluster[] = array($a);
 $clusterMean[] = $a;
}

//populate an array of all the differences between pairs
$diff = array();
foreach ($clusterMean as $i = $c1) {
 $diff[$i] = array();
 foreach ($clusterMean as $j = $c2) {
   // Only loop until we get to j, so we don't duplicate results
  if ($i = $j)
   break;
  $diff[$i][$j] = abs( $c1 - $c2 );
 }
}

while ( count($cluster)  $k ) {

 // find the smallest value (hence the closest pair)
 $p1 = false;
 $p2 = false;

 foreach ($diff as $i = $diffi) {
  foreach ($diffi as $j = $d) {
   if ($p1 === false || $d  $diff[$p1][$p2]) {
$p1 = $i;
$p2 = $j;
   }
  }
 }

 echo $p1 $p2\n;
 //print_r($cluster);

 // Add the 2nd cluster to the first, and remove the 2nd
 $cluster[ $p1 ] = array_merge ($cluster[ $p1 ], $cluster[ $p2 ]);
 $clusterMean[$p1] = mean( $cluster[ $p1 ] );
 unset( $cluster[ $p2 ] );
 unset( $clusterMean[ $p2 ] );

 // Now recalc any diffs that would have changed
 unset( $diff[ $p2 ] ); // Remove the $p2 row

 // Remove the p2 col
 foreach( $diff as $i = $ds ) {
  if ( $i  $p2 ) {
   unset($ds[$p2]);
  }
 }

 // recalc the full p1 row
 foreach ($diff[$p1] as $j = $d) {
  $diff[$p1][$j] = abs( $clusterMean[$p1] - $clusterMean[$j] );
 }

}

return array_values( $cluster );
}

$a = array( 1132565342 , 0, 1132565360, 100, 1132565359, 1132565360, 
1 );


print_r ( find_k_clusters($a, 2) ) ;


?
-

Now you pass the function a array of values, and the number of clusters you 
wish to find. So for example entering the array

1132565342 , 0, 1132565360, 100, 1132565359, 1132565360, 1
will return 2 clusters like so:
[0] = 1132565342 , 1132565360, 1132565359, 1132565360
[1] = 0, 100, 1

It works by putting each value in its own cluster, and then finding the two 
closest clusters again and again until you are left with $k clusters. I 
haven't used the concept of variance.


Now its just up to you to figure out which cluster is correct, and voila you 
can throw away (or correct) the bad cluster values.


The problem might get more complex if you have for example dates such as 
1970, 1990, 2006... Because then the 1990 will be nearer to the 2006 and be 
clustered in the good cluster. If you have values such as this you might 
want to change this so instead of creating k cluster, it only clusters 
values within a suitable distance of each other (for example within 72 hours 
of each other, which is a max acceptable time for a email to be bounced 
around).


I hope this helps in some way. If not it was fun quickly coding up a 
clustering algorithm :)


On reflexation it might be a lot easier to not use clustering and instead 
just look at todays date, and throw away any value more than X days out.


Andrew Brampton 


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



[PHP] password protecting files, only allowing authorized users

2007-01-11 Thread Dave

Hello,
   I'm using php and apache2 on a freebsd box. I know about .htaccess that 
the web server can provide, but i'm looking for something php can do, i want 
it to pop up a page when a user requests certain files, asking for a 
username and password. If those are valid the user is taken to a page where 
the files requested can be downloaded. I'd rather not use a mysql database 
and keep this user information in a flat file, as what i am trying to do is 
on a small scale. I am also interested in blocking direct access to the 
files, for instance if someone puts in their direct url they should not be 
retrievable, but instead php should give an error msg. Any help appreciated.

Thanks.
Dave.

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



Re: [PHP] password protecting files, only allowing authorized users

2007-01-11 Thread Casey Chu

This is impossible with only PHP. You might need a combination of PHP
and AJAX [Javascript].

On 1/11/07, Dave [EMAIL PROTECTED] wrote:

Hello,
I'm using php and apache2 on a freebsd box. I know about .htaccess that
the web server can provide, but i'm looking for something php can do, i want
it to pop up a page when a user requests certain files, asking for a
username and password. If those are valid the user is taken to a page where
the files requested can be downloaded. I'd rather not use a mysql database
and keep this user information in a flat file, as what i am trying to do is
on a small scale. I am also interested in blocking direct access to the
files, for instance if someone puts in their direct url they should not be
retrievable, but instead php should give an error msg. Any help appreciated.
Thanks.
Dave.

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




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



Re: [PHP] password protecting files, only allowing authorized users

2007-01-11 Thread Chris

Dave wrote:

Hello,
   I'm using php and apache2 on a freebsd box. I know about .htaccess 
that the web server can provide, but i'm looking for something php can 
do, i want it to pop up a page when a user requests certain files, 
asking for a username and password.


http://www.php.net/features.http-auth has some nice examples, though the 
popup is the same as using htaccess.


I am also interested in 
blocking direct access to the files, for instance if someone puts in 
their direct url they should not be retrievable, but instead php should 
give an error msg.


If it's in a publicly accessible folder and only a php file to protect 
it, it won't work.


Put the files in a non-public folder (outside the webroot) and get php 
to pipe them in.


http://php.net/readfile or http://php.net/fpassthru will work for small 
files. For larger files you will need to use http://php.net/fread 
(specifically the loop example) so you don't blow out memory.



--
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] Pear on WinNT

2007-01-11 Thread Mark
I'm finally upgrading to PHP5, and when I try to run go-pear on my NT box, I 
get an ActiveX error.

What actually happens is that it will not let me specify the CLI path. When I 
try to edit that line, it give me the following error:

C:\TEMP\tmp27B.tmp\bf.vbs(18, 1) Microsoft VBScript runtime error: ActiveX 
component can't create object: 'Shell.Application'

Has anyone encountered this? I made sure that WMI was installed and up to date.

I've tried googling the error, but I get nothing useful. I tried microsoft.com 
and MSDN. No help.

Any ideas?

Thanks,

Mark
 
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to 
death to defend everyone else's right to the same thing.
***




 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

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



Re: [PHP] Javascript detection , working version

2007-01-11 Thread Jürgen Wind

tedd wrote:
index.php, jstest110.php) , make it one.
ok
---8---
It would be cool if I could send js value via a 
POST instead of GET-- can that be done?
have a look http://149.222.235.16/jstest/70112/index.php ( POST version )

tedd

PS: I read somewhere that using noscript is not recommended.
any info?

have fun,
Jürgen

-- 
View this message in context: 
http://www.nabble.com/Javascript-detection-tf2905451.html#a8292741
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] Downloading a binary file

2007-01-11 Thread Miguel J. Jiménez
El Thu, 11 Jan 2007 14:59:36 -0500
Sugrue, Sean [EMAIL PROTECTED] escribió:

 I need download a binary file in php. I don't need to read the
 contents just download the whole file to a browsed directory.
 I know you can use the header function, does anyone know the syntax.
 
 Sean
 


Maybe you can do:

?php
$file = file_get_contents(URI); // Must have wrapper
activated
file_put_contents(FILE, $file);
?

---
Miguel J. Jiménez
ISOTROL, S.A.
[EMAIL PROTECTED]
+34 955036800
+34 607448764

I try to save a life a day. Usually it's my own.
John Crichton, FARSCAPE (1x07)

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



Re: [PHP] Javascript detection , working version

2007-01-11 Thread Ruben Rubio
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

A good way to detect if javascript exists is (cross-browser,
cross-platform):

You try to load javascript_exists.htm.

- 
javascript_exists.htm:
noscript
meta http-equiv=refresh content=0; URL=javascript_not_actived.htm
/noscript
html
 ...
Javascript is actived!!
/html

- 
javascript_not_actived.htm:
html
 ...
Javascript is *NOT* actived!!
/html

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFpzemIo1XmbAXRboRAirXAKCo8LlqI0gv/7+Kfs7L6EHJGRdN3QCgo530
1YwBznS0B8p3KSFVCVcyyfc=
=DjZ8
-END PGP SIGNATURE-

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



Re: [PHP] Handling SimpleXMLElements

2007-01-11 Thread Satyam
- Original Message - 
From: Jochem Maas [EMAIL PROTECTED]




I'm guessing you have php5.0.x running - you really want a php5.1.x


PhpInfo reports it's 5.2.0 so I'm covered there.


version if your going to use XML - it will avoid *alot* headaches with
regarding to using var_dump() (or print_r() or even echo) to figure out
what the simpleXML objects are/contain.

Satyam wrote:

I have a problem trying to handle SimpleXml objects.  Though I can manage
some workaround the problem, I would like to understand it better.






cell.
Function dump() just does a var_dump() of whatever is given in the first
argument within a pre tag and uses the second argument as a heading,
surrounded by dashes.  In this case I copied the expression of what I am
dumping as the title (within single quotes so it does not expand).

 foreach($row as $cell) {
   dump($cell,'$cell);
   dump($cell-p,'$cell-p');
   dump((array)$cell-p,'(array)$cell-p');
   dump($cell-p[1],'$cell-p[1]');
  }

The section in question is shown below.  Though $cell is shown as a
SimpleXMLElement containing one 'p' property which contains an array of 
two

elements:
$cell-
object(SimpleXMLElement)#8 (1) {
 [p]=
 array(2) {
   [0]=
   string(12) Indian Rupee
   [1]=
   string(8) Ngultrum
 }
}


If I dump that 'p' element, I don't get an array but an object with just
one element, the first value in the array
$cell-p-
object(SimpleXMLElement)#7 (1) {
 [0]=
 string(12) Indian Rupee
}


If I typecast it to an array, I still get a single element
(array)$cell-p-
array(1) {
 [0]=
 string(12) Indian Rupee
}

Nevertheless, if I explicitly index into the 'p' element, without even
typecasting it into an array, the second element is there.
$cell-p[1]-
object(SimpleXMLElement)#10 (1) {
 [0]=
 string(8) Ngultrum
}


So, now you see it, now you don't, or do you?  What's happening?

Satyam





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