Re: [PHP] Adding users to a linux system?

2002-10-15 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


you need to be root to add users - and your web server is most likely not 
runings as root (certainly shouldn't be!!)

To make this work, add the user apache runs under to /etc/sudoers  (look at 
the sudo man page),

then change the command you have to this...

sudo /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario


That will use sudo to run adduser as root.

btw - try to only allow sudo access for the apache user, and only to use the 
command adduser (e.g. NOT rm or anything else dangerous..)

Also, make very sure that $paqss and $usuario contain only alphanumeric 
characters; no backticks or quotes or anything.


Hope that helps

Cheers

Shane



On Tuesday 15 October 2002 2:16 pm, :: wkwrz entertainment :: wrote:
 $creador = /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass
 $usuario;
  $creador = exec($creador);
  echo $creador;


 I HAVE THIS, BUT IN THE APACHE LOG FILE I HAVE THIS:
 adduser: unable to lock password file


 what should i do to run the $creador sucefully?

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9rCgK5DXg6dCMBrQRAtm5AKCykAWtTJntkIKIbKx1hH7kAM+i0gCgrd6o
Lz8qZCsNAdhY1orz0yNDLLM=
=sqJ/
-END PGP SIGNATURE-


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




Re: [PHP] Adding users to a linux system?

2002-10-15 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


A C wrapper running setuid root?

I guess there's less chance of getting a 'bad' username to execute arbitrary 
commands, but at the same time I wonder about the possiblity of exploiting 
overflows, but that'd be much harder.  (hmm, if the C program shells to 
adduser anyway the same problem is there?)

I dunno, personally I dont like the idea of _anything_ needing root..

S

