Re: [PHP] Re: Postnuke Anyone ?

2002-05-04 Thread Ricardo Fitzgerald

 How about some code?
 
 
 Here is the code
?php

include 'includes/pnAPI.php';
pnInit();
include 'includes/legacy.php';
pnThemeLoad();

# includes the mainfile functions and the header junk
if (!isset($mainfile)) { include(mainfile.php); }
include(header.php);
# When submit starts db connection and inserts data from the form

if ($submit) {
$db=mysql_connect(localhost, mysql, 10987654321);
mysql_select_db(intertur,$db);
$sql=INSERT INTO RegistroPersonas (nombre,apellido,pais,email,login_usuario,clave) 
VALUES ('$nombre','$apellido','$pais','$email','$login_usuario','$clave');
$result=mysql_query($sql);
echo Bienvenido $nombre $apellido.\n;
} else {

#Otherwise starts form input

 ?

pnbsp;nbsp;bINTEGRACION REGIONALbrnbsp;nbsp;LA HACE QUIEN 
TRABAJAbrbrbrstrongnbsp;nbsp;nbsp;nbsp;TEXTO/strongbr/p
brbrbrpnbsp;nbsp;UNIDOS E INTEGRADOSbrnbsp;nbsp;ELEGIMOS NUESTRO 
DESTINObrbrbrstrongnbsp;nbsp;nbsp;nbsp;TEXTO/b/strongbr/p
bh3nbsp;nbsp;Registrarse/h3/bnbsp;
table cellpadding=2 cellspacing=1 align=right width=400 style=font-family: 
tahoma, verdana, arial, helvetica, sans-serif; tr
form  method=POST action=php? echo $PHP_SELF?
tdstrongNombre/strong/td
tdstrongApellido/strong/td
tdstrongPaiacute;s/strong/td
/tr
tr
tdinput type=text name=nombre size=20 maxlength=25 /td
tdinput type=text name=apellido size=20 maxlength=25 /td
tdselect name=paisoption value=1Argentina/optionoption 
value=2Brasil/optionoption value=3Bolivia/optionoption 
value=4Chile/optionoption value=5Paraguay/optionoption 
value=6Uruguay/option/select/td
/tr
tr
tdstrongEmail/strong/td
tdinput type=text name=email size=20 maxlength=25 /td
tdstrongAlias/strong/td
/tr
tr
tdstrongClave/strong/td
tdinput type=text name=login_usuario size=20 maxlength=25 /td
tdinput type=text name=clave size=20 maxlength=25 /td
/tr
tr
tdstrongRepita la Clave/strong/td
tdinput type=text name=repclave size=20 maxlength=25 /td
td/td
/tr
tr
tdstrongSexo/strong/td
tdinput type=radio name=sexo value=masculino masculinobr
input type=radio name=sexo value=femenino femenino/td
tdstrongFecha de Nacimiento/strong/td
/tr
tr
tdnbsp;/td
tdnbsp;input type=submit value=Enviar/form/td
tdnbsp;/td
/tr

/table
?php
}
?

?php
// include footer junk
include(footer.php);
?

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




[PHP] Displaying contents of MySQL Table {!?}

2002-05-04 Thread Liam MacKenzie

Hi all, got a problem here...

This bit of script works, but it displays the results the wrong way.  I have
to scroll to the end of the page to see the last bit of data entered into
the database, I want the last bit of data entered to be displayed first.

?
$usr = lanolot;
$pwd = ...;
$db = lanolot;
$host = localhost;
$cid = mysql_connect($host,$usr,$pwd);
if (!$cid) { echo(ERROR:  . mysql_error() . \n);}
$SQL =  SELECT * FROM admin_shouts;
$retid = mysql_db_query($db, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
else {
while ($row = mysql_fetch_array($retid)) {
$comment  = $row[comment];
$date   = $row[date];
$uid   = $row[uid];

echo 
FONT SIZE='2' COLOR='red'I$date/I/FONTbr
$comment
BRBRBR
;
}
}
?


Is there a simple way that I can reverse the display order of the results?

Cheers,
Liam





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




Re: [PHP] Displaying contents of MySQL Table {!?}

2002-05-04 Thread Jason Wong

On Friday 03 May 2002 15:08, Liam MacKenzie wrote:
 Hi all, got a problem here...

 This bit of script works, but it displays the results the wrong way. 

Computers are never wrong. They just do what they are told.

 I have to scroll to the end of the page to see the last bit of data entered
 into the database, I want the last bit of data entered to be displayed
 first.

 $SQL =  SELECT * FROM admin_shouts;

Use an ORDER BY clause. See manual for details.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
If they were so inclined, they could impeach him because they don't like
his necktie.
-- Attorney General William Saxbe
*/

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




Re: [PHP] Secure user authentication

2002-05-04 Thread The_RadiX

Pedro Pontes wrote:
 with a SIMPLE equals test. So if a user happens to get that crypted
value
 of the password (from a temporary file on the server, for example), then
all
 the little devil has to do is to create a dummy session user object, or in
 your case, array, set its password value to the stolen crypted hash and
then
 link freely to any of your pages.


well simply put? no..

If a user can get the crypted value off your server, AND also figure how to
trick the PHP engine into accepting a session cookie that wasn't created on
your domain, then that would be either:
a) you have dangerous and volatile PHP scripts that allow users to perform
such nasty tricks
b) your server security should be greatly improved..


Jon Haworth wrote:
 Why are you passing the password around, hashed or not, in the first
place?
 Just have a yes/no flag for whether the session is an authenticated user
or
 not.

 Is there any particular reason why you'd need to reauthenticate on every
 page?

yes.. too true.. and simply put.. I could just pass the key or something
around instead and then in my PHP header that runs on each and every page
just reload a array with all the details anyway.. instead of passing around
the array..

oh and as for reauthenticating well that's done because.. well stupid
really when you think of it.. Unless they breach PHP as mentioned above, and
trick the session system, then there is little need to keep auth'ing them..


Haha.. Actually I just looked at my code.. Sorry I was mistaken.. due to the
complexity of my site. it doesn't actually reauth as such.. instead it
checks to see the status of the user and does some log updates.. (to keep
track of user's still online etc..) ... when I say status.. I mean if I
ban/block users while logged in.. the changes happen AS SOON as they view
another page on the site and they get a lovely page telling them of their
predicament :)



Anywayz.. very interesting topic.. I will keep an eye on this..


Miguel says:
 This would only work if some other user is able to create files that the
 web server thinks are part of your domain (since the session cookies are
 domain-specific). Sounds to me like your problem here is severe server
 misconfiguration. If your server environment is that insecure, then
 worrying about anything else is sort of a waste of time.

Yes.. Too true..


Michael Kismal says:
 What I can't figure out is why you're allowing people to just randomly
 put pages on your server.  If someone was to randomly register a similar
 user object, etc - why bother?  If I can put pages on your server and
 execute them, I'd do some something far more malicious than just pretend
 I'm user X.


Precisely what I am getting at too..


Yes the general opinion seems to be: If someone can get the session handler
of the PHP engine tricked so easily, or gain access so easily to your
site... Then you'd better look into that WAY before you start picking on
authentication schemes..


No harm intended ok.. Just pointing out some facts..


Hope I can help.. Would love to demonstate some ideas/etc.. about how I do
security stuff..



