Re: [PHP] From: Newman, using and ' or ` in My Sql

2002-03-16 Thread mnc

On Sat, 16 Mar 2002, Philip J. Newman wrote:
 A few of us folk at PhilipNZ.com would like to know about using  and ' or ` in My 
Sql when calling information from the database.
 
 we have always used
 
 $sql = SELECT * FROM `hyperlinks` ORDER BY `clicks` DESC LIMIT 0, 10;
 
 but where told that the ` was not required
 
 $sql = SELECT * FROM hyperlinks ORDER BY clicks DESC LIMIT 0, 10;

The backtick (`) has an entirely different meaning and shouldn't be used 
to delimit arguments in MYSQL statements.

It's used to indicate that you want to execute a command external to PHP 
(for instance, `/bin/ls`).

The standard quote (') should be used to delimit string literals in MYSQL
statements. Use it to surround strings you're inserting into or comparing 
against VARCHARs, CHARs, TEXTs, etc.

Both are unnecessary in the statements you cite above. Here's a simple 
statement using the standard single quote:

   $sql = UPDATE mytable SET name='Best Table Of All' WHERE id=3;

miguel


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




Re: [PHP] Weird?

2002-03-16 Thread scott furt

... i think you might have to create the
$date directory before writing a file to it.

writing to /tmp/dir/file.txt will fail if
the directory dir doesn't exist.


jtjohnston wrote:
 Does anyone have time to run this code?
 This is definitely weird. Either a Windows or a code problem. If I set:
 
 $to_path = c:\\ccl_www\\.$date.ccl_www\\;
 
 to:
 
 $to_path = c:\\ccl_www\\.$date.\\ccl_www\\;
 (I add \\)
 
 It fails to create c:\ccl_www\20020315\ccl_www, but otherwise will
 create c:\ccl_www\20020315ccl_www
 
 I've tried debugging this thing backwards, but have not found my
 problem.
 
 If for example, I tried creating manually:
 
 c:\ccl_www
 
 thinking it was a root thing. It worked, then it didn't.
 
 :x( John
 P.S. By the by, I tried this on a Unix box, and thought it worked, but
 then it didn't when I went back to it this morning. I'm confused!
 
 
 snip
 $date = date (MD);
 ###
 ###  Don't forget trailing slash  #
 ###
 $from_path = c:\\program files\\easyphp\\ccl_www\\;
 $to_path = c:\\ccl_www\\.$date.ccl_www\\;
 ###
 
 if(!is_dir($from_path))
 {
 echo failed;
 exit;
 }else{
 rec_copy($from_path, $to_path);
 echo files copies from $from_path and backed up to $to_path;
 }
 
 #
 
 function rec_copy ($from_path, $to_path) {
 if(!is_dir($to_path))
 mkdir($to_path, 0777);
 
 $this_path = getcwd();
  if (is_dir($from_path))
  {
 chdir($from_path);
 $handle=opendir('.');
 
 while (($file = readdir($handle))!==false)
 {
  if (($file != .)  ($file != ..)) {
   if (is_dir($file))
   {
   rec_copy ($from_path.$file./,  $to_path.$file./);
chdir($from_path);
   }else{
 #  echo error if (is_dir($file))br;
   }
   if (is_file($file))
   {
   copy($from_path.$file, $to_path.$file);
   }else{
 #  echo error copy($from_path.$file, $to_path.$file)br;
   }
  }#end (($file != .)
 }#end while (($file
 
 closedir($handle);
  }# end if (is_dir
  else{
 # echo if (is_dir($from_path))br;
  }
 }# end function
 
 
 
 
 




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




[PHP] Increment a value in a MySQL database with one query?

2002-03-16 Thread Kevin Stone

Is there a MySQL function that I can use to increment the integer value of a row entry 
with one query?

Here's the combined PHP and SQL in psuedo code form...
UPDATE mytable SET myval++

Something like that.  So I dont have to pull the value from the database, increment 
it, then post it back to the database.  Any help will be greatly appreciated,

-Keivn



Re: [PHP] Increment a value in a MySQL database with one query?

2002-03-16 Thread mnc

On Sat, 16 Mar 2002, Kevin Stone wrote:
 Is there a MySQL function that I can use to increment the integer value of a row 
entry with one query?
 
 Here's the combined PHP and SQL in psuedo code form...
 UPDATE mytable SET myval++
 
 Something like that.  So I dont have to pull the value from the database, increment 
it, then post it back to the database.  Any help will be greatly appreciated,

   UPDATE mytable SET myval=myval+1
 
miguel


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




[PHP] IMAGE Manipulation

2002-03-16 Thread Dani

Hi,

I'm trying to resize images from a big image to smaller image in
dimension and also file size so that when a user upload an image into
server, when a browser display the picture it desn't have to be as big.
I hope my question make sense.

I just don't know where to start.

may be somebody could help me, please.

thank you for reviewing my email.

regards,
Dani


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




[PHP] Re: IMAGE Manipulation

2002-03-16 Thread Marcel Besancon

Hi Dani,

 I'm trying to resize images from a big image to smaller image in
 dimension and also file size so that when a user upload an image into
 server, when a browser display the picture it desn't have to be as big.
 I hope my question make sense.

a good way for working with images is using the gd-library. Just look at
http://www.boutell.com/gd/. Ther's a possibility to download the extension
and there are some introductions too.

I hope this helps

Bye, Marcel

--
registered Fli4l-User #0388



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




[PHP] QA help needed

2002-03-16 Thread James Cox

firstly, apologies for the cross post, but I urgently need a Windows 98 /
PHP / PWS environment to test an issue on.

if anyone could help out with that, please email me back directly.

Thanks,

James

--
James Cox :: [EMAIL PROTECTED] :: Landonize It! http://landonize.it/
Was I helpful?  http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/


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




[PHP] RE: [PHP-QA] QA help needed

2002-03-16 Thread Liz

James,

Firstly I have a suggestion for you, I downloaded a copy of something
called VMWare, it allows you to install virtual machines, ie, depending
on your disk space you can run mutliple operating systems without multi
boot. It even has the ability to forget changes, so you can have a
stable build, and 'try' software on it - great for perfecting software
installation and so on.

It runs on windows and linux

Im not affiliated but it's a rocking product.  I don't however, curretly
have a Win98 setup on it, I have every other stupid form of windows bar
the 98/me/95 variety

They do a 30day eval version no other restrictions, its nice.

 -Original Message-
 From: James Cox [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, March 16, 2002 2:04 PM
 To: Php-Qa
 Cc: php-general; Php-Dev
 Subject: [PHP-QA] QA help needed
 
 
 firstly, apologies for the cross post, but I urgently need a 
 Windows 98 / PHP / PWS environment to test an issue on.
 
 if anyone could help out with that, please email me back directly.
 
 Thanks,
 
 James
 
 --
 James Cox :: [EMAIL PROTECTED] :: Landonize It! 
 http://landonize.it/ Was I helpful?  
http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/


-- 
PHP Quality Assurance 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] Formatting input text?

2002-03-16 Thread Andre Dubuc

I wonder whether this is possible? 

I would like to format a text input so that the first letter of the input (as 
the user is typing it in) would automatically be converted to Uppercase 
(capitals). Furthermore, if it is possible, I would like to pre-format the 
date input type=text so that only numbers or dashes could be entered. I 
really enjoyted this capablity in Paradox PAL language. 

Does anything exist that would allow me to do this in PHP?

An example:

Code
tdbSurname/b/td
tdinput type=text name=rap/td

Screen (and into database)
Surname: blackwould be converted as they type to  Surname: Black

Any suggestions or advice would be greatly appreciated.
Tia,
Andre


-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.

May God bless you abundantly in His love!

For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/

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




[PHP] Problem with sessions.

2002-03-16 Thread Carlos Costa Portela

Hello all:

I am playing with sessions and I have a problem with the
session_destroy() function. If I do a session_register() after calling it,
the session recover the previous values (values that I supposed forgot by
the session).

At
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
have the web page and the code, respectively.

The problem is that the counter variable maintains the value
even after click logout.

If you go to the web page, press:

login - counter=0
other link - counter=1
other link - counter=2
other link - counter=3
logout
other link - counter=4

I suppose that the problem is that I call
session_register(counter). How must I solve this problem?

Best regards and thanks in advance,
Carlos.

[ all about php+web : http://www.improveyourweb.com ]

 ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




[PHP] PHP Document not found

2002-03-16 Thread Jan Weidhaase

Hi

If I try to open a non-existing PHP document by my Apache server I got an
internal server error massage. All other documents that were not found bring
me to a error 404 document.
4 days ago I updated from PHP3 to PHP4.0.3pl1 and with the former version i
got a error massage like: no php file input spicified on line 0 or
something like that.

Does anybody no about this problem? Thank you
Jan



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




[PHP] where is http_cookie ?

2002-03-16 Thread Bas Jobsen

Hello,

I have installed php 4.1.2. as a cgi module.
But http_cookie isn't set. I don' know whats wrong.
You can find the output of phpinfo() at
http://www.tgp2stats.com/test.php

Tnx,

Bas Jobsen

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




[PHP] server load

2002-03-16 Thread caspar kennerdale

Would a 10kb file which has 5kb of comments take longer to process in php
than the same file wihout the comments which is 5kb?

Or are the comments ignored as far as server load and speed to delivery are
concerned?


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




php-general Digest 16 Mar 2002 17:13:08 -0000 Issue 1230

2002-03-16 Thread php-general-digest-help


php-general Digest 16 Mar 2002 17:13:08 - Issue 1230

Topics (messages 88732 through 88749):

Re: Newman, using  and ' or ` in My Sql
88732 by: Jason Wong
88735 by: David Robley
88736 by: mnc.stoic.net

Somebody knows about SecureLink?
88733 by: Jan Grafström

browser caching
88734 by: Peter Hall

Re: Weird?
88737 by: scott furt

Increment a value in a MySQL database with one query?
88738 by: Kevin Stone
88739 by: mnc.stoic.net
88740 by: Kevin Stone

IMAGE Manipulation
88741 by: Dani
88742 by: Marcel Besancon

QA help needed
88743 by: James Cox

Re: [PHP-QA] QA help needed
88744 by: Liz

Formatting input text?
88745 by: Andre Dubuc

Problem with sessions.
88746 by: Carlos Costa Portela

PHP Document not found
88747 by: Jan Weidhaase

where is http_cookie ?
88748 by: Bas Jobsen

server load
88749 by: caspar kennerdale

Administrivia:

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

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

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


--

---BeginMessage---

On Saturday 16 March 2002 13:08, Philip J. Newman wrote:
 A few of us folk at PhilipNZ.com would like to know about using  and ' or
 ` in My Sql when calling information from the database.

 we have always used

 $sql = SELECT * FROM `hyperlinks` ORDER BY `clicks` DESC LIMIT 0, 10;

 but where told that the ` was not required

 $sql = SELECT * FROM hyperlinks ORDER BY clicks DESC LIMIT 0, 10;

 Any Comments on this?

Yes, this should be posted to php-db.

For simple cases ` ` are not needed. It is only used if your column names 
contain weird characters, spaces for instance, then:

SELECT `First Name` FROM Address;


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
A domineering man married a mere wisp of a girl.  He came back from
his honeymoon a chastened man.  He'd become aware of the will of the wisp.
*/

---End Message---
---BeginMessage---

In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 On Saturday 16 March 2002 13:08, Philip J. Newman wrote:
  A few of us folk at PhilipNZ.com would like to know about using  and ' or
  ` in My Sql when calling information from the database.
 
  we have always used
 
  $sql = SELECT * FROM `hyperlinks` ORDER BY `clicks` DESC LIMIT 0, 10;
 
  but where told that the ` was not required
 
  $sql = SELECT * FROM hyperlinks ORDER BY clicks DESC LIMIT 0, 10;
 
  Any Comments on this?
 
 Yes, this should be posted to php-db.
 
 For simple cases ` ` are not needed. It is only used if your column names 
 contain weird characters, spaces for instance, then:
 
 SELECT `First Name` FROM Address;

 
And of course single quotes (') should be used to delimit text data being 
inserted into CHAR type fields. But you knew that, of course.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

---End Message---
---BeginMessage---

On Sat, 16 Mar 2002, Philip J. Newman wrote:
 A few of us folk at PhilipNZ.com would like to know about using  and ' or ` in My 
Sql when calling information from the database.
 
 we have always used
 
 $sql = SELECT * FROM `hyperlinks` ORDER BY `clicks` DESC LIMIT 0, 10;
 
 but where told that the ` was not required
 
 $sql = SELECT * FROM hyperlinks ORDER BY clicks DESC LIMIT 0, 10;

The backtick (`) has an entirely different meaning and shouldn't be used 
to delimit arguments in MYSQL statements.

It's used to indicate that you want to execute a command external to PHP 
(for instance, `/bin/ls`).

The standard quote (') should be used to delimit string literals in MYSQL
statements. Use it to surround strings you're inserting into or comparing 
against VARCHARs, CHARs, TEXTs, etc.

Both are unnecessary in the statements you cite above. Here's a simple 
statement using the standard single quote:

   $sql = UPDATE mytable SET name='Best Table Of All' WHERE id=3;

miguel


---End Message---
---BeginMessage---

Hi!
I wonder if this script can be written in PHP?
I know nothing about asp.

SCRIPT LANGUAGE=VBScript RUNAT=Server
Sub Application_OnStart
Set SecureLink = Server.CreateObject(SecureLinkActiveX.SecureCnx.1)
Set Application(SecureLink) = SecureLink
SecureLink.SetTransacServer specifiedserver.com, 443, 80
SecureLink.SetContentServer www.webshop.com, 80,/webshop/
SecureLink.SetKeyFileName c:/programs/securelink/secrets/flat_o.kf
SecureLink.SetOfrFileName c:/programs/securelink/osl40.ofr
SecureLink.SetApplStoreID 00
SecureLink.SetApplMiofferName shopingcart
End sub
/SCRIPT

--
Regards,
Jan Grafström

Sweden

Bredsäter 2091
87010 Älandsbro



---End Message---
---BeginMessage---

Hi,

I'm having difficulty getting a php page to reload when the user goes back
to it. The page is initially loaded with no variables passed, but is then
reloaded with variables passed with GET 

Re: [PHP] server load

2002-03-16 Thread Andrey Hristov

Flex - the tools that parses the code skips everything between /* and */ and for this 
no token is given back. Of course if you don't
have 5kb comments Flex will be a little faster but possibly few %.

Regards,
Andrey

- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:13 PM
Subject: [PHP] server load


 Would a 10kb file which has 5kb of comments take longer to process in php
 than the same file wihout the comments which is 5kb?

 Or are the comments ignored as far as server load and speed to delivery are
 concerned?


 --
 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: where is http_cookie ?

2002-03-16 Thread Ray Hunter

Try using the predefined variable $_COOKIE instead and see if that works for
you...


Bas Jobsen [EMAIL PROTECTED] wrote in message
02031617361309.10531@bjobsen">news:02031617361309.10531@bjobsen...
 Hello,

 I have installed php 4.1.2. as a cgi module.
 But http_cookie isn't set. I don' know whats wrong.
 You can find the output of phpinfo() at
 http://www.tgp2stats.com/test.php

 Tnx,

 Bas Jobsen



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




[PHP] Re: PHP Document not found

2002-03-16 Thread Ray Hunter

You should try moving to the current version of php and then try it...

Ray Hunter


Jan Weidhaase [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi

 If I try to open a non-existing PHP document by my Apache server I got an
 internal server error massage. All other documents that were not found
bring
 me to a error 404 document.
 4 days ago I updated from PHP3 to PHP4.0.3pl1 and with the former version
i
 got a error massage like: no php file input spicified on line 0 or
 something like that.

 Does anybody no about this problem? Thank you
 Jan





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




RE: [PHP] server load

2002-03-16 Thread caspar kennerdale

So you could have as much commented text without any detriment to the pages
performance?

great



-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: 16 March 2002 17:17
To: caspar kennerdale
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] server load


Flex - the tools that parses the code skips everything between /* and */ and
for this no token is given back. Of course if you don't
have 5kb comments Flex will be a little faster but possibly few %.

Regards,
Andrey

- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:13 PM
Subject: [PHP] server load


 Would a 10kb file which has 5kb of comments take longer to process in php
 than the same file wihout the comments which is 5kb?

 Or are the comments ignored as far as server load and speed to delivery
are
 concerned?


 --
 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] server load

2002-03-16 Thread Andrey Hristov

However write short but meaningful comments. Keep in mind that the scripts has to be 
loaded in the memory from the disk. Although
after first request it is in some cache.


Andrey


- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:24 PM
Subject: RE: [PHP] server load


 So you could have as much commented text without any detriment to the pages
 performance?

 great



 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 16 March 2002 17:17
 To: caspar kennerdale
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] server load


 Flex - the tools that parses the code skips everything between /* and */ and
 for this no token is given back. Of course if you don't
 have 5kb comments Flex will be a little faster but possibly few %.

 Regards,
 Andrey

 - Original Message -
 From: caspar kennerdale [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 7:13 PM
 Subject: [PHP] server load


  Would a 10kb file which has 5kb of comments take longer to process in php
  than the same file wihout the comments which is 5kb?
 
  Or are the comments ignored as far as server load and speed to delivery
 are
  concerned?
 
 
  --
  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] server load

2002-03-16 Thread caspar kennerdale

I am thinking of using a documentation parser such as javadoc (called
phpdoc) which will create a separate html document on the functions and
feastures of the classes I am writing,as well as examples and tutorial info.

I am just considering whether or no I have two versions - a no comments
version which goes live and a commented version which I compile the html
fromand also distribute.

Does anyone here have experience with phpdoc?

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: 16 March 2002 17:29
To: caspar kennerdale
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] server load


However write short but meaningful comments. Keep in mind that the scripts
has to be loaded in the memory from the disk. Although
after first request it is in some cache.


Andrey


- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:24 PM
Subject: RE: [PHP] server load


 So you could have as much commented text without any detriment to the
pages
 performance?

 great



 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 16 March 2002 17:17
 To: caspar kennerdale
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] server load


 Flex - the tools that parses the code skips everything between /* and */
