Re: [PHP] Flat PHP projects and Firebug

2012-04-12 Thread Kranthi Krishna
I never had a problem with FirePHP. Among other tools I have used,
some gave Headers already sent problem. The rest failed in case of
AJAX requests.

AFAIR Breakpoints are used for debugging and are different from
Logging. For debugging you may have a look at xDebug

Kranthi.
http://goo.gl/e6t3



On 12 April 2012 18:10, Louis Huppenbauer louis.huppenba...@gmail.com wrote:
 2012/4/12 Mihamina Rakotomandimby miham...@rktmb.org

 Hi all,

 For flat PHP projects (I mean without framework such as Jelix or
 Symfony), what Firebug logging tooldo you recommend to use?
 - FirePHP?
 - in-the-code Javascript console.log() generation?
 - other tools?


 These are for training project, not really real-world ones, in order to
 train juniors/newcomers to our team.

 I missed the name of a PHP class or library that allowed to use
 breakpoints and so with Firebug... or some similar things...



 --
 RMA.

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


 Hi there

 I think that firephp could do the trick for you.

 http://www.firephp.org/

 Sincerely
 Louis

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



Re: [PHP] Headers already sent

2011-11-10 Thread Kranthi Krishna
Hi,

 Perhaps your server is configured to have output buffering enabled by default
Thanks. That was the problem. I spent a day trying to debug this.

Kranthi.
http://goo.gl/e6t3

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



Re: [PHP] Linking A C Program Example to PHP

2011-07-11 Thread Kranthi Krishna
  But the example will NOT work via the web browser on my Apache 2
 (2.2.17) / PHP (5.3.5) Web Server!
May be a problem with the permissions ?

Kranthi.
http://goo.gl/e6t3

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



Re: [PHP] Re: Getting File Owner Name

2011-06-13 Thread Kranthi Krishna
this might be of use
http://php.net/posix-getpwnam
 http://php.net/manual/en/function.posix-getpwnam.php

Kranthi.
http://goo.gl/e6t3


Re: [PHP] No errors gets displayed, just a blank page

2010-12-07 Thread Kranthi Krishna
wats the setting of display_errors php.net/display_errors ?

if you are not getting any output it might be because of a simple
parse error (mismatched brackets, misplaced semicolon etc) or an
exit/die command

Kranthi.
http://goo.gl/e6t3

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



Re: [PHP] newbie basic realm protection - why don't the input usr/pass stick?

2010-12-07 Thread Kranthi Krishna
you script looks (and works) fine. so i dont think the problem is in your script

I found firebug/live http headers firefox addons to be helpful in this situation
see if your client is actually sending Authorization   Basic header

Kranthi.
http://goo.gl/e6t3

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



Re: [PHP] Scripts running twice

2010-10-12 Thread Kranthi Krishna
apache log files will be of help

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



Re: [PHP] Google Calendar

2010-10-12 Thread Kranthi Krishna
The exact error message will help understand your situation

Most probable reason is Zend is not included in your include path

develop with error_reporting set to E_ALL  E_STRICT that will help
you understand many trivial errors

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



Re: [PHP] Google Calendar

2010-10-12 Thread Kranthi Krishna
in this case when you put a tab before the closing heredoc it is not
an error in itself. Its equivalent to removing the closing heredoc. so
PHP treats the rest of the code as part of the string.

A Parse error is reported when ? OR end of the file is reached

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



Re: [PHP] Unknown Table i field list

2010-10-11 Thread Kranthi Krishna
echo $query;
before
$result = mysqli_query($dbc, $query);
might be of help to understand what is going wrong

copy that query and execute in phpMyAdmin

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



Re: [PHP] Syntax Error

2010-10-04 Thread kranthi
As pointed out echo $insertSQl should help you locate many trivial
problems. But using PDO will avoid these kind of problems

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



Re: [PHP] file_get_contents() failing on CentOS.

2010-10-04 Thread kranthi
http_proxy or HTTP_PROXY i m not sure

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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread kranthi
they should be something like error_log-[date] not sure about windows though

However I have found that if I paste the html into my web page created by 
Serif WebPlus 10 I get the html line but not the php line.

are you saying that you are getting the php code in your browser ?
?php
echo pThis is a PHP line/p;
phpinfo();
?

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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread kranthi
apache error logs will be helpful in this case. Their location varies
depending upon your installation. But in any case they'll be insde
your server directory (IIRC it is c:/Program Files/Apache Software
Foundation/Apache by default)

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



Re: [PHP] file_get_contents() failing on CentOS.

2010-10-04 Thread kranthi
and if proxxy is the issue http://proxychains.sf.net/ will help

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



Re: [PHP] PHP Email Question

