php-general Digest 4 May 2002 17:42:38 -0000 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]


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

 ?>

<p>&nbsp;&nbsp;<b>INTEGRACION REGIONAL<br>&nbsp;&nbsp;LA HACE QUIEN 
TRABAJA<br><br><br><strong>&nbsp;&nbsp;&nbsp;&nbsp;TEXTO</strong><br></p>
<br><br><br><p>&nbsp;&nbsp;UNIDOS E INTEGRADOS<br>&nbsp;&nbsp;ELEGIMOS NUESTRO 
DESTINO<br><br><br><strong>&nbsp;&nbsp;&nbsp;&nbsp;TEXTO</b></strong><br></p>
<b><h3>&nbsp;&nbsp;Registrarse</h3></b>&nbsp;
<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?>">
    <td><strong>Nombre</strong></td>
    <td><strong>Apellido</strong></td>
    <td><strong>Pa&iacute;s</strong></td>
</tr>
<tr>
    <td><input type="text" name="nombre" size="20" maxlength="25" ></td>
    <td><input type="text" name="apellido" size="20" maxlength="25" ></td>
    <td><select name="pais"><option value="1">Argentina</option><option 
value="2">Brasil</option><option value="3">Bolivia</option><option 
value="4">Chile</option><option value="5">Paraguay</option><option 
value="6">Uruguay</option></select></td>
</tr>
<tr>
    <td><strong>Email</strong></td>
    <td><input type="text" name="email" size="20" maxlength="25" ></td>
    <td><strong>Alias</strong></td>
</tr>
<tr>
    <td><strong>Clave</strong></td>
    <td><input type="text" name="login_usuario" size="20" maxlength="25" ></td>
    <td><input type="text" name="clave" size="20" maxlength="25" ></td>
</tr>
<tr>
    <td><strong>Repita la Clave</strong></td>
    <td><input type="text" name="repclave" size="20" maxlength="25" ></td>
    <td></td>
</tr>
<tr>
    <td><strong>Sexo</strong></td>
    <td><input type="radio" name="sexo" value="masculino">< masculino><br>
    <input type="radio" name="sexo" value="femenino">< femenino></td>
    <td><strong>Fecha de Nacimiento</strong></td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td>&nbsp;<input type="submit" value="Enviar"></form></td>
    <td>&nbsp;</td>
</tr>

</table>
<?php
}
?>

<?php
// include footer junk
include("footer.php");
?>
--- End Message ---
--- Begin Message ---
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'] ?>'>
          <center><input 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
>
>


--- End Message ---
--- Begin Message ---
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></FONT><br>
$comment
<BR><BR><BR>
";
        }
    }
?>


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

Cheers,
Liam




--- End Message ---
--- Begin Message ---
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
*/
--- End Message ---
--- Begin Message ---
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 huge
> > perl system to maintain the files etc.. for members and the forum..
> >
> >
> > Anyway! off the sub now..
> >
> >
> > I used sessions and pass around the array of columns for that
member/user
> ..
> > but the password is put through my own fairly unbreakable (yes.. I am
> > serious) password key system..
> >
> >
> > An idea to make your own safe keys to pass them around or use for
> > authenticating is simple maths and a crypt() or my preferred: md5()
> > function..
> >
> >
> > I simply do some lovely maths like for each char of pword I loop through
> > them and append them onto the entire pword string plus the length, get
the
> > md5 of that.. then md5 that md5 with the md5 of the previous result and
> then
> > do some maths, pick some specified characters (like every 3rd or
whatever
> > you wish) .. strrev( reverse the string) md5 that again, all md5'ed
> again..
> >
> >
> > :) haha, you get the idea..
> >
> >
> > SO basically you'll end up with a nice 32 char string which is QUITE
safe
> to
> > pass around and the chance anyone's gonna decrypt it IMHO is about
zilch,
> > buckley's, zut, nil, null, zero..
> >
> >
> > And all you have to do, is when they login once, just run the password
> they
> > entered through this "algorithm" and check it against the stored algo'd
> > password..
> >
> > Ah yes that's the next thing.. the DB passwords will also have to be
proc.
> > using your algorithm..
> >
> > So it's kinda like a key security idea.. you are not meant to decrypt
md5
> > hashes.. instead recreate it using what you are supplied and then
compare
> > both hashes..
> >
> >
> > Simple :P
> >
> >
> >
> >
> > Ok hope that helps
> >
> > :::::::::::::::::::::::::::::::::::::::::::
> > :  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: Friday, May 03, 2002 10:19 PM
> > Subject: [PHP] Secure user authentication
> >
> >
> > > Hello,
> > >
> > > I'm using the regular user authentication method, that is, check the
> > > specified login/pass agains't the entries in the DB, if it is valid,
> > create
> > > the user object and register it with the section.
> > >
> > > How can we prevent any user from creating a simple PHP page that
creates
> a
> > > simmilar user object, registers it with the session and then links to
my
> > > pages? One way would be to check, in each page, for the password in
the
> > > session user object and match it with the DB entry, but storing the
> > password
> > > in the session is not advisable, as other users in the host system may
> > have
> > > access to that information.
> > >
> > > Please advise.
> > >
> > > Thank you ver much for your time.
> > >
> > > --
> > >
> > >
> > > Pedro Alberto Pontes
> > >
> > >
> > >
> > > --
> > > 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
>