and
 for this no token is given back. Of course if you don't
 have 5kb comments Flex will be a little faster but possibly few %.

 Regards,
 Andrey

 - Original Message -
 From: caspar kennerdale [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 7:13 PM
 Subject: [PHP] server load


  Would a 10kb file which has 5kb of comments take longer to process in
php
  than the same file wihout the comments which is 5kb?
 
  Or are the comments ignored as far as server load and speed to delivery
 are
  concerned?
 
 
  --
  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




[PHP] Download do Manual

2002-03-16 Thread Márcio Santos

Olá pessoal!
Gostaria que alguém me enviasse o manual de php em portugues 
descompactado, pois tenho tido problemas em descompacta-lo, mesmo em 
pdf.
Com os melhores cumprimentos:

++
| Marcio Santos  |
| Estudante de Ensino de Informatica |
| Universidade da Madeira|
| GSM: +351 96 653 10 72 |
++


__
http://www.IOL.pt
Todo o mundo passa por aqui!



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




Re: [PHP] server load

2002-03-16 Thread Andrey Hristov

I have :)))

Andrey

- Original Message - 
From: caspar kennerdale [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:40 PM
Subject: RE: [PHP] server load


 I am thinking of using a documentation parser such as javadoc (called
 phpdoc) which will create a separate html document on the functions and
 feastures of the classes I am writing,as well as examples and tutorial info.
 
 I am just considering whether or no I have two versions - a no comments
 version which goes live and a commented version which I compile the html
 fromand also distribute.
 
 Does anyone here have experience with phpdoc?
 
 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 16 March 2002 17:29
 To: caspar kennerdale
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] server load
 
 
 However write short but meaningful comments. Keep in mind that the scripts
 has to be loaded in the memory from the disk. Although
 after first request it is in some cache.
 
 
 Andrey
 
 
 - Original Message -
 From: caspar kennerdale [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 7:24 PM
 Subject: RE: [PHP] server load
 
 
  So you could have as much commented text without any detriment to the
 pages
  performance?
 
  great
 
 
 
  -Original Message-
  From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
  Sent: 16 March 2002 17:17
  To: caspar kennerdale
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] server load
 
 
  Flex - the tools that parses the code skips everything between /* and */
 and
  for this no token is given back. Of course if you don't
  have 5kb comments Flex will be a little faster but possibly few %.
 
  Regards,
  Andrey
 
  - Original Message -
  From: caspar kennerdale [EMAIL PROTECTED]
  To: PHP General [EMAIL PROTECTED]
  Sent: Saturday, March 16, 2002 7:13 PM
  Subject: [PHP] server load
 
 
   Would a 10kb file which has 5kb of comments take longer to process in
 php
   than the same file wihout the comments which is 5kb?
  
   Or are the comments ignored as far as server load and speed to delivery
  are
   concerned?
  
  
   --
   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
 
 


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




Re: [PHP] Problem with sessions.

2002-03-16 Thread Tom Rogers

Hi
When you create the new session give it a different name.
Tom

At 01:49 AM 17/03/2002, Carlos Costa Portela wrote:
 Hello all:

 I am playing with sessions and I have a problem with the
