Re: [PHP] PHP code will not work

2008-07-10 Thread Sanjay Mantoor
Hi,

I found
$_SERVER['HTTP_USER_AGENT'] works when you are using with browser by
server like Apache.

If you are executing your code like script in command prompt it may not work.
I got below :-
PHP Notice:  Undefined index: HTTP_USER_AGENT

If you use print_r($_SERVER) , you can see all the listing of indexes.



On Wed, Jul 9, 2008 at 7:15 PM, Mike V [EMAIL PROTECTED] wrote:

 I had this problem and just figured it out.  I was copying and pasting the
 code snippet from the tutorials page to my test editor and in the process
 picked up an invisible ctrl char.  Doh!!


 Joseph Subida wrote:


 The error I get when I try

 ?php
 echo $_SERVER['HTTP_USER_AGENT'];
 ?

 is

 Parse error: syntax error, unexpected T_VARIABLE in
 /Library/WebServer/Documents/test.php on line 106

 I tried Googling T_VARIABLE and haven't found any useful solutions.
 Any ideas? Thanks!

 -J.C.

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




 --
 View this message in context: 
 http://www.nabble.com/PHP-code-will-not-work-tp17811807p18362005.html
 Sent from the PHP - General mailing list archive at Nabble.com.


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





-- 
Thanks,
Sanjay Mantoor

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



[PHP] PHP: array with null shows different with print_r and var_dump

2008-04-02 Thread Sanjay Mantoor
Hello,

I am new to PHP and PHP community.

Following program outputs different values with print_r and var_dump.

$array = array(null, NULL);

print_r($array); prints values like below
Array
(
[0] =
[1] =
)

where as var_dump($array) prints values like below
array(2) {
  [0]=
  NULL// Does this convert to null to NULL?
  [1]=
  NULL
}

Can you tell me why the above difference?


-- 
Thanks,
Sanjay Mantoor


Re: [PHP] Apache is not parsing .php files

2006-01-28 Thread sanjay

Thanks for the help.

Yeah problem was with php.ini file.

Entry for memory limit is 12MB in the file actually it should read 12M (not 
12MB).

sanjay
www.apptility.com

Richard Lynch wrote:


On Thu, January 26, 2006 2:19 pm, sanjay wrote:
 


I have a strange problem while trying to run php based applications.

Lets start with phpMyAdmin, a very popular open source tool to manage
MySQL written in php.
I have already installed phpMyAdmin and was running fine.
One day suddenly when I pointed my browser at :
http://localhost/phpMyAdmin
Instead of running the phpMyAdmin browser opened a message window with
options-
Open With or Save to disk .
I am sure its not browser problem because I tried on Firefox-1.5,
Mozilla, Epiphany and Konqueror.

One more point I would like to add here that if I write one small php
program and
save it in as php file (test.php) then
http://localhost/test.php
executes properly

I am using Fedora 2 and apache2, php-4.3x and mysql-3.x were part of
the
Fedora installation.
The only change I made in the /etc/php.ini file was to increase the
memory limit from 8MB to 12MB.
(Then restarted the http server)
Now even php.ini file is in the original state but problem is still
there.
The http.conf file is unchanged.


Can any one give me some sort of idea.
   



My first WILD GUESS is that way long time ago, you changed httpd.conf
and/or php.ini, but forgot to re-start Apache, and then tested, and
everything worked, so you went on.

Now, when you HAVE re-started Apache, your fix from ages ago is
finally kicking in, and you have no recollection of that change.

If you have log files or notes of changes made previously, especially
to httpd.conf, php.ini, or .htaccess, review them -- Keep in mind that
what you are calling your original httpd.conf and php.ini file are,
in fact, the ones you modified oh so long ago.

Another tack you can take is to go ahead and save what the browser is
sending you and look at it and see what it looks like.

PHP Source?

Or something else?

Also use telnet or curl (from another box) or similar to get the
headers and HTML that is coming out from the broken pages.

 



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



[PHP] Apache is not parsing .php files

2006-01-26 Thread sanjay

Hi,

I have a strange problem while trying to run php based applications.

Lets start with phpMyAdmin, a very popular open source tool to manage
MySQL written in php.
I have already installed phpMyAdmin and was running fine.
One day suddenly when I pointed my browser at :
http://localhost/phpMyAdmin
Instead of running the phpMyAdmin browser opened a message window with 
options-

Open With or Save to disk .
I am sure its not browser problem because I tried on Firefox-1.5, 
Mozilla, Epiphany and Konqueror.


One more point I would like to add here that if I write one small php 
program and

save it in as php file (test.php) then
http://localhost/test.php
executes properly

I am using Fedora 2 and apache2, php-4.3x and mysql-3.x were part of the 
Fedora installation.
The only change I made in the /etc/php.ini file was to increase the 
memory limit from 8MB to 12MB.

(Then restarted the http server)
Now even php.ini file is in the original state but problem is still there.
The http.conf file is unchanged.


Can any one give me some sort of idea.

Thanks,

Sanjay

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



[PHP] return multiple value from function

2002-04-29 Thread sanjay

