php-general Digest 5 May 2002 06:16:17 -0000 Issue 1326

Topics (messages 96072 through 96112):

Re: Sessions
        96072 by: Alex Francis
        96080 by: John Holmes

Re: How to save records from MySQL in separate files?
        96073 by: John Holmes

Re: Javascript function
        96074 by: John Holmes
        96092 by: Hugh Bothwell

Re: Variable scope
        96075 by: Miguel Cruz

Re: getting pages with FILE
        96076 by: Miguel Cruz

Re: PHP compared to JSP
        96077 by: Ilia A.
        96087 by: Michael Kimsal

Re: php_network_getaddresses
        96078 by: Miguel Cruz
        96079 by: Julian

Re: Message isn't received in form mailer
        96081 by: John Holmes
        96085 by: David Jackson

Re: Is this valid: IF:.. ELSE: ENDIF:
        96082 by: Miguel Cruz
        96084 by: David Jackson
        96086 by: John Holmes
        96093 by: David Jackson
        96109 by: Jason Wong

Re: PHP 4.2.0 and the GET method URLs
        96083 by: John Holmes

php beginner
        96088 by: Paras Mukadam
        96089 by: Julio Nobrega

$HTTP_SERVER_VARS
        96090 by: Kyle Gibson
        96097 by: John Holmes
        96099 by: Kyle Gibson
        96102 by: Kyle Gibson
        96105 by: Kyle Gibson

SSH
        96091 by: Kyle Gibson
        96094 by: Insomniac Admin
        96103 by: Kyle Gibson

global variables
        96095 by: Jule
        96098 by: John Holmes

help !!!
        96096 by: Yoel Benitez Fonseca
        96110 by: Matt Friedman

Re: » PHP Installation Problems «
        96100 by: David Jackson
        96101 by: David Jackson

Is  --enable-track-vars still needed?
        96104 by: David Jackson

HTML to mysql - from msql to html
        96106 by: Mantas Kriauciunas
        96107 by: Kyle Gibson
        96108 by: John Holmes

weird foreach problem when calling date or getdate function, variable does not change
        96111 by: Zachary Buckholz

Tailing a log file {!?}
        96112 by: Liam MacKenzie

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


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


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


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


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

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


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

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

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

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




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

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

--- End Message ---
--- Begin Message ---
>      $Mensagem = $coments;

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

---John Holmes...

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

David 

-------------- Mail Call PHP ------------

<html>
<head><title>hello 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.
> */
--- End Message ---
--- Begin Message ---
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

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


-- 


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


--- End Message ---
--- Begin Message ---
John --
Thanks for your reply.
I stand corrected :)

David


> 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


-- 


--- End Message ---
--- Begin Message ---
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) {
    ?>
    <p>Hello</p>
    <?
  }

Whereas this is much neater:

  <? if (something): ?>
     <p>Hello</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.
*/
--- End Message ---
--- Begin Message ---
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=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
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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


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


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

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


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



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


--- End Message ---
--- Begin Message ---
My firewall prevented me from seeing the variable in action.


Ignore this.



-Kyle


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



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


--- End Message ---
--- Begin Message ---
Thanks, I'll try what you suggested.



-Kyle

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


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


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


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


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




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

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

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

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


--- End Message ---
--- Begin Message ---
The following block of code loops over an array but when I call the PHP
function date or getdate the variable used in this function is always the
first one used in the array. What am I doing wrong? The sample output is
below.

foreach ($results_array as $array) {
                //$time = date("H:i:s", $array[0]);
                $time = getdate($array[0]);
                $chk_status = $array[1];
                $resp_sec = $array[2];
print "$array[0] <br>";
print "$time[hours]:$time[minutes]:$time[seconds] = $chk_status = $resp_sec
<br>";

                array_push ($array_time, $time);
                //array_push ($array_status, $chk_status);
                array_push ($array_resp, $resp_sec);

        }


20020504160503         <-- Notice how this date/time value is updated
properly each loop
20:14:7 = 200 = 2         <-- Notice how this value always remains the same?
20020504160702
20:14:7 = 200 = 1
20020504160903
20:14:7 = 200 = 1
20020504161101
20:14:7 = 200 = 1
20020504161302
20:14:7 = 200 = 1
20020504161502
20:14:7 = 200 = 1
20020504161702
20:14:7 = 200 = 2
20020504161901
20:14:7 = 200 = 1
20020504162101
20:14:7 = 200 = 1
20020504162301
20:14:7 = 200 = 1
20020504162701
20:14:7 = 200 = 1
20020504162901
20:14:7 = 200 = 1
20020504163102
20:14:7 = 200 = 1
20020504163302
20:14:7 = 200 = 1
20020504163509
20:14:7 = 200 = 6
20020504163702
20:14:7 = 200 = 1
20020504163901
20:14:7 = 200 = 1
20020504164101
20:14:7 = 200 = 1
20020504164301
20:14:7 = 200 = 1
20020504164502
20:14:7 = 200 = 1
20020504164702
20:14:7 = 200 = 1
20020504164905
20:14:7 = 200 = 1
20020504165103
20:14:7 = 200 = 1
20020504165301
20:14:7 = 200 = 1
20020504165502
20:14:7 = 200 = 1
20020504165701
20:14:7 = 200 = 1
20020504165902
20:14:7 = 200 = 1
20020504170101
20:14:7 = 200 = 1


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



--- End Message ---

Reply via email to