session_destroy() function. If I do a session_register() after calling it,
the session recover the previous values (values that I supposed forgot by
the session).

 At
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
have the web page and the code, respectively.

 The problem is that the counter variable maintains the value
even after click logout.

 If you go to the web page, press:

login - counter=0
other link - counter=1
other link - counter=2
other link - counter=3
logout
other link - counter=4

 I suppose that the problem is that I call
session_register(counter). How must I solve this problem?

 Best regards and thanks in advance,
 Carlos.

 [ all about php+web : http://www.improveyourweb.com ]

  ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


--
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: Variable Variables and Mulitdimensional Arrays

2002-03-16 Thread Joe Webster

You seem to have three different ideas/questions... let me attempt to answer
them:

 Hi. I want to be able to access a key in a multidimensional array at some
 depth n without knowing before runtime what the keys are.

let's take a multidimensional array $x
$x = array(
somevar,
array(
otherval,
evenmore
)
);

echo $x[0]; should print 'somevar'
echo $x[1]; should print 'Array'
echo $x[1][0]; should print 'otherval'
echo $x[1][1]; should print 'evenmore'


 I thought this might be possible using variable variables. Here's some
 sample code using variable variables and multidimensional arrays:
 $y = 'a';
 $z = 'b';
 $t = 'c';
 $x = array(a=array(b=array(c=TRUE)));


 // I want to be able to concatenate the array indexes into one variable
 variable. This would be done in a loop at runtime.
if you want to concat all the key's of an array with a loop you could do:

reset($x); //just to make sure we are at the first key
while(list($key,$val) = each($x)){
$my_keys .= $key
}
echo $my_keys;

should result in: (using $x from my code above)

1 (I think it might even come out as 01 -- but probally 1 since it will be
treated as a int maybe =) )


 Any help would greatly be appreciated,

 Charlie



Hope that helps, still not sure what your question was or if i answered it
;)

-Joe



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




Re: [PHP] server load

2002-03-16 Thread Andrey Hristov

I've just tested on the productional test server a sample php consisting from 62kb 
comment. Benchmarked with ab
1-st bench - ten connections
Server Port:80

Document Path:  /test.php
Document Length:0 bytes

Concurrency Level:  10
Time taken for tests:   0.552 seconds
Complete requests:  100
Failed requests:0
Total transferred:  17992 bytes
HTML transferred:   0 bytes
Requests per second:181.16
Transfer rate:  32.59 kb/s received

2-nd bench:
Server Port:80

Document Path:  /test.php
Document Length:0 bytes

Concurrency Level:  10
Time taken for tests:   100.601 seconds
Complete requests:  1
Failed requests:0
Total transferred:  1730173 bytes
HTML transferred:   0 bytes
Requests per second:99.40
Transfer rate:  17.20 kb/s received

3rd bench:  - one connection
Server Port:80

Document Path: /test.php
Document Length:0 bytes

Concurrency Level:  1
Time taken for tests:   280.047 seconds
Complete requests:  1
Failed requests:0
Total transferred:  173 bytes
HTML transferred:   0 bytes
Requests per second:35.71
Transfer rate:  6.18 kb/s received

Connnection Times (ms)
  min   avg   max
Connect:0 3  3000
Processing: 924   209
Total:  927  3209

Keep in mind that I've started ab from another machine on the same 100Mbit network.

Regards,
Andrey

- Original Message - 
From: caspar kennerdale [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:40 PM
Subject: RE: [PHP] server load


 I am thinking of using a documentation parser such as javadoc (called
 phpdoc) which will create a separate html document on the functions and
 feastures of the classes I am writing,as well as examples and tutorial info.
 
 I am just considering whether or no I have two versions - a no comments
 version which goes live and a commented version which I compile the html
 fromand also distribute.
 
 Does anyone here have experience with phpdoc?
 
 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 16 March 2002 17:29
 To: caspar kennerdale
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] server load
 
 
 However write short but meaningful comments. Keep in mind that the scripts
 has to be loaded in the memory from the disk. Although
 after first request it is in some cache.
 
 
 Andrey
 
 
 - Original Message -
 From: caspar kennerdale [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 7:24 PM
 Subject: RE: [PHP] server load
 
 
  So you could have as much commented text without any detriment to the
 pages
  performance?
 
  great
 
 
 
  -Original Message-
  From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
  Sent: 16 March 2002 17:17
  To: caspar kennerdale
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] server load
 
 
  Flex - the tools that parses the code skips everything between /* and */
 and
  for this no token is given back. Of course if you don't
  have 5kb comments Flex will be a little faster but possibly few %.
 
  Regards,
  Andrey
 
  - Original Message -
  From: caspar kennerdale [EMAIL PROTECTED]
  To: PHP General [EMAIL PROTECTED]
  Sent: Saturday, March 16, 2002 7:13 PM
  Subject: [PHP] server load
 
 
   Would a 10kb file which has 5kb of comments take longer to process in
 php
   than the same file wihout the comments which is 5kb?
  
   Or are the comments ignored as far as server load and speed to delivery
  are
   concerned?
  
  
   --
   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
 
 


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




Re: [PHP] Formatting input text?

2002-03-16 Thread Edward van Bilderbeek - Bean IT

Just use javascript... (be careful, what works with IE, doesn't
automatically work with Netscape)...

Greets,

Edward

- Original Message -
From: Andre Dubuc [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 4:44 PM
Subject: [PHP] Formatting input text?


 I wonder whether this is possible?

 I would like to format a text input so that the first letter of the input
(as
 the user is typing it in) would automatically be converted to Uppercase
 (capitals). Furthermore, if it is possible, I would like to pre-format the
 date input type=text so that only numbers or dashes could be entered. I
 really enjoyted this capablity in Paradox PAL language.

 Does anything exist that would allow me to do this in PHP?

 An example:

 Code
 tdbSurname/b/td
 tdinput type=text name=rap/td

 Screen (and into database)
 Surname: blackwould be converted as they type to  Surname: Black

 Any suggestions or advice would be greatly appreciated.
 Tia,
 Andre


 --
 Please pray the Holy Rosary to end the holocaust of abortion.
 Remember in your prayers the suffering souls in Purgatory.

 May God bless you abundantly in His love!

 For a free Cenacle Scriptural Rosary Booklet --
http://www.webhart.net/csrb/

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




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




Re: [PHP] Problem with sessions.

2002-03-16 Thread Edward van Bilderbeek - Bean IT

maybe you better use:

session_unregister(counter);

Greets,
Edward


- Original Message -
From: Carlos Costa Portela [EMAIL PROTECTED]
To: php-general mailing list [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 4:49 PM
Subject: [PHP] Problem with sessions.


 Hello all:

 I am playing with sessions and I have a problem with the
 session_destroy() function. If I do a session_register() after calling it,
 the session recover the previous values (values that I supposed forgot by
 the session).

 At
 http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
 http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
 have the web page and the code, respectively.

 The problem is that the counter variable maintains the value
 even after click logout.

 If you go to the web page, press:

 login - counter=0
 other link - counter=1
 other link - counter=2
 other link - counter=3
 logout
 other link - counter=4

 I suppose that the problem is that I call
 session_register(counter). How must I solve this problem?

 Best regards and thanks in advance,
 Carlos.

 [ all about php+web : http://www.improveyourweb.com ]

  ___Carlos Costa
Portela_
 | e-mail:  [EMAIL PROTECTED] | home page:
http://casa.ccp.servidores.net |
 |_Tódalas persoas maiores foron nenos antes, pero poucas se
lembran__|


 --
 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] Formatting input text?

2002-03-16 Thread Andre Dubuc

Hi Edward,

If I wanted to avoid Javascript, could I still accomplish this in PHP?

Regards, Andre


On Saturday 16 March 2002 13:33, you wrote:
 Just use javascript... (be careful, what works with IE, doesn't
 automatically work with Netscape)...

 Greets,

 Edward

 - Original Message -
 From: Andre Dubuc [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 4:44 PM
 Subject: [PHP] Formatting input text?

  I wonder whether this is possible?
 
  I would like to format a text input so that the first letter of the input

 (as

  the user is typing it in) would automatically be converted to Uppercase
  (capitals). Furthermore, if it is possible, I would like to pre-format
  the date input type=text so that only numbers or dashes could be
  entered. I really enjoyted this capablity in Paradox PAL language.
 
  Does anything exist that would allow me to do this in PHP?
 
  An example:
 
  Code
  tdbSurname/b/td
  tdinput type=text name=rap/td
 
  Screen (and into database)
  Surname: blackwould be converted as they type to  Surname: Black
 
  Any suggestions or advice would be greatly appreciated.
  Tia,
  Andre
 
 
  --
  Please pray the Holy Rosary to end the holocaust of abortion.
  Remember in your prayers the suffering souls in Purgatory.
 
  May God bless you abundantly in His love!
 
  For a free Cenacle Scriptural Rosary Booklet --

 http://www.webhart.net/csrb/

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

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.

May God bless you abundantly in His love!

For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/

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




[PHP] Update: [PHP] Weird?

2002-03-16 Thread jtjohnston

I have created date :)
$date = date (MD);
That's not it. It seems to fail at one level or another, I think, becuase the
function calls itself - and probably gets lost somehow.
John

 ... i think you might have to create the
 $date directory before writing a file to it.
 writing to /tmp/dir/file.txt will fail if
 the directory dir doesn't exist.

?php

###
$date = date (MD);
###
###  Don't forget trailing slash  #
###
$from_path = c:\\program files\\easyphp\\ccl_www\\;
$to_path = c:\\ccl_www\\.$date.ccl_www\\;
###

if(!is_dir($from_path))
{
echo failed;
exit;
}else{
rec_copy($from_path, $to_path);
echo files copies from $from_path and backed up to $to_path;
}

#
function rec_copy ($from_path, $to_path) {
if(!is_dir($to_path))
mkdir($to_path, 0777);

$this_path = getcwd();
 if (is_dir($from_path))
 {
chdir($from_path);
$handle=opendir('.');

while (($file = readdir($handle))!==false)
{
 if (($file != .)  ($file != ..)) {
  if (is_dir($file))
  {
  rec_copy ($from_path.$file./,  $to_path.$file./);
   chdir($from_path);
  }else{
#  echo error if (is_dir($file))br;
  }
  if (is_file($file))
  {
  copy($from_path.$file, $to_path.$file);
  }else{
#  echo error copy($from_path.$file, $to_path.$file)br;
  }
 }#end (($file != .)
}#end while (($file

closedir($handle);
 }# end if (is_dir
 else{
# echo if (is_dir($from_path))br;
 }
}# end function

?


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




Re: [PHP] Formatting input text?

2002-03-16 Thread heinisch

At 16.03.2002  10:44, you wrote:

I wonder whether this is possible?

I would like to format a text input so that the first letter of the input (as
the user is typing it in) would automatically be converted to Uppercase
(capitals). Furthermore, if it is possible, I would like to pre-format the
date input type=text so that only numbers or dashes could be entered. I
really enjoyted this capablity in Paradox PAL language.

Does anything exist that would allow me to do this in PHP?

An example:

Code
tdbSurname/b/td
tdinput type=text name=rap/td

Screen (and into database)
Surname: blackwould be converted as they type to  Surname: Black

Any suggestions or advice would be greatly appreciated.
Suggestion:
a.)try this in JavaScript on the client side, you have to check if the 
valid chars/numbers are entered
otherwise the page will be not send.
b.) check the form, whem the page arrives on the server, and if the vals 
are not correct, send
the page back to be corrected by the user.
HTH Oliver


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