On Tuesday 15 October 2002 3:51 pm, Tim Monaghan wrote:
 Is it better to use a c wrapper to do this? thats what Ive always done.
 Which is more secure?

 Tim

 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Custom Programming
 Web Programming community  discussion
 http://www.inter-apps.com



 - Original Message -
 From: Shane Wright [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, October 15, 2002 9:36 AM
 Subject: Re: [PHP] Adding users to a linux system?



 you need to be root to add users - and your web server is most likely not
 runings as root (certainly shouldn't be!!)

 To make this work, add the user apache runs under to /etc/sudoers  (look at
 the sudo man page),

 then change the command you have to this...

 sudo /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario


 That will use sudo to run adduser as root.

 btw - try to only allow sudo access for the apache user, and only to use
 the command adduser (e.g. NOT rm or anything else dangerous..)

 Also, make very sure that $paqss and $usuario contain only alphanumeric
 characters; no backticks or quotes or anything.


 Hope that helps

 Cheers

 Shane

 On Tuesday 15 October 2002 2:16 pm, :: wkwrz entertainment :: wrote:
  $creador = /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass
  $usuario;
   $creador = exec($creador);
   echo $creador;
 
 
  I HAVE THIS, BUT IN THE APACHE LOG FILE I HAVE THIS:
  adduser: unable to lock password file
 
 
  what should i do to run the $creador sucefully?

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9rDKV5DXg6dCMBrQRAn5JAJ90z11UFAUQ7KBgGIC5OdWJH8XlvwCggqQ6
En4ZsJ31Y617D2IdfDou6pI=
=26WP
-END PGP SIGNATURE-


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




[PHP] strange bug(?) when opening lots of files

2002-09-17 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

One of my pages opens ~100 files, reads from them, and closes them, (only one 
file open at a time).

The problem is that the page just dies mid-way through execution - no errors, 
no segfault, it just dies and returns a blank page to the user.  the problem 
goes away if I reduce the number of files accessed.

its a build of PHP 4.1.2 on Linux running as an Apache module,  (if it makes 
any odds, the configure line is below).

I can't see anything on bugs.php.net about this - has anyone seen this before 
(and, of course, the crucial question; what can I do to fix it?)

Any help appreciated,

Thanks

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc


 './configure' '--with-gd' '--enable-gd-native-ttf' '--enable-track-vars' 
'--enable-sysvsem' '--enable-sysvshm' '--enable-calendar' '--with-zlib' 
'--prefix=/opt/php-4.1' '--with-config-file-path=/usr/local/etc/httpd/conf' 
'--enable-memory-limit' '--with-db2=/usr' '--with-db3=/usr' 
'--with-gdbm=/usr' '--with-ndbm=/usr' '--with-dbase' '--with-xml' 
'--with-expat-dir=/usr' '--enable-debugger' '--enable-ftp' '--with-ttf' 
'--with-jpeg-dir=/usr' '--enable-bcmath' '--with-openssl' 
'--enable-trans-sid' '--with-mysql=/usr' '--with-xpm-dir=/usr/X11R6' 
'--with-png' '--with-png-dir=/usr' '--with-imap' '--with-dom=/usr' 
'--with-bz2' '--with-curl' '--with-mhash=/usr' '--with-mcrypt=/usr' 
'--with-pgsql' '--with-gmp' '--with-gettext' '--with-iconv' '--with-kerberos' 
'--enable-xslt' '--with-xslt-sablot' '--with-freetype-dir=/usr' 
'--with-apxs=/usr/sbin/apxs'
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9h6lW5DXg6dCMBrQRAhhiAKCIo1xdyyDtx7fT8SO8Xz4bfWOg7QCfdjE3
STUVeNEID6bzu4+hq+PqCI4=
=zZqL
-END PGP SIGNATURE-


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




Re: [PHP] strange bug(?) when opening lots of files

2002-09-17 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Thanks for the input - but its definately not that; time limit is set to 600 
seconds and it dies inside 1 second :(

(i should have added this to the original mail, but it seems to supply the 
page but keep the connection open, strange...)

S

On Wednesday 18 September 2002 12:01 am, Tyler Longren wrote:
 How long does the script tend to run before it just quits?  Perhaps
 a timeout is set too low in php.ini.

 Take a look at max_execution_time in php.ini

 tyler

 On Tue, 17 Sep 2002 23:14:46 +0100

 Shane Wright [EMAIL PROTECTED] wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Hi
 
  One of my pages opens ~100 files, reads from them, and closes them,
  (only one file open at a time).
 
  The problem is that the page just dies mid-way through execution - no
  errors, no segfault, it just dies and returns a blank page to the
  user.  the problem goes away if I reduce the number of files accessed.
 
  its a build of PHP 4.1.2 on Linux running as an Apache module,  (if it
  makes any odds, the configure line is below).
 
  I can't see anything on bugs.php.net about this - has anyone seen this
  before (and, of course, the crucial question; what can I do to fix
  it?)
 
  Any help appreciated,
 
  Thanks
 
  - --
  Shane
  http://www.shanewright.co.uk/
  Public key: http://www.shanewright.co.uk/files/public_key.asc
 
 
   './configure' '--with-gd' '--enable-gd-native-ttf'
   '--enable-track-vars'
  '--enable-sysvsem' '--enable-sysvshm' '--enable-calendar'
  '--with-zlib' '--prefix=/opt/php-4.1'
  '--with-config-file-path=/usr/local/etc/httpd/conf'
  '--enable-memory-limit' '--with-db2=/usr' '--with-db3=/usr'
  '--with-gdbm=/usr' '--with-ndbm=/usr' '--with-dbase' '--with-xml'
  '--with-expat-dir=/usr' '--enable-debugger' '--enable-ftp'
  '--with-ttf' '--with-jpeg-dir=/usr' '--enable-bcmath' '--with-openssl'
 
  '--enable-trans-sid' '--with-mysql=/usr' '--with-xpm-dir=/usr/X11R6'
  '--with-png' '--with-png-dir=/usr' '--with-imap' '--with-dom=/usr'
  '--with-bz2' '--with-curl' '--with-mhash=/usr' '--with-mcrypt=/usr'
  '--with-pgsql' '--with-gmp' '--with-gettext' '--with-iconv'
  '--with-kerberos' '--enable-xslt' '--with-xslt-sablot'
  '--with-freetype-dir=/usr' '--with-apxs=/usr/sbin/apxs'
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.0.7 (GNU/Linux)
 
  iD8DBQE9h6lW5DXg6dCMBrQRAhhiAKCIo1xdyyDtx7fT8SO8Xz4bfWOg7QCfdjE3
  STUVeNEID6bzu4+hq+PqCI4=
  =zZqL
  -END PGP SIGNATURE-
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9h8Q85DXg6dCMBrQRApEbAKCIewL9fgwPT1ey3byL2t2pg1BPRACfWJwN
rUT+B2yFqGn6e2IO3XAGqeM=
=qz1m
-END PGP SIGNATURE-


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




Re: [PHP] strange bug(?) when opening lots of files

2002-09-17 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

my ISP keeps a little behind the curve - sometimes thats a good thing, but 
sometimes not.  :(

We could install our own PHP, but unless this is a known issue that has been 
fixed since I'd rather not risk any others by installing a new version (and 
having to deal with the update issues that causes with my ISPs updates)

Thanks

Shane

On Wednesday 18 September 2002 1:20 am, [EMAIL PROTECTED] wrote:
 Can't you upgrade to 4.2.3 many bugs were fixed.

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9h8gz5DXg6dCMBrQRArHKAJ4w3TjYJpI4ZaRSIi1cXWqOj7DzdwCgu1et
ofTLnvU/I9C4RQMNnpvwXIY=
=JLHf
-END PGP SIGNATURE-


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




Re: [PHP] Dos Paths

2002-07-10 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi 

I have a problem that's somewhat related to this - I can get short filenames 
from the OS but I really need long filenames.  Does anyone know how to do 
this?

Thanks

Shane


On Wednesday 10 July 2002 1:14 pm, BB wrote:
 I've got an application that requires dos folder names (8.3 standard) as
 input.

 I also have PHP, which quite happily can cope with both.

 Can someone help me write a function to translate full paths to dos paths

 Thanks

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9LEBu5DXg6dCMBrQRAk7bAKCS10F8NjFrStSaha0Dkno0uwGE0QCgjdFi
gNzKf3kaWjP5h2rWtImS6Xw=
=I22O
-END PGP SIGNATURE-


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




[PHP] get pwd on windows

2002-06-11 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

Ok, I need to write this little script to run on a Windows box (don't ask...), 
but I'm getting completely shafted by the inconsistent use of long filenames.

I need to get the current directory, but it must have long filenames and not 
be chopped to xxx~1 or anything.   $SCRIPT_FILENAME is not set, there is no 
pwd utility, nothing is set in the environment and realpath('./') returns 
cropped firectory names.

Is there a way to do this or am I condemned to bang my head against a wall and 
swear some more?

Cheers

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9Bjcw5DXg6dCMBrQRAjjbAJ4iz2jRJ5rMzkV7Md5GHpTd3YcX1wCfZb6B
44Qwj0u6jdfNpGtf+LTEX+w=
=HgUp
-END PGP SIGNATURE-


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




Re: [PHP] Number formatting

2002-06-06 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

 $aprTemp = number_format($apr, 2); which in the case of 3.05 will return
 305.00 and 300.00 for 3%.  Anyone have a snippet to test and display
 properly so that 3% would be 3.00, etc.

you could try this...

$val = sprintf(%0.02f, $val);

Cheers

- -- 
Shane
www.shanewright.co.uk
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8/58q5DXg6dCMBrQRApb0AJsFZ7WxZK5PRguKZqNbRndVUnkl/QCgpafj
VWVFBaJ9ysYxJqNP3Bxm2EI=
=zrZI
-END PGP SIGNATURE-


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




Re: [PHP] am i just a session tracking idiot?

2002-06-06 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi 

This may sound silly - but is there enough free disk space on whatever 
partition /tmp is mounted on?  

Alternatively, as a workaround, you could create a new directory and give the 
web server user permission to write to it and tell PHP to save sessions 
there.  (this is actually better from a security standpoint as well; less 
chance of session hijacking).

Cheers

- -- 
Shane
www.shanewright.co.uk
Public Key: http://www.shanewright.co.uk/files/public_key.asc


On Thursday 06 June 2002 6:31 pm, dan radom wrote:
 I can't seem to get session tracking to work to save my life.  The end
 result I'm after is to store the value of the single column returned from
 this query .. SELECT user_id from users WHERE user_name = '$user_name' AND
 user_password = '$user_password' .. for use throughout the site.  The
 current error I'm getting is Warning: Failed to write session data
 (files). Please verify that the current setting of session.save_path is
 correct (/tmp) in Unknown on line 0 which is very strange, as
 session.save_path is set to /tmp, and tmp is drwxrwxrwt2 root
 root.  The code is listed below.  Any suggestions are greatly appreciated.

 dan




 ?

 //  if ($user_name) {
 //class 'new uid' { var $row-user_id; };
 //start_session();
 //$abqSession = new abqnl;
 //$abqSession-user_id = $uid;
 //session_register(abqSession);
 // }

 if ($user_name) {
 session_id($_GET['user_id']);
 session_start();
 $foo=$row-user_id;
 $_SESSION[uid] = $foo;
 echo $foo;
 }


   include '/storage/apache/htdocs/test.radom.org/.siteconf.php';

   echo brbr;

   if (!$user_name) {

   echo center;

   echo table cellspacing=10;
   echo tr;

   echo form method=post action=\login.php\;

   echo td align=left;
   echo user name;
   echo /td;

   echo td align=left;
   echo input size=12 name=\user_name\;
   echo /td;

   echo /tr;
   echo tr;

   echo td align=left;
   echo password;
   echo /td;

   echo td align=left;
   echo input type=\password\ size=12 name=\user_password\;
   echo /td;

   echo /tr;
   echo tr;

   echo td;
   echo /td;

   echo td align=left;
   echo center;
   echo input type = \submit\ value=\submit\;
   echo /center;
   echo /td;

   echo /form;

   echo /tr;
   echo /table;

   echo /center;

   exit;

   } else

   $result = pg_exec ($database, SELECT user_id from users WHERE user_name
 = '$user_name' AND user_password = '$user_password');

   if (!$result) {
 echo query died\n;
 exit;
   }

   if (pg_num_rows($result) == 0) {
   echo centeryou have entered an invalid user name and password
 combination.  please try again.  new users may create an account from the
 sign up link above./center; exit;
 }


   for ($i = pg_num_rows($result) - 1; $i = 0; $i--) {
   if(!($row = pg_fetch_object($result)))
 continue;
   }

   echo your user_id is ;

   pg_close($database);

 ?
 /body
 /html

- -- 
Shane
www.shanewright.co.uk
Public Key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8/6S75DXg6dCMBrQRAjhVAKCcAb1x2/rWZFqtDBKQTCYb4OCmdACgmax8
eav61ozpEGIbHXzIYU7zt5A=
=EIC2
-END PGP SIGNATURE-


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




Re: [PHP] am i just a session tracking idiot?

2002-06-06 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

On Thursday 06 June 2002 7:55 pm, dan radom wrote:
 the last bgcolor example was cut and pasted from oreilly's session tracking
 examples.  it should work.

IIRC, some things depend on your PHP version and ini file (register_globals, 
track_vars and maybe others).  its worth trying those definately.  The manual 
also says that $_SESSION is only available after 4.1.0 - if you're using an 
older version try $HTTP_SESSION_VARS.

  that file write error concerns me.  i think
 something larger is going on here.

Definately - if all else fails it could be worth upgrading PHP (if your ISP 
won't let you, maybe they've seen the problem before?).

Ah!  What user is your web server running as?  Try creating a new user, 
running the web server as that user (group as well come to think of it), and 
trying the permissions with that).  I'm not sure why this should make a 
difference but it rings bells for some reason (can't remember enough offhand 
about UNIX users/permissions).

Cheers

- -- 
Shane
www.shanewright.co.uk
Public Key: http://www.shanewright.co.uk/files/public_key.asc

 * Chris Knipe ([EMAIL PROTECTED]) wrote:
  Have you tried using $_SESSION['bgcolor'] = bleh
 
  It might work... who knows...
 
  - Original Message -
  From: dan radom [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Thursday, June 06, 2002 8:36 PM
  Subject: Re: [PHP] am i just a session tracking idiot?
 
   what's weird is that if i set session.save_handler = mm, i obviously
   don't
 
  get the file error, but it still won't work.
 
   here's another example of what i've tried...
  
   mars:~/apache/htdocs/test.radom.org$ cat test.php
   ?
   // create a new session
   session_start();
  
   // register a session-variable
   session_register(bgcolor);
  
   // Assign a value to the session-variable
   $bgcolor = #8080ff;
   ?
   html
   head
   titleSession Example #1/title
   /head
  
   body bgcolor=?=$bgcolor? text=#00 link=#00
 
  vlink=#00 alink=#00
 
   Welcome to a session-enabled page! The background color on the next
   page
 
  will be set to a stylish blue.p
 
   a href = test2.phpGo to another session-enabled page/a.
   /body
   /html
  
   and
  
   mars:~/apache/htdocs/test.radom.org$ cat test2.php
   ?
   // Resume session created in Listing 1-2
   session_start();
   ?
   html
   head
   titleSession Example #1/title
   /head
  
   body bgcolor=?=$bgcolor? text=#00 link=#808040
 
  vlink=#606060 alink=#808000
 
   ?
   // Retrieve SID from cookie.
   print Your SID is $PHPSESSID br;
  
   // Display the value of the $bgcolor variable.
   print The persistent background color is: $bgcolor.;
   ?
  
  
   argggh!
  
   * dan radom ([EMAIL PROTECTED]) wrote:
I've just tried that.  /foo is owned by nobody and is mode 777. 
there's
 
  135M available on that partition.
 
* Shane Wright ([EMAIL PROTECTED]) wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi

 This may sound silly - but is there enough free disk space on
 whatever partition /tmp is mounted on?

 Alternatively, as a workaround, you could create a new directory
 and
 
  give the
 
 web server user permission to write to it and tell PHP to save
 
  sessions
 
 there.  (this is actually better from a security standpoint as
 well;
 
  less
 
 chance of session hijacking).

 Cheers

 - --
 Shane
 www.shanewright.co.uk
 Public Key: http://www.shanewright.co.uk/files/public_key.asc

 On Thursday 06 June 2002 6:31 pm, dan radom wrote:
  I can't seem to get session tracking to work to save my life. 
  The
 
  end
 
  result I'm after is to store the value of the single column
  returned
 
  from
 
  this query .. SELECT user_id from users WHERE user_name =
 
  '$user_name' AND
 
  user_password = '$user_password' .. for use throughout the site.
 
  The
 
  current error I'm getting is Warning: Failed to write session
  data (files). Please verify that the current setting of
  session.save_path
 
  is
 
  correct (/tmp) in Unknown on line 0 which is very strange, as
  session.save_path is set to /tmp, and tmp is drwxrwxrwt2
  root root.  The code is listed below.  Any suggestions are
  greatly
 
  appreciated.
 
  dan
 
 
 
 
  ?
 
  //  if ($user_name) {
  // class 'new uid' { var $row-user_id; };
  // start_session();
  // $abqSession = new abqnl;
  // $abqSession-user_id = $uid;
  // session_register(abqSession);
  // }
 
  if ($user_name) {
  session_id($_GET['user_id']);
  session_start();
  $foo=$row-user_id;
  $_SESSION[uid] = $foo;
  echo $foo;
  }
 
 
include '/storage/apache/htdocs/test.radom.org/.siteconf.php';
 
echo brbr;
 
if (!$user_name) {
 
echo center;
 
echo

Re: [PHP] Undefined variables

2002-03-30 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


 Not really. You either have to init your variables or turn off notices
 in error_reporting() (or otherwise suppress them; i.e. display_errors =
 off).

initialising them with safe defaults is the thing to do - the point of the 
error is to warn about uninitialised variables (which, if register_globals is 
on, could be used by an attacker to make your scripts to bad things...)

- --
Shane
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8pmm85DXg6dCMBrQRAl0PAJ9W6iBFtaYtXBKnvmtfKPPVJzHWyACfRg91
6IXouixJwNAsLJDhvYyhnSs=
=DBej
-END PGP SIGNATURE-


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




Re: [PHP] Undefined variables

2002-03-30 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


sorry, didnt get that that was your prefered method - didnt mean to step on 
your toes :)

S

On Sunday 31 March 2002 2:50 am, Lars Torben Wilson wrote:
 On Sat, 2002-03-30 at 17:43, Shane Wright wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
   Not really. You either have to init your variables or turn off notices
   in error_reporting() (or otherwise suppress them; i.e. display_errors =
   off).
 
  initialising them with safe defaults is the thing to do - the point of
  the error is to warn about uninitialised variables (which, if
  register_globals is on, could be used by an attacker to make your scripts
  to bad things...)
 
  - --
  Shane

 Yes, this is my standard suggestion as well, but since Ernesto seemed
 to be aware of the issues I decided not to press the point.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8pm4K5DXg6dCMBrQRAsTLAJ9377x/gjRKbHrfcSYW11BKUgotgACfQmTw
x2rcCdMlPbAaPg8zAey7L/8=
=WVbB
-END PGP SIGNATURE-


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




[PHP] sessions concurrency

2002-03-13 Thread Shane Wright

Hi

If I set up a session while generating a page, and I store some data in it, 
when does that data become available for other connections from the same user 
(same session)?

I.e. If I have a complex page with some session data that is used to 
dynamically generate some of the images in the page, it is conceivably 
possible that the browser could receive the HTML and IMG tags for the images 
before the page itself finishes building.

I'm thinking that the session data probably isnt written until the PHP script 
exits, and that there probably isnt any locking.  Is this the case?

I imagine that if this is true I could write my own session save/load 
handlers to install with session_set_save_handler() and handle 
locking/concurrency issues - if so would these work if written in C as a php 
extension?

Any info appreciated,

Thanks

--
Shane

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




Re: [PHP] Uploading a file

2002-01-25 Thread Shane Wright

Hi Jason

You have set the form's ENCTYPE attribute to 'multipart/form-data' haven't 
you?

FORM  ENCTYPE='multipart/form-data'

--
Shane


On Friday 25 Jan 2002 2:08 pm, Todd Cary wrote:
 Jason -

 Using the recommended HTML, everything works *except* the file does not
 become part of the data sent back to the server.  In fact, the VALUE
 from the INPUT element is not received (e.g. $filename==
 $HTTP_POST_VARS[filename];).  I am using RH Linux 7.2 with Apache.  Is
 there a parameter in the Apache that needs to be set for file uploads?

 Many thanks...

 Todd

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] strange behaviour of mysql_pconnect()

2002-01-22 Thread Shane Wright


Actually, I'd be interested to know why the same connection is used for two 
connections to the same database?

I'm guessing people could fall over this trying to do, say, unbuffered 
queries through one to fetch a huge result set, and normal queries through 
another to make changes

Of course thats not really a good thing to do anyways...

--
Shane

On Tuesday 22 Jan 2002 4:27 pm, Jimmy wrote:
 Hi list,

 I do a small test on mysql_connect() and mysql_pconnect(),
 and discover a strange behaviour.

 ?
 $cid1 = mysql_pconnect($host,$user,$pass) or die(cant connect1);
 $cid2 = mysql_pconnect($host,$user,$pass) or die(cant connect2);
 echo $cid1, $cid2;
 ?

 the output if using mysql_connect():
 Resource id #1
 Resource id #1
 (both resource id are the same, as expected)

 the output if using mysql_pconnect():
 Resource id #1
 Resource id #2
 (both resource id are different)

 at first I though pconnect() will create 2 different connection
 because the printed resource id is different.

 But after doing some test (by looking at the mysql processlist) i can
 conclude that those two link_identifier are actually the same
 (only one link, but with two different id)

 the question is, why pconnect() print different resource id,
 whereas connect() print the same one?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] RTFM

2002-01-18 Thread Shane Wright

Hi

Maybe this list should be split - kindof into a php-newbies and a 
php-advanced ?

--
Shane

On Friday 18 Jan 2002 9:39 pm, Richard Crawford wrote:
 Consider yourself fried. ;-)

 Seriously, though, I think that there are more advanced PHP lists that
 would probably be more to your liking.  Try doing a search on php.net or
 yahoogroups.com for something more technical.  I, personally, joined
 this list just over a year ago when I was assigned a project at work to
 rebuild Phorum to work against my former company's custom database.  The
 respondents on this group were incredibly helpful; and most of the
 responses to technical questions I've seen on this list have usually
 included comments like, This works because..., or You can find more
 information about this at

 I've found that this list is an excellent resource for beginners, as
 well as an excellent place for advanced users to get quick answers to
 urgent questions.

 Nick Wilson wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
 
  Hi all,
  just a very quick note: I've been following the list for about a
  week and I probably follow one or two threads a day. Some of the stuff
  here is *very* interesting. Unfortunately most of the stuff posted is a
  little ridiculous in that it's posted by people that clearly don't know
  where the online manual is located.
 
  Don't get me wrong, I'm no expert and I don't object to the 'I had a
  look but...' posts I just think the list might be a little more
  interesting if those that *really* know there stuff stopped giving
  detailed answers to Q's like 'my html page shows the php code' and were
  just a little less tolerant.
 
  Feel free to fry me.
  - --
 
  Nick Wilson
 
  Tel:+45 3325 0688
  Fax:+45 3325 0677
  Web:www.explodingnet.com
 
 
 
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.0.6 (GNU/Linux)
 
  iD8DBQE8SJLTHpvrrTa6L5oRAg8SAKCLzzFk6i29BzABak9ezbtsVIIw9wCgnn4o
  +Evq2JM0f2FDj1O1WEvm82o=
  =NaDy
  -END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Time calculation after UNIX

2002-01-16 Thread Shane Wright


Use 64bit integers!  They'll count up to a much higher number and will last 
way beyond 2038.

In the database, set the correct type (INT8 in PostgreSQL, dont know about 
the others).  Dont worry about PHP as I'm sure there'll be a few newer 
versions supporting wider int formats before then (if it doesn't already??)

--
Shane

On Wednesday 16 Jan 2002 9:33 am, Olav Drageset wrote:
 Hi

 I have a database that is supposed to last more than 30 years

 Could someone advice me how to calculate (add and subtract) time in a maner
 that willl be correct after 2030 when Unix Time stop working?

 ragards

 [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP vs. ASP

2002-01-09 Thread Shane Wright

Hi

Something I dont think anyone's mentioned yet is that PHP is also great for 
running stuff from the command line - e.g. for background scripts for a site 
or mailing scripts or whatever...

In case that doesnt sound so useful, it measn you can use all the same 
libraries for the online site as for the offline processing bits :)

--
Shane

On Wednesday 09 Jan 2002 1:43 pm, Jake wrote:
 Hello there, I need some help.

 I have to do a technical report(about 2200 words) comparing PHP to ASP.  I
 have already decided to make PHP the winner becasue it is superior.  But I
 am kinda stumped on what areas to compare the two.

 If you could help me out in suggesting some possible areas of comparison.
 Keeping in mind that I need about the same amount of info on both PHP and
 ASP.  Also if you could point me in the right direction by including some
 web links that deal with the topic.

 Thank You,
 Jake

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PostgreSQL query taking a long time

2001-12-21 Thread Shane Wright

Hi,

You dont have the book field in the asv_bible table indexed.  Use this to 
index it

CREATE INDEX myindexname ON asv_bible(book);

(the primary key fields are ok because PostgreSQL creates a unique index to 
implement the PRIMARY KEY constraint).

Hope that helps :)

--
Shane

 I have a PostgreSQL database that is storing The Bible.  It has 31,103
 records in it and I have a PHP page executing this query:
 SELECT
 books.book_name, bible.chapter, bible.verse, bible.versetext
 FROM asv_bible bible, book_bible books WHERE bible.book = books.id ORDER BY
 random() LIMIT 1

 The database schema is:

 /* 
   Sequences
  */
 CREATE SEQUENCE book_bible_seq start 1 increment 1 maxvalue 2147483647
 minvalue 1 cache 1;

 /* 
   Table structure for table asv_bible
  */
 CREATE TABLE asv_bible (
id int8 NOT NULL,
book int8,
chapter int8,
verse int8,
versetext text,
CONSTRAINT asv_bible_pkey PRIMARY KEY (id)
 );



 /* 
   Table structure for table book_bible
  */
 CREATE TABLE book_bible (
id int4 DEFAULT nextval('book_bible_seq'::text) NOT NULL,
book_name varchar(20),
CONSTRAINT book_bible_pkey PRIMARY KEY (id)
 );

 Right now it takes 9 seconds to return the results.  I was wondering if
 anyone could offer any help with lowering the time it takes to run?

 Or if this is the normal runtime for a database of this size, I'd just like
 confirmation.

 Thanks,
 Kevin


 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP ssi

2001-12-21 Thread Shane Wright

Hi Nick,

No, this isnt possible - but the constructs in PHP should allow you to do 
anything you can do with SSI just as easily.

--
Shane

On Friday 21 Dec 2001 5:45 pm, Nick wrote:
 Is it possible to have a .php file parse SSI's?  I tried adding .php as a
 SSI file but it overwrote the php type, and wouldn't display PHP.  And
 vice-versa.  If not, i'd hafta write a php script that executes a program,
 and take the output from that program and parse it, which I don't know how
 to do.  If anyone can help on that, please do so, and if anyone knows how
 to get SSI working with PHP, please let me know how.  Thanks.

 -Nick

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP / SSL

2001-12-20 Thread Shane Wright


Hang on, correct me if I'm wrong, but isn't 56bit DES significantly different 
from 40-bit SSL  (which uses a 40bit key for the public key crypto and 
something like a 3000bit key for the symmetric cipher used for the actual 
data transfer).

What I mean is, DES is significantly weaker than the weakest part of standard 
40bit SSL yes?

If I'm wrong, arent a lot of people putting a lot of confidence in something 
that really isnt secure (i.e. all SSL sessions...)??

--
Shane

On Thursday 20 Dec 2001 9:07 pm, TD - Sales International Holland B.V. wrote:
 On Thursday 20 December 2001 14:58, you wrote:

 I urge you strongly to advise against that. Although it might be possible
 to downgrade your encryption to 40bit I'd like to make you aware of the
 fact that DES which is 56 bit encryption if I'm not mistaken was cracked
 several times by brute force in UNDER 22 hours by the distributed.net
 people (www.distributed.net). Therefore I would NOT consider 40 bits
 encryption safe and I feel obligated to make you aware of that. You are
 warned now :-) so do as you please.

 Kind regards,

 Ferry van Steen

 PS I'm also on distributed.net's mailing list. I once asked why it wouldn't
 be safe then, since distributed.net has a huge load processing power due to
 the number of people that participate. Appearantly it's fairly easy for a
 lot of companies/governments/etc to EASILY!! match that computational
 power.

  Hi,
  Bit off topic this, but I thought I'd ask anyway...
 
  I've been implementing a financial reporting system, in PHP, which will
  be running on the internet.
 
  Obviously, therefore, security is an issue. The system itself implements
  a username/password login system, but I want to be able to run it using
  SSL for obvious reasons.
 
  My problem is this: The server we have (Red Hat 7.0, Apache 1.3.14-3,
  open-ssl 0.9.5a-14, mod_ssl 2.7.1-3) came with ssl preconfigured and
  ready to use. It runs at 128 bit encryption which is fine as far as I'm
  concerned.
 
  The people who will be using the system, however, have a company standard
  browser which is IE 4 and only supports 40 bit encryption. And for
  various political reasons they don't want to upgrade all the browsers. So
  what I want to know is how easy it is to turn down the encryption
  level, and how to go about it.
 
  Any suggestions, pointers??? All the documentation I've come across thus
  far doesn't really cover anything like this
 
  Richy
 
 
  ==
  Richard Black
  Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
  Tel: 0141 435 3504
  Email: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] compressed content and output buffering