Bye
:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::
- Original Message -
From: Pedro Pontes [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, May 04, 2002 12:33 AM
Subject: Re: [PHP] Secure user authentication


 First of all, thank you for your devote answer.

 The method I was thinking about before was to pass the md5 hash of the
 password around, as the passwords are already md5'ed in the DB. Your
method
 seems more secure as you use a totally spiced-up and personalized
encryption
 engine.

 But, the main question remains, I think. If you pass your crypted password
 around, then, in each page, you must check it agains't the database entry
 with a SIMPLE equals test. So if a user happens to get that crypted
value
 of the password (from a temporary file on the server, for example), then
all
 the little devil has to do is to create a dummy session user object, or in
 your case, array, set its password value to the stolen crypted hash and
then
 link freely to any of your pages.

 Am I right? Thanks again.

 --


 Pedro Alberto Pontes

 The_radix [EMAIL PROTECTED] wrote in message
 003601c1f2aa$6120dbb0$f86086cb@oracle">news:003601c1f2aa$6120dbb0$f86086cb@oracle...
  Hmm yes good question..
 
  Security was (still is) a major for my organisation's site and I did
  something a little unique and robust..
 
 
  I love programming and I hate stealing (some call it borrowing) other
  programmer's scripts/code from the web.. therefore I write it _all_
 myself..
 
 
  Trust me.. Sometimes this is a dumb attitude to take such as when I
 created
  my first Perl discussion forum.. still running I think
  (http://the-radix.hypermart.net i think) and that consisted of this 

[PHP] How to save records from MySQL in separate files?

2002-05-04 Thread Yura

I need all the records in my database saved as separate html files on 
the disk how can I do this with PHP?

Youri

God is our provider 
http://www.body-builders.org/


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




[PHP] Javascript function

2002-05-04 Thread Morten Nielsen

Hi
Is it possible to call a function in a javascriptpage from a PHP page?
I have a function, which I use when the user press a button. I would like to
call this function just by typing the name. Is that possible?

Thanks,
Morten



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




[PHP] ob_start(ob_gzhandler) and require_once

2002-05-04 Thread bob

can  ob_start(ob_gzhandler) function be nested ?

after echo 'test' ,  does it continue to includes and evaluates c.php?



for example:

a.php
?php 
require_once main.php;
..
include b.php;

?

b.php
?php
require_once main.php;
...
echo 'test';
include c.php;
?

c.php
?php
require_once main.php;
...
?

main.php
?php
ob_start(ob_gzhandler);

?

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




[PHP] Re: How to save records from MySQL in separate files?

2002-05-04 Thread David Robley

In article 3CD3C8A3.19104.5190C40@localhost, [EMAIL PROTECTED] 
says...
 I need all the records in my database saved as separate html files on 
 the disk how can I do this with PHP?
 
 Youri
 
 God is our provider 
 http://www.body-builders.org/
 
 
Use a suitable query to select the info, then cycle throught the results 
and use fopen/fwrite to save as files.


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Php Sessions

2002-05-04 Thread Daniel Svanbäck

Hi

I have a problem. I can't send the session_id to the next page. It worked
before (when I had an old version of php, now I have 4.2.0). It can send the
session_id() if it's a link, but not a header(). If it is a header I have to
do this:

define('MYSID', session_name().'='.session_id());
header('Location: ../index.php?'.zOLSID);

Do I have to add this to every header()? Or is there a easyier way. I have
global variables = on.

//Daniel



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




[PHP] Re: Apache-2.0.35 + 4.2.0RC4: not seeing index.php

2002-05-04 Thread vins

I'm guessing that you've set the default directory index in the conf file
for apache2 as follows.
Directory Index   index.html index.php
???

If I'm right, then change that to
Directory Index index.html
Directory Index inde.php

Every new index add a new directive on a new line.
Works for me.

Cheerz



David Jackson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to trouble shoot a problem with a site hosted on a local ISP.
 They're running Slackware-8.0,apache-2.0.35 and PHP4.2.0RC4 and virtual
 hosting?

 The problem is the site not seeing index.php as default directory index?
 The SA assured me
 that both the DirectoryIndex and AddType are setup up correct?

 My question is what do they need todo to correct this, and how can I
 recreate this error?
 I'm running  Slackware-8.0, Apache-2.0.35 and PHP4.2.0?

 Also I beleive there maybe some secruity issues with their PHP
 configure, phpinfo() returns the following
 for Configure Command (NO --enable-track-vars or
 --enable-force-cgi-redirect):

 './configure' '--with-mysql' '--with-apxs2=/usr/local/apache2/bin/apxs'
'--prefix=/usr/local/php4'


 Thanks in advance,

 David Jackson



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




[PHP] Pear on Windows

2002-05-04 Thread Luke van Blerk

Hi

Can someone please refer me to some information on how to install Pear on
windows. The manual seems to cover unix only.

Thanks
Luke


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




[PHP] Re: Pear on Windows

2002-05-04 Thread David Robley

In article 000201c1f355$a7baee20$a8f103c4@luke, [EMAIL PROTECTED] 
says...
 Hi
 
 Can someone please refer me to some information on how to install Pear on
 windows. The manual seems to cover unix only.
 
 Thanks
 Luke
 
 
Strong odds are that you already have it on your system. Look in the 
directory pear under where php is installed.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Frames

2002-05-04 Thread Morten Nielsen

Hi,
I got a page with 2 frames. In the first one I have an IMG. Is it possible
to get the URL from the second frame?

Regards,
Morten



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




RE: [PHP] Frames

2002-05-04 Thread Maxim Maletsky \(PHPBeginner.com\)

Yes,

But this is a JavaScript problem.

Please ask elsewhere or look at the Google. 
Also, take a look here:
http://developer.irt.org/script/script.htm

Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins



 -Original Message-
 From: Morten Nielsen [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 1:12 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Frames
 
 Hi,
 I got a page with 2 frames. In the first one I have an IMG. Is it
possible
 to get the URL from the second frame?
 
 Regards,
 Morten
 
 
 
 --
 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] Javascript function

2002-05-04 Thread Maxim Maletsky \(PHPBeginner.com\)


 Is it possible to call a function in a javascriptpage from a PHP page?

Javascriptpage?

Do you mean using JavaScript to call a PHP function?
NO, it is not.

Because PHP is SERVER-SIDE and JavaScript is CLIENT-SIDE. You can do
vice versa though.



Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins





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




[PHP] 2 Syntax Questions

2002-05-04 Thread Miva Guy

I'm very new to PHP. I've scanned the manual for these two, but I can't
quite find the answers:

1. Is the following legal?
   INPUT TYPE=hidden NAME=user_id VALUE=? echo $user_id ?
   Or is it necessary to do this?
   ? echo(INPUT TYPE=\hidden\ NAME=\user_id\
VALUE=\.$user_id.\); ?

2. If I use the ? if:  else:  endif; ? syntax to avoid echoing larger
blocks of HTML, within those statements, is it legal to use the standard ?
if(...) {...} else {...} ? syntax?

Thanks!
Mark


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




Re: [PHP] 2 Syntax Questions

2002-05-04 Thread Jason Wong

On Saturday 04 May 2002 19:37, Miva Guy wrote:
 I'm very new to PHP. I've scanned the manual for these two, but I can't
 quite find the answers:

Wouldn't it have been quicker to just try it for yourself?

 1. Is the following legal?
INPUT TYPE=hidden NAME=user_id VALUE=? echo $user_id ?
Or is it necessary to do this?
? echo(INPUT TYPE=\hidden\ NAME=\user_id\
 VALUE=\.$user_id.\); ?

Both are OK. But for readability you could change the second to:

? echo('INPUT TYPE=hidden NAME=user_id VALUE=' . $user_id .''); ?

 2. If I use the ? if:  else:  endif; ? syntax to avoid echoing larger
 blocks of HTML, within those statements, is it legal to use the standard ?
 if(...) {...} else {...} ? syntax?

Yes.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You possess a mind not merely twisted, but actually sprained.
*/

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




Re: [PHP] getting pages with FILE

2002-05-04 Thread jyrgen

On 3 May 02, at 12:16, Miguel Cruz wrote:

 On Fri, 3 May 2002 [EMAIL PROTECTED] wrote:
  i'm using FILE to read a page via HTTP and construct an array of 
  HTML lines. After that i modify the page and echo it out.
  this all works great. The web server delivers pages depending on
  browser types. Now i need to pretend a certain browser. Can this
  be done ? What kind of HTTP-request does FILE send to the 
  webserver ?
 
 It identifies itself along these lines:
 
HTTP-User-Agent: PHP/4.1.2

thank you. now is there a way to modify the above identification, 
say something like HTTP-User-Agent: Netscape 4 (Mozilla etc...


 If that's not going to work out, you may need to use something like cURL.

never heard of cURL ? is it a extension for PHP ?

jyrgen


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




Re: [PHP] getting pages with FILE

2002-05-04 Thread Jason Wong

On Saturday 04 May 2002 20:06, [EMAIL PROTECTED] wrote:

 never heard of cURL ? is it a extension for PHP ?

google  curl ?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Some men who fear that they are playing second fiddle aren't in the
band at all.
*/

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




[PHP] need help on ereg statement

2002-05-04 Thread Andy

Hi there,

I am trying to validate a password. Only characters in the alphabet and
numbers should be allowed.

Somehow my statement does not work at all :-(

if (ereg(^[A-Za-z0-9],$new_passw))
echo 'invalid';

Can anybody help on that?

Thanx in advance,

Andy



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




Re: [PHP] need help on ereg statement

2002-05-04 Thread Trond Arve Nordheim

On Sat, May 04, 2002 at 02:42:34PM +0200, Andy wrote:
 if (ereg(^[A-Za-z0-9],$new_passw))

if (!preg_match(/^[a-zA-Z0-9]*$/, $new_passw)) {
  echo invalid;
}

preg-power! :)

-- 
Trond Arve Nordheim
 - This message is ROT13-encrypted twice for extra security.


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




Re: [PHP] Re: I-worm/Klez and a GIF query/question

2002-05-04 Thread Hugh Bothwell


R [EMAIL PROTECTED] wrote in message
001501c1f369$060a52a0$0a6da8c0@lgwezec83s94bn">news:001501c1f369$060a52a0$0a6da8c0@lgwezec83s94bn...
 Hey,
 Thanks for replying,
 Do you by any chance have the code or functions that i can use to do this?
 even to output on jpeg should be ok.
 Cheers,
 -Ryan

If outputting a JPEG is ok, why bother?  I guess you
could up the output quality to prevent blurring...


I don't have code to hand, but I can tell you
how to go about it:

Look up the Gif89a format spec; it will tell you
how to write the header (desired bits-per-
pixel, size, etc).

Count the number of different colors you use.
Set the bits-per-pixel to the lowest value
such that 2^bpp= numcols+1, and encode
at bpp+1 actual bits per pixel, always referring
to entries in the _existing_ palette, one entry
per pixel.  This is obviously less efficient than
the LZW expanding-dictionary scheme, but
avoids patent infringement.

I recommend writing this as a PHP function
that accepts an image structure and returns
a bit-string; that will make it very easy to
integrate into your scripts.

... if this sounds too complicated, you
could always hire me to do it instead (hint, hint).



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




[PHP] questions about a self-made mini chat

2002-05-04 Thread Duncan

Hi there,

i have some questions to solve some problems, i recently encountered with my self made 
mini chat script.

Ok, i use the meta-refresh in the main chat-messages frame to update the frame every 
few seconds.
In windows OS, you always get that click sounds whenever it refreshes the frame. Is 
there any way to stop this?

I provided the script with a Users online-list, but when a user simply closes the 
browser, he won't get deleted from the list, because of not having used the logout 
function.
What would be a nice way to catch this exception?
I thought about adding a timestamp to the user online list table and every time the 
user submits s.th. new the timestamp gets updated. If the user didnt post for about 
...lets say 5 minutes, then he gets deleted from the table by the script.
...well, thats just what i thought about so far, but would this cause too much MySQL 
traffic?

Regards,

Duncan



[PHP] Re: Apache-2.0.35 + 4.2.0RC4: not seeing index.php

2002-05-04 Thread David Jackson

Vins --
Thanks very much for your reply, I think your really close to the
answer.
Remember were talking about an ISP/hosting company (I actualy don't work
for them) using virtual hosting. Wouldn't a DirectiveIndex in the
VitualHost /VituralHost section of the httpd.conf override the
system directive? 
 
 I'm guessing that you've set the default directory index in the conf file
 for apache2 as follows.
 Directory Index   index.html index.php
 ???
Yes, my default index is setup on my local box this why.
I don't have any problems with it seeing index.php as the default index
page,
but I not running virtual host. 

What are you thoughts on the security question raised reblow?

 
  Also I beleive there maybe some secruity issues with their PHP
  configure, phpinfo() returns the following
  for Configure Command (NO --enable-track-vars or
  --enable-force-cgi-redirect):
 
  './configure' '--with-mysql' '--with-apxs2=/usr/local/apache2/bin/apxs'
 '--prefix=/usr/local/php4'
 
 
  Thanks in advance,
 
  David Jackson


Thanks again for you time and knowledge.
David Jackson

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




[PHP] Variable scope

2002-05-04 Thread George Nicolae

I have the following code:

?
function a($var_a)
{
b();
}

function b()
{
global $var_a;
echo $var_a;
}

a(hello word!);
?

why function b() don't echo anything? can I resolve this problem without
calling b($var_a)?


Best regards,
George Nicolae
IT Manager
___
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com





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




[PHP] Is this valid: IF:.. ELSE: ENDIF:

2002-05-04 Thread David Jackson

Greeting ---
I was handed a broken form that contain:

IF (cond):

.

ELSEIF:

..
ENDIF:


My Questions are:
1. Is this type of IF: code block valid in PHP4.x.x?
2. Shouldn't  it be --

IF (cond):
ELSE:

or maybe

IF (cond):
ELSEIF (cond):
ELSE:

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




Re: [PHP] Re: I-worm/Klez and a GIF query/question

2002-05-04 Thread Hugh Bothwell


Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Saturday 04 May 2002 04:58, Hugh Bothwell wrote:
  NOTE that for someone sufficiently persistent, they could still
  pattern-match the generated image to retrieve the number and
  auto-register that way.  (I could write a PHP file to do that, too :-)

 The pics generated by services like Yahoo are distorted and thus are
 extremely difficult to OCR.

Yahoo apparently uses a mixture of static, marble, grid,
colored background, ripple, and warp to obfuscate images.
 They don't seem to vary the typeface, size, spacing, or
alignment of their font, although they do randomize the
location. Of these, only ripple and warp seem inherently
difficult to OCR.  They also weaken it by using only short
dictionary words; this could be useful in an attack (ie if the
result is not a word in the dictionary, scrap it and
start fresh).


Yahoo links to an interesting page at Carnegie-Mellon:
http://www.captcha.net/

They use a different scheme here; they show
a set of six images and ask for a 'theme' word
that describes them.

Me being a skeptic, I wonder how many image
sets they actually have and guess not more than
200 or so; it seems that a sufficiently determined
person could catalog a decent-sized subset and
automate an attack that way (of course, they
could always obfuscate their images to some
degree...).


... and the race continues ;-)



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




Re: [PHP] questions about a self-made mini chat

2002-05-04 Thread Jason Wong

On Saturday 04 May 2002 21:23, Duncan wrote:
 Hi there,

 i have some questions to solve some problems, i recently encountered with
 my self made mini chat script.

 Ok, i use the meta-refresh in the main chat-messages frame to update the
 frame every few seconds. In windows OS, you always get that click sounds
 whenever it refreshes the frame. Is there any way to stop this?

That's an IE problem. Use Opera or Netscape if you don't want the click or 
see if there's an option in IE to disable the click.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You can do very well in speculation where land or anything to do with dirt
is concerned.
*/

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




[PHP] What about XSLT in PHP 4.2?

2002-05-04 Thread Olexandr Vynnychenko

Some months ago I used Sablotron in PHP 4.0.6. What should I do now
with PHP 4.2.0? There is no Sablotron. php_xslt.dll is placed into
'experimental' directory. Manual says:

  This extension is different than the sablotron extension distributed
  with versions of PHP prior to PHP 4.1, currently only the new XSLT
  extension in PHP 4.1 is supported.

How should I use it and what is the difference between old and new
XSLT extensions?

Thanks in advance.

-- 
Best regards,
 Olexandr  mailto:[EMAIL PROTECTED]


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




Re: [PHP] Variable scope

2002-05-04 Thread Jason Wong

On Thursday 14 March 2002 21:53, George Nicolae wrote:
 I have the following code:

 ?
 function a($var_a)
 {
 b();
 }

 function b()
 {
 global $var_a;
 echo $var_a;
 }

 a(hello word!);
 ?

 why function b() don't echo anything? 

Because $var_a has not, at any point, been defined in the global scope.

 can I resolve this problem without
 calling b($var_a)?

I'm curious as to what you're trying to achieve. Could you enlighten me?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
I will make no bargains with terrorist hardware.
-- Peter da Silva
*/

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




[PHP] Slow in retriveing webpage

2002-05-04 Thread Joseph Then

Hi!
I want to grab a webpage and I use the file() function to grab it.

The URL in the file() function works OK when I typed it in my address bar.
The speed is OK.

$fcontents = file
(http://www.website.com/cgi-bin/cgifunction/webpage.cgi;);

However, when I use the above code and tried to run the PHP file, I have to
wait for 10 seconds before I get any results.

I tried to isolate the problem and realised that the slowing down portion is
the above line. I tried fopen() and the results is still the same.


I need to know if it is possible to speed up the above process.

If possible, please email me at [EMAIL PROTECTED]

Thank you for any help rendered.



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




Re: [PHP] Re: I-worm/Klez and a GIF query/question

2002-05-04 Thread Jason Wong

On Saturday 04 May 2002 22:18, Hugh Bothwell wrote:
 Jason Wong [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...

  On Saturday 04 May 2002 04:58, Hugh Bothwell wrote:
   NOTE that for someone sufficiently persistent, they could still
   pattern-match the generated image to retrieve the number and
   auto-register that way.  (I could write a PHP file to do that, too :-)
 
  The pics generated by services like Yahoo are distorted and thus are
  extremely difficult to OCR.

 Yahoo apparently uses a mixture of static, marble, grid,
 colored background, ripple, and warp to obfuscate images.
  They don't seem to vary the typeface, size, spacing, or
 alignment of their font, although they do randomize the
 location. Of these, only ripple and warp seem inherently
 difficult to OCR.  They also weaken it by using only short
 dictionary words; this could be useful in an attack (ie if the
 result is not a word in the dictionary, scrap it and
 start fresh).

There are many variations on the theme. Altavista use random letters and 
numbers and different fonts and at varying degrees of rotation. Something 
like that would probably be the easiest to implement in PHP.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Give me a fish and I will eat today.

Teach me to fish and I will eat forever.
*/

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




[PHP] PHP compared to JSP

2002-05-04 Thread Paras Mukadam

Sorry if this is repeated, but I didn't see my query in the news group so
reposting it !
---
Dear all,
How is PHP similar to / different than JSP ? I mean, in JSP the page is
compiled the first time it runs on the web-browser, then the next time it
finds the .class file and just runs it. i.e. the compiling is just the
first time !! How does it work in PHP? Does PHP has any way to figure out
whether it's first time ? that is does PHP compile .php file to some
.compiled_php type and then it gives the output ?

Thanks a lot.
Paras.



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




RE: [PHP] PHP compared to JSP

2002-05-04 Thread Matt Friedman

JSP does not ever run in the browser. JSP is a server side technology
designed to compete with ASP. PHP is similar in that it too is a server
side language and can be embedded into html pages. Java tends to be
considerably slower than PHP but the Java folks have made great strides
towards overcoming this. As far as compiling scripts, both Java and PHP
are capable of doing this if the correct software is installed on the
server. In PHP's case this is the Zend Optimizer - in the case of Java,
I am not certain but I think this would require a Sun web server; both
solutions cost $$$. However, as far as PHP is concerned there are many
open source free caching solutions available. This is perhaps true for
Java as well. Unless your site is going to get many users per second
this is probably not necessary. Ultimately, running LAMP (Linux, Apache,
MySQL and PHP) will cost less and is probably faster. Many solutions, to
my knowledge, requiring Java cost $$$ while LAMP is completely Open
source. (Read the licenses for more info). 

Matt Friedman

 

-Original Message-
From: Paras Mukadam [mailto:[EMAIL PROTECTED]] 
Sent: Saturday May 4, 2002 10:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP compared to JSP

Sorry if this is repeated, but I didn't see my query in the news group
so
reposting it !
---
Dear all,
How is PHP similar to / different than JSP ? I mean, in JSP the page is
compiled the first time it runs on the web-browser, then the next time
it
finds the .class file and just runs it. i.e. the compiling is just the
first time !! How does it work in PHP? Does PHP has any way to figure
out
whether it's first time ? that is does PHP compile .php file to some
.compiled_php type and then it gives the output ?

Thanks a lot.
Paras.



-- 
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] Slow in retriveing webpage

2002-05-04 Thread Matt Friedman

Grab the file using a script that is run by Cron, assuming your are on a
Linux type system. Grab it every 5 minutes or something. Store/cache it
on your web server. Then when you need the file in your other script,
grab it from the place where you've cached it. You're script can then
get the content almost instantly! 

Matt Friedman
 

-Original Message-
From: Joseph Then [mailto:[EMAIL PROTECTED]] 
Sent: Saturday May 4, 2002 10:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Slow in retriveing webpage

Hi!
I want to grab a webpage and I use the file() function to grab it.

The URL in the file() function works OK when I typed it in my address
bar.
The speed is OK.

$fcontents = file
(http://www.website.com/cgi-bin/cgifunction/webpage.cgi;);

However, when I use the above code and tried to run the PHP file, I have
to
wait for 10 seconds before I get any results.

I tried to isolate the problem and realised that the slowing down
portion is
the above line. I tried fopen() and the results is still the same.


I need to know if it is possible to speed up the above process.

If possible, please email me at [EMAIL PROTECTED]

Thank you for any help rendered.



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

2002-05-04 Thread Julian

 Try just pinging www.nancies.org from the command line.
$ ping nancies.org
PING nancies.org (207.8.144.57): 56 data bytes
64 bytes from 207.8.144.57: icmp_seq=0 ttl=64 time=0.047 ms
64 bytes from 207.8.144.57: icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from 207.8.144.57: icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from 207.8.144.57: icmp_seq=3 ttl=64 time=0.037 ms
64 bytes from 207.8.144.57: icmp_seq=4 ttl=64 time=0.047 ms

nancies is local, so I'm not suprised that the pings came back ok.  We did
put up a firewall about a week ago that blocks pings from the outside
though.  Since everything is local though, I'm not sure why we would have
this problem.

Sabre


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




Re: [PHP] PHP compared to JSP

2002-05-04 Thread Paras Mukadam

Thanks for that !
But my question still remains the same ... does PHP alone (without ZEND)
compile code into some .compiled_PHP file so that the user loading same page
for 2nd time gets better response than the 1st time?

Regards,
Paras.

Matt Friedman [EMAIL PROTECTED] wrote in message
001401c1f37c$6bc34c60$[EMAIL PROTECTED]">news:001401c1f37c$6bc34c60$[EMAIL PROTECTED]...
 JSP does not ever run in the browser. JSP is a server side technology
 designed to compete with ASP. PHP is similar in that it too is a server
 side language and can be embedded into html pages. Java tends to be
 considerably slower than PHP but the Java folks have made great strides
 towards overcoming this. As far as compiling scripts, both Java and PHP
 are capable of doing this if the correct software is installed on the
 server. In PHP's case this is the Zend Optimizer - in the case of Java,
 I am not certain but I think this would require a Sun web server; both
 solutions cost $$$. However, as far as PHP is concerned there are many
 open source free caching solutions available. This is perhaps true for
 Java as well. Unless your site is going to get many users per second
 this is probably not necessary. Ultimately, running LAMP (Linux, Apache,
 MySQL and PHP) will cost less and is probably faster. Many solutions, to
 my knowledge, requiring Java cost $$$ while LAMP is completely Open
 source. (Read the licenses for more info).

 Matt Friedman





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




Re: [PHP] php_network_getaddresses

2002-05-04 Thread Pag



nancies is local, so I'm not suprised that the pings came back ok.  We did
put up a firewall about a week ago that blocks pings from the outside
though.  Since everything is local though, I'm not sure why we would have
this problem.

 I have this problem too, i mean, the same warning and bad location 
error. But its not always, i get it from time to time on my website 
(www.pagongski.com) and i cant figure out what it is.
 I have a random banner, a random quote and some fopen's for a 
shoutbox and news heading fetcher. Even changed all the vars hoping it 
would fix it. One thing i noticed is that the error is less frequent on IE6 
at home than it is at work. At home i acess the net by adsl and at the 
office we use isdn but by router/lan. Something to do with that? Dont know 
the reason for such errors.

 Pag


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




Re: [PHP] PHP compared to JSP

2002-05-04 Thread Luc Saint-Elie

At 11:07 04/05/2002 -0500, Paras Mukadam wrote:
Thanks for that !
But my question still remains the same ... does PHP alone (without ZEND)
compile code into some .compiled_PHP file so that the user loading same page
for 2nd time gets better response than the 1st time?

Hello,

Both have nothing reallyr elated (as strange as it sounds)

Does PHP compile : NO
Does the user loading same page for 2nd time gets better response : YES it 
can if caching is provided

Luc


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




Re: [PHP] PHP compared to JSP

2002-05-04 Thread Pag



But my question still remains the same ... does PHP alone (without ZEND)
compile code into some .compiled_PHP file so that the user loading same page
for 2nd time gets better response than the 1st time?

 No, it doesnt. Every time a user accesses a page that has PHP, the 
page will be built on the spot. (server side) Its extremely fast so no 
delays whatsoever.
 More figurately, you have a webpage with the PHP code somewhere in 
it, if  a user requests to view it, the server generates the code, builds 
the page, delivers it to the user and still keeps the original PHP code for 
the next user, going over it again, dynamically.
 Sorry if i cant explain this very well.

 Pag


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




Re: [PHP] PHP compared to JSP

2002-05-04 Thread Pag



Does PHP compile : NO
Does the user loading same page for 2nd time gets better response : YES it 
can if caching is provided

 On a side not..isnt caching a bit like going against why PHP was 
built in the first place? I mean, information may get a bit out of date if 
we get a page on the cache instead of getting it fresh from the server.

 Pag


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




Re: [PHP] Variable scope

2002-05-04 Thread George Nicolae


Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Thursday 14 March 2002 21:53, George Nicolae wrote:
  I have the following code:
 
  ?
  function a($var_a)
  {
  b();
  }
 
  function b()
  {
  global $var_a;
  echo $var_a;
  }
 
  a(hello word!);
  ?
 
  why function b() don't echo anything?

 Because $var_a has not, at any point, been defined in the global scope.

how i declare $var_a as global?

  can I resolve this problem without
  calling b($var_a)?

 I'm curious as to what you're trying to achieve. Could you enlighten me?

I have a big(=many lines) function a() and a little one b(). I call
function b() from function a() and alsow from many other php files. I
need to midify the function b() without modify any other php files. That's
why I don't want to use b($var_a).

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 I will make no bargains with terrorist hardware.
 -- Peter da Silva
 */


Best regards,
George Nicolae
IT Manager
___
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com



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




[PHP] Re: Postnuke Anyone ?

2002-05-04 Thread Kirk Babb

Ricardo,
I have noticed several things from just a quick look at your code:

 1. If your not able to post any data/receive any variables from your form
when the submit button is clicked, you could have register_globals set to
Off.  Here is a example form used for that situation:

form name=form1 method=post action='?php $_SERVER['PHP_SELF'] ?'
  centerinput type=submit name=register value=REGISTER

Please note that I used $_SERVER instead of PHP_SELF alone, and note the use
of the single quotes.  This is done when register_globals is turned off,
which I have learned is the best way to write your scripts (thanks to the
other guys  gals on this discussion board).

2. Using
if (isset($submit)) { stuff..}

is another thing i've been taught to do, rather than if($submit).

3. You haven't given a variable name to your submit button:
input type=submit value=Enviar/form

give the submit button a name=submit and you will actually have a variable
which your script can pick up.  Otherwise nothing will happen.

HTH,

-Kirk

Ricardo Fitzgerald [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I've been unsuccesfully trying to add a php script to a postnuke menu.
 What I did is a simple form, that connects to a mysql database, and
 inserts data, then some data is retrieved to generate a page with
 Welcome $name $lastname ... and so on
 The problem is the script must be in the center and must include the
 header, the footer and the left block, I don't understand many things
 from the way postnuke works, and I couldn't display any variable
 entered in the form, neither insert data into the db ...
 I've tried with action=some.php and action=?php PHP_SELF?;
 so far I only got parsing errors.

 Any ideas ?

 Regards,

 Rick





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




[PHP] Message isn't received in form mailer

2002-05-04 Thread Rodrigo

Hi guys, I'm trying to send the contents of a form thru the php script
under this message, but I'm not receiving the message itself, I just
receive the message in blank. Just with the subject and the from.
Does anybody know what the problem is?
Thanks for the help, Rodrigo
 
 
 
 
?php
 $Destino =  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED];
 $Remetente = $name $email;
 $Assunto = Form Domain.com;
 $Mensagem = $coments;
 mail($Destino,$Assunto,$Mensagem,From:$Remetente\n);
 header(Location:http://www.domain.com/success.htm;);
?



[PHP] gettext

2002-05-04 Thread Gerard Samuel

Hi all.  Im trying to get gettext working.  It is compiled in php 4.1.2 
on a FreeBSD-4.5 p4 box.
In the root of the webserver I have
-
?php

// User language here
putenv(LANG=fr);
putenv (LC_ALL=fr);

// Specify location of translation tables
bindtextdomain (messages, ./locale);

// Choose domain
textdomain (messages);

print(_(Hello world));

?
-

Directly under the root I have a directory structure as

locale/en/LC_MESSAGES
locale/fr/LC_MESSAGES

Under locale/fr/LC_MESSAGES, I have messages.po messages.mo created from 
xgettext and msgfmt with 'Hello World' and the translation 'Bonjour 
Monde' in messages.po.

For some reason or another, it won't translate to french.  Anyone see 
anything wrong with this setup??

Thanks


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




[PHP] PHP 4.2.0 and the GET method URLs

2002-05-04 Thread Dylan Fitzgerald


Hello-

   I recently installed PHP 4.2.0 and Apache2, and everything finally
seems to be working nicely...except for GET method (which I believe it
http://sitename/pagename.php?var=valuevar=valuevar=value; perhaps
that's POST, sue me...).  The variables simply aren't passed to the PHP
script.  At all.  Register_globals shouldn't have anything to do with
this, but it's on anyway...see http://cinotes.tnt.2y.net and click on
pretty much anything for an example.  (Note that the modules.php file
most of those links fire off to displays 'Sorry, you can't access this
file directly' if and only if no name=modulename variable is passed to
it.)

Many thanks in advance!

-- Dylan Fitzgerald

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




Re: [PHP] PHP compared to JSP

2002-05-04 Thread Jess Planck

In PHP programming this can be a complex issue. An excellent example of 
caching or re-handling data is the Smarty Template Engine, 
http://www.phpinsider.com/php/code/Smarty/ .  It may seem a rather 
redundant idea to cache and create scripts in PHP which is already part 
of the HTML documents, but for highly complex sites this can become a 
necessity!

jess.

On Saturday, May 4, 2002, at 11:18  AM, Pag wrote:



 Does PHP compile : NO
 Does the user loading same page for 2nd time gets better response : 
 YES it can if caching is provided

 On a side not..isnt caching a bit like going against why PHP 
 was built in the first place? I mean, information may get a bit out of 
 date if we get a page on the cache instead of getting it fresh from 
 the server.

 Pag


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

2002-05-04 Thread Alex Francis

Newbie question

I have installed PHP 4.1.2 on a Windows 2000 for test purposes. I have never
used sessions before and am having difficulty with them.

I am using

session_start();  and get the following error.

Warning: open(/tmp\sess_51d4849918d3ffe4d2cc70013d678f6b, O_RDWR) failed: No
such file or directory (2)

I have session support enabled, is there something else I need to do.

--
Alex Francis




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





Re: [PHP] Variable scope

2002-05-04 Thread Jason Wong

On Friday 15 March 2002 00:34, George Nicolae wrote:
 Jason Wong [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...

  On Thursday 14 March 2002 21:53, George Nicolae wrote:
   I have the following code:
  
   ?
   function a($var_a)
   {
   b();
   }
  
   function b()
   {
   global $var_a;
   echo $var_a;
   }
  
   a(hello word!);
   ?
  
   why function b() don't echo anything?
 
  Because $var_a has not, at any point, been defined in the global scope.

 how i declare $var_a as global?

Strictly speaking, in php you don't. Any variable declared outside of a 
function is what can be loosely called global. To access such variables 
inside a function you must tell PHP you want to use the global version of 
that variable.

  $doo = 'dah';
  $foo = 'bar';
  a();

  function a() {
global $doo;
echo $doo; # displays 'dah';
echo $fool # displays nothing.
  }

In your code above, you haven't defined $var_a anywhere outside of a 
function. Thus it is a local variable that only exists inside function a(). 
That is why function b() doesn't see it.

   can I resolve this problem without
   calling b($var_a)?
 
  I'm curious as to what you're trying to achieve. Could you enlighten me?

 I have a big(=many lines) function a() and a little one b(). I call
 function b() from function a() and alsow from many other php files. I
 need to midify the function b() without modify any other php files.
 That's why I don't want to use b($var_a).

The easiest solution I can see right now is to explicitly define $var_a.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The use of anthropomorphic terminology when dealing with computing systems
is a symptom of professional immaturity.
-- Edsger Dijkstra
*/

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




Re: [PHP] Message isn't received in form mailer

2002-05-04 Thread Jason Wong

On Sunday 05 May 2002 00:39, Rodrigo wrote:
 Hi guys, I'm trying to send the contents of a form thru the php script
 under this message, but I'm not receiving the message itself, I just
 receive the message in blank. Just with the subject and the from.
 Does anybody know what the problem is?
 Thanks for the help, Rodrigo

 ?php
  $Destino =  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED];
  $Remetente = $name $email;
  $Assunto = Form Domain.com;
  $Mensagem = $coments;
  mail($Destino,$Assunto,$Mensagem,From:$Remetente\n);
  header(Location:http://www.domain.com/success.htm;);
 ?

Presumably you've echo($Mensagem) and it does contain something?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
timesharing, n:
An access method whereby one computer abuses many people.
*/

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




Re: [PHP] questions about a self-made mini chat

2002-05-04 Thread Duncan McLord

Thanks for the reply.

Oh, i just tried Opera 5.x and it messed up my whole script... lol,
actually, for no reason it added about 10 login entries to the database, 
some matched the current one, others were from earlier logins with Opera.
I think this might be related to the cache, so i need to find a way, 
so that Opera doesn't cache the sites...
i found one for IE, so that the script works just perfect in IE now.

Will check out Opera and (maybe) Netscape issues now, cause no1 wants an 
IE only site ;)


Regards,

Duncan

Jason Wong wrote:

On Saturday 04 May 2002 21:23, Duncan wrote:

Hi there,

i have some questions to solve some problems, i recently encountered with
my self made mini chat script.

Ok, i use the meta-refresh in the main chat-messages frame to update the
frame every few seconds. In windows OS, you always get that click sounds
whenever it refreshes the frame. Is there any way to stop this?


That's an IE problem. Use Opera or Netscape if you don't want the click or 
see if there's an option in IE to disable the click.





Re: [PHP] Sessions

2002-05-04 Thread Stuart Dallas

On 4 May 2002 at 18:22, Alex Francis wrote:
 Warning: open(/tmp\sess_51d4849918d3ffe4d2cc70013d678f6b, O_RDWR)
 failed: No such file or directory (2)

Does the directory it's trying to write to exist? Seeing as you've posted this 
question, I'll 
assume that you don't understand the error message. Out of curiosity, which bit of No 
such 
file or directory are you having trouble with?

Sarcasm aside, it's trying to create a file named 
/tmp\sess_51d4849918d3ffe4d2cc70013d678f6b in the root of the current drive (usually 
C). 
In other words, does the directory c:\tmp exist? I would bet the farm that it doesn't.

The solution? Either create the directory or change the session.save_path entry in 
your 
php.ini.

-- 
Stuart

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




php-general Digest 4 May 2002 17:42:38 -0000 Issue 1325

2002-05-04 Thread php-general-digest-help


php-general Digest 4 May 2002 17:42:38 - Issue 1325

Topics (messages 96019 through 96071):

Re: Postnuke Anyone ?
96019 by: Ricardo Fitzgerald
96061 by: Kirk Babb

Displaying contents of MySQL Table {!?}
96020 by: Liam MacKenzie
96021 by: Jason Wong

Re: Secure user authentication
96022 by: The_RadiX

How to save records from MySQL in separate files?
96023 by: Yura
96026 by: David Robley

Javascript function
96024 by: Morten Nielsen
96033 by: Maxim Maletsky \(PHPBeginner.com\)

ob_start(ob_gzhandler) and require_once
96025 by: bob

Php Sessions
96027 by: Daniel Svanbäck

Re: Apache-2.0.35 + 4.2.0RC4: not seeing index.php
96028 by: vins
96042 by: David Jackson

Pear on Windows
96029 by: Luke van Blerk
96030 by: David Robley

Frames
96031 by: Morten Nielsen
96032 by: Maxim Maletsky \(PHPBeginner.com\)

2 Syntax Questions
96034 by: Miva Guy
96035 by: Jason Wong

Re: getting pages with FILE
96036 by: jyrgen.gmx.de
96037 by: Jason Wong

need help on ereg statement
96038 by: Andy
96039 by: Trond Arve Nordheim

questions about a self-made mini chat
96040 by: Duncan
96046 by: Jason Wong
96070 by: Duncan McLord

Re: I-worm/Klez and a GIF query/question
96041 by: Hugh Bothwell
96045 by: Hugh Bothwell
96050 by: Jason Wong
96064 by: Jennifer Downey

Variable scope
96043 by: George Nicolae
96048 by: Jason Wong
96060 by: George Nicolae
96068 by: Jason Wong

Is this valid: IF:.. ELSE: ENDIF:
96044 by: David Jackson

What about XSLT in PHP 4.2?
96047 by: Olexandr Vynnychenko

Slow in retriveing webpage
96049 by: Joseph Then
96053 by: Matt Friedman

PHP compared to JSP
96051 by: Paras Mukadam
96052 by: Matt Friedman
96055 by: Paras Mukadam
96057 by: Luc Saint-Elie
96058 by: Pag
96059 by: Pag
96066 by: Jess Planck

Re: php_network_getaddresses
96054 by: Julian
96056 by: Pag

Message isn't received in form mailer
96062 by: Rodrigo
96069 by: Jason Wong

gettext
96063 by: Gerard Samuel

PHP 4.2.0 and the GET method URLs
96065 by: Dylan Fitzgerald

Sessions
96067 by: Alex Francis
96071 by: Stuart Dallas

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

 How about some code?
 
 
 Here is the code
?php

include 'includes/pnAPI.php';
pnInit();
include 'includes/legacy.php';
pnThemeLoad();

# includes the mainfile functions and the header junk
if (!isset($mainfile)) { include(mainfile.php); }
include(header.php);
# When submit starts db connection and inserts data from the form

if ($submit) {
$db=mysql_connect(localhost, mysql, 10987654321);
mysql_select_db(intertur,$db);
$sql=INSERT INTO RegistroPersonas (nombre,apellido,pais,email,login_usuario,clave) 
VALUES ('$nombre','$apellido','$pais','$email','$login_usuario','$clave');
$result=mysql_query($sql);
echo Bienvenido $nombre $apellido.\n;
} else {

#Otherwise starts form input

 ?

pnbsp;nbsp;bINTEGRACION REGIONALbrnbsp;nbsp;LA HACE QUIEN 
TRABAJAbrbrbrstrongnbsp;nbsp;nbsp;nbsp;TEXTO/strongbr/p
brbrbrpnbsp;nbsp;UNIDOS E INTEGRADOSbrnbsp;nbsp;ELEGIMOS NUESTRO 
DESTINObrbrbrstrongnbsp;nbsp;nbsp;nbsp;TEXTO/b/strongbr/p
bh3nbsp;nbsp;Registrarse/h3/bnbsp;
table cellpadding=2 cellspacing=1 align=right width=400 style=font-family: 
tahoma, verdana, arial, helvetica, sans-serif; tr
form  method=POST action=php? echo $PHP_SELF?
tdstrongNombre/strong/td
tdstrongApellido/strong/td
tdstrongPaiacute;s/strong/td
/tr
tr
tdinput type=text name=nombre size=20 maxlength=25 /td
tdinput type=text name=apellido size=20 maxlength=25 /td
tdselect name=paisoption value=1Argentina/optionoption 
value=2Brasil/optionoption value=3Bolivia/optionoption 
value=4Chile/optionoption value=5Paraguay/optionoption 
value=6Uruguay/option/select/td
/tr
tr
tdstrongEmail/strong/td
tdinput type=text name=email size=20 maxlength=25 /td
tdstrongAlias/strong/td
/tr
tr
tdstrongClave/strong/td
tdinput type=text name=login_usuario size=20 maxlength=25 /td
tdinput type=text name=clave size=20 maxlength=25 /td
/tr
tr
tdstrongRepita la Clave/strong/td
tdinput type=text name=repclave size=20 maxlength=25 /td
td/td
/tr
tr
tdstrongSexo/strong/td
tdinput type=radio name=sexo value=masculino masculinobr
input type=radio name=sexo value=femenino femenino/td
tdstrongFecha de Nacimiento/strong/td
/tr
tr
tdnbsp;/td
tdnbsp;input type=submit value=Enviar/form/td
tdnbsp;/td
/tr

/table

Re: [PHP] Sessions

2002-05-04 Thread Alex Francis

You'r right of course, the directory didn't exist. Working alright now.

--
Alex Francis
Cameron Design
35, Drumillan Hill
Greenock PA16 0XD

Tel 01475 798106
[EMAIL PROTECTED]
http://www.camerondesign.co.uk

This message is sent in confidence for the addressee only. It may contain
legally privileged information.
Unauthorised recipients are requested to preserve this confidentiality and
to advise the sender
immediately of any error in transmission.
Stuart Dallas [EMAIL PROTECTED] wrote in message
3CD42BAD.28161.5486682@localhost">news:3CD42BAD.28161.5486682@localhost...
 On 4 May 2002 at 18:22, Alex Francis wrote:
  Warning: open(/tmp\sess_51d4849918d3ffe4d2cc70013d678f6b, O_RDWR)
  failed: No such file or directory (2)

 Does the directory it's trying to write to exist? Seeing as you've posted
this question, I'll
 assume that you don't understand the error message. Out of curiosity,
which bit of No such
 file or directory are you having trouble with?

 Sarcasm aside, it's trying to create a file named
 /tmp\sess_51d4849918d3ffe4d2cc70013d678f6b in the root of the current
drive (usually C).
 In other words, does the directory c:\tmp exist? I would bet the farm that
it doesn't.

 The solution? Either create the directory or change the session.save_path
entry in your
 php.ini.

 --
 Stuart



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




RE: [PHP] How to save records from MySQL in separate files?

2002-05-04 Thread John Holmes

Get your data, and write it to a file with fopen()/fwrite()

---John Holmes...

 -Original Message-
 From: Yura [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 2:40 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How to save records from MySQL in separate files?
 
 I need all the records in my database saved as separate html files on
 the disk how can I do this with PHP?
 
 Youri
 
 God is our provider
 http://www.body-builders.org/
 
 
 --
 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] Javascript function

2002-05-04 Thread John Holmes

No. PHP is server side, Javascript is client side and their code does
not mix. 

---John Holmes...

 -Original Message-
 From: Morten Nielsen [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 2:42 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Javascript function
 
 Hi
 Is it possible to call a function in a javascriptpage from a PHP page?
 I have a function, which I use when the user press a button. I would
like
 to
 call this function just by typing the name. Is that possible?
 
 Thanks,
 Morten
 
 
 
 --
 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] Variable scope

2002-05-04 Thread Miguel Cruz

On Thu, 14 Mar 2002, George Nicolae wrote:
  ?
  function a($var_a)
  {
  b();
  }
 
  function b()
  {
  global $var_a;
  echo $var_a;
  }
 
  a(hello word!);
  ?
 
  why function b() don't echo anything?

 Because $var_a has not, at any point, been defined in the global scope.
 
 how i declare $var_a as global?

Define it somewhere within the global context (i.e., outside of any
function. Or do what you have done, refer to it in function b() with the
global keyword. But you can do that all day long and that won't make it 
local to function a() unless you modify that function as well.

miguel


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




Re: [PHP] getting pages with FILE

2002-05-04 Thread Miguel Cruz

On Sat, 4 May 2002 [EMAIL PROTECTED] wrote:
 It identifies itself along these lines:
 
HTTP-User-Agent: PHP/4.1.2
 
 thank you. now is there a way to modify the above identification, 
 say something like HTTP-User-Agent: Netscape 4 (Mozilla etc...

I haven't really checked, but I suspect the only way to change this would 
be to muck with the PHP source code.

 If that's not going to work out, you may need to use something like cURL.
 
 never heard of cURL ? is it a extension for PHP ?

Well, it's an independent library and CLI utility, but there is a nice set 
of PHP calls that link in to it. It has its own section in the manual.

  http://php.net/curl

miguel


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




Re: [PHP] PHP compared to JSP

2002-05-04 Thread Ilia A.

Caching is not going against PHP as long as whenever the file is changed of 
the 1st access it would be cached, rather then caching php scripts based on 
some arbitrary timer.

Ideally the caching script would on the 1st access of the script convert the 
script to binary code which can then be executed right away without needing 
to pass through an interpreter. Just like you would run a compiled C program. 
I suspect such caching solution would greatly boost the speed of any PHP 
page. Unfortunately, as far as I know no current PHP caching solution does 
this.

Ilia


On May 4, 2002 12:18 pm, Pag wrote:
 Does PHP compile : NO
 Does the user loading same page for 2nd time gets better response : YES it
 can if caching is provided

  On a side not..isnt caching a bit like going against why PHP was
 built in the first place? I mean, information may get a bit out of date if
 we get a page on the cache instead of getting it fresh from the server.

  Pag


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




Re: [PHP] php_network_getaddresses

2002-05-04 Thread Miguel Cruz

On Sat, 4 May 2002, Julian wrote:
 Try just pinging www.nancies.org from the command line.
 $ ping nancies.org
 PING nancies.org (207.8.144.57): 56 data bytes
 64 bytes from 207.8.144.57: icmp_seq=0 ttl=64 time=0.047 ms
 64 bytes from 207.8.144.57: icmp_seq=1 ttl=64 time=0.043 ms
 64 bytes from 207.8.144.57: icmp_seq=2 ttl=64 time=0.036 ms
 64 bytes from 207.8.144.57: icmp_seq=3 ttl=64 time=0.037 ms
 64 bytes from 207.8.144.57: icmp_seq=4 ttl=64 time=0.047 ms
 
 nancies is local, so I'm not suprised that the pings came back ok.  We did
 put up a firewall about a week ago that blocks pings from the outside
 though.  Since everything is local though, I'm not sure why we would have
 this problem.

I'm not trying to be difficult, but you know that www.nancies.org is a
different resource from nancies.org, right? For instance, we do
split-horizon DNS and there are occasional glitches where addresses
pointing to local hosts make it into the public DNS but not the local DNS.

miguel


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




Re: [PHP] php_network_getaddresses

2002-05-04 Thread Julian

  $ ping nancies.org
  PING nancies.org (207.8.144.57): 56 data bytes
  64 bytes from 207.8.144.57: icmp_seq=0 ttl=64 time=0.047 ms
  64 bytes from 207.8.144.57: icmp_seq=1 ttl=64 time=0.043 ms
  64 bytes from 207.8.144.57: icmp_seq=2 ttl=64 time=0.036 ms
  64 bytes from 207.8.144.57: icmp_seq=3 ttl=64 time=0.037 ms
  64 bytes from 207.8.144.57: icmp_seq=4 ttl=64 time=0.047 ms
  nancies is local, so I'm not suprised that the pings came back ok.  We did
  put up a firewall about a week ago that blocks pings from the outside
  though.  Since everything is local though, I'm not sure why we would have
  this problem.


 I'm not trying to be difficult, but you know that www.nancies.org is a
 different resource from nancies.org, right? For instance, we do
Not at all, I'd rather have you point something out that I might have
missed :)
www.nancies.org is an alias for nancies.org.  Both point towards the same
IP address.  Just to check, I did a ping on it as well though with the
same results as above.
Any other ideas?
Sabre


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




RE: [PHP] Sessions

2002-05-04 Thread John Holmes

Yes, modify your php.ini file to tell PHP where to write the session to.
It's trying to write it to /tmp, which is either not a valid file, or
PHP doesn't have permissions to write a file there.

---John Holmes...

 -Original Message-
 From: Alex Francis [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 10:23 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Sessions
 
 Newbie question
 
 I have installed PHP 4.1.2 on a Windows 2000 for test purposes. I have
 never
 used sessions before and am having difficulty with them.
 
 I am using
 
 session_start();  and get the following error.
 
 Warning: open(/tmp\sess_51d4849918d3ffe4d2cc70013d678f6b, O_RDWR)
failed:
 No
 such file or directory (2)
 
 I have session support enabled, is there something else I need to do.
 
 --
 Alex Francis
 
 
 
 
 --
 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] Message isn't received in form mailer

2002-05-04 Thread John Holmes

  $Mensagem = $coments;

Where is $coments coming from? Why do you assign a variable to a
variable, without changing anything?

---John Holmes...


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




Re: [PHP] Is this valid: IF:.. ELSE: ENDIF:

2002-05-04 Thread Miguel Cruz

On Sat, 4 May 2002, David Jackson wrote:
 Greeting ---
 I was handed a broken form that contain:
 
 IF (cond):
 
 .
 
 ELSEIF:
 
 ..
 ENDIF:
 
 
 My Questions are:
 1. Is this type of IF: code block valid in PHP4.x.x?

I think it is, but I've never heard of anyone using it. One teensy thing; 
the endif should be followed by a semicolon rather than a colon, as it 
terminates the compound statement.

Of course, most normal people use:

  if (cond) {}
  elseif (cond) {}

and 'endif' is then moot as the scope of the branch is terminated by the 
last closing brace.

miguel


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




RE: [PHP] PHP 4.2.0 and the GET method URLs

2002-05-04 Thread John Holmes

Have you tried using $_GET[name] to get the value?

---John Holmes...

 -Original Message-
 From: Dylan Fitzgerald [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 9:53 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP 4.2.0 and the GET method URLs
 
 
 Hello-
 
I recently installed PHP 4.2.0 and Apache2, and everything finally
 seems to be working nicely...except for GET method (which I believe it
 http://sitename/pagename.php?var=valuevar=valuevar=value; perhaps
 that's POST, sue me...).  The variables simply aren't passed to the
PHP
 script.  At all.  Register_globals shouldn't have anything to do with
 this, but it's on anyway...see http://cinotes.tnt.2y.net and click on
 pretty much anything for an example.  (Note that the modules.php file
 most of those links fire off to displays 'Sorry, you can't access this
 file directly' if and only if no name=modulename variable is passed to
 it.)
 
 Many thanks in advance!
 
 -- Dylan Fitzgerald
 
 --
 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] Is this valid: IF:.. ELSE: ENDIF:

2002-05-04 Thread David Jackson

Miguel --
Thanks for you reply, the if (ops) else is the only one
could find listed in the docs. and you right that's the
why normal people do it, but this devoloper used to be a COBAL
programer which explain it.

Thanks again,
David


 On Sat, 4 May 2002, David Jackson wrote:
 Greeting ---
 I was handed a broken form that contain:
 
 IF (cond):
 
 .
 
 ELSEIF:
 
 ..
 ENDIF:
 
 
 My Questions are:
 1. Is this type of IF: code block valid in PHP4.x.x?
 
 I think it is, but I've never heard of anyone using it. One teensy
 thing;  the endif should be followed by a semicolon rather than a
 colon, as it  terminates the compound statement.
 
 Of course, most normal people use:
 
  if (cond) {}
  elseif (cond) {}
 
 and 'endif' is then moot as the scope of the branch is terminated by
 the  last closing brace.
 
 miguel


-- 



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




Re: [PHP] Message isn't received in form mailer

2002-05-04 Thread David Jackson

Jason --
This ain't pretty (and probly not even correct) but it works:

David 

-- Mail Call PHP 

html
headtitlehello mail/title/head
body

pre
?php
$From = $_POST['from'];
$Two = $_POST['two'];
$Subject = $_POST['sub_ject'];
$Comments = $_POST['comments'];
echo b$From/b;print \n;
echo $Two;print \n;
echo $Subject;print\n;
echo $Comments;print \n;
?
?php mail($Two,$Subject,$Comments) ?
/pre
/body
/html

-
Jason Wong wrote:
 
 On Sunday 05 May 2002 00:39, Rodrigo wrote:
  Hi guys, I'm trying to send the contents of a form thru the php script
  under this message, but I'm not receiving the message itself, I just
  receive the message in blank. Just with the subject and the from.
  Does anybody know what the problem is?
  Thanks for the help, Rodrigo
 
  ?php
   $Destino =  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED];
   $Remetente = $name $email;
   $Assunto = Form Domain.com;
   $Mensagem = $coments;
   mail($Destino,$Assunto,$Mensagem,From:$Remetente\n);
   header(Location:http://www.domain.com/success.htm;);
  ?
 
 Presumably you've echo($Mensagem) and it does contain something?
 
 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 
 /*
 timesharing, n:
 An access method whereby one computer abuses many people.
 */

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




RE: [PHP] Is this valid: IF:.. ELSE: ENDIF:

2002-05-04 Thread John Holmes

Alternative methods are listed here:

http://www.php.net/manual/en/control-structures.alternative-syntax.php

---John Holmes...

 -Original Message-
 From: David Jackson [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 1:28 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Is this valid: IF:.. ELSE: ENDIF:
 
 Miguel --
 Thanks for you reply, the if (ops) else is the only one
 could find listed in the docs. and you right that's the
 why normal people do it, but this devoloper used to be a COBAL
 programer which explain it.
 
 Thanks again,
 David
 
 
  On Sat, 4 May 2002, David Jackson wrote:
  Greeting ---
  I was handed a broken form that contain:
 
  IF (cond):
 
  .
 
  ELSEIF:
 
  ..
  ENDIF:
 
 
  My Questions are:
  1. Is this type of IF: code block valid in PHP4.x.x?
 
  I think it is, but I've never heard of anyone using it. One teensy
  thing;  the endif should be followed by a semicolon rather than a
  colon, as it  terminates the compound statement.
 
  Of course, most normal people use:
 
   if (cond) {}
   elseif (cond) {}
 
  and 'endif' is then moot as the scope of the branch is terminated by
  the  last closing brace.
 
  miguel
 
 
 --
 
 
 
 --
 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] PHP compared to JSP

2002-05-04 Thread Michael Kimsal

Ilia A. wrote:
 Caching is not going against PHP as long as whenever the file is changed of 
 the 1st access it would be cached, rather then caching php scripts based on 
 some arbitrary timer.
 
 Ideally the caching script would on the 1st access of the script convert the 
 script to binary code which can then be executed right away without needing 
 to pass through an interpreter. Just like you would run a compiled C program. 
 I suspect such caching solution would greatly boost the speed of any PHP 
 page. Unfortunately, as far as I know no current PHP caching solution does 
 this.
 

It's not PHP's place to do this.  Currently, it would be Zend's
place to do this, as they have somewhat of a monopoly on the PHP engine. 
  Obviously not a monopoly like, well, MS, but there's not any notable
support or demand for alternative PHP engines.  Current caches
cache the zend 'opcodes' (as far as I can tell), and the Zend engine 
translates to machine code during execution.  If anything was to do 
this, that's the place where it would/should happen.  I'd read about
someone planning a PHP - C compiler, but haven't seen anything on it
yet.  This might alleviate speed problems for people (although it
would introduce a longer write/compile/test cycle).

Michael Kimsal
http://www.logicreate.com/
734-480-9961





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




[PHP] php beginner

2002-05-04 Thread Paras Mukadam

I'm using this simple command in my PHP script :
 echo My Name is  . $myName . \n;

I'm invoking the php page by the command
http://localhost/testing/test.php?myName=Paras

I'm getting eoor :
Notice: Undefined variable: myName in c:\apache\htdocs\testing\test.php on
line 12
My Name is


Please help.
Regards,
Paras.



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




[PHP] Re: php beginner

2002-05-04 Thread Julio Nobrega

echo My Name is  . $_GET['myName'] . \n;

  Specify where myName is from! It's coming from GET method, in other
(simplistic) words, from the url.

--
Julio Nobrega.

Tô chegando:
http://www.inerciasensorial.com.br
Paras Mukadam [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm using this simple command in my PHP script :
  echo My Name is  . $myName . \n;

 I'm invoking the php page by the command
 http://localhost/testing/test.php?myName=Paras

 I'm getting eoor :
 Notice: Undefined variable: myName in c:\apache\htdocs\testing\test.php on
 line 12
 My Name is


 Please help.
 Regards,
 Paras.





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




[PHP] $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

Heya folks,

I've got a little problem here, maybe you can help me out.

$HTTP_SERVER_VARS[HTTP_REFERER] is supposed to point to the referring 
webpage, if it exists. As is $_SERVER[HTTP_REFERER] and $HTTP_REFERER 
itself.

However, it seems that I do not have this variable available on my 
server. I do however have this funky variable called HTTP_WREFERER 
which returns a strange string like value like below:

VLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJ

I've searched PHP.net, and practically every PHP site on the Internet 
with no luck as to what this is supposed to represent. I've even tried 
to find out how I could enable the HTTP_REFERER variable, since it 
seems that it is disabled or something.

I am guessing that WREFERER is some kind of encrypted version of 
HTTP_REFERER, but I don't know. It changes everytime, so it is hard to say.

I'm running on PHP Version 4.0.6, if that helps.

Thanks,

Kyle Gibson


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




[PHP] SSH

2002-05-04 Thread Kyle Gibson

I am curious as to how I would go about executing SSH command line 
operations through PHP. Say for instance the command ftpwho, which 
would return a list of users connected to a FTP server, along with what 
they are doing, etc. I've tried to open a socket to my SSH server, along 
with the functions system(), shell_exec(), and exec().

Thanks,

Kyle Gibson




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




[PHP] Re: Javascript function

2002-05-04 Thread Hugh Bothwell


Morten Nielsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi
 Is it possible to call a function in a javascriptpage from a PHP page?
 I have a function, which I use when the user press a button. I would like
to
 call this function just by typing the name. Is that possible?

Strictly speaking, no...

Indirectly, you can use PHP to write Javascript such that your
Javascript function will be called when the client loads the page.



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




[PHP] RE: SSH

2002-05-04 Thread Insomniac Admin

Hi,

 man ssh

Do that, you'll see there is a -c command, and also read up on using RSA
key authentication, so that the password doesn't have to be entered for
that host.

BE WARNED - if you use RSA key auth, then any process under the login
account you specify it for (it will probably have to be nobody) will
be able to waltz in without being asked for a password. Big security
hole.

You could use popen to open a ssh process and wait to be asked for the
password etc... Remember to check the RSA key pattern.

- Dan

-Original Message-
From: Kyle Gibson [mailto:[EMAIL PROTECTED]] 
Sent: 04 May 2002 23:32
To: [EMAIL PROTECTED]
Subject: [PHP] SSH


I am curious as to how I would go about executing SSH command line 
operations through PHP. Say for instance the command ftpwho, which 
would return a list of users connected to a FTP server, along with what 
they are doing, etc. I've tried to open a socket to my SSH server, along

with the functions system(), shell_exec(), and exec().

Thanks,

Kyle Gibson




-- 
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] global variables

2002-05-04 Thread Jule

Hey,
i'm just wondering if there is another way to write global variables to a 
global.php, now i just the whole fopen etc script, where i open a file and 
write the sctring $number_right = [whatever number it is] to the file, but is 
there a different way to write it to the file with one simple command?

i could use cookies, but i prefer a simpler way.

thanks

Jule
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] help !!!

2002-05-04 Thread Yoel Benitez Fonseca

H!

 Excuse me, but I need help. Somebody can give me a 
 link from where I can download the version 1.0 of the Delphi.  
 
Thank you in advance.

Mark



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




RE: [PHP] $HTTP_SERVER_VARS

2002-05-04 Thread John Holmes

Have you tried looking at a phpinfo() page and seeing what variables are
available?

Make a page with just the following line in it and load it up through
your web server.

?phpinfo()?

---John Holmes...

 -Original Message-
 From: Kyle Gibson [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 3:17 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] $HTTP_SERVER_VARS
 
 Heya folks,
 
 I've got a little problem here, maybe you can help me out.
 
 $HTTP_SERVER_VARS[HTTP_REFERER] is supposed to point to the
referring
 webpage, if it exists. As is $_SERVER[HTTP_REFERER] and
$HTTP_REFERER
 itself.
 
 However, it seems that I do not have this variable available on my
 server. I do however have this funky variable called HTTP_WREFERER
 which returns a strange string like value like below:
 
 VLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJ
 
 I've searched PHP.net, and practically every PHP site on the Internet
 with no luck as to what this is supposed to represent. I've even tried
 to find out how I could enable the HTTP_REFERER variable, since it
 seems that it is disabled or something.
 
 I am guessing that WREFERER is some kind of encrypted version of
 HTTP_REFERER, but I don't know. It changes everytime, so it is hard to
 say.
 
 I'm running on PHP Version 4.0.6, if that helps.
 
 Thanks,
 
 Kyle Gibson
 
 
 --
 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] global variables

2002-05-04 Thread John Holmes

This is simpler than cookies?? Anyway, that's how you have to do it.
Fopen(), fwrite(), fclose()...not any way simpler that I know of.

---John Holmes...

 -Original Message-
 From: Jule [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 6:23 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] global variables
 
 Hey,
 i'm just wondering if there is another way to write global variables
to a
 global.php, now i just the whole fopen etc script, where i open a file
and
 write the sctring $number_right = [whatever number it is] to the file,
but
 is
 there a different way to write it to the file with one simple command?
 
 i could use cookies, but i prefer a simpler way.
 
 thanks
 
 Jule
 --
 Jule Slootbeek
 [EMAIL PROTECTED]
 http://blindtheory.cjb.net
 
 --
 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] $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

 Have you tried looking at a phpinfo() page and seeing what variables are
 available?
 
 Make a page with just the following line in it and load it up through
 your web server.
 
 ?phpinfo()?


Yes. That is how I know of WREFERER. Do you know what it is?

If you want, you can look at my phpinfo page here:

http://php.plaguenet.com/MyAdmin/phpinfo.php.


Kyle Gibson




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




[PHP] Re: » PHP Installation Problems «

2002-05-04 Thread David Jackson

Vins --

Let me  see if  I can return the favor.
Here's what the seem to work for me with PHP4.2.0:
  form.php 

// Depending on wheather your using  POST or GET
$var_name1 = $_POST['form_var_name']'
// or
$var_name2= $_GET['form_var_name']'
echo $var_name1;
echo $var_name2;

Also I believe you used to have to ./configure --enable-track-vars? This 
maybe depreciated now ?
See variable sections of manaul for sorid details.


David Jackson
[EMAIL PROTECTED]






Vins wrote:

I have installed php4 with apache 1.3.24.
Downgraded apache again.
LOL

When I wan't to submit a form from say  form.php to from2.php
with the following fields   :   input field name=stuff
input stuff contains  Hello World

when i submit form.php
form2.php displays nothing.

I've set form2.php to echo $stuff;

My php4 installation doesn't seem to be sending my variables.
but the funny thing is that phpmyadmin works 100% fine.

what could be the problem ?


  




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




Re: [PHP] $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

Whoops. It wont show unless you come from somewhere else...


Go here and click the link:

http://www.plaguenet.com/wreferer.php


Thanks,


Kyle Gibson



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




[PHP] Re: SSH

2002-05-04 Thread Kyle Gibson

Thanks, I'll try what you suggested.



-Kyle


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




[PHP] Is --enable-track-vars still needed?

2002-05-04 Thread David Jackson

Is I still recommended that config be run with the --enable-track-vars flag?
Or has this been deprieciated? Recently? Does the chagnes to global vars 
come in to play here?


TIA,
David Jackson


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




[PHP] Re: $HTTP_SERVER_VARS

2002-05-04 Thread Kyle Gibson

My firewall prevented me from seeing the variable in action.


Ignore this.



-Kyle



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




[PHP] HTML to mysql - from msql to html

2002-05-04 Thread Mantas Kriauciunas

Hey PHP General List,

 I have hare a little problem. Well i have in the page TEXTAREA
 thingy and there i wrote text like that(between lines):

 --
 foo bar

 more foo bar
 --

 now i do msql_query(UPDATE.); and it sets into the
 database with just space. and when i take it out from database there
 is no empty line in the middle. I can see only like that when i do
 echo $myrow[1] after fetching array:

 --
 foo bar more foo bar
 --

 so how should i do and what should i use to put it like it was set.

 P.S i know there have been some questions like that but i didn't see
 them myself

 thanks for helping me out :)

:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt


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




[PHP] Re: HTML to mysql - from msql to html

2002-05-04 Thread Kyle Gibson

You entered data into a text area field that was entered into a mysql 
row. Then you tried to print it out.

Try this:

$content = str_replace(\n,br,$row[row_name]);

echo $content;


-Kyle


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




RE: [PHP] HTML to mysql - from msql to html

2002-05-04 Thread John Holmes

www.php.net/nl2br

---John Holmes...

 -Original Message-
 From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 04, 2002 11:27 PM
 To: PHP General List
 Subject: [PHP] HTML to mysql - from msql to html
 
 Hey PHP General List,
 
  I have hare a little problem. Well i have in the page TEXTAREA
  thingy and there i wrote text like that(between lines):
 
  --
  foo bar
 
  more foo bar
  --
 
  now i do msql_query(UPDATE.); and it sets into the
  database with just space. and when i take it out from database there
  is no empty line in the middle. I can see only like that when i do
  echo $myrow[1] after fetching array:
 
  --
  foo bar more foo bar
  --
 
  so how should i do and what should i use to put it like it was set.
 
  P.S i know there have been some questions like that but i didn't see
  them myself
 
  thanks for helping me out :)
 
 :--:
 Have A Nice Day!
  Mantas Kriauciunas A.k.A mNTKz
 
 Contacts:
 [EMAIL PROTECTED]
 Http://mntkz-hata.visiems.lt
 
 
 --
 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] Is this valid: IF:.. ELSE: ENDIF:

2002-05-04 Thread Jason Wong

On Sunday 05 May 2002 04:20, Miguel Cruz wrote:
 On Sat, 4 May 2002, David Jackson wrote:
  Greeting ---
  I was handed a broken form that contain:
 
  IF (cond):
 
  .
 
  ELSEIF:
 
  ..
  ENDIF:
 
 
  My Questions are:
  1. Is this type of IF: code block valid in PHP4.x.x?

 I think it is, but I've never heard of anyone using it. One teensy thing;
 the endif should be followed by a semicolon rather than a colon, as it
 terminates the compound statement.

That alternative syntax is good for when doing conditional HTML loops. For 
example, for me, the following looks odd and untidy:

  if (something) {
?
pHello/p
?
  }

Whereas this is much neater:

  ? if (something): ?
 pHello/p
  ? endif; ?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
millihelen, n.:
The amount of beauty required to launch one ship.
*/

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




RE: [PHP] help !!!

2002-05-04 Thread Matt Friedman

Try www.php.net. Oh, no that's for php. 

I might know if this was a Delphi list. Hrm...

Matt Friedman
Web Applications Developer
 

-Original Message-
From: Yoel Benitez Fonseca [mailto:[EMAIL PROTECTED]] 
Sent: Saturday May 4, 2002 10:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] help !!!

H!

 Excuse me, but I need help. Somebody can give me a 
 link from where I can download the version 1.0 of the Delphi.  
 
Thank you in advance.

Mark



-- 
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] Tailing a log file {!?}

2002-05-04 Thread Liam MacKenzie

Hi guys,

just a simple question, how would I go about displaying the last 100 lines
of a log file?
I know that on the command line it's:
tail -n 100 access_log

Is there a PHP function to do this?

Cheers,
Liam




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