[PHP] PHPMyAdmin: [PHP] From: Newman, using and ' or ` in My Sql

2002-03-16 Thread jtjohnston

 The standard quote (') should be used to delimit string literals in MYSQL
 statements. Use it to surround strings you're inserting into or comparing
 against VARCHARs, CHARs, TEXTs, etc.

  $sql = UPDATE mytable SET name='Best Table Of All' WHERE id=3;

That is ok if you call MySQL in your .php. But in PHPMyAdmin, it seems preferable to 
use `.


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




Re: [PHP] Formatting input text?

2002-03-16 Thread Edward van Bilderbeek - Bean IT

As Oliver says, it is possible in PHP, but then you have to do it, AFTER the
form is submitted... Just do some regular expressions on your data before
displaying / storing it...

Edward


- Original Message -
From: Andre Dubuc [EMAIL PROTECTED]
To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:49 PM
Subject: Re: [PHP] Formatting input text?


 Hi Edward,

 If I wanted to avoid Javascript, could I still accomplish this in PHP?

 Regards, Andre


 On Saturday 16 March 2002 13:33, you wrote:
  Just use javascript... (be careful, what works with IE, doesn't
  automatically work with Netscape)...
 
  Greets,
 
  Edward
 
  - Original Message -
  From: Andre Dubuc [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, March 16, 2002 4:44 PM
  Subject: [PHP] Formatting input text?
 
   I wonder whether this is possible?
  
   I would like to format a text input so that the first letter of the
input
 
  (as
 
   the user is typing it in) would automatically be converted to
Uppercase
   (capitals). Furthermore, if it is possible, I would like to pre-format
   the date input type=text so that only numbers or dashes could be
   entered. I really enjoyted this capablity in Paradox PAL language.
  
   Does anything exist that would allow me to do this in PHP?
  
   An example:
  
   Code
   tdbSurname/b/td
   tdinput type=text name=rap/td
  
   Screen (and into database)
   Surname: blackwould be converted as they type to  Surname:
Black
  
   Any suggestions or advice would be greatly appreciated.
   Tia,
   Andre
  
  
   --
   Please pray the Holy Rosary to end the holocaust of abortion.
   Remember in your prayers the suffering souls in Purgatory.
  
   May God bless you abundantly in His love!
  
   For a free Cenacle Scriptural Rosary Booklet --
 
  http://www.webhart.net/csrb/
 
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php

 --
 Please pray the Holy Rosary to end the holocaust of abortion.
 Remember in your prayers the suffering souls in Purgatory.

 May God bless you abundantly in His love!

 For a free Cenacle Scriptural Rosary Booklet --
http://www.webhart.net/csrb/

 --
 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] Weird INCLUDE / mySQL problem

2002-03-16 Thread Dan Tappin

I have a simple INCLUDE file that creates a default dynamic tab style table
of contact for the top of each of my pages.

I wanted a solution where I could control the content by simply changing an
integer in mySQL indicating weather a tab was visible or not. It works but I
now have a strange problem.

Each entry in the DB has unique id but I recently added a 'order' value. For
example: Home = 10, Buy = 20, Sell = 30, Contact = 40. Well I added Manage =
35 so that I could sort my results and control the order with our re-writing
code.

The problem is that when I use the include the sort order gets lost. In all
cases I have the ORDER BY toc_order which are my 10,20,30,35 values in each
row.

Can anyone shed some light on this issue?

Here is a link for an example:

http://test.oilfiielddepot.com/test

Please CC me as I am on digest mode.

Thanks,

Dan Tappin ([EMAIL PROTECTED])


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




Re: [PHP] where is http_cookie ?

2002-03-16 Thread Bas Jobsen

Hi,

Well okay. But now i'm using this code:

test.php (http://www.tgp2stats.com/test.php):
--
?
$test=bas;
session_start();
session_register(test);
header(Location: test2.php);
?
--
test2.php (http://www.tgp2stats.com/test2.php):
--
?
session_start();
session_register(test);
echo test: .$test;
phpinfo();
?
--

For netscape(linux) $test print bas, but is empty when using Konquerer, 
Opera or even IE (on a win98 system).

This code will work for all this browsers with php4.1.2 as module.
Has this something to do with CGI vs module? Or is there a configuration 
mistake?

Bas







Op zaterdag 16 maart 2002 18:02, schreef Jackson Miller:
 HTTP COOKIE will only be set
 if you have a cookie from that
 domain on your computer.  Try
 setting a cookie with
 setcookie() before your
 phpinfo() line on your
 test.php page.

 Hope this helps.


 -Jackson

 -Original Message-
 From: Bas Jobsen
 [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, March 16, 2002
 11:36 AM
 To: PHP General
 Subject: [PHP] where is
 http_cookie ?


 Hello,

 I have installed php 4.1.2. as
 a cgi module.
 But http_cookie isn't set. I
 don' know whats wrong.
 You can find the output of
 phpinfo() at
 http://www.tgp2stats.com/test.
 php

 Tnx,

 Bas Jobsen

 --
 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: Help Out A Newbie In Configuring PHP.INI

2002-03-16 Thread Dr. Shim

Well, I was stupid posting this question anyway. Don't worry about my
problem. I have it fixed. =)

Again, I will be more careful not to repeat posts (or post things I can find
the answer for somewhere else).

---Original Message---

Well, aroung 14 Feb I ended up saying this to an address that might or
might not be yours :-):




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




[PHP] From: Newman, PHP on non PHP servers?

2002-03-16 Thread Philip J. Newman

Ok say I have a top ten list of something in a MySql db on server lisa.philipnz.com 
which runs php scripts.  Is it possable to call, using a javascript information from 
say

http://www.geocities.com/philip_newman/ this list, will the PHP exacute on 
lisa.philipnz.com when the script is requested from another server page.

Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]
ICQ# 20482482
+64 25 6144012



Re: [PHP] Formatting input text?

2002-03-16 Thread Jason Wong

On Saturday 16 March 2002 23:44, Andre Dubuc wrote:
 I wonder whether this is possible?

 I would like to format a text input so that the first letter of the input
 (as the user is typing it in) would automatically be converted to Uppercase
 (capitals). Furthermore, if it is possible, I would like to pre-format the
 date input type=text so that only numbers or dashes could be entered. I
 really enjoyted this capablity in Paradox PAL language.

 Does anything exist that would allow me to do this in PHP?

 An example:

 Code
 tdbSurname/b/td
 tdinput type=text name=rap/td

 Screen (and into database)
 Surname: blackwould be converted as they type to  Surname: Black

 Any suggestions or advice would be greatly appreciated.

Wrong place! PHP is a server-side language. What you need requires 
client-side -- Javascript or Java.



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
People who go to conferences are the ones who shouldn't.
*/

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




Re: [PHP] Targetted redirection?

2002-03-16 Thread anders nawroth

I use this code to break out of frames:

if (top.frames.length!=0)
top.location=self.document.location;

Put this code in the head section between script tags.
If the document isn't on top, it soon will be.
(This solution slows the loading of the page a bit, the browser will
have to go thru the page once more, I think.)

Anders

- Ursprungligt meddelande - 
Från: Brinkman, Theodore [EMAIL PROTECTED]
Till: PHP List [EMAIL PROTECTED]
Skickat: den 15 mars 2002 17:27
Ämne: RE: [PHP] Targetted redirection?


 OK, If I understand correctly, the following scenario would work?
 
 Given: My site is being brought up inside somebody else's (say
 about.com)frameset.  [We'll call this page about.html]
 Given: I want my main page (index.html) to break out of the frames in the
 about.html page.  
 
 Solution: My main page (index.html) should send header('Window-target:
 _Top');
 
 So, if I use frames, and I want to keep my frameset page out of someone
 else's frame, I should send that header for my frameset page?
 
 Is this correct?
 
 - Theo
 
 
 -Original Message-
 From: Analysis  Solutions [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 10:27 AM
 To: PHP List
 Subject: Re: [PHP] Targetted redirection?
 
 
 Hi Folks:
 
 Okay, here's what I'm talking about...  A sample system.  Four files.
 
 index.php main page holding the frameset.  frameset has two
   frames.  one on left.  one on right.
 left.php  navigation menu that goes in the left hand frame
 right.php content in right hand frame.  this page is the default
   one that comes up in the initial frameset.
 right2.phpanother page for the right hand frame
 
 
 * index.php **
 
 ?php
 #   This has no effect.
 #   header('Window-target: _top');
 ?
 
 html
 headtitleindex page/title/head
 frameset COLS=120,*
 FRAME SRC=left.php name=menu scrolling=no
 frame src=right.php name=content
 /frameset
 /html
 
 
 * left.php **
 
 ?php
 #   Turning this on will jump this page out of the frames.
 #   header('Window-target: _top');
 ?
 
 htmlheadtitlethe menu/title/headbody
 a href=right.php target=contentright/a
 br /a href=right2.php target=contentright 2/a
 /body/html
 
 
 * right.php **
 
 ?php
 #   Turning this on will jump this page out of the frames.
 #   header('Window-target: _top');
 ?
 
 HTMLHEADTITLERight/TITLE/HEADBODY
 Hi there. This is the main content page in the right frame.
 /BODY/HTML
 
 
 * right2.php **
 
 ?php
 #  This has no effect.
 #  header('Window-target: _top');
 ?
 
 HTMLHEADTITLERight 2/TITLE/HEADBODY
 Hi there. This is the secondary content page in the right frame.
 /BODY/HTML
 
 
 
 Now, put all those files on your machine.  Hit index.php and you'll see 
 everything normally.  Then, uncomment the header function in left.php or 
 right.php and you'll see that page jump out of the frames.  But, turn 
 the header on in index.php or index2.php and you'll still be in the 
 frames.
 
 Enjoy,
 
 --Dan
 
 -- 
 PHP scripts that make your job easier
   http://www.analysisandsolutions.com/code/
  SQL Solution  |  Layout Solution  |  Form Solution
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 
 -- 
 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] Success Using PEAR?

2002-03-16 Thread Bryan Henry

anyone had success using PEAR?

I have read the documentation and been trying to use the PEAR
files that came with PHP 4.1.2 , PEAR cvs and PHP4/PEAR cvs 
with no success.  

I wish there was some updated documentation, and more explanation 
on which files to use for stable development.  Every answer I 
get from people developing PEAR is vague and contradictory.

~ b r y a n

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




Re: [PHP] From: Newman, PHP on non PHP servers?

2002-03-16 Thread heinisch

At 17.03.2002  08:02, you wrote:

Ok say I have a top ten list of something in a MySql db on server 
lisa.philipnz.com which runs php scripts.  Is it possable to call, using a 
javascript information from say

http://www.geocities.com/philip_newman/ this list, will the PHP exacute on 
lisa.philipnz.com when the script is requested from another server page.
why don´t you just

html
frameset...
frame src=http://www.geocities.com/philip_newman/ 
your_script_page.php3?your_parameters
/frameset
frameset could be just the whole page.
But there could be a better way

HTH Oliver




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




[PHP] php.ini and fixing timeouts

2002-03-16 Thread DigitalKoala

hi folks,

I'm running a php script from a console - it includes quite a lot of heavy
database queries - and takes a while to run.  Problem is that the the script
keeps on timing out and I get

Fatal error:  Maximum execution time of 30 seconds exceeded ...

I've set the MAX EXECUTION time in php.ini to 3 - but php doesn't seem
to be reading it..

Any ideas?

thanks!



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




Re: [PHP] From: Newman, PHP on non PHP servers?

2002-03-16 Thread Michael Geier

create a page on the PHP server that returns the results as an html page...
than use an include or frameset to put the results into the geocities page...

if it wasn't a geocities site, you could use an SSI include or PHP include.
-- 
Michael Geier
CDM Sports, Inc. - Systems Administrator
email: [EMAIL PROTECTED]

Quoting Philip J. Newman [EMAIL PROTECTED]:

 Ok say I have a top ten list of something in a MySql db on server
 lisa.philipnz.com which runs php scripts.  Is it possable to call, using a
 javascript information from say
 
 http://www.geocities.com/philip_newman/ this list, will the PHP exacute on
 lisa.philipnz.com when the script is requested from another server page.
 
 Philip J. Newman
 PhilipNZ :: Design Solutions
 http://www.philipnz.com/
 [EMAIL PROTECTED]
 ICQ# 20482482
 +64 25 6144012
 


-
This mail sent through CDM Sports Webmail.

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




Re: [PHP] Update: [PHP] Weird?

2002-03-16 Thread scott furt

I meant, have you created a physical directory
named $date?

That's your problem.  There's no directory
named $date on your computer, and you're
trying to write files into a non-existent
directory.

jtjohnston wrote:
 I have created date :)
 $date = date (MD);
 That's not it. It seems to fail at one level or another, I think, becuase the
 function calls itself - and probably gets lost somehow.
 John
 
 
... i think you might have to create the
$date directory before writing a file to it.
writing to /tmp/dir/file.txt will fail if
the directory dir doesn't exist.

 
 ?php
 
 ###
 $date = date (MD);
 ###
 ###  Don't forget trailing slash  #
 ###
 $from_path = c:\\program files\\easyphp\\ccl_www\\;
 $to_path = c:\\ccl_www\\.$date.ccl_www\\;
 ###
 
 if(!is_dir($from_path))
 {
 echo failed;
 exit;
 }else{
 rec_copy($from_path, $to_path);
 echo files copies from $from_path and backed up to $to_path;
 }
 
 #
 function rec_copy ($from_path, $to_path) {
 if(!is_dir($to_path))
 mkdir($to_path, 0777);
 
 $this_path = getcwd();
  if (is_dir($from_path))
  {
 chdir($from_path);
 $handle=opendir('.');
 
 while (($file = readdir($handle))!==false)
 {
  if (($file != .)  ($file != ..)) {
   if (is_dir($file))
   {
   rec_copy ($from_path.$file./,  $to_path.$file./);
chdir($from_path);
   }else{
 #  echo error if (is_dir($file))br;
   }
   if (is_file($file))
   {
   copy($from_path.$file, $to_path.$file);
   }else{
 #  echo error copy($from_path.$file, $to_path.$file)br;
   }
  }#end (($file != .)
 }#end while (($file
 
 closedir($handle);
  }# end if (is_dir
  else{
 # echo if (is_dir($from_path))br;
  }
 }# end function
 
 ?
 
 




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




Re: [PHP] Driving me nuts, need one second of your time

2002-03-16 Thread scott furt

It's not absurd at all.

What is absurd is that you're coding without
checking for any error conditions :-)

As a rule of thumb, if a function returns a
success flag, check it.  it'll immediately
cut out about 90% of all weird errors.

cosmin laslau wrote:
 ?
 $query = SELECT * from mytable;
 $result = mysql_db_query(db, $query);
 
 while ($myarray = mysql_fetch_array($result))
 {
 $title = $myarray[title];
 echo $titlebr;
 }
 ?
 
 Can someone PLEASE tell me why the coding above gives the following error:
 
 
 Warning: Supplied argument is not a valid MySQL result resource in 
 /var/web/somesite.com/html/index.php on line 5
 
 
 It's absurd. It's driving me nuts. I'm about to introduce my computer to 
 the pavement 40 feet below.
 
 Thanks in advance for whoever sees what I am sure is a glaring and 
 obvious flaw in the coding. I've been looking at it for an hours and 
 just can't get anything from where I'm standing, maybe a different 
 perpective will help.
 
 
 
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
 
 




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




Re: [PHP] Success Using PEAR?

2002-03-16 Thread James Arthur

On Saturday 16 Mar 2002 20:32, Bryan Henry wrote:
 anyone had success using PEAR?

 I have read the documentation and been trying to use the PEAR
 files that came with PHP 4.1.2 , PEAR cvs and PHP4/PEAR cvs
 with no success.

 I wish there was some updated documentation, and more explanation
 on which files to use for stable development.  Every answer I
 get from people developing PEAR is vague and contradictory.



What part of PEAR?

I use the DB,DB-pager and RSS functions from PEAR. They seem to work well.

--jaa

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




Re: [PHP] regular expression for (NOT 'word')

2002-03-16 Thread scott furt

Try this... it should only print out Some webpage data

$text = 
script somethingscript data./script
Some webpage data
script somethinganother script data /script
;

print preg_replace('/script (.*?)/script(.*?)\/script/',
   '', $text);


Ando Saabas wrote:
 Ok let me explain my problem further some. I need the regular expression to
 purify the html page from script tags:
 I used: $file = eregi_replace((script(.*).*/script),  , $file);
 Now this works fine, until theres a webpage like:
 
 script somethingscript data./script
 Some webpage data
 script somethinganother script data /script
 
 so the regexp above replaces everything between first script  and last
 /script ie the webpage data also.
 So i thought to change the regexp to something like this:  $file =
 eregi_replace((script(.*)NOT(script)/script),  , $file);
 where NOT(script) would match everything that contains word script
 
 
 
 
 Rick Emery wrote:
 
 
the best you can do is:

?php
$a = this has php  in the string;
if( ! ereg(php, $a ) )
{ print a: not in string; }
$a = this has in the string;
if( ! ereg(php, $a ) )
{ print b: not in string; }
?

-Original Message-
From: Ando Saabas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regular expression for (NOT 'word')

how would i build a regular expression in php that would match
everything but the given word. For example, match the string only if
there isnt a word 'php' in the string.
I understand i can list characters i dont want to see in the string:
[^php].
but this means there cant be any p or h in the string. And ^(php) checks
if the string starts with 'php'.
How should i do it?

--
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] From: Newman, PHP on non PHP servers?

2002-03-16 Thread Philip J. Newman

I'm thinking of more around the site of haveing something that can be
included in peoples homepages like a top ten list that changes, but they
don't have to change it ... thats why I was thinking about javascript.

script language=JavaScript
src=http://lisa.philipnz.com/javatopten.php;/script

and javatopten.php returns document.write(' Blar Blar');

- Original Message -
From: Michael Geier [EMAIL PROTECTED]
To: Philip J. Newman [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 9:06 AM
Subject: Re: [PHP] From: Newman, PHP on non PHP servers?


 create a page on the PHP server that returns the results as an html
page...
 than use an include or frameset to put the results into the geocities
page...

 if it wasn't a geocities site, you could use an SSI include or PHP
include.
 --
 Michael Geier
 CDM Sports, Inc. - Systems Administrator
 email: [EMAIL PROTECTED]

 Quoting Philip J. Newman [EMAIL PROTECTED]:

  Ok say I have a top ten list of something in a MySql db on server
  lisa.philipnz.com which runs php scripts.  Is it possable to call, using
a
  javascript information from say
 
  http://www.geocities.com/philip_newman/ this list, will the PHP exacute
on
  lisa.philipnz.com when the script is requested from another server page.
 
  Philip J. Newman
  PhilipNZ :: Design Solutions
  http://www.philipnz.com/
  [EMAIL PROTECTED]
  ICQ# 20482482
  +64 25 6144012
 


 -
 This mail sent through CDM Sports Webmail.






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




[PHP] problems with 4.1.2 build

2002-03-16 Thread Phil Glatz

I'm trying to build PHP 4.1.2 with an existing static Apache 1.3.23 
installation, and am having some resolution problems I haven't seen before.

This is on a dusty old Free BSD 2.2.2 system, but I was able to build 4.1.1 
with no problems with the same configuration.  It uses gcc version 2.7.2.1 
--- yes, I know I should upgrade the OS, but since it was able to make 
4.1.1 ok a few weeks ago, I'm guessing that isn't the problem.  I'm 
compiling in postgres and gd support, but have the same problem with them out.


I followed the steps (minimal apache, php, fuill apache), running configure 
each time and doing a make clean.

During the PHP make I see:
gcc -I. -I/usr/local/src/php-4.1.2/sapi/apache -I/usr/local/src/php-4.1.2/main
-I/usr/local/src/php-4.1.2 -I/usr/local/src/apache_1.3.23/src/include
-I/usr/local/src/apache_1.3.23/src/os/unix -I/usr/local/src/php-4.1.2/Zend
-I/usr/local/src/php-4.1.2/ext/xml/expat 
-I/usr/local/src/apache_1.3.23/src/include
-I/usr/local/src/apache_1.3.23/src/os/unix -I/usr/local/src/php-4.1.2/TSRM
-g -O2  -c mod_php4.c  touch mod_php4.lo
In file included from /usr/local/src/apache_1.3.23/src/include/httpd.h:72,
  from mod_php4.c:32:
/usr/local/src/apache_1.3.23/src/include/ap_config.h:1386: warning: 
`XtOffsetOf' redefined
/usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location of 
the previous definition

I was able to fix this by editing main/php.h and removing the extra spaces, 
so the definition was the same as in the other files.

I tried an Apache build, but it gave me:
=== src/modules/php4
gcc -c  -I../../os/unix -I../../include   -funsigned-char
-I/usr/local/src/php-4.1.2 -I/usr/local/src/php-4.1.2/main 
-I/usr/local/src/php-4.1.2/main
-I/usr/local/src/php-4.1.2/Zend -I/usr/local/src/php-4.1.2/Zend
-I/usr/local/src/php-4.1.2/TSRM -I/usr/local/src/php-4.1.2/TSRM 
-I/usr/local/src/php-4.1.2
-DUSE_EXPAT -I../../lib/expat-lite `../../apaci` -fpic -DSHARED_MODULE
mod_php4.c  mv mod_php4.o mod_php4.so-o
In file included from ../../include/httpd.h:72,
  from mod_php4.c:32:
../../include/ap_config.h:1386: warning: `XtOffsetOf' redefined
/usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location of 
the previous definition
rm -f libphp4.so
gcc -shared -o libphp4.so mod_php4.so-o 
libmodphp4.a  -L/usr/local/src/gd-1.8.4/ 
-L/usr/local/postgres/lib  -L/usr/local/src/gd-1.8.4/ 
-L/usr/local/postgres/lib -Lmodules/php4 -L../modules/php4 
-L../../modules/php4 -lmodphp4   -lpq -lgd -lcrypt -lbind 
-lm  -lcrypt   -lcrypt
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cd9 for 
_zend_unblock_interruptions
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1ccd for 
_alloc_globals
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cc0 for 
_alloc_globals

followed by hundreds of similar errors...

thanks



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




RE: [PHP] problems with 4.1.2 build

2002-03-16 Thread Stephano Mariani

Upgrade binutils?

Stephano Mariani

 -Original Message-
 From: Phil Glatz [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, 16 March 2002 10:30 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] problems with 4.1.2 build
 
 I'm trying to build PHP 4.1.2 with an existing static Apache 1.3.23
 installation, and am having some resolution problems I haven't seen
 before.
 
 This is on a dusty old Free BSD 2.2.2 system, but I was able to build
 4.1.1
 with no problems with the same configuration.  It uses gcc version
2.7.2.1
 --- yes, I know I should upgrade the OS, but since it was able to make
 4.1.1 ok a few weeks ago, I'm guessing that isn't the problem.  I'm
 compiling in postgres and gd support, but have the same problem with
them
 out.
 
 
 I followed the steps (minimal apache, php, fuill apache), running
 configure
 each time and doing a make clean.
 
 During the PHP make I see:
 gcc -I. -I/usr/local/src/php-4.1.2/sapi/apache -I/usr/local/src/php-
 4.1.2/main
 -I/usr/local/src/php-4.1.2 -I/usr/local/src/apache_1.3.23/src/include
 -I/usr/local/src/apache_1.3.23/src/os/unix
-I/usr/local/src/php-4.1.2/Zend
 -I/usr/local/src/php-4.1.2/ext/xml/expat
 -I/usr/local/src/apache_1.3.23/src/include
 -I/usr/local/src/apache_1.3.23/src/os/unix
-I/usr/local/src/php-4.1.2/TSRM
 -g -O2  -c mod_php4.c  touch mod_php4.lo
 In file included from
/usr/local/src/apache_1.3.23/src/include/httpd.h:72,
   from mod_php4.c:32:
 /usr/local/src/apache_1.3.23/src/include/ap_config.h:1386: warning:
 `XtOffsetOf' redefined
 /usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location
of
 the previous definition
 
 I was able to fix this by editing main/php.h and removing the extra
 spaces,
 so the definition was the same as in the other files.
 
 I tried an Apache build, but it gave me:
 === src/modules/php4
 gcc -c  -I../../os/unix -I../../include   -funsigned-char
 -I/usr/local/src/php-4.1.2 -I/usr/local/src/php-4.1.2/main
 -I/usr/local/src/php-4.1.2/main
 -I/usr/local/src/php-4.1.2/Zend -I/usr/local/src/php-4.1.2/Zend
 -I/usr/local/src/php-4.1.2/TSRM -I/usr/local/src/php-4.1.2/TSRM
 -I/usr/local/src/php-4.1.2
 -DUSE_EXPAT -I../../lib/expat-lite `../../apaci` -fpic -DSHARED_MODULE
 mod_php4.c  mv mod_php4.o mod_php4.so-o
 In file included from ../../include/httpd.h:72,
   from mod_php4.c:32:
 ../../include/ap_config.h:1386: warning: `XtOffsetOf' redefined
 /usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location
of
 the previous definition
 rm -f libphp4.so
 gcc -shared -o libphp4.so mod_php4.so-o
 libmodphp4.a  -L/usr/local/src/gd-1.8.4/
 -L/usr/local/postgres/lib  -L/usr/local/src/gd-1.8.4/
 -L/usr/local/postgres/lib -Lmodules/php4 -L../modules/php4
 -L../../modules/php4 -lmodphp4   -lpq -lgd -lcrypt -lbind
 -lm  -lcrypt   -lcrypt
 ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cd9 for
 _zend_unblock_interruptions
 ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1ccd for
 _alloc_globals
 ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cc0 for
 _alloc_globals
 
 followed by hundreds of similar errors...
 
 thanks
 
 
 
 --
 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] mktime on W2K?

2002-03-16 Thread Jeff Oien

I use this on a Unix server to get yesterday's date if it's a
Saturday:

if ($day == '6') {
$today1 = date(Y:m:d, mktime(0,0,0,$month,$day-1,$year));
}

But on my Windows 2000 machine it thinks it's 1999:12:05.
How can I do this on Windows? Thanks.
Jeff Oien

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




Re: [PHP] php.ini and fixing timeouts

2002-03-16 Thread heinisch

At 16.03.2002  20:59, you wrote:
hi folks,

I'm running a php script from a console - it includes quite a lot of heavy
database queries - and takes a while to run.  Problem is that the the script
keeps on timing out and I get

Fatal error:  Maximum execution time of 30 seconds exceeded ...

I've set the MAX EXECUTION time in php.ini to 3 - but php doesn't seem
to be reading it..

Any ideas?

 set_time_limit (int seconds);

from the manual:
When called, set_time_limit() restarts the timeout counter from zero. In 
other words, if the timeout is the default 30 seconds, and 25 seconds into 
script execution a call such as set_time_limit(20) is made, the script will 
run for a total of 45 seconds before timing out.

Note that set_time_limit() has no effect when PHP is running in safe mode. 
There is no workaround other than turning off safe mode or changing the 
time limit in the configuration file.
HTH Oliver


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




[PHP] retrieving remote web page

2002-03-16 Thread Andy Aldridge

Hi,

I'm wanting to retrieve a remote page and extract information from it to
insert into my own page. I know that this can be done with fopen, however
the page I am wishing to retrieve is generated with a POSTed form.

Is there any way that I can retrieve a page that has been created by the
filling in of a form (using the POST method)?

Thanks for any help...

-Andy



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




[PHP] Getting TOTAL DB Size of a MySQL Database

2002-03-16 Thread eric.coleman

Anyone have a small snippet I could use to get the total size of any certin
MySQL database..

Just want to disply it in my browser using a little php script, have any
ideas?

Thanks,
Eric


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




[PHP] OBJECT£ºWHAT'S THE RALATION BETWEEN A,B AND C?

2002-03-16 Thread bob

?php
class A
{
function A($i)
{
$this-value = $i;
// try to figure out why we do not need a reference here
$this-b = new B($this);
}

function createRef()
{
$this-c = new B($this);
}

function echoValue()
{
echo br,class ,get_class($this),': ',$this-value;
}
}


class B
{
function B($a)
{
$this-a = $a;
}

function echoValue()
{
echo br,class ,get_class($this),': ',$this-a-value;
}
}

// try to undestand why using a simple copy here would yield
// in an undesired result in the *-marked line
$a =new A(10);
$a-createRef();

$a-echoValue();
$a-b-echoValue();
$a-c-echoValue();

$a-value = 11;

$a-echoValue();
$a-b-echoValue(); // *
$a-c-echoValue();

?

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




[PHP] Sessions and enable-trans-sid

2002-03-16 Thread lists

I have compiled php with the enable-trans-sid (for the site I am using I 
can NOT use cookies)

when I start a session or store something in _SESSION['varname']  varname 
can not be accessed on other pages

nor is there a file in the /tmp file

nor does my URI change with a session id


Any Ideas,

Michael


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




RE: [PHP] retrieving remote web page

2002-03-16 Thread Dave

have a look at CURL

Dave

-Original Message-
From: Andy Aldridge [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 16, 2002 7:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] retrieving remote web page


Hi,

I'm wanting to retrieve a remote page and extract information from it to
insert into my own page. I know that this can be done with fopen, however
the page I am wishing to retrieve is generated with a POSTed form.

Is there any way that I can retrieve a page that has been created by the
filling in of a form (using the POST method)?

Thanks for any help...

-Andy



-- 
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] Again, and Again, and AGAIN!

2002-03-16 Thread Dr. Shim

I've tried repediately to have a PHP script validate a form when the form is
submitted. I'm quite new to PHP, and I'd really appreciate the help anybody
could give me. I've been stuck on this problem far to long.

I have a form (here's the code):

form method=post action=?php $PHP_SELF; ?
  Username:
  input type=text name=username maxlength=255 value=?
$HTTP_POST_VARS['username']; ?
  br
  Password:
  input type=text name=password maxlength=8 value=?
$HTTP_POST_VARS['password']; ?
  br
  input type=submit name=login value=Log In
onclick=document.refresh()
  br
  br
/form

And right underneath the form code, I have my PHP script:

?php
 if (isset($login)) {
  insert();
 }

 function insert() {
  $db = odbc_connect('mydatabase', 'myusername', 'mypassword');

  if(!$db) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbr~~~br$PHP_ERRORbr$dbbr~~~;
  }

  $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
AND fldPassword = '$password';
  $cursor = odbc_exec($db, $SQLQuery);

  if (!$cursor) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbrbr . odbc_errormsg($db) . br~~~;
  }
 }
   ?

What I'm trying to achieve here is that when the user fills out the form,
presses the Log In button, the script underneath validates and inserts the
data into a database.  Now, I click on the Log In button, nothing happens.

Could anybody please help me with this? I would really, really appreciat any
help.



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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Mike Gohlke

Dr. Shim wrote:

I've tried repediately to have a PHP script validate a form when the form is
submitted. I'm quite new to PHP, and I'd really appreciate the help anybody
could give me. I've been stuck on this problem far to long.

I have a form (here's the code):

form method=post action=?php $PHP_SELF; ?
  Username:
  input type=text name=username maxlength=255 value=?
$HTTP_POST_VARS['username']; ?

The shortcut is ?php =$blah?, not ?php $blah?

  br
  Password:
  input type=text name=password maxlength=8 value=?
$HTTP_POST_VARS['password']; ?
  br
  input type=submit name=login value=Log In
onclick=document.refresh()

document.submit() should do it, refresh() will just reload the page.

  br
  br
/form

And right underneath the form code, I have my PHP script:

?php
 if (isset($login)) {
  insert();
 }

 function insert() {
  $db = odbc_connect('mydatabase', 'myusername', 'mypassword');

  if(!$db) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbr~~~br$PHP_ERRORbr$dbbr~~~;
  }

  $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
AND fldPassword = '$password';
  $cursor = odbc_exec($db, $SQLQuery);

  if (!$cursor) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbrbr . odbc_errormsg($db) . br~~~;
  }
 }
   ?

What I'm trying to achieve here is that when the user fills out the form,
presses the Log In button, the script underneath validates and inserts the
data into a database.  Now, I click on the Log In button, nothing happens.

Could anybody please help me with this? I would really, really appreciat any
help.








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




[PHP] No Sense: [PHP] Update: [PHP] Weird?

2002-03-16 Thread jtjohnston

No!? $date is a string?!

$date = date (MD);

How does that make a difference?

$to_path = c:\\ccl_www\\.$date.\\ccl_www\\;

You want me to change it to:

$to_path = c:\\ccl_www\\$date\\ccl_www\\;

Does anyone follow why?

Scott Furt wrote:

 I meant, have you created a physical directory
 named $date?
 That's your problem.  There's no directory named $date on your computer, and
 you're
 trying to write files into a non-existent directory.

 jtjohnston wrote:
  I have created date :)
  $date = date (MD);
  That's not it. It seems to fail at one level or another, I think, becuase the
  function calls itself - and probably gets lost somehow.
  John
 
 
 ... i think you might have to create the
 $date directory before writing a file to it.
 writing to /tmp/dir/file.txt will fail if
 the directory dir doesn't exist.
 
 
  ?php
 
  ###
  $date = date (MD);
  ###
  ###  Don't forget trailing slash  #
  ###
  $from_path = c:\\program files\\easyphp\\ccl_www\\;
  $to_path = c:\\ccl_www\\.$date.ccl_www\\;
  ###
 
  if(!is_dir($from_path))
  {
  echo failed;
  exit;
  }else{
  rec_copy($from_path, $to_path);
  echo files copies from $from_path and backed up to $to_path;
  }
 
  #
  function rec_copy ($from_path, $to_path) {
  if(!is_dir($to_path))
  mkdir($to_path, 0777);
 
  $this_path = getcwd();
   if (is_dir($from_path))
   {
  chdir($from_path);
  $handle=opendir('.');
 
  while (($file = readdir($handle))!==false)
  {
   if (($file != .)  ($file != ..)) {
if (is_dir($file))
{
rec_copy ($from_path.$file./,  $to_path.$file./);
 chdir($from_path);
}else{
  #  echo error if (is_dir($file))br;
}
if (is_file($file))
{
copy($from_path.$file, $to_path.$file);
}else{
  #  echo error copy($from_path.$file, $to_path.$file)br;
}
   }#end (($file != .)
  }#end while (($file
 
  closedir($handle);
   }# end if (is_dir
   else{
  # echo if (is_dir($from_path))br;
   }
  }# end function
 
  ?
 
 

--
John Taylor-Johnston
-
  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Dr. Shim

I've changed

form method=post action=?php $PHP_SELF; ?

To

form method=post action=?php =$PHP_SELF; ?

And I get a parse error. Could you possibly help me correct this? (I'm a
newbie, so have pity on me. =)



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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Jason Wong

On Sunday 17 March 2002 11:46, Dr. Shim wrote:
 I've changed

 form method=post action=?php $PHP_SELF; ?

 To

 form method=post action=?php =$PHP_SELF; ?


 And I get a parse error. Could you possibly help me correct this? (I'm a
 newbie, so have pity on me. =)


Use:

  form method=post action=?php echo $PHP_SELF; ?


Also, please use a descriptive subject heading next time!


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Paul's Law:
You can't fall off the floor.
*/

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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Dr. Shim

Sorry about the subject heading.

I've put in

form method=post action=?php echo $PHP_SELF; ?

But still when I click on the Log In button, thing happens.



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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Dr. Shim

Oh, by the way, the if...then claus runs successfully, but the function
never is called. Am I wrong?




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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Jason Wong

On Sunday 17 March 2002 12:04, Dr. Shim wrote:
 Sorry about the subject heading.

 I've put in

 form method=post action=?php echo $PHP_SELF; ?

 But still when I click on the Log In button, thing happens.

Please post the rest of your code and also which version of PHP you're using.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Your lover will never wish to leave you.
*/

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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Dr. Shim

I'm using PHP 4.1.1 (for Windows). Here is *all* of my code.

html
head
titleAdministrative Log-In Page/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body bgcolor=#FF
Please enter your username and password below in the fields below.
form method=post action=?php echo $PHP_SELF; ?
  Username:
  input type=text name=username maxlength=255 value=?php echo
$HTTP_POST_VARS['username']; ?
  br
  Password:
  input type=text name=password maxlength=8 value=? echo
$HTTP_POST_VARS['password']; ?
  br
  input type=submit name=login value=Log In
  br
  br
/form
  ?php
 if (isset($login)) {
  insert();
  echo $login;
 }

 function insert() {
  $db = odbc_connect('IdentDatabase', 'root', '');

  if(!$db) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbr~~~br$PHP_ERRORbr$dbbr~~~;
  }

  $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
AND fldPassword = '$password';
  $cursor = odbc_exec($db, $SQLQuery);

  if (!$cursor) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbrbr . odbc_errormsg($db) . br~~~;
  }
 }
   ?
/body
/html



Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
On Sunday 17 March 2002 12:04, Dr. Shim wrote:
 Sorry about the subject heading.

 I've put in

 form method=post action=?php echo $PHP_SELF; ?

 But still when I click on the Log In button, thing happens.

Please post the rest of your code and also which version of PHP you're
using.


--
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Your lover will never wish to leave you.
*/



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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread pong-TC

[EMAIL PROTECTED] writes:
I'm using PHP 4.1.1 (for Windows). Here is *all* of my code.

html
head
titleAdministrative Log-In Page/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body bgcolor=#FF
Please enter your username and password below in the fields below.
form method=post action=?php echo $PHP_SELF; ?
  Username:
  input type=text name=username maxlength=255 value=?php echo
$HTTP_POST_VARS['username']; ?
  br
  Password:
  input type=text name=password maxlength=8 value=? echo
$HTTP_POST_VARS['password']; ?
  br
  input type=submit name=login value=Log In
  br
  br
/form

Hello Jason

If I were you, I would not use $HTTP_POST_VARS.. YOur form element like
this input type=text name=password maxlength=8 is good enough.  I
don't think you need this value=? echo
$HTTP_POST_VARS['password']; ?.   Also, make sure that echo $PHP_SELF
is output the form name or just put the form name directly.  Anything else
is fine.  Your isset condition should be provoked once clicked,  and call
the insert function.  It is very simple from my opinion.  I use PHP on IIS
also.

Hope, this would help.
Pong

  ?php
 if (isset($login)) {
  insert();
  echo $login;
 }

 function insert() {
  $db = odbc_connect('IdentDatabase', 'root', '');

  if(!$db) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbr~~~br$PHP_ERRORbr$dbbr~~~;
  }

  $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
AND fldPassword = '$password';
  $cursor = odbc_exec($db, $SQLQuery);

  if (!$cursor) {
   echo An error has occured. Please a
href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
me.brbrbr . odbc_errormsg($db) . br~~~;
  }
 }
   ?
/body
/html




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




[PHP] Re: No Sense: [PHP] Update: [PHP] Weird?

2002-03-16 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 No!? $date is a string?!
 
 $date = date (MD);
 
 How does that make a difference?
 
 $to_path = c:\\ccl_www\\.$date.\\ccl_www\\;
 
 You want me to change it to:
 
 $to_path = c:\\ccl_www\\$date\\ccl_www\\;
 
 Does anyone follow why?
 
 Scott Furt wrote:
 
  I meant, have you created a physical directory
  named $date?
  That's your problem.  There's no directory named $date on your computer, and
  you're
  trying to write files into a non-existent directory.
 
  jtjohnston wrote:
   I have created date :)
   $date = date (MD);
   That's not it. It seems to fail at one level or another, I think, becuase the
   function calls itself - and probably gets lost somehow.
   John
  
  
  ... i think you might have to create the
  $date directory before writing a file to it.
  writing to /tmp/dir/file.txt will fail if
  the directory dir doesn't exist.
  

I think what is being suggested is that you may not have a directory 
named whatever c:\\ccl_www\\.$date.\\ccl_www\\ expands to; frinstance 
if $date were 0203 you would need to have an existing directory 
c:\\ccl_www\\0203\\ccl_www\\

Of course, I could be misunderstanding...

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Jason Wong

On Sunday 17 March 2002 12:12, Dr. Shim wrote:

 I'm using PHP 4.1.1 (for Windows). Here is *all* of my code.

 html
 head
 titleAdministrative Log-In Page/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head

 body bgcolor=#FF
 Please enter your username and password below in the fields below.
 form method=post action=?php echo $PHP_SELF; ?
   Username:
   input type=text name=username maxlength=255 value=?php echo
 $HTTP_POST_VARS['username']; ?

You're using 4.1.1, $HTTP_POST_VARS{} has been replaced by $_POST[] (see 
changelog/history/php.ini for details).

   br
   Password:
   input type=text name=password maxlength=8 value=? echo
 $HTTP_POST_VARS['password']; ?
   br
   input type=submit name=login value=Log In
   br
   br
 /form
   ?php
  if (isset($login)) {
   insert();
   echo $login;
  }

  function insert() {
   $db = odbc_connect('IdentDatabase', 'root', '');

   if(!$db) {
echo An error has occured. Please a
 href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to
 me.brbr~~~br$PHP_ERRORbr$dbbr~~~;
   }

   $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username'
 AND fldPassword = '$password';

If register_globals is not ON, then $username  $password will not have been 
defined. You have to reference them as $_POST['username']. But as you're 
referencing an array from inside a double-quoted string then just 
$_POST[username] will do:

  $SQLQuery = SELECT fldID FROM tblUsers 
WHERE fldUsername = '$_POST[$username]'
  AND fldPassword = '$_POST[$password]';


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
You'd like to do it instantaneously, but that's too slow.
*/

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




php-general Digest 17 Mar 2002 05:16:56 -0000 Issue 1231

2002-03-16 Thread php-general-digest-help


php-general Digest 17 Mar 2002 05:16:56 - Issue 1231

Topics (messages 88750 through 88803):

Re: server load
88750 by: Andrey Hristov
88753 by: caspar kennerdale
88754 by: Andrey Hristov
88755 by: caspar kennerdale
88757 by: Andrey Hristov
88760 by: Andrey Hristov

Re: where is http_cookie ?
88751 by: Ray Hunter
88769 by: Bas Jobsen

Re: PHP Document not found
88752 by: Ray Hunter

Download do Manual
88756 by: Márcio Santos

Re: Problem with sessions.
88758 by: Tom Rogers
88762 by: Edward van Bilderbeek - Bean IT

Re: Variable Variables and Mulitdimensional Arrays
88759 by: Joe Webster

Re: Formatting input text?
88761 by: Edward van Bilderbeek - Bean IT
88763 by: Andre Dubuc
88765 by: heinisch.creaction.de
88767 by: Edward van Bilderbeek - Bean IT
88772 by: Jason Wong

Update: [PHP] Weird?
88764 by: jtjohnston
88778 by: scott furt

PHPMyAdmin: [PHP] From: Newman, using  and ' or ` in My Sql
88766 by: jtjohnston

Weird INCLUDE / mySQL problem
88768 by: Dan Tappin

Re: Help Out A Newbie In Configuring PHP.INI
88770 by: Dr. Shim

Re: Newman, PHP on non PHP servers?
88771 by: Philip J. Newman
88775 by: heinisch.creaction.de
88777 by: Michael Geier
88782 by: Philip J. Newman

Re: Targetted redirection?
88773 by: anders nawroth

Success Using PEAR?
88774 by: Bryan Henry
88780 by: James Arthur

php.ini and fixing timeouts
88776 by: DigitalKoala
88786 by: heinisch.creaction.de

Re: Driving me nuts, need one second of your time
88779 by: scott furt

Re: regular expression for (NOT 'word')
88781 by: scott furt

problems with 4.1.2 build
88783 by: Phil Glatz
88784 by: Stephano Mariani

mktime on W2K?
88785 by: Jeff Oien

retrieving remote web page
88787 by: Andy Aldridge
88791 by: Dave

Getting TOTAL DB Size of a MySQL Database
88788 by: eric.coleman.zaireweb.com

OBJECT£ºWHAT'S THE RALATION BETWEEN A,B AND C?
88789 by: bob

Sessions and enable-trans-sid
88790 by: lists.mhess.qn.net

Again, and Again, and AGAIN!
88792 by: Dr. Shim
88793 by: Mike Gohlke
88795 by: Dr. Shim
88796 by: Jason Wong
88797 by: Dr. Shim
88798 by: Dr. Shim
88799 by: Jason Wong
88800 by: Dr. Shim
88801 by: pong-TC
88803 by: Jason Wong

No Sense: [PHP] Update: [PHP] Weird?
88794 by: jtjohnston
88802 by: David Robley

Administrivia:

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

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

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


--

---BeginMessage---

Flex - the tools that parses the code skips everything between /* and */ and for this 
no token is given back. Of course if you don't
have 5kb comments Flex will be a little faster but possibly few %.

Regards,
Andrey

- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:13 PM
Subject: [PHP] server load


 Would a 10kb file which has 5kb of comments take longer to process in php
 than the same file wihout the comments which is 5kb?

 Or are the comments ignored as far as server load and speed to delivery are
 concerned?


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




---End Message---
---BeginMessage---

So you could have as much commented text without any detriment to the pages
performance?

great



-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: 16 March 2002 17:17
To: caspar kennerdale
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] server load