2001-12-20 Thread Shane Wright

Hi

The way output buffering and output compression work, all the output is 
buffered until script termination, at which point it's compressed and then 
all sent to the browser.

Is there any way having it compressed but not buffering it?  gzip is a stream 
based algorithm, so there shouldn't be any problem theoretically.

I imagine mod_gzip would help in this respect - but I'd like it to be 
switched on and off within PHP.

Anyone know a nice way of doing this?

Thanks

--
Shane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] 'Select All'

2001-12-18 Thread Shane Wright

Hi Martin,

Excellent, thanks for your help :)

Regards

--
Shane

On Monday 17 Dec 2001 10:15 pm, Martin Towell wrote:
 you _can_ reference it by name - try this:

 script
   function my_select(type)
   {
 frm = document.forms.test;
 ele = frm[mycheckbox[]];
 len = ele.length;
 for (i = 0; i  len; i++)
   ele[i].checked = type;
   }
 /script
 form name=test
 input type=button value=All onClick=my_select(true);
 input type=button value=None onClick=my_select(false);
 input type=checkbox name=mycheckbox[]
 input type=checkbox name=mycheckbox[]
 input type=checkbox name=mycheckbox[]
 input type=checkbox name=mycheckbox[]
 /form

 Martin


 -Original Message-
 From: Shane Wright [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 18, 2001 4:55 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] 'Select All'


 Hi

 I'm having somewhat of a problem :(

 I have my banks of checkboxes, all named 'mycheckbox[]' with the values as
 different IDs.  The user happily checks a few of them and my scripts
 happily

 process the resulting arrays.

 But...  how do I get Javascript to do a 'select all' on them??  I cant
 access
 them by name because of the square brackets, and I cant access them by
 going

 through all form elements in case there are other checkboxes that dont want
 to be included.

 Is there a tidy way around this, does any of the above make sense?

 Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] 'Select All'