2010-10-01 Thread kranthi
I cant see why you are getting the letter 'z' (assuming $msgContent
was referenced properly) . Complete code will be helpful to debug the
problem.

Also, Heredoc syntax will be more helpful in your situation. And usage
of global keyword is strongly discouraged in favor of $GLOBALS
superglobal array

http://php.net/GLOBALS
http://php.net/heredoc

Kranthi.
http://goo.gl/e6t3

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



Re: [PHP] file_get_contents() failing on CentOS.

2010-10-01 Thread kranthi
probably not the issue, but is the php engine behind a proxy server ?
wget uses the environment variable, but PHP does not

Kranthi.
http://goo.gl/e6t3

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



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread kranthi
i m not sure if i usderstood your question completely.
by database you mean something like phpmyadmin, right ?

i would save the latest session id of the boss in a file, and every
time an employee tries to log in, verify the time stamp of the session
file in the tmp folder.
and if the boss logs out... clear off the tmp folder to ensure that
the employees dosent have further access.

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



Re: [PHP] New to PHP and the list

2010-09-13 Thread kranthi
 Is MAX_FILE_SIZE passed to PHP as $MAX_FILE_SIZE?
only if register_golbals is set to ON in php.ini. This is a very bad
practice and should be avoided. Use $_POST['MAX_FILE_SIZE'] instead.
But in this case dont use the post variable also. define a constant in
your configuration file and use that constant. The only use of
MAX_FILE_SIZE  is to inform the browser that dont allow the user to
upload files which are  MAX_FILE_SIZE.

 ?php

 $MAX_FILE_SIZE = 3;

 echo _END
 form enctype=multipart/form-data action=__URL__ method=POST
     !-- MAX_FILE_SIZE must precede the file input field --
     input type=hidden name=MAX_FILE_SIZE  /
     !-- Name of input element determines name in $_FILES array --
     Send this file: input name=userfile type=file /
     input type=submit value=Send File /
 /form
 _END
Nope, you cant. You have to mention the value attribute of a hidden field

 I'm also concerned that in the first instance, a malicious user can
 modify the value and I will be hosed. Am I correct?
A malicious user can ALWAYS modify the data. You will have to always
validate every input field.

 echo _END
 form enctype=multipart/form-data action=__URL__ method=POST
!-- MAX_FILE_SIZE must precede the file input field --
input type=hidden name=?php echo $max_file_size; ?  /
!-- Name of input element determines name in $_FILES array --
Send this file: input name=userfile type=file /
input type=submit value=Send File /
 /form
 _END
i did not understand this echo _END means that you are in php so
why do you need a ?php echo $max_file_size; ? ?

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



Re: [PHP] Hi

2010-09-06 Thread kranthi
use some thing like http://uploadify.com


u can always check for the uploaded file extension/mime-type on the server side

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



[PHP] array_walk_recursive pass by reference

2010-08-28 Thread kranthi
i have an array
$parms = array('1' = 'a', 'b' = array(3 = 'test'));
i want $mail = '1:a 3:test';

array_walk_recursive($parms, function($val, $key, $mail) {
    $mail .= ucwords($key) . ': '. ucwords($val) . \n;
}, $mail);

The above function worked perfectly well
but i am getting: Call-time pass-by-reference has been deprecated in
/var/www/html/test.php on line 31

if i change it to

array_walk_recursive($parms, function($val, $key, $mail) {
$mail .= ucwords($key) . ': '. ucwords($val) . \n;
}, $mail);

i am not getting the error but $mail is not being returned.

ny solution ?

Regards
KK

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



Re: [PHP] login to protected directory by php

2010-08-15 Thread kranthi
i would configure apache to let php interpreter handle all kinds of
extensions ( http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addhandler
)

even then u'll have go through all the steps pointed out by Ash.
the only advantage of this method is more user friendly URL

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



Re: [PHP] user login and access + headers already sent

2010-07-15 Thread kranthi
i prefer using a template engine like smarty http://www.smarty.net/

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



Re: [PHP] set different .htaccess rules

2010-07-15 Thread kranthi
i would use a single point of entry to solve this problem
1. keep the files outside your doc root
2. in the php file files.php check for an authorized user, if so allow
the user to download the file

the path http://site.com/files/we23h4hk234hjksdjrjkl23jfasdf will
actually be http://site.com/files.php?file=we23h4hk234hjksdjrjkl23jfasdf

if you hav access to httpd.conf (i am not sure if .htaccss works) u
can set the non php extensions to be executed by the php interpreter
and check for authorization (the way rapidshare works)

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



Re: [PHP] Versión del MySQL en PHP

2010-05-19 Thread kranthi
http://www.php.net/manual/en/function.mysql-get-server-info.php

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



Re: [PHP] var_dump( (0 == 'heading') ) == TRUE ?!