Flex - the tools that parses the code skips everything between /* and */ and
for this no token is given back. Of course if you don't
have 5kb comments Flex will be a little faster but possibly few %.

Regards,
Andrey

- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:13 PM
Subject: [PHP] server load


 Would a 10kb file which has 5kb of comments take longer to process in php
 than the same file wihout the comments which is 5kb?

 Or are the comments ignored as far as server load and speed to delivery
are
 concerned?


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




---End Message---
---BeginMessage---

However write short but meaningful comments. Keep in mind that the scripts has to be 
loaded in the memory from the disk. Although
after first request it is in some cache.


Andrey


- Original Message -
From: caspar kennerdale [EMAIL 

Re: [PHP] Again, and Again, and AGAIN!

2002-03-16 Thread Jason Wong

On Sunday 17 March 2002 13:14, Jason Wong wrote:


 You're using 4.1.1, $HTTP_POST_VARS{} has been replaced by $_POST[] (see
 changelog/history/php.ini for details).


Sorry a typo:

$HTTP_POST_VARS[] has been replaced by $_POST[]


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
What's done to children, they will do to society.
*/

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




Re: [PHP] check on pictures

2002-03-16 Thread Martin Kampherbeek

Thanks for repying. Yes, the page has pictures. But all jpg pictures must
link to another jpg pictures. A gif is alowed to link to a html file. The
minium numers of jpg pictures must be 12.