2001-12-17 Thread Shane Wright

Hi

I'm having somewhat of a problem :(

I have my banks of checkboxes, all named 'mycheckbox[]' with the values as 
different IDs.  The user happily checks a few of them and my scripts happily 
process the resulting arrays.

But...  how do I get Javascript to do a 'select all' on them??  I cant access 
them by name because of the square brackets, and I cant access them by going 
through all form elements in case there are other checkboxes that dont want 
to be included.

Is there a tidy way around this, does any of the above make sense?

Thanks

--
Shane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] 'Select All'

2001-12-17 Thread Shane Wright

Hi Charles,

As a button, ideally two in fact - 'select all' and 'unselect all'.

I've done it easily with ASP sites - where the '[]' is not required to have 
the values passed back as an array.

(I know I could find a non-array way of doing it but its a pain)

--
Shane

On Monday 17 Dec 2001 6:06 pm, Charles Williams wrote:
 Shane,

 is this meant for initial settings of the form only or as a button, or some
 such, to allow someone to select all the boxs?

 chuck

 - Original Message -
 From: Shane Wright [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, December 17, 2001 6:54 PM
 Subject: [PHP] 'Select All'

  Hi
 
  I'm having somewhat of a problem :(
 
  I have my banks of checkboxes, all named 'mycheckbox[]' with the values
  as different IDs.  The user happily checks a few of them and my scripts

 happily

  process the resulting arrays.
 
  But...  how do I get Javascript to do a 'select all' on them??  I cant

 access

  them by name because of the square brackets, and I cant access them by

 going

  through all form elements in case there are other checkboxes that dont

 want

  to be included.
 
  Is there a tidy way around this, does any of the above make sense?
 
  Thanks
 
  --
  Shane
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] [PHP/Apache] Transparent Subdomains ?