2010-05-14 Thread kranthi
== operator type casts the string to integer before comparing
so the comparison boils down to 0 == 0 which is true
these rules also apply to the switch statement
http://php.net/manual/en/language.operators.comparison.php

but with === the typecasting does no occur

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



Re: [PHP] Any One See where this is going wrong?

2010-04-30 Thread kranthi
may be it is not the error with the code. The problem may be with some
'  in the input. Print out the mysql error and/or the sql query to see
what is going wrong.

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



Re: [PHP] Get Power Saving Settings of the Server

2010-04-20 Thread kranthi
 Your server management software may provide a way to get this information 
 either through the command line or through a network interface

Using exec('gconftool-2 -g
/apps/gnome-power-manager/timeout/sleep_display_ac') helped. Thanks

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



[PHP] Get Power Saving Settings of the Server

2010-04-19 Thread kranthi
Hi all,
My PHP script is running as CLI. Can I get the Power Management
Settings of the server ?

I am using PHP 5.3.2 on Fedora 12 Machine (2.6.32.10-90.fc12.i686)


KK.

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



Re: [PHP] changing NULL behavior in PHP arithmetic

2010-04-15 Thread kranthi
 because arithmetic operations with Unknown operands should result to 
 Unknown ...
in PHP Unknown values are represented by NaN, not NULL
http://php.net/manual/en/function.is-nan.php

but what surprises me is
is_nan(6/0) = (bool)false (along with a warning)

 Now PHP uses NULL as a 0 (zero) for arithmetic
I dont expect anything different, because intval(null) is 0.

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



Re: [PHP] Mail Function Problem

2010-04-12 Thread kranthi
PEAR's mail package does support authentication.
http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm

In case you get a Sent Successfully message (but didn't get a mail
in your inbox or spam folder) there is a problem with your SMTP server
configuration. And
 There's no need to edit anything in php.ini, and, since it is pure PHP,
 it should work on Windows too (i tried it and it works)

KK.

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



Re: [PHP] Mail Function Problem

2010-04-12 Thread kranthi
thats weired...
Mail.php contains the class Mail. So getting a class not found error
is not possible... (require_once stops the script in case it can't
find Mail.php)
 Do I need to move the Mail PEAR class to the same folder as my web folder
ensure that C:/xampp/php/PEAR folder is added to your include list

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



Re: [PHP] Mail Function Problem

2010-04-12 Thread kranthi
when you install pear package Mail a file called Mail.php will be
installed into C:/xampp/php/PEAR
 Mail.php contains the class Mail. So getting a class not found error is 
 not possible..
are you sure you are doing require_once 'Mail.php' ?

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



Re: [PHP] Re: PHP execute very slow : PHP Version 5.2.6

2010-04-11 Thread kranthi
have you tried using a profiler like xdebug? or may be it is not a php
issue at all..
i find https://addons.mozilla.org/en-US/firefox/addon/1843 to be
helpful in these situations

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



Re: [PHP] PHP MYSQL sorting

2010-04-11 Thread kranthi
You can use javascript to trigger an onclick function every time a checkbox
is selected.
The onclick function can make an ajax call to a remote php script which can
then make the database query.


Re: [PHP] need help w/ unfamiliar syntax

2010-04-11 Thread kranthi
guess you are looking for
http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing

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



Re: [PHP] 404 redirects stolen by provider

2010-04-09 Thread kranthi
header('HTTP/1.1 200 Ok');
in /subapp_members/search_user.php will do the job

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



Re: [PHP] No notices for undefined index

2010-04-08 Thread kranthi
 print $a[0];   // prints 5
 print $a[100]; // Notice: Uninitialized string offset:  100
Yup, this should happen when 5 is treated as an array of characters.
In other words as a string.
$a = '5';
echo $a[0];
echo $a[100];
gives you the expected result

regarding the original question, i think that the interpreter is
prefilling the variable with null

$a = 5;
var_dump(isset($a[0]));
var_dump($a[0]);

since $a[0] is already assigned (to null) the interpreter is not
throwing a notice

$b = null;
var_dump(isset($b));
var_dump($b);

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



Re: [PHP] Forgot what to install

2010-04-08 Thread kranthi
you forgot httpd
KK.



On Fri, Apr 9, 2010 at 08:32, David McGlone da...@dmcentral.net wrote:
 Hey guys, quick question. I had to re-install my Ubuntu, and I forgot
 what package I needed so firefox will display the php files and not ask
 me to if I want to download them. I've done installed PHP5, mysql, and
 php-mysql. What did I miss. I know the package name, but it's completely
 slipping my mind right now.

 Thanks
 David M.


 --
 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] no-cache control