Cheers,
Martin.


- Original Message -
From: Boaz Yahav [EMAIL PROTECTED]
To: Martin Kampherbeek [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Saturday, March 02, 2002 7:35 PM
Subject: RE: [PHP] check on pictures


This is pretty Trivial if the remote pages had a standard. But from your
words I understand that the remote gallery pages can look like anything
and contain links to other places than only images.

Not trivial at all...

Sincerely

  berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Martin Kampherbeek [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 10:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] check on pictures


Can someone help me with this problem?

Someone fills in my form. One field on the form is galleryurl. Here he
types a url with some pictures on it. On this page the are thumbnail
with links to bigger pictures.
Now I want to check if the pictures are realy on it. And I want to check
if there is a link to a picture on the thumbnail and not to a html page.

I hope someone can help me.

Cheers,
Martin.





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




[PHP] send fax

2002-03-16 Thread Senih

Hi,
is it possible  to send automated faxes via PHP?
Thanks in advance,
Senih



[PHP] Class Function Issue

2002-03-16 Thread Jason Bell

Hi!  I'm building a class, and am trying to include an authorization function the 
code works when used outside of the class, but when I put it inside the class, for 
some reason my session variables won't get set.  Am I attempting the impossible, or am 
I missing something that I need to make this work? Below is the code for the Auth 
function.


function Auth($username,$password) {
$query = SELECT id,username,sl FROM KAOPA_users where 
username='$username' AND password=PASSWORD('$password');
$Auth = $this-Query($query);
if ($this-number_returned($Auth) == '1') {
$id = mysql_result($Auth,0,id);
$uname = mysql_result($Auth,0,username);
$sl = mysql_result($Auth,0,sl);
global $HTTP_SESSION_VARS;
$HTTP_SESSION_VARS[id] = $id;
$HTTP_SESSION_VARS[user] = $uname;
$HTTP_SESSION_VARS[sl] = $sl;
}
}



[PHP] problem with file writing

2002-03-16 Thread Ben Waldher

I'm having some trouble writing data to a file, when I use this code it
works fine:
?php

$file = fopen(template.txt, w);

fwrite ($file, $temp);

fclose ($file);

?

But several problems with this occur:

?php

$stuff = include (news.txt);

$file = fopen (news.txt, w);

$newnews = include (template.txt) . $stuff;

fwrite ($file, $newnews);

?

First of all, it tries to open template.txt1 instead of template.txt.

Second of all, some letters written to news.txt become a 1 for some odd
reason. I don't know why.

I am using a windows server and I have tried using the mode wb but it
doesn't help.




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




Re: [PHP] problem with file writing

2002-03-16 Thread Jason Wong

On Sunday 17 March 2002 12:53, Ben Waldher wrote:
 I'm having some trouble writing data to a file, when I use this code it
 works fine:
 ?php

 $file = fopen(template.txt, w);

 fwrite ($file, $temp);

 fclose ($file);

 ?

 But several problems with this occur:

 ?php

 $stuff = include (news.txt);

 $file = fopen (news.txt, w);

 $newnews = include (template.txt) . $stuff;

 fwrite ($file, $newnews);

 ?

include() is not the way to read files, use the Filesystem Functions for that.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
A few hours grace before the madness begins again.
*/

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




[PHP] Re: [PHP] Weird?

2002-03-16 Thread jtjohnston

Dave,

That's just the problem with the code. See the snippet,
http://www.php.net/manual/en/function.copy.php

The function should MKDIR for me one level at a time as
the function calls itself. It should MKDIR and copy *.*
  if (is_dir($file))
  {
  rec_copy ($from_path.$file./,  $to_path.$file./);
   chdir($from_path);
  }

Somehow, some place the code fails.
:) I've been going nuts trying to make it work.