2001-12-15 Thread Shane Wright


If there are no other virtual hosts on your box, you could leave Apache as is 
(unrecognised hostnames will go to the default site), and do the dynamic 
processing in PHP using the $REQUEST_URI variable...

as for the crazy-page.php thing, you could set up a custom error handler page 
that points at your dynamic page...

Hope that helps...

--
Shane



On Thursday 13 Dec 2001 7:56 pm, Jon Shoberg wrote:
 Any ideas on how to pull this off.

 I would like to have http://mydomain.com and http://www.mydomain.com
 resolve to my /index.html page.  When a user types in
 http://crazy.mydomain.com or http://crazy.mydomain.com/crazy-page.php, I
 would like to have it resolve to /home/mydomain/public_html/handler.php
 where I can trap for the subdomain/URI and perform dynamic processing on
 those values.

 I presume it would have to be a process though mod_rewrite and
 .htaccess?  Is this able to be done.  I've gone though quite a bit yet
 unable to get it working as described.

 Any ideas?

 Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Logout problem - help me out....!

2001-12-15 Thread Shane Wright


HTTP authentication (which is what you're using) is controlled by the 
browser.  Some browsers even keep the login/password after the window is 
closed until the user logs out (Konqueror on Linux for one...)

If you want more control over logins and the ability to do a logout, you 
should make your own login scheme using an HTML form for username/password 
and setting a cookie to flag that the user is 'logged in'.  Then, when the 
user wants to log out, clear the cookie and job done :)

--
Shane

On Saturday 15 Dec 2001 5:37 am, J.F.Kishor wrote:
 hello all,

   I have already posted this mail, Is there anyone to help me out?,
 it's urgent plz.!

I have designed a web page using php, as a security measure I have
  kept it password protected. I have used Apache authentication, using
  htpasswd file. Now I want to keep a logout in this web page, I tried to
  send a header request http/1.0 401 Unauthorized to force it to
  reauthenticate when the logout link is clicked in the form, but this dose
  not work.

  I tried using session_destroy() even that does not work.

  To get the authenticated users name I have used GetEnv(REMOTE_USER) in
  all the form and with that username I'am handling mysql and other
 requests. I don't know where exactly the REMOTE_USER gets stored.

  So please help me out in this problem. I want to remove the
  window's authentication cache.

  Please give me some ideas and suggestion to remove the user name and make
  the page fresh for the other user to log in.

  If possible please send me a sample script.

 Thanks for sparing time on this mail.

 with hope's,
   - JFK

 kishor
 Nilgiri Networks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is PHP up to task?

2001-12-15 Thread Shane Wright


Or...

what you can do though it 'post-load' them.  Same idea, but stick images that 
are on other pages in some JS at the _end_ of the HTML and they'll load after 
the images on that page are complete.

That way, the browser is essentially preloading images for the next page the 
users is likely to visit (while the user is sitting there reading the page...)

It isnt appropriate in all situations, but it can be a useful trick... :)

--
Shane