2010-04-06 Thread kranthi
you can do that by using .htacess in the required directory
http://www.askapache.com/htaccess/apache-speed-cache-control.html

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



[PHP] CLI behind proxy

2010-02-04 Thread kranthi
Hi all,

I want to run fsockopen etc behind a proxy.
proxychains (http://proxychains.sourceforge.net/) may be helpful,
unfortunately the support for that is pretty bad. Please inform me of other
alternatives

KK.


Re: [PHP] CLI behind proxy

2010-02-04 Thread kranthi
I did'nt understand completely. But I noticed that if i do

$opts = array('http' = array('proxy' = 'tcp://10.3.100.212:8080',
'request_fulluri' = true));
$context = stream_context_set_default($opts);

fopen, file_get_contents, etc. are working fine, but fsockopen is not

KK.


Re: [PHP] CLI behind proxy

2010-02-04 Thread kranthi
stream_socket_client(tcp://talk.google.com:5222)
i m trying to use http://code.google.com/p/xmpphp/ actually

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



Re: [PHP] Cookies sessions

2010-01-19 Thread kranthi
 When I first started using sessions, I was alarmed to read a very similar 
 statement about
 sessions, but I soon found that if I started my program with the statement
 session_start(); I could then set up, access, modify or clear any session 
 variable at
 any time in my program. This is enormously useful, as I can put the session 
 handling at
 any convenient point in my program, and can precede them with diagnostics if 
 I need to.

are you looking for ob_* functions ?

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



[PHP] stream_socket_client via proxy

2010-01-10 Thread kranthi
Hi all,

I am trying to use http://code.google.com/p/xmpphp/ package. It uses
stream_socket_client to connect to XMPP servers. I am behind a proxy
server so obviously this is not working. Tried proxychains but to no
avail.

Am I missing something obvious?

Kranthi.

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



Re: [PHP] output buffer

2009-12-29 Thread kranthi
most probable error in your case is the dev server has output
buffering enabled while it is turned off on the live server. try
phpinfo to verify

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



Re: [PHP] Unable to get output from exec ssh remote-server 'ping -c4 ip'

2009-12-29 Thread kranthi
better try using ssh2_* functions

http://www.php.net/manual/en/function.ssh2-tunnel.php

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



Re: [PHP] Tracking file download progress

2009-12-25 Thread kranthi
 Thanks all, I've found the solution! PHP Backend + JQuery works great!
Just out of curiosity. Can you please tell me how you initiated the download?

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



Re: [PHP] Tracking file download progress

2009-12-24 Thread kranthi
I dont think the problem in discussion has a solution. Your idea can
probably work but I could not understand how $_REQUEST['compleated']
variable is populated.

However it suffers from 2 problems.
1. It consumes a lot of unnecessary bandwidth.
2. How are you going to initiate the download ?

That said, there is a work around of using server push technology. Of
course it does not work in IE though.

www.howtocreate.co.uk/php/serverpushdemo.php

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



Re: [PHP] Form validation issue

2009-12-24 Thread kranthi
The javascript function formValidator() must return false if any
errors are formed.

The PHP only runs if the fields are set by testing using ‘isset”.
You should definitely have a better validation than that. Remember
that all users dont have javascript enabled. Moreover it is very easy
to modify the request variables.

 However, if the server-side evaluation fails and the page is refreshed, then 
 all the previous values are lost -- UNLESS -- you keep them in a cookie, 
 database, or session. I suggest using a session.
This is true when the page is refreshed but I doubt that is the case
here. Since $_SERVER['PHP_SELF'] is being used I think value=?php
echo $_POST[...] ? will be sufficient

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



Re: [PHP] Tracking file download progress

2009-12-24 Thread kranthi
Just out of curiosity. Can you please tell me how you initiated the download?

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



Re: [PHP] sending email with php

2009-12-23 Thread kranthi
another point worth noting...

most of the major email clients does not display external css/images by
default. The user will have to grant permission explicitly.


Re: [PHP] sending email with php

2009-12-23 Thread kranthi
No. You must have noticed gmail saying images are blocked from .. . This
is done to prevent spammers from knowing if your email is authentic or not.
Moreover you must have also noticed that all the news letters have a link
pointing to a web page version of the newsletter.


Re: [PHP] Upload dir

2009-12-11 Thread kranthi
my mistake didn't use move_uploaded_file to see if the uploading
is working or not in the first case

but i could not understand why
   1. ini_get() is giving correct value while
$_FILES['file']['tmp_name'] is ignoring that.
   2. move_uploaded_file($_FILES['file']['tmp_name'], 'file.php'); is
working fine but file_exists($_FILES['file']['tmp_name']) is returning
false
   3. php_admin_value upload_tmp_dir /var/www/html
in httpd.conf seems to work ($_FILES['file']['tmp_name'] is not ignoring that);

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



[PHP] Upload dir

2009-12-10 Thread kranthi
How can i change the temporary upload directory?
var_dump(ini_get('upload_tmp_dir'));  gives me (and that is set in php.ini)
string '/var/www/cgi-bin' (length=16)

but
var_dump($_FILES) gives me
'tmp_name' = string '/tmp/phpbSZ6WP' (length=14)

var_dump(file_exists($_FILES['file']['tmp_name']));  gives me  (/tmp
has permissions drwxrwxrwt and i never used file_move_upload or any
similar functions)
boolean false

am I missing something here?
Kranthi.

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



Re: [PHP] Upload dir

2009-12-10 Thread kranthi
i doubt i can use ini_set in this scenario

http://us3.php.net/manual/en/ini.core.php#ini.upload-tmp-dir

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



Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-09 Thread kranthi
may be unrelated to your problem... but are you behind a proxy?

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



Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread kranthi
as jim stated you'll get a undefined function error if php_mysql
extension is not loaded.
in this case probably the MySql server is not running, or not running
on the default port (most likely the former)

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



Re: [PHP] RewriteRule to hide PHP vars in URL

2009-10-25 Thread kranthi
base will just complicate things... (its sure to solve your problems but
you have to type the relative path to your document root for every URI)

seems you are looking for
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#RewriteCond


Re: [PHP] php mail() function

2009-10-23 Thread kranthi
i faced the same problem quite a few times.

the general email route is
php script - sender smtp server - receiving mail server
in your case path 2 is broken. meaning port 25 is blocked by your ISP

the work around is:
1. see if your ISP provides you with an SMTP account that is not blocked (OR)
2. try using a socks

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



Re: [PHP] Is there any way to get all the function name being called in a process?

2009-10-23 Thread kranthi
even APD is not up to the task

xdebug trace http://devzone.zend.com/article/2871 is sufficient, but
the output will be in a separate file.

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



Re: [PHP] php mail() function

2009-10-23 Thread kranthi
i never worked with postfix, but form my experience with hmail server
i can say that you need to relay through a mail account of ISP(not the
server itself)

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



Re: [PHP] Sessions seems to kill db connection

2009-10-23 Thread kranthi
 Db error: Access denied for user 'www-data'@'localhost' (using password: NO)

 WTF? I´m not using a user called www-data for MySQL connections, but apache 
 runs as this user

in the case where $test is true there is an open mysql connection, but
when $test is false there is no open connection is  available. may be
you have opened a connection when $test is true or used a
mysql_close() when $test is false or when $_SESSION['login']['uid'] is
set.

regarding www-data, when mysql_query() fails to find a valid MySql
connection, it tries to open a new connection with mysql.default_user
and mysql.default_password (u can see these values trough phpinfo());
http://php.net/manual/en/function.mysql-connect.php

this used to be the behavior earlier, seems it was changed from PHP  5.3.0

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



Re: [PHP] Get rid of warning massage

2009-10-20 Thread kranthi
http://php.net/manual/en/language.operators.errorcontrol.php ?

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



Re: [PHP] Re: php exception handling

2009-10-12 Thread kranthi
cant http://us3.php.net/manual/en/function.set-exception-handler.php be used ?

?php
function exception_handler($e) {
//mail('to', 'exception', $e-getMessage());
}
set_exception_handler('exception_handler');

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



Re: [PHP] Header problem

2009-10-03 Thread kranthi
Thats a lot of headers to read..
At a first glance I can see that you did not specify a content-length
header. this is a must and must be equal to the size of the file in
bytes

-- 
Kranthi.

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



Re: [PHP] Curl output

2009-10-02 Thread kranthi
using the base tag is a solution to your problem if the links are relative..
http://www.w3schools.com/TAGS/tag_base.asp
but I am not sure if base tag works outside html/html

try... base href=URL/base before curl_init()
where URL is parsed using PHP's parse_url() function on http://example.com

in either case if there are any external js/css files cURL wont fetch
external files(and if they are internal/inline your browser should
display them already).. your browser will have to fetch them for you,
net console of firebug will be helpful in that case.

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



Re: [PHP] Self-Process php forms or not?

2009-10-02 Thread kranthi
I try to avoid the use of hidden form elements as much as possible,
especially for tracking whether a user has submitted a form or not...

I use name=submit for the submit button instead, that will pass the
value of the submit button to the action script.

above all i use a template engine, smarty to take care of the
presentation for me(like deciding whether to show the form and/or a
success/failure message)

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



Re: [PHP] Incorrect _SERVER['SERVER_PORT'] returned??

2009-10-02 Thread kranthi
i dont have any idea about your problem, but just an idea

have you used https://localhost in the browser while trying to check
_SERVER['SERVER_PORT'] ?

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



Re: [PHP] RE: WYSIWYG editor to change textarea

2009-10-02 Thread kranthi
I would recommend using an open framework like yui/dojo/jquery for ALL
your javascript needs..(i personally prefer jquery) each of the above
mentioned frameworks have wysiwyg editors of their own.

try using http://code.google.com/p/jwysiwyg/ i doubt it will conflict
with your javascript with compatibility mode ON
http://docs.jquery.com/Using_jQuery_with_Other_Libraries

TinyMCE as such is a very good plugin (i use that in nearly all of my
projects and never faced a problem with it). may be you should try to
debug your code that is conflicting with tinyMCE

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



Re: [PHP] Self-Process php forms or not?

2009-10-02 Thread kranthi
 That only works if the user clicks on that submit button. If the user
 hits the enter key in a text input, the form is submitted but the submit
 input variable is not set. That is why an hidden input is a safer solution.

i doubt that, because i use the above mentioned method in nearly all
of my projects, and all of them are working fine.

P.S: i prefer keyboard to mouse as a input device

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



Re: [PHP] Self-Process php forms or not?

2009-10-02 Thread kranthi
and yes i forgot to mention... i avoid hidden form elements because
they can be modified very easily and hence pose a security threat.

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



Re: [PHP] Self-Process php forms or not?

2009-10-02 Thread kranthi
 You say you don't use hidden fields because they can be modified too
 easily, yet you say you check for the submit button? Which out of the
 two do you do, as last time I checked, modifying one form field is as
 easy as changing any other!
I completely agree with you. changing submit text is as easy as
changing hidden fields, but its less likely for a user to modify a
submit button as compared to a hidden field. moreover it just reduces
my typing load. (This is just my practice)

 Also worth noting, you can only successfully check for the name=submit
 value if there is only one submit button in your form, as that is then
 the default (and only) submit that the form can use, so it uses that. If
 you have more than one submit button (and this includes image input
 elements) then using the keyboard will use the first submit field it
 finds I believe.
Cant agree with you on this though. as far as i know using name=
(names of the two buttons may/may not be unique) is the only way to
track form submission for forms with multiple submit buttons. Please
point out if you think otherwise

-- 
Kranthi.

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



Re: [PHP] Curl output

2009-10-02 Thread kranthi
 Some browser security settings may not allow you to run Javascript code
 that exists on another server though
not many users use those kind of browsers, because if they do most of
the websites which use CDNs will not work.

Firstly, it is not a good idea to fetch an entire web page and snow it
to an user. (use iframes if this is a must)
Secondly, this idea may not be feasible if the web page in question
uses AJAX, because none of the browsers allow cross domain AJAX
requests

As a side note, use str_replace(head, headbase/base,
$text) if base tag doesnot work

On 02/10/2009, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
 On Fri, 2009-10-02 at 12:51 +0530, kranthi wrote:
 using the base tag is a solution to your problem if the links are
 relative..
 http://www.w3schools.com/TAGS/tag_base.asp
 but I am not sure if base tag works outside html/html

 try... base href=URL/base before curl_init()
 where URL is parsed using PHP's parse_url() function on http://example.com

 in either case if there are any external js/css files cURL wont fetch
 external files(and if they are internal/inline your browser should
 display them already).. your browser will have to fetch them for you,
 net console of firebug will be helpful in that case.


 Some browser security settings may not allow you to run Javascript code
 that exists on another server though. The base tag can be used to
 reference the external CSS and Javascript, but watch out for security
 settings on client agents.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk






-- 
Kranthi.

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



Re: [PHP] Curl output

2009-10-02 Thread kranthi
 I've read that the upcoming Firefox 4 may have some features built in
 for this sort of thing, and there are plugins out there for most
 browsers that can do this as an added layer of security.
Sorry but I could not understand what you meant by this

coming back to original problem... you should keep in mind that if
base tag is used, the links (a href=...) in that page will become
absolute links instead of relative links

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



Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-12 Thread kranthi
I dont think I understood you completely..

Javascript debugger: Something you use to debug javascript. but
Formaldehyde dosent make any seance if xhr object is not used.
PHP Debugger: We cant use Formaldehyde to debug errors in every single
PHP script. I am talking about pages called directly via the browsers
URL bar. FirePHP on the other hand can be used with all PHP scripts.
AJAX Debugger: I think the example given in Formaldehyde Google code
page fits this category. If not may be you can give an example ?

@Andera May be you should consider using application/json as the
content type instead of text/plain.
The Response text given by  Formaldehyde cannot be understood manually
(for example if I use jQuery.load()).
Had the content type been application/json firebug parses it by default

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



Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-12 Thread kranthi
 @Andera May be you should consider using application/json as the
 content type instead of text/plain.
 The Response text given by  Formaldehyde cannot be understood manually
 (for example if I use jQuery.load()).
 Had the content type been application/json firebug parses it by default

my mistake.

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



Re: [PHP] Odd Endless Loop with Explorer 8 (pc)

2009-09-12 Thread kranthi
 ?php echo 'meta http-equiv=refresh content=0;page2.php'; ?
may b u should have
?php echo 'meta http-equiv=refresh content=0;url=page2.php'; ?

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



Re: [PHP] Date +30 comparison

2009-09-01 Thread kranthi
i prefer http://in3.php.net/strtotime it supports loads of other
formats as well (including +30 days and 8/26/2009)
above all it returns unix time stamp which can be used directly with date().

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



Re: [PHP] SESSIONS lost sometimes

2009-08-20 Thread kranthi
The original problem..

 server is losing session variables.
I dont think PHP is not good at unset() ing variables while the script
is executing.

general logger will be of use in this case (especially when cant
reproduce the problem every time). PEAR, Zend, FirePHP, files... any
thing will do...

try to log every thing related to sessions at the start of the page...
session_id, $_SESSION super global, _SERVER['PHP_SELF']
do the same thing after the script exists...

i had a similar problem earlier...
a page in my app used to change $_SESSION['id']. It took me ages to
find out the source... even grep was of no use... at last  i was able
to isolate the page that was causing this, with the help of logging.
Of course, the main problem was that my production server has
register_globals on, while my development server has them off.

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



Re: [PHP] SESSIONS lost sometimes

2009-08-20 Thread kranthi
 I imagine redirects couldn't be the cause of the problem, right?
Thanks, this is really a life saver.. I never used
session_write_close() before any redirects...

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



Re: [PHP] Extract column names from a (my)SQL query

2009-08-20 Thread kranthi
this might be some help...
http://stackoverflow.com/questions/283087/php-mysql-sql-parser-insert-and-update

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



Re: [PHP] Re: PHP and CGI

2009-08-18 Thread kranthi
try adding

AddType application/x-httpd-php .pl -- or whatever extension your
perl script has

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



Re: [PHP] Undefined Offset Error with Pagination and Sessions

2009-08-18 Thread kranthi
may be you can use a couple of var_dumps to see what's happening
behind the screens.


and... use a debugger like xdebug.. it'll be of help

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



Re: [PHP] getting the search words from a google query

2009-08-18 Thread kranthi
can you provide a sample URL that you have in your mysql database ?

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



Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread kranthi
HTTP_REFERRER is transparent, but if can be messed with very easily. I
prefer use of $_SESSION vars if security is needed in my application
(epically when a page is shown after a POST request)

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



Re: [PHP] link to a css file requires .css ???

2009-08-17 Thread kranthi
A browser will always parse link .. tag regard less of the
extension. the only condition is that the file should provide a mine
type 'text/css' for css files.

https://developer.mozilla.org/en/Incorrect_MIME_Type_for_CSS_Files

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



Re: [PHP] Another date exercise

2009-08-17 Thread kranthi
dont you think http://in3.php.net/strtotime is a solution to your problem ?

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



Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
see if can run the same php file via CLI. does script.sh run without
any problems ? then, probably something linke SELinux is preventing
httpd from running scripts. you have to contact your system
administrator to get this fixed.

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



Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
Did you check SELinux options ??

I have a similar problem. For some unknown reason scan_dir() is not
able to read /home/user when run as Apache module. but the CLI is
giving expected results. I did not find any work around, but had to
read /var/www which is the home directory of 'apache' (this is the
user under which apache runs by default. hence you script needs 777 to
execute)

So if every thing else fails I'll recommend you to move the script to
/var/ww (usually your server root) instead of /home/user

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



Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
 That's a potential security flaw waiting to happen. A script like this
 shouldn't be kept in a web-accessible directory.
/var/www is not the document root. document root is /var/www/html so I
dont think there's a problem.

 /var/www (usually your server root)
I am mistaken regarding this.

for details (the location of httpd.conf may vary depending on your
distro, but it is definitely located in /etc/)
$ cat /etc/passwd | grep apache
$ cat /etc/httpd/conf/httpd.conf | grep ^ServerRoot
$ cat /etc/httpd/conf/httpd.conf | grep ^DocumentRoot
$ cat /etc/httpd/conf/httpd.conf | grep ^User

 I have no access to that directory.
seems you do not have access to any directory other than /home/user.
but i dont think there's a work around, you'll have to request your
administrator to move that file to /var/www directory (and retain
777).

 ls, pwd, and other commands run fine.
i dont think ls /home/user will work fine.

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



Re: [PHP] Displaying user data and picture

2009-08-07 Thread kranthi
not a good place to discuss the merits and demerits of  binary blobs. is it ?

now coming back to the question. Firebug firefox addon, and http live
headers firefox addon will be of help to you in this case.

You have img src=display_img.php?id=1 tag(or something similar) i
suppose... try opening that src link in a new browser window. For the
application to work, you should see the picture of the user in the new
window

if there are any php errors in that file, correct them before you proceed.
if you see some arbitrary data(without any php warnings or notices)
but not the image that means you did not set header(Content-type:..')
in display_img.php

 however with a .png extention to get the browser displaying the picture.
thats not required as long as you have correct Content-type header

Kranthi.



On Fri, Aug 7, 2009 at 05:38, Michael A. Petersmpet...@mac.com wrote:
 Ben Dunlap wrote:

 I don't have any data blobs in my database - which makes incremental
 backups easier - I use rsync for files and do a nightly mysql dump.
 Except for the first of the month, the diff of that nights backup
 compared to first of month is saved to flat file for rsync. Binary blobs
 in the database would likely mean I have to change my backup protocol,
 but if it really is advantageous, I'd do it.

 This is just an aside but are you aware of the '--hex-blob' argument to
 mysqldump? It causes binary data to be dumped as a hexadecimal string:


 http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_hex-blob

 It's space-greedy (every byte in your original data requires two bytes in
 the
 dump file) but it seems like it would be compatible with your
 mysqldump/diff
 approach.

 Ben


 No I wasn't aware of it.
 I'll keep it in mind if I ever do start keeping binary blobs.

 --
 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] Radio buttons problem

2009-08-07 Thread kranthi
you dont seem to understand how radio buttons work. they treat
name=sex[][] as a single group. and you can select only one element
in that group.

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



Re: [PHP] Radio buttons problem

2009-08-06 Thread kranthi
you will have to manually maintain the number in the bracket. but you
can try using a template engine like smarty, and use a for loop to
take care of the numbers in the brackets

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



Re: [PHP] clean url problem .htaccess

2009-08-01 Thread kranthi
mod_rewrite is the best solution available to your case. more over if
you are sure that your host supports .htaccess, there is very little
chance that they will block mod rewrite alone. you can confirm that by
phpinfo. look in apache2handler- Loaded Modules  section (this does
not tell you if .htaccess is enabled/disabled)

but in the worst case try using $_SERVER['REQUEST_URI'] instead of
$_SERVER['PHP_SELF'].

in either case you cannot do this with .htaccess disabled.

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



Re: [PHP] Formatting plain text file

2009-07-30 Thread kranthi
?php
//assuming you have a 2d matrix $table
$table = array(
array(c11, c12, c13),
array(c21, c22, c23)
);
foreach($table as $rows) {
$row = vsprintf(str_repeat(%-10s, count($rows)), $rows);
echo {$row}br /\n;
}

wont this do ?

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



[PHP] scandir() permissions

2009-07-26 Thread kranthi
code:

?php
$files = scandir('/home/kranthi/downloaded');
var_dump($files);

permissions for the dir:
$ ls -lA
drwxrwxrwx  2 apache  apache
all the files in the directory have permissions
-rw-rw-rw- 1 apache apache

when i run the above code via CLI, with user kranthi it is working
as expected.
but if i run the above code via http server (running as user apache)
i am getting permission denied error. ny ideas ?

Kranthi.

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



[PHP] parallel execution

2009-07-18 Thread kranthi
Code:

passthru('firefox ');
echo '1';

I am expecting 1 to be echoed while firefox is running. but that is
not the case. ny ideas how i can make this work ?

Kranthi.

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



Re: [PHP] why does PHP parse *.html files in one subdir/ but not in another?

2009-07-18 Thread kranthi
i never used x-mapp-php5, but most of a forums say it is specific to
1and1 hosting service. php recommends application/x-httpd-php

http://us2.php.net/manual/en/install.unix.apache2.php

try adding AddType application/x-httpd-php .html in your root htaccess
if that dosent help you'll have to add that to your htpd.conf file

 You do realize that PHP does not parse HTML files, right? The web server
 does that. In fact, the web server also parses PHP files, using a
 different library.
Kindly elaborate If you are saying that PHP cant parse files with
extension .html
http://us2.php.net/manual/en/security.hiding.php.

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



Re: [PHP] Need Help.

2009-07-14 Thread kranthi
Hi Girish,

1. You cannot modify the browser Back button (any thing on the
client's computer for that matter).
2. I strongly oppose the use of Cookies for tracking the user login,
due to security reasons. Cookies are saved on the client's computer
and he/she can easily modify the information present. But that is
impossible with sessions.

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



  1   2   >