David Robley wrote:

  Scott Furt wrote:
   I meant, have you created a physical directory
   named $date?
   That's your problem.  There's no directory named $date on your
 computer, and
   you're trying to write files into a non-existent directory.
 I think what is being suggested is that you may not have a directory
 named whatever c:\\ccl_www\\.$date.\\ccl_www\\ expands to;
 frinstance
 if $date were 0203 you would need to have an existing directory
 c:\\ccl_www\\0203\\ccl_www\\
 Of course, I could be misunderstanding...

snip-
?php

###
$date = date (Ymd);
###
###  Don't forget trailing slash  #
###
$from_path = c:/program files/easyphp/ccl_www/;
$to_path = c:/$date/ccl_www/;
###

if(!is_dir($from_path))
{
echo failed;
exit;
}else{
rec_copy($from_path, $to_path);
echo files copies from $from_path and backed up to $to_path;
}

#

function rec_copy ($from_path, $to_path) {
#if(!is_dir($to_path))
mkdir($to_path, 0777);

$this_path = getcwd();
 if (is_dir($from_path))
 {
chdir($from_path);
$handle=opendir('.');

while (($file = readdir($handle))!==false)
{
 if (($file != .)  ($file != ..)) {
  if (is_dir($file))
  {
  rec_copy ($from_path.$file./,  $to_path.$file./);
   chdir($from_path);
  }else{
#  echo error if (is_dir($file))br;
  }
  if (is_file($file))
  {
  copy($from_path.$file, $to_path.$file);
  }else{
#  echo error copy($from_path.$file, $to_path.$file)br;
  }
 }#end (($file != .)
}#end while (($file

closedir($handle);
 }# end if (is_dir
 else{
# echo if (is_dir($from_path))br;
 }
}# end function

?



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




[PHP] Copy *.*

2002-03-16 Thread jtjohnston

Does anyone know of another snippet any place where I can copy *.*
(files and all sub-directories) from one drive to another? In other
words, a backing-up function. The snippet I got from
http://www.php.net/manual/en/function.copy.php has been a disaster.

John


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