On Saturday 15 Dec 2001 7:39 pm, René Fournier wrote:
 What you're saying makes sense--that loading ALL the nav button images
 for the whole site at once is overkill. In this case, however, it really
 isn't, since there are just to 'sets' of nav buttons--the top-level set,
 which needs to be preloaded no matter what page the user is on; and the
 products subsection set, which SHOULD be preloaded, because every visit
 will inevitably visit that section (it is the reason why any visits the
 site). I agree that if there were numerous sub-level 'sets' of nav
 button images, that loading all of them would be inefficient.

 ...Rene

 On Saturday, December 15, 2001, at 02:08  AM, Charles Williams wrote:
  - Original Message -
  From: René Fournier [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, December 15, 2001 1:27 AM
  Subject: [PHP] Is PHP up to task?
 
  (Now that I have your attention... :-)
 
  Here's the situation: All the navigational buttons in the site I'm
  working on have three different states (for mousovers--normal,
  mouseover, onClick). What I don't like: When I mouse over one button,
  it
  takes a second or two for the page to fetch the mouseover state of the
  button from the server. Now, normally, I would just write a
  preloadimages() function in JavaScript and preload all the button
  states
  when the pages load. BUT, this is a little harder, since this is a
  fairly big site (or will be) and it's not always the same buttons that
  need to be loaded; they can change from page to page (say, between
  sections, with subnav bars). That being said, I've kept one thing
  simple: All the buttons (and their states) are stored in the same
  directory, and in fact only button images are in that directory
  (/nav).
 
  So here's what I would like to know: Is it possible for PHP to read the
  contents of a directory--all the files--and then take that array and
  generate some javascript preload() statements? (Of course, I'm sure it
  IS possible, but I would appreciate any pointers you might have
  before I
  undertake it. Maybe there's even a better way than what I can see!)
  What
  I was thinking was to preload all the nav buttons and their states in
  the header.inc.
 
  Thanks.
 
  ...Rene
 
  Rene,
 
  Of course this is possible.  However, I doubt if it is desirable.  The
  more
  visitors to your site the larger the load if you load all the graphics,
  because each session would have it's own copy of all the graphics.  It
  would
  be better if you checked the page being loaded and passed a list of the
  needed graphics needed to a function that would load ONLY those graphics
  needed for said page.  This is not too very difficult and if run on a
  PHP
  caching server then the overhead is not so bad.  The hard part is
  getting
  the JS to work correctly (at least for me. hehe. I suck at JS).
 
  For example. http://clans.acnsnet.com is a package I'm working on that
  uses
  templates to control the layout.  Each menu item is stored in an SQL
  backend
  as well as the Template info (location, menu type, state, etc).  I
  already have a function to determine what page is active.  So finding
  out
  what menu items are visible is simply a matter of comparing the active
  page
  to the array of menu items.  I can then determin which images I would
  need
  to load (depending on the template in use).  This way I only load the
  images
  that are needed, which saves on load time and memory.
 
  Anyway, have fun.
 
  chuck
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

 ---
 René Fournier
 [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need high bandwidth provider for my Asian community site

2001-12-13 Thread Shane Wright


For a UK based server, have a look at dsvr.co.uk - they do great hosting and 
bandwidth is pretty cheap (AFAIK for a dedicated box its ~£300 p/month for 
40-50Gb of storage and 25Gb/month bandwidth)

Its worked out the best deal for us anyways :)

(PHP4 with loads of extensions compiled in, mySQL, PostgreSQL, ssh access, 
cron access, they're very flexible (edit your own apache and PHP configs, add 
your own extensions and so forth, support is also great; quick and 
knowledgable).

[no, I dont work for them, but they're the best I've found - so long as you 
know a bit about Linux/Apache/PHP]

Hope that helps

--
Shane



On Thursday 13 Dec 2001 1:13 pm, sunny AT wde wrote:
 I also forgot to ask:

 are messageboards really big bandwidth suckers?? I get about 2000
 messages posted a day on my messageboard and I use up nealry 20 gigs
 with that. Is this normal?

 My site is - www.barfiCulture.com

 thanks

 sunny

 --- sunny AT wde [EMAIL PROTECTED] wrote:
  Hi all,
 
  I manage an South-Asian community site from the UK (but hosted in
  USA) which is currently wolfing down 20 GB per month and is
  increasing to about 25 very soon as the popularity grows.
 
  I've searched the mailing lists, but couldn't find a good solution.
  How shall I go about increasing bandwidth? Should I go for a
  dedicated boxes? Or does anyone know a host that provides 25-30 a
  month fairly cheaply (its a non-commercial site).
 
  TIA
 
  sunny
 
  __
  Do You Yahoo!?
  Check out Yahoo! Shopping and Yahoo! Auctions for all of
  your unique holiday gifts! Buy at http://shopping.yahoo.com
  or bid at http://auctions.yahoo.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]

 __
 Do You Yahoo!?
 Check out Yahoo! Shopping and Yahoo! Auctions for all of
 your unique holiday gifts! Buy at http://shopping.yahoo.com
 or bid at http://auctions.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Performance

2001-12-13 Thread Shane Wright


another resounding YES vote on this corner

[anything so I dont have to do it all myself]

--
Shane

On Thursday 13 Dec 2001 5:45 pm, Jim Lucas wrote:
 the site that I design for has converted all of the echo; print()  and
 any other printing function of php into a simple breakout into HTML.

 ie:
 ?
 for($i=0;$i10;$i++)
 {
 ?We have done ?=$i? loop.?
 }
 ?

 We have done performance testing on most everything that can be done out
 put and include()/require() stuff.  If you would like information on the
 performance results I might be able to round up some of the data. It is
 faster and cleaner.

 Jim Lucas
 www.bend.com


 - Original Message -
 From: René Fournier [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, November 13, 2001 9:05 AM
 Subject: [PHP] Performance


 Is it true that mixing HTML and PHP--switching back and forth with
 ?php ?  tags--slows down performance? (I'm using PHP4.) Is it better
 to echo output than to drop out of PHP mode?

 And concerning database connections, my ISP asks that I always close a
 MySQL connection with a mysql_close()--which I can understand. But I'm
 curious, if I have to make, say, 10 SELECTs throughout a page (in the
 header, body, and footer), is it perhaps faster to use the mysql_close()
 at the very end of the page (in the bottom of the footer.inc)? In other
 words, is there any disadvantage performance-wise (or stability reason)
 to open and immediately thereafter close mysql connections?

 Can anyone recommend an article or two on coding techniques for
 improving PHP and MySQL performance? I don't wan to spend the rest of my
 life optimizing my php code, but if I knew a few basic rules about its
 performance characteristics, I might be able to make better decisions
 when coding. Thanks.

 ...Rene

 ---
 René Fournier,
 [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need high bandwidth provider for my Asian community site

2001-12-13 Thread Shane Wright


but it can understand br

[ive never had any problems anyways...]

--
Shane

On Thursday 13 Dec 2001 6:14 pm, l0t3k wrote:
 Sunny,
   AFAICR, br / is for Netscrape, which apparently cant understand br/
 for some reason..

 Sunny At Wde [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  yeah i'll have a look at making the html a lot smaller as well :) i
  guess thats a cheap way of tryin to hold out on the machine as much
  as possible.
 
  the br / unfortunately happens automatically when i use the nl2br
  function before stuff goes into the database. anyway of avoiding
  that?
 
  /sunny

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Connecting MS SQL

2001-12-13 Thread Shane Wright

Hi

you're getting MS SQL messages so you have the MS SQL library installed ok 
(otherwise you'd be getting 'undefined function' or thereabouts...)

The problem is most likely with MS SQL itself - is the username/password set 
up and is access allowed from the machine your making the connection from 
(most likely localhost)?

--
Shane

On Thursday 13 Dec 2001 6:14 pm, pong-TC wrote:
 Hello All

 I am trying to connect MS SQL, but got the error message as follows:

 Warning: MS SQL message: Login failed for user 'pong'. (severity 14) in
 d:\inetpub\wwwroot\cgi-bin\mailman.php on line 26

 Warning: MS SQL: Unable to connect to server: dilbert in
 d:\inetpub\wwwroot\cgi-bin\mailman.php on line 26
 Cannot connect to the database.

 I followed all instructions before I did try ie. copy php_mssql.dll to
 winnt/system32 directory and uncomment extension in php.ini.  Still no
 luck, anyone, please help.  I am running PHP 4.1.0 on IIS 5.

 Thank you.
 Pong

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] flushing contents to the browser

2001-12-12 Thread Shane Wright

Hi

The most practical thing to do is to do the big db operation in a background 
process and have an independent page on the browser that automatically 
refreshes and changes when the job is done.

There are 2 issues...

1 - running the background process, there are quite a few ways of doing this 
(search the list archives for details).

2 - automatic refresh.  There's an HTML meta tag that does this, check out an 
HTML reference.

Hope that helps 

--
shane

On Wednesday 12 Dec 2001 9:17 pm, DigitalKoala wrote:
 hi folks,

 i'm trying to display something like processing... please wait on a web
 page whilst a rather hefty database query is being run.

 i don't want to refresh the page so i've been attempting to use flush and
 ob_start, together with some css stuff to try and do this.. but no luck so
 far - as once the buffer has been flushed, i can't retrieve the content..

 does anyone have any nifty ideas?

 many thanks
 dk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to get week number from date

2001-12-11 Thread Shane Wright


Actually, this is in PHP 4.1.0 which has just been released...

..here's the line from the changelog:

Added 'W' flag to date() function to return week number of year using ISO 
8601 standard. (Colin)

--
Shane

On Tuesday 11 Dec 2001 3:37 pm, Nick Ward wrote:
 Hello,

 First of all I am very new to PHP so if I am asking something very obvious
 then I apologise.  I am writing a time-sheet application for a division of
 our company and we book all time by week number.  Is it possible to get PHP
 to work out the week number (1-53) from the current date.

 Any help and advice would be greatly appreciated.

 Regards

 Nick Ward

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php as cron

2001-12-10 Thread Shane Wright

Hi

You probably need to set the path to your PHP binary in crontab.

Alternatively (this is probs a better way), wrap the whole lot up in a simple 
shell script and get cron to run the shell script.

It's easier than it sounds...

#!/bin/bash
cd /path/to/php/scripts
php  myscript.php  /dev/null

(also, I tend not to have PHP direct output to /dev/null, but to configure 
cron not to send emails on completion - that way you get the info when you 
run the script on the command line but dont get overrun with pointless emails)

Hope that helps :)

--
Shane

On Monday 10 Dec 2001 5:54 pm, Jay Paulson wrote:
 I'm trying to test php running as a cron job and I have installed php as a
 CGI in /usr/local/bin and I have edited my crontab file to call a php file
 every two minutes.  However, it's not working and I was wondering if you
 all would know what's going on.  Anyway, here's how I have things set up.

 crontab file:
 */2 * * * * php /home/crontest.php  /dev/null

 crontest.php:
 #!/usr/local/bin/php -q
 ?php
 mail([EMAIL PROTECTED],cron test, testing,NULL);
 ?

 email I'm receiving with error:
 Subject: Cron  php /home/crontest.php  /dev/null
 Body: /bin/sh: php: command not found

 thanks for any help.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Running WML (WAP services) under PHP

2001-12-09 Thread Shane Wright

Hi

 i think that php sends out headers showing that the page is html.not
 sure bout this, but you might have to send a diff header..

This is true - you should send a content type of either text/x-wap.wml or 
text/vnd.wap.wml (for WML 1.0 and 1.1 respectively)...

header('Content-Type: text/x-wap.wml');

PHP doesnt insert anything extra into the output that isn't in the script you 
write - check there is no leading whitespace before the first '?'  (same 
applies in all include files)

--
Shane


 -Original Message-
 From: M [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, December 09, 2001 5:08 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Running WML (WAP services) under PHP


 Hello, I am trying to develop some WML apps using PHP.
 To run WML apps into my local Apache (win98) server, I added

 AddType application/x-httpd-php .wml

 into httpd.conf. This works ok when calling directly from netscape
 http://localhost/mywml.wml ,
 treating script like a true PHP program.

 BUT when writing a REAL WML app. (cards and so) and trying to run on
 NOKIA simulator (by calling URL), it shows a parse error on line 1 (for
 all scripts).
 The same script, when executed in file mode on NOKIA sim (that is first
 load .wml file and then press SHOW button) , works fine, proving the
 error is not in script, but in way PHP interpret .WML pages.

 I suspect PHP introduces some invisible code (just 1 byte?) or something
 at beginning of .WML page.


 Thanks for your attn.

 Miguel

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Stripping slashes from db-insert?

2001-12-01 Thread Shane Wright


Addslashes() is probably getting called twice on the data on the insert...

if you have magic_gpc on, any inputted data already has the necessary escapes 
- so you shouldnt need to call it again...

Hope that helped :)

--
Shane

On Saturday 01 Dec 2001 1:14 pm, Daniel Alsén wrote:
 Hi,

 i know this has been asked before - but:

 When i add entries to MySql (varchar and text) all  and ' gets a slash in
 front of them. How do i get rid of these slashes?

 Regards
 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   | +46 8 694 82 22  #
 # PGP: http://www.mindbash.com/pgp/  #

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] APC and memory troubles

2001-11-29 Thread Shane Wright

Hi List,

I'm having some troubles with APC and was wondering if anyone else had seen 
this and perhaps knew of a solution...

Basically, random pages at random times cause the script to run out of 
memory.  This first happened with the default 8Mb limit, so I upped it to 
20Mb but the problem remained.

It happened in both the shm and mmap modes.  the versions are PHP 4.0.5 as an 
apache DSO and APC 1.1.0pl1.

Has anyone seen this before?  Is there anything else thats likely to ceuse 
problems with APC?

Any help appreciated,

Regards

Shane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] setcookie BUG w/ IE 5.5, 6.0 Netscape!

2001-11-27 Thread Shane Wright


Oh yeah, about the lifetime of the cookie - with no valid expiry time it is 
created as a session cookie - which is supposed to only live as long as the 
browser does.

[opening a new independent browser window does not share the session, but 
window.open() calls do, as do other 'browser created from browser with 
session' methods, if that makes any sense, grin]

--
Shane

On Saturday 29 Dec 2001 6:35 pm, Kris Wilkinson wrote:
 Just recently I've noticed an issue with setcookie. My scripts which
 normall ran :

 setcookie (myCookie,Blah,time()+7201);

 Are killing the cookie immediately after you close the browser window, or
 access another https:// site. It appears as though the life of the cookie
 is actually not being set, and is based entirely around the life of the
 browser window which it was originally called.

 if you leave the window open, and attempt at access the cookie from another
 window, the cookie does not exist.

 IDEAS? PHP GODS? :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] cookies

2001-11-27 Thread Shane Wright

Hi Urb

Can you not just set the cookie again [using the updated expiry date].

If I remember correctly, this should work..

--
Shane

On Tuesday 27 Nov 2001 5:45 pm, Urb LeJeune wrote:
 Speaking of cookies, is there a way using session control
 to modify the expiration date of a cookie? I would like to add
 a check box in a login dialog that says remember me

   Thanks

 Urb

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Standalone PHP Application

2001-11-19 Thread Shane Wright


mm, thats true - there is no compiler as such.  PHP probably isnt the right 
language for you in this case :(

--
Shane


On Sunday 18 Nov 2001 11:43 pm, John Monfort wrote:
  I just got it.
  So far, it doesn't look like it lets convert your code to a .exe code.
  My client's scoring logic is proprietary and I need to protect the code.


 __John Monfort_
 _+---+_
  P E P I E  D E S I G N S
www.pepiedesigns.com
 The world is waiting, are you ready?
 -+___+-

 On Sun, 18 Nov 2001, Shane Wright wrote:
  Hi
 
  You could have a look at the GTK+ bindings for PHP - AFAIK they let you
  write standalone apps.
 
  There's info on the PHP web site ( www.php.net ).
 
  --
  Shane
 
I'm looking for information on using PHP for standalone applications.
Specifically, I need to create a PHP-based application that can be
   runned from a CD-ROM. Have any of you done this?
  
Any suggestions?
  
On another note:
I need to develop a CD-ROM based Survey, where the result will be
   saved in an external file. What software, would you recommend, to use
   for this? I'm currently using Multimedia Builder, and was wondering if
there is something better.
  
I need something that allows customization(via scripting) and more
interaction with external files/commands.
Any help would be appreciated.
  
Thanks!
  
-John
  
  
  
   __John Monfort_
   _+---+_
P E P I E  D E S I G N S
  www.pepiedesigns.com
   The world is waiting, are you ready?
   -+___+-
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Quiz questions on PHP

2001-11-18 Thread Shane Wright


Hi

Have a look at the PHP tests on Brainbench.com - they're of a different ilk 
but may be useful (I think they're still free)...

[dunno about the copyright though - but it should say on the site, if nothign 
else it might help with some pointers]

--
Shane

On Sunday 18 Nov 2001 12:43 pm, Srinivasan Ramakrishnan wrote:
 Hi,

 I'm preparing a quiz on PHP for some programmers. I was wondering if there
 are good questions that I can use instead of inventing my own.

 I'm also evaluating any quizzing software out there that will allow me to
 conduct it. Actually I'm in the process of throwing together a script to do
 that, but I'm guessing any prefab script will be more feature packed. Do
 you know of any?

 Cheers,
 -Srini

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Changing var value from int to string

2001-11-18 Thread Shane Wright


Hi

Nope, this is fine

[not necessarily good programming practise mind, but thats a different 
story...]

--
Shane

On Sunday 18 Nov 2001 6:13 am, phantom wrote:
 Is there any inherit danger or taboos against changing the value of a
 variable from an integer to a string?

 example:

 if ($Msg==1) $Msg = You have foobar'ed your entire server.;

 Thanks.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Standalone PHP Application

2001-11-18 Thread Shane Wright


Hi

You could have a look at the GTK+ bindings for PHP - AFAIK they let you write 
standalone apps.

There's info on the PHP web site ( www.php.net ).

--
Shane


  I'm looking for information on using PHP for standalone applications.
  Specifically, I need to create a PHP-based application that can be runned
  from a CD-ROM. Have any of you done this?

  Any suggestions?

  On another note:
  I need to develop a CD-ROM based Survey, where the result will be saved
  in an external file. What software, would you recommend, to use for this?
  I'm currently using Multimedia Builder, and was wondering if
  there is something better.

  I need something that allows customization(via scripting) and more
  interaction with external files/commands.
  Any help would be appreciated.

  Thanks!

  -John



 __John Monfort_
 _+---+_
  P E P I E  D E S I G N S
www.pepiedesigns.com
 The world is waiting, are you ready?
 -+___+-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] select+uploading multiple files

2001-11-02 Thread Shane Wright

Hi fitiux

I'm sure the list will correct me if I'm wrong, but what you're talking about 
isnt possible, at least not in this way.

This isn't a limitation of PHP - its a limitation of the HTML form element 
that handles the uploads.

You could consider a client-side applet to achieve the result another way.  A 
Java applet would do the job - although you will need to sign it and users 
will need to grant it permission to read their hard drives (I think this is 
how it works, it's been a while...)

Good luck

Shane



On Friday 02 November 2001 3:01 pm, fitiux wrote:
 Hi everybody!

 I'm new in the list.
 I'll help anybody if I can  =)

 by now I have a little trouble  ;-)

 I have to create a php page where users can upload many files
 the idea is that users could select many files by holding down
 the shift key... with this I can avoid to put many input tags in my page.
 When I use an input type=file  and pass to the next page
 a temporary file name (/var/temp/phpGH65YT) is created..
 but if I try to use another way to send the file name.. this temp file name
 is not created. and I just get an error: I cannot open the file name
 test.txt in /var/html/pages/test.php for reading

 an alternative is in fact of I know the file names that users must upload.
 I could ask them for the path and then I'd show a list of files to upload
 and users only will have to click on one button.



 is it possible to make more easy the file uploading for users?
 I mean... is it possible to upload many files without to choose one by one
 within a html page with many input tags?

 ooh yes.. I cannot use zipped files not even a ftp connection


 best regards
 from Chile.



 PS:  I apology for my english... I hope that you can understand me   =)

-- 
Shane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to get Usernames

2001-11-02 Thread Shane Wright

Hi Michael

How about explode()ing it using '/' as the seperator, then finding the 
element in the resulting array that begins with '~', strip that first 
character using substr() and bod's your uncle...

I'd write the code but I've had a long day...

Shane

On Friday 02 November 2001 6:11 pm, [EMAIL PROTECTED] wrote:
 I have a setup where users can access their own pages using a /~username
 here account

 I need to put a PHP script in their directoies that will be able to tell
 me what their username is.

 I was thinking about $REQUEST_URI however if I go to /~username/dir/page
 it will return it all.

 all I want is the username...

 Thanks for your help,
 Michael

-- 
Shane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to get Usernames

2001-11-02 Thread Shane Wright

Okz,

Hows this...

$myarray = explode('/', $REQUEST_URI);

for ($i=0; $icount($myarray); $i++) {
$mystr = $myarray[$i];

if ($mystr[0] = '~') {
$username = substr($mystr, 1);
$i = count($myarray);
};
};

and presto, username in $username

[there are more efficient ways to walk the array, but I've had a long day...]

Hope that helps,

Shane


On Friday 02 November 2001 6:46 pm, [EMAIL PROTECTED] wrote:
 Ok,

 How do I do that?

  Hi Michael
 
  How about explode()ing it using '/' as the seperator, then finding the
  element in the resulting array that begins with '~', strip that first
  character using substr() and bod's your uncle...
 
  I'd write the code but I've had a long day...
 
  Shane
 
  On Friday 02 November 2001 6:11 pm, [EMAIL PROTECTED] wrote:
   I have a setup where users can access their own pages using a
   /~username here account
  
   I need to put a PHP script in their directoies that will be able to
   tell me what their username is.
  
   I was thinking about $REQUEST_URI however if I go to
   /~username/dir/page it will return it all.
  
   all I want is the username...
  
   Thanks for your help,
   Michael

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] A way to simulate modem speeds?

2001-10-31 Thread Shane Wright


duno about for windows, but there's quite a bit around on packet shaping for 
Linux and *BSD which amounts to the same thing - could be worthwhile sticking 
an old server in the middle with some different rules on different ports 
(i.e. port 81 set up for 14k4 equiv, 82 for 28k8 equiv, etc..)

sorry aint got any URLs but some googling should get you somewhere...

Shane

On Wednesday 31 October 2001 6:23 pm, Michael Hall wrote:
 I apologize for the only-vaguely-PHP-related nature of this, but I'm
 endlessly impressed with the knowledge here.

 I'm looking for a way to clamp down a network machine (we're on a T1) to
 modem speeds (28 to 52 K) for testing purposes.

 Is there software (preferably for Windows) that would do this?  Better yet,
 would this software be free?

 I don't want much, do I?

 Thanks.

-- 
Shane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]