Hi List,

I am new to php programming and wanted to know if it is possible to return
multiple value from a function like cgi programs.
How can I get the following result using php.

($var1, $var2) = myfunction($a,$b);


function myfunction($c,$d)
{
   // code
// code
return ($e,$f);
}


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




Re: [PHP] return multiple value from function

2002-04-29 Thread sanjay

Thnaks. It solved my problem.

sanjay

- Original Message - 
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 29, 2002 7:50 PM
Subject: Re: [PHP] return multiple value from function


On Monday 29 April 2002 22:11, sanjay wrote:
 Hi List,

 I am new to php programming and wanted to know if it is possible to return
 multiple value from a function like cgi programs.
 How can I get the following result using php.

 ($var1, $var2) = myfunction($a,$b);


 function myfunction($c,$d)
 {
// code
 // code
 return ($e,$f);
 }

No. But it is possible to get similar results.

a) Return an array

  $result = myfunction($a, $b);
  echo $result['e'];
  echo $result['f'];


  function myfunction($c, $d) {
do
something
$result['e'] = $this_is_e;
$result['f'] = $this_is_f;
return $result;
  }


b) Use references

  myfunction($c, $d, $e, $f);

  echo $e;
  echo $f;
 
  function myfunction($c, $d, $e, $f) {
do
something
$e = $this_is_e;
$f = $this_is_f;
  }

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

/*
I didn't know it was impossible when I did it.
*/

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



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




Re: [PHP] Crontab

2002-02-26 Thread sanjay

see whether the command line option is available on your server. 

sanjay

- Original Message - 
From: Uma Shankari T. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 27, 2002 10:41 AM
Subject: [PHP] Crontab




 Hello,


   I need to run one php script using crontab.I am having this doubt.If
the phpscript run in the command prompt then only we can run the script
using crontab...please tell me how do i go about with this..




-Uma 


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




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




[PHP] How to define subroutine

2002-01-07 Thread sanjay

Hi

I am new to PHP and want to do object oriented programming in PHP. I want to write a 
subroutine and call that subroutine. I tried the following code but it gives me an 
error.

Regards
Sanjay

?
$ref = testfun();
print Ref is $ref;
sub testfun()
{
return HI;
}
?



[PHP] php binary

2001-12-11 Thread sanjay

Hi

Can someone tell me from where can I get the binary file of php so that I
can run php files from the command line of Unix.

Thanks in advance.

Regards
Sanjay



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




[PHP] How to change Return-path and sender address

2001-12-06 Thread sanjay

Hi

I have a script which sends email from the web. The problem is the header of
the message contains Return-path and Sender email address as the
[EMAIL PROTECTED]

So, can some one help how can I set Return-path and Sender address as From
Address?

Regards
Sanjay



Return-path: [EMAIL PROTECTED]
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Thu, 06 Dec 2001 11:14:05 +
Received: from [192.168.0.2] (helo=mail.linuxserver.com)
 by mail.softhome.net with esmtp (Exim 3.22 #2)
 id 16BwTd-0007yH-00
 for [EMAIL PROTECTED]; Thu, 06 Dec 2001 11:14:05 +
Received: from webmaster by mail.linuxserver.com with local (Exim 3.16 #1)
 id 16BvPB-0003HI-00
 for [EMAIL PROTECTED]; Thu, 06 Dec 2001 10:05:25 +
To: [EMAIL PROTECTED]
Subject: Re: Your  Application
From: [EMAIL PROTECTED]
Message-Id: [EMAIL PROTECTED]
Sender:  [EMAIL PROTECTED]
Date: Thu, 06 Dec 2001 10:05:25 +



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




Re: [PHP] How to change Return-path and sender address

2001-12-06 Thread sanjay

I tried this before posting to the list. it didn't worked for me.

sanjay

- Original Message -
From: Bart Frackiewicz [EMAIL PROTECTED]
To: sanjay [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 06, 2001 4:00 PM
Subject: Re: [PHP] How to change Return-path and sender address


Hi Sanjay,

you can add extra headers in the mail command.

example from php.net:

mail([EMAIL PROTECTED], the subject, $message,
 From: webmaster@$SERVER_NAME\r\n
.Reply-To: webmaster@$SERVER_NAME\r\n
.X-Mailer: PHP/ . phpversion());

Bart

-Ursprüngliche Nachricht-
Von: sanjay [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 6. Dezember 2001 11:29
An: [EMAIL PROTECTED]
Betreff: [PHP] How to change Return-path and sender address


Hi

I have a script which sends email from the web. The problem is the
header of
the message contains Return-path and Sender email address as the
[EMAIL PROTECTED]

So, can some one help how can I set Return-path and Sender address as
From
Address?

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


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



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




[PHP] unbale to send mails using mail function

2001-11-29 Thread sanjay

Hi

I have successfully installed PHP 4.0.6 with apache 1.3.22 on my mandrake
Linux box. Now, the problem is I am not able to send email using mail () of
php. However, I am able to send it using mail command.

Any help will be highly appreciated.

Regards
Sanjay



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