--- End Message ---
--- Begin Message ---
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/

--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---

> 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




--- End Message ---
--- Begin Message ---
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");
........
?>
--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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.
*/
--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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.
*/
--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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."

--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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.
*/
--- End Message ---
--- Begin Message ---
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.
>

--- End Message ---
--- Begin Message ---

"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).


--- End Message ---
--- Begin Message ---

"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 ;-)


--- End Message ---
--- Begin Message ---
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.
*/
--- End Message ---
--- Begin Message ---
Ok so is there a tutorial on how to write the code to generate the key and
the image?
Please point me to it.

Thanks
Jennifer


"R" <[EMAIL PROTECTED]> wrote in message
007501c1f304$3c1607a0$0a6da8c0@lgwezec83s94bn">news:007501c1f304$3c1607a0$0a6da8c0@lgwezec83s94bn...
> Hey all,
> Whooooah, talk about getting a response, I posted the I-Worm/Klez question
> hoping to get one or two replies of people who actually got
infected......I
> got more than 40 replies!
> I got two more today, but one poor dude says he got around 149 and
counting!
> Anyway, thanks for your replies guys/girls and for the URLs, but
> 'nuff about virus's back to PHP....
>
> I got a client who want a simple registeration form (Which i can do
without
> any problem...easy.)
> but he wants one extra bit:
> at the end of the form he wants a "key" gif...(A gif with a number)
> that is automatically generated and that number has to be entered into the
> text box....the idea is that it prevents automaited registerations.....
> Yahoo and a couple of other big sites/portals use it. For those of you who
> dont know what i am talking about and are curious to see an example, try
> registering for an account at yahoo mail or chat or something.
>
> I understand that the new version of PHP/GD or whatever does not support
GIF
> and i also know for PNG or JPEG i can use LIBJPEG and LIBPNG (both are
> installed on my webhost) but how do i do it in GIF?
> (He insists on GIF- the clients a &##@ his money helps pay the bills)
>
> Any ideas? and if any of you guys done anything similar, can give me the
> function/s or any help?
>
> ANY help appreciated and guys.....please dont send me anything more about
> I-Worm/Klez...I apoligise about that.
> All feedback appreciated even ones that just want to flame me. :-)
>
> Cheers,
> -Ryan.
>
> /* If you see a cop beating me, put down the @$#@ing camera and come help
> me! */
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002


--- End Message ---
--- Begin Message ---
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




--- End Message ---
--- Begin Message ---
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
*/
--- End Message ---
--- Begin Message ---

"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


--- End Message ---
--- Begin Message ---
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
*/
--- End Message ---
--- Begin Message ---
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:
--- End Message ---
--- Begin Message ---
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]

--- End Message ---
--- Begin Message ---
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.


--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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.


--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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
>
>


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---


>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

--- End Message ---
--- Begin Message ---

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

--- End Message ---
--- Begin Message ---
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
>

--- End Message ---
--- Begin Message ---
> 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

--- End Message ---
--- Begin Message ---

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

--- End Message ---
--- Begin Message ---
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";);
?>
--- End Message ---
--- Begin Message ---
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.
*/
--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---

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=value&var=value&var=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
--- End Message ---
--- Begin Message ---
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



--- End Message ---
--- Begin Message ---
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
--- End Message ---

Reply via email to