RE: [PHP] Re: Question about template systems

2009-03-03 Thread Chetan Rane
Hi

I think what you are looking for is static Header Footer and dynamic
content.
One way of doing this is by having the front controller pattern

For example : consider the following list of files in your application

1000.php
2000.php
1001.php
3000.php

In the front controller Pattern we usually have a only one file referenced
all eth time and most of the times it is Index.php

The code of your index.php file would be something like this

require_once "header.php";

require_once $_GET['r'].".php";

require_once "footer.php";

once this is done. To access any of the above mentioned files your URL will
be like this

index.php?r=1000 or index.php?r=2000 or index.php?r=1001 etc

The code given above is just the start point and is not secure enough and
had a Code injection threat. 
However I think this is enough to get you started.
You can do more research on what is Code Injection and how to avoid it.



From: Shawn McKenzie [mailto:nos...@mckenzies.net] 
Sent: Wednesday, March 04, 2009 9:05 AM
To: php-general@lists.php.net
Subject: [PHP] Re: Question about template systems

Shawn McKenzie wrote:
> Matthew Croud wrote:
>> Hello,
>>
>> First post here, I'm in the process of learning PHP , I'm digesting a
>> few books as we speak.
>> I'm working on a content heavy website that provides a lot of
>> information, a template system would be great and so i've been looking
>> at ways to create dynamic data with a static navigation system.
>>
>> So far, using the require_once(); function seems to fit the bill in
>> order to bring in the same header html file on each page.
>> I've also looked at Smartys template system.
>>
>> I wondered how you folk would go about creating a template system ?
>>
>> My second question might be me jumping the gun here, I haven't come
>> across this part in my book but i'll ask about it anyway.  I often see
>> websites that have a dynamic body and static header, and their web
>> addresses end like this: "index.php?id=445" where 445 i presume is some
my 
>> file reference.
>> What is this called ?  It seems like the system i'm after but it doesn't
>> appear in my book,  If anyone could let me know what this page id
>> subject is called i can do some research on the subject.
>>
>> Thanks for any help you can provide :)
>>
>> Matt.
>>  
> 
> I have written a popular theme/template system for some CMS systems.  In
> my opinion, templating is only needed for those that are totally
> ignorant of the concept of programming languages in general.  It helps
> for those designers that know HTML or they export their graphics as HTML
> and know enough to modify it or add some simple tags like {post-date} to
> HTML.  That's it!  No loops, no ifs, nothing.  Simple things
> designers/users can add that represent some complex code, queries, etc...
> 
> PHP IS a template language.  You can easily separate your logic and
> design/display using PHP.  Anything more than abstracting some complex
> code to some simple var is overkill.  If you want to display a dropdown
> of categories, and the code needed is a database query and some PHP
> logic, etc., then it makes sense in my above scenario to do this in code
> and then assign the result to a template var like {categories-dropdown}
> that the designer/user can use in the HTML.  Other than that its just
waste.
> 
> Smarty and similar template approaches just take PHP (but more limited)
> and make it look slightly different.  Anyone who doesn't know or want to
> know anything about programming will not see the difference between PHP
> and Smarty.  Consider the following:
> 
> PHP: 
> 
> Smarty: {somevar}
> //oh except in your PHP you have to do the following
> //$smarty->assign('somevar', $somevar);
> //$smarty->display('some.tpl');
> 
> PHP: include('header.tpl');
> 
> Smarty: {include file="header.tpl"}
> 
> Don't even get me started on loops and conditionals.  Smarty just
> replicates PHP, except it looks slightly different and is much less
> powerful.  If you are confused with:
> 
> if ($something) {
>   echo "Some stuff...";
> } else {
>   echo "Some other stuff...";
> }
> 
> Why is this better:
> 
> {if $something}
> Some stuff...
> {else}
> Some other stuff...
> {/if}
> 
> Like I said earlier, if you have some complex code that you can reduce
> to a simple tag or something that a designer can insert into HTML then
> great.  If not then it is just unsuccessfully trying to replicate PHP!

Actually, I forgot myself and the alternative syntax:

if($something):
echo "Some stuff...";
else:
echo "Some other stuff...";
endif;

Hardly different...

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
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] Strange charecters

2009-03-03 Thread Chetan Rane
Hi gang

 

I am using ob_start() in my application. However I am getting this error
about headers already sent.

I have put ob_start at the beginning of the script. I think this has to do
something with Unicode. 

Can anyone explain why this happens. And whats the solution for this

 


Chetan Dattaram Rane | Software Engineer | Persistent Systems

  chetan_r...@persistent.co.in  |
Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014

Innovation in software product design, development and delivery-
 www.persistentsys.com

 

 



RE: [PHP] Assign 2 values from Mysql to an array

2009-03-06 Thread Chetan Rane
Hi this is similar to what Dollah Ihsan had suggested , however I ave
tweeked the getPopulationById function a bit.
/**
 * assume your table structure just like this.
 * table: users
 * |  id  |   country| name   |  population |
 * --
 * |  1   |Texas |  Fort Worth  |40|
 *
 */

function getPopulationById($id) {
// echo 'SELECT country, name, population FROM users WHERE id = ' .
$id;die;
$result = mysql_query('SELECT country, name, population FROM users
WHERE id = ' . $id);
While($row = mysql_fetch_assoc($result)) 
$pop[$id][$row['country']][$row['name']] =
$row['population'];
return $pop;
}


Chetan Dattaram Rane | Software Engineer | Persistent Systems
chetan_r...@persistent.co.in  | Cell: +91 94033 66714 | Tel: +91 (0832) 30
79014
Innovation in software product design, development and delivery-
www.persistentsys.com




-Original Message-
From: Dollah Ihsan [mailto:dollah.ih...@gmail.com] 
Sent: Friday, March 06, 2009 3:04 PM
To: Anton Heuschen
Cc: php-general@lists.php.net
Subject: Re: [PHP] Assign 2 values from Mysql to an array

I'm sorry if this is not what you're talking about...

/**
 * assume your table structure just like this.
 * table: users
 * |  id  |   country| name   |  population |
 * --
 * |  1   |Texas |  Fort Worth  |40|
 *
 */

function getPopulationById($id) {
// echo 'SELECT country, name, population FROM users WHERE id = ' .
$id;die;
$result = mysql_query('SELECT country, name, population FROM users
WHERE id = ' . $id);
if(mysql_num_rows($result) != 1) return false;
$row = mysql_fetch_assoc($result);
$pop[$id][$row['country']][$row['name']] = $row['population'];
return $pop;
}

$array = getPopulationById(1);
print_r($array);
// print_r($array) should be like this:
// Array ( [1] => Array ( [Texas] => Array ( [Fort Worth] => 40 ) ) )

On Fri, Mar 6, 2009 at 3:41 PM, Anton Heuschen  wrote:
>
> This might sound trivial, but for the live of me cant seem to get it to
> work, and I am not familiar with such a thing.
>
> What I have is a query lets say :
>
> select  country,name,population from USERS where id= 'some_id' ";
>
>
> Now I want to assign the result to one set (The above example might have
3+
> entries per telephone, thus what would be nice is something like an array
of
> :
>
>
> [id][country][name]  = population .. or to be exact if I echo the
> value for each id and country and name to get the population value
>
>
> Like :
>
> Array {
>
>  [id] array {
>         [country] array {
>                    [0] = USA
>          }
>  [name] array {
>         [0] = test
>
>  }
>
> }
>
>
>
>
> I dont know something like that, maybe Im over comlicating the question
now
> even, the main thing is wondered was in the first place was with a
standard
> query and variable assign, from the query like:
>
> select  country,name,population from USERS where id= 'some_id' ";
>
> normally you would just assign each field to one variable. like
>
> $country = result["country"]
> $name = result["name"]
>
>
> But now I want all 3 fields as one variable (which would be an array)
..but
> how ?
>
> I hope I have not totally confused the question now.
>
> Thanks in advance

-- 
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] Cookies/Sessions and how they work

2009-03-09 Thread Chetan Rane
Hi 
I don't think PHP stores Session information in Cookies. However It dose
store the sessionId (a unique alphanumeric string) in cookies.
This SessionId is used to identify the requests sent from one user.
The Session information is by default stored in the /tmp directory on your
system in a flat file.

Chetan Dattaram Rane | Software Engineer | Persistent Systems
chetan_r...@persistent.co.in  | Cell: +91 94033 66714 | Tel: +91 (0832) 30
79014
Innovation in software product design, development and delivery-
www.persistentsys.com




-Original Message-
From: Paul M Foster [mailto:pa...@quillandmouse.com] 
Sent: Tuesday, March 10, 2009 7:57 AM
To: php-general@lists.php.net
Subject: [PHP] Cookies/Sessions and how they work

This is in two parts. First cookies. I'm a little unclear on how they
work. From what I've read, cookies are stored by the browser. When a
request for that cookie comes in from the server, the browser returns
only the value, and no other data. One question: When the browser
requests a page from a server, does it automatically search its cookies
for that domain and send them along with the other requests? If that's
now how it works, then how does it work?

Second part is about sessions. According to the notes for the cookies
page at php.net, it's considered bad practice to store user IDs and
passwords in cookies. It's considered better practice to use PHP's
native session-handling code to do this. But if a user has cookies
turned on in the browser, then PHP will store the session information
(possibly user ID and password) as a cookie. So what's the difference?

The reference for the above is:
http://us2.php.net/manual/en/features.cookies.php#36058


Paul

-- 
Paul M. Foster

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


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



RE: [PHP] [php] while loop failure

2009-04-06 Thread Chetan Rane
I think its exceeding the max execution time set in PHP.ini
Either set yoru cron to run after every 60 seconds, or change the setting in 
PHP.ini

Chetan Dattaram Rane | Software Engineer | Persistent Systems
chetan_r...@persistent.co.in  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: Andrew Williams [mailto:andrew4willi...@gmail.com]
Sent: Monday, April 06, 2009 3:51 PM
To: php-general@lists.php.net
Subject: [PHP] [php] while loop failure

Does any one knows why while loop below ends after few loops when it meant
to keep in loop?

File name: while_loop_script.php

define('run', 0);
define('START', 10);

while(START >run){

$ch = curl_init("mydomain/update_script.php?action=run");
curl_exec($ch);
curl_close($ch);

}

using php.exe to scheldule task it every 5 minutes:

C:\php.exe D:\update\while_loop_script.php

--
www.willandy.co.uk

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

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



Re: [PHP] Something I don't understand about PHP classes

2009-05-09 Thread chetan rane
Hi
you can use the following code


On Sat, May 9, 2009 at 10:16 PM, Robert Cummings wrote:

> On Sat, 2009-05-09 at 18:35 +0200, Cesco wrote:
> > Ok, I suppose that this should be a very simple problem and probably
> > the answer is obvious, but I really can't understand how the classes
> > and the rest of the stuff works in PHP...
> >
> > Let's suppose that we have this piece of code:
> >
> >
> >  >
> >  class Duck {
> >
> >   function __construct() {
> >
> >   while(1==1) {
> >   // This is an infinite loop
> >   }
> >
> >   }
> >  }
> >
> >   echo "Hello world...";
> >   $DonaldDuck = new Duck();
> >
> > ?>
> >
> >
> > I have put an infinite loop in the class constructor just to introduce
> > a problem that will halt the execution of the PHP code.
> >
> > Now, If I run this code I would expect that the PHP interpreter would
> > print the "Hello world..." string, and then it should call the class
> > constructor with the infinite loop inside of it.
> >
> > But that doesn't happen.
> >
> > Instead, the PHP interpreter enters IMMEDIATELY into an infinite loop,
> > as if the variables were declared immediately and then the rest of the
> > code is executed.
> >
> > Is it right? Because I'm having really hard times in debugging a PHP
> > class
>
> Presumably you're doing this on the shell (versus in a web page). You
> need to send the newline ("\n") character since most terminals buffer
> the output until a newline character is encountered. If htis is a
> webpage you are in for even more trouble since browser often won't
> output anything until they receive at least X bytes (where X depends on
> the browser).
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: chetsc...@yahoo.com
chetr...@rediffmail.com


[PHP] HTTPS

2007-01-28 Thread chetan rane

hi everyone

i am writing a progrram for a Jabber COnnection manager. I want to access
the client XML using HTTPS. do any one know a way to so it


Have any one the

--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] Pwersistent Queue

2007-01-31 Thread chetan rane

Hi everyone

I aneed top maintain a persisistent Queue can anyone help.


--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] accepting POST variables using CURL

2007-02-02 Thread chetan rane

HI al

i tried curl to access HTTPS pages but how do i get the POST variables been
passed to me .
here is teh exact thing which i want.
i have a HTML page when i submit  the form i want ot read all teh POST data
using HTTPS.
I know its possible using CURL but dont exactly know how to do it



--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] Year

2007-02-02 Thread chetan rane

HI Dan

try this this should work 100%;

echo "";
for ($y=0;$y<=10;$y++) {
$years=date('Y')+$y;
$short_years=date('y')+$y;
printf("%d",$short_years,$years);

}
echo "";

On 2/2/07, Dan Shirah <[EMAIL PROTECTED]> wrote:


Hello all,

I am trying to populate a dropdown list to contain the current year to 10
years in the future.  Below is the code I'm using:

http://php.net/date>('Y')+$y;
  $short_years=date ('y')+$y;
  echo "$short_years";
  echo "$years";
  }
?>
I want the selection value to be 2007, 2008, 2009, 2010  and the
$years
accomplishes this.  Howeverm I want the option value to be the two digit
year ex. 07, 08, 09, 10...the $short_years semi accomplishes
thisinstead
of getting 07, 08, 08, 10 I get 7, 8, 9, 10...how can I get it to output
the
two year for 07, 08, 09 without it cutting off the zero?

Reagrds,

Dan





--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] Jabber conection manager

2007-02-03 Thread chetan rane

HI all

i want to develop a Jabber connection manage its role will be

1. accept HTTp request from the Client
2. establish connection with a jabber server using TCp
3. and later start the instant mechanism between them

has any one worked on this please let me know how to do it


--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] is there socket.so file?

2007-02-03 Thread chetan rane

HI Yeni

I had similar problems i recommmend using the following

fsockopen()  instead open_socket()

it wprks fine on both

On 2/3/7, Yeni Setiawan <[EMAIL PROTECTED]> wrote:


Hi there,
I'm currently writing an IRC bot using php (CLI) and get a little problem.

For windows version, I need to enable socket extension (socket.dll) and
my bot will be able to connect to an IRC server.

But in linux version, it's unable to connect. So I wonder if there's a "
socket.so" or something else
to activate socket extension.

And the question is, do I need socket extension in Linux?

--
regards,

Yeni Setiawan





--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] Peristent Listen over an HTTP connection

2007-02-04 Thread chetan rane

HI all

I have a small issue to be handled here

i want to persistently moniter the HTTP stream from a Client Browser. How do
i accomplish it

--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] Peristent Listen over an HTTP connection

2007-02-04 Thread chetan rane

hi

what i mean is

i want to write a script
where , when ny client requests come i read the stream and then process it

here is the exact steps

when the user first initiates
i create a session and establish a TCP connection
second: when teh user next sends a request i dont create a new TCP
connection but use the existing TCP connection.

On 2/4/07, Stut <[EMAIL PROTECTED]> wrote:


chetan rane wrote:
> I have a small issue to be handled here
>
> i want to persistently moniter the HTTP stream from a Client Browser.
> How do
> i accomplish it

I'm not sure what you mean by 'persistently monitor'. If you mean listen
for incoming connections then you need to look at the socket or stream
functions. If that is the case then I don't see where the "Client
Browser" comes into it.

Please elaborate further on what you are actually trying to accomplish.

-Stut





--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] Peristent Listen over an HTTP connection

2007-02-04 Thread chetan rane

same TCP creation,

because i i am bindiing that stream to the Server.

i am actually creating a component.

a component which resides in between a client and server

i accept HTTP requests from a client and relay the same uysing a TCP
connection to the SERVER.
and vice versa

i think this makes it clear.

On 2/4/07, Stut <[EMAIL PROTECTED]> wrote:


chetan rane wrote:
> i want to write a script
> where , when ny client requests come i read the stream and then process
it
>
> here is the exact steps
>
> when the user first initiates
> i create a session and establish a TCP connection
> second: when teh user next sends a request i dont create a new TCP
> connection but use the existing TCP connection.

Ok, couple of questions...

1) Why?
2) Why?

What is making these connections from the client side?

-Stut





--
Have A plesant Day
Chetan. D. Rane
Location: Pune , India
Contact: +91-9890792762
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


RE: [PHP] Need unrounded precision

2009-10-12 Thread Chetan Rane
May be this will work
$elapsed = 28.56018;
$elapsed_rel = (int) 28.56018;
$elapsed_deci = $elapsed - $elapsed_rel;
$deci = ((int) ($elapsed_deci * 10))/10;
$final = $elapsed_rel + $deci;


With regards,

Chetan Dattaram Rane | Software Engineer | Persistent Systems
chetan_r...@persistent.co.in  | Cell: +91 9766646714 | Tel: +91 (0832) 30 79228
Innovation in software product design, development and delivery- 
www.persistentsys.com


-Original Message-
From: Arno Kuhl [mailto:ak...@telkomsa.net]
Sent: Monday, October 12, 2009 12:07 PM
To: 'Andre Dubuc'; php-general@lists.php.net
Subject: RE: [PHP] Need unrounded precision

-Original Message-
From: Andre Dubuc [mailto:aajdu...@webhart.net]
Sent: 02 January 2010 03:20 AM
To: php-general@lists.php.net
Subject: [PHP] Need unrounded precision

Hi,

I need to extract the first digit after the decimal point from a number such
as 28.56018, which should be '5'.

I've tried a few methods to accomplish this. If I use 'ini_set' I would need
to know the number of digits before the decimal (which, unfortunately, I
would not have access to).

Then I've tried:



What I need is only the first digit after the decimal -- all the rest could
be 'chopped' or discarded but without rounding the first digit after the
decimal point.

Is there any way of doing this?

I'm stumped.

Tia,
Andre

--

One way that should work regardless the number of digits before/after the
decimal is:
- convert to string (sprintf or typecast)
- strpos the decimal
- grab the char from the next position

Cheers
Arno


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


DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

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



Re: [PHP] Converting tables into forms

2009-10-27 Thread chetan rane
Hi Ben

The quickest way to this is by using a framework.
and the best way i could find was using the yiiframework
www.yiiframework.com

i could create a basic form with validations in less then 15 minutes.

On Wed, Oct 28, 2009 at 6:42 AM, ben...@gmail.com  wrote:

> Does anyone have a quick way of converting tables into forms?
>
> --
> **
> The content of this e-mail message and any attachments are
> confidential and may be legally privileged, intended solely for the
> addressee. If you are not the intended recipient, be advised that any
> use, dissemination, distribution, or copying of this e-mail is
> strictly prohibited. If you receive this message in error, please
> notify the sender immediately by reply email and destroy the message
> and its attachments.
> *
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
with regards,

Chetan Dattaram Rane
Mob :  +91 9766646714
Phone: 0831-2462055


Re: [PHP] PHP Application Structre

2010-05-10 Thread chetan rane
Hi all,

mod rewrite was actually inrduced to have search engne frendly urls.
hnce if you want a seo site then you have to use options 1 & 2. using
smarty or any templating engine for readibility is not total  true.
one of the major advantages of using template engines is caching

On 5/11/10, David McGlone  wrote:
> On Monday 10 May 2010 13:04:36 richard gray wrote:
>> On 10/05/2010 18:17, Ashley Sheridan wrote:
>> > It makes sense sometimes to have different files for different sections
>> > of a website. For example, blog.php, gallery.php, cart.php could deal
>> > with the blog, gallery and shopping cart sections for an artists
>> > website. Yes, it could all be achieved with one script handling
>> > everything, but sometimes when the areas of the site differ greatly, it
>> > results in a lot of extra code to deal with pulling in the right
>> > template and content parts. I've always favoured only including the code
>> > a page needs rather than a huge amount of stuff that it doesn't.
>>
>> this isn't necessarily true - the architecture I've developed uses a
>> single dispatch script (works fine with the mod rewrite option 2
>> scenario as well) - this script does general checks/security/filters etc
>> then simply determines what page/function the user wants from the
>> request ($_GET/$_POST parameter) and passes control to the specific
>> handler via including the relevant controller module. The controller
>> module is responsible for which template is required and loads up
>> specific classes needed to process the request etc so each module just
>> loads its own stuff and nothing else so there's no overhead.
>>
>> This method also has a small extra benefit that the web server document
>> root just has a very simple 2 liner script instead a myriad of php
>> scripts... if the webserver is misconfigured then someone who sees the
>> source code doesn't get to see much..
>
> This thread makes me wonder if using Smarty is smart. Does anyone here use a
> templeting system such as smarty or am I the only one?
>
> --
> Blessings,
> David M.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Sent from my mobile device

with regards,

Chetan Dattaram Rane
Mob :  +91 9766646714
Phone: 0831-2462055

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



Re: [PHP] Querying a database for 50 users' information: 50 queries or a WHERE array?

2011-09-13 Thread chetan rane
Hi,

There are 2 peoblems with subselect

1. You cant use a limit on the nested select
2. Id the number of elements in the in clause exceeds the subselect buffer
you will run into performance issues ans eventually you query will be
doomed. Inner joins in,this is the best option for this . You can use a temp
table for this
On 14 Sep 2011 01:35, "Alex Nikitin"  wrote:
> On Tue, Sep 13, 2011 at 3:45 PM, Dotan Cohen  wrote:
>
>> On Tue, Sep 13, 2011 at 21:34, Alex Nikitin  wrote:
>> > And this will be faster or at least more efficient with a limit (e.g.
>> limit
>> > 50) this way when you have found the 50 users in the "in" statement,
you
>> > don't continue iterating through the rest of your data set...
>> >
>>
>> The number is never exactly 50 but rather some arbitrary large number.
>> But there is no need for LIMIT, that is the purpose of the _INNER_
>> JOIN. INNER means to only return the matching rows.
>>
>>
>> --
>> Dotan Cohen
>>
>> http://gibberish.co.il
>> http://what-is-what.com
>>
>
> Dotan,
>
> IN (the function used in all of the queries above) is not the same as an
> INNER_JOIN, inner join joins 2 tables, as you have already described, IN
> however is a function that return 1 if the value being searched for is in
> the array of its values or 0 if it is not, thus IN is not an inner join,
but
> a comparator function, thus if you are using IN, limit will indeed be more
> efficient than it's omission for exactly the reason i have stated in my
> previous post. Because your user array seems to be in php, and implode has
> been a topic of discussion above as well, setting an adequate limit is a
> simple task with the php's count function.
>
> This is all ofcourse void if the user array being pulled from mysql, in
> which case you could simply join the two tables to get your resulting data
> set. The trick there is to use the USING clause which seems to run a lot
> faster than any ON clause, or work on an optimized subselect, especially
if
> you are running a cluster.
>
>
> --
> The trouble with programmers is that you can never tell what a programmer
is
> doing until it’s too late. ~Seymour Cray


Re: [PHP] __sleep() strange behavior with file writting and SESSION using

2007-11-20 Thread chetan rane
This aint a bug

because __sleep is called only when you serialize an object and not when you
assign it to a session Variable;

On Nov 21, 2007 12:21 AM, Julien Pauli <[EMAIL PROTECTED]> wrote:

> Consider that very simple code, that runs on PHP 5.2.5 onto a Windows
> machine :
>  class a
> {
>public $b;
>
>public function __sleep()
>{
>file_put_contents("log.txt","ok" . PHP_EOL,FILE_APPEND);
>echo "done!";
>return array();
>}
> }
>
> $a = new a;
> serialize($a);
> ?>
>
> No problem here, log.txt is writtable, when it passes on the serialize()
> instruction, it goes to __sleep and works well.
> "OK\r\n" is appended to the log file , and "done!" is displayed.
>
>
>
> Now consider this :
>
>  session_start();
> class a
> {
>public $b;
>
>public function __sleep()
>{
>file_put_contents("log.txt","ok" . PHP_EOL,FILE_APPEND);
>echo "done!";
>return array();
>}
> }
>
> $a = new a;
> $_SESSION['obj'] = $a;
> ?>
>
> In this case, when the object is going in the session, it naturally passes
> throught __sleep().
> The problem is that file_put_contents() doesn't work -> the file is not
> appended "OK\r\n" as it should be.
> "done!" is displayed , and if you look at the return value of
> file_put_contents ( number of bytes that have been written ) : it's all
> right ! It simply doesn not write to the file.
>
> Anyone has an idea ?
> Is this a bug ?
> Thx :)
>



-- 
Have A plesant Day
Chetan. D. Rane
Location: India
Contact: +91-9844922489
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] __sleep() strange behavior with file writting and SESSION using

2007-11-21 Thread chetan rane
Sorry Buddie But Session dose not serialize the Object Please Have a look at
the Code Again I have tried it with PHP 5.2
IT dose not call __sleep function. only when you have serialize it calls it.


On Nov 21, 2007 3:23 AM, Julien Pauli <[EMAIL PROTECTED]> wrote:

> Sorry but it goes throught __sleep() as session serializes objects before
> storing them
> Proof is that "done!" is echoed.
> Step by step debugging also prove that , the only thing is that
> file_put_contents, doesn't execute, but returns a value...
>
>
>
> 2007/11/20, chetan rane <[EMAIL PROTECTED]>:
>
> > This aint a bug
> >
> > because __sleep is called only when you serialize an object and not when
> > you assign it to a session Variable;
> >
> > On Nov 21, 2007 12:21 AM, Julien Pauli < [EMAIL PROTECTED]> wrote:
> >
> > > Consider that very simple code, that runs on PHP 5.2.5 onto a Windows
> > > machine :
> > >  > > class a
> > > {
> > >public $b;
> > >
> > >public function __sleep()
> > >{
> > >file_put_contents("log.txt","ok" . PHP_EOL,FILE_APPEND);
> > >echo "done!";
> > >return array();
> > >}
> > > }
> > >
> > > $a = new a;
> > > serialize($a);
> > > ?>
> > >
> > > No problem here, log.txt is writtable, when it passes on the
> > > serialize()
> > > instruction, it goes to __sleep and works well.
> > > "OK\r\n" is appended to the log file , and "done!" is displayed.
> > >
> > >
> > >
> > > Now consider this :
> > >
> > >  > > session_start();
> > > class a
> > > {
> > >public $b;
> > >
> > >public function __sleep()
> > >{
> > >file_put_contents("log.txt","ok" . PHP_EOL,FILE_APPEND);
> > >echo "done!";
> > >return array();
> > >}
> > > }
> > >
> > > $a = new a;
> > > $_SESSION['obj'] = $a;
> > > ?>
> > >
> > > In this case, when the object is going in the session, it naturally
> > > passes
> > > throught __sleep().
> > > The problem is that file_put_contents() doesn't work -> the file is
> > > not
> > > appended "OK\r\n" as it should be.
> > > "done!" is displayed , and if you look at the return value of
> > > file_put_contents ( number of bytes that have been written ) : it's
> > > all
> > > right ! It simply doesn not write to the file.
> > >
> > > Anyone has an idea ?
> > > Is this a bug ?
> > > Thx :)
> > >
> >
> >
> >
> > --
> > Have A plesant Day
> > Chetan. D. Rane
> > Location: India
> > Contact: +91-9844922489
> > otherID: [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> >
>
>


-- 
Have A plesant Day
Chetan. D. Rane
Location: India
Contact: +91-9844922489
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] Resetting a session variable

2008-02-03 Thread chetan rane
Hi

there are 2 functions
session_unset('Key');
session_destroy();

please find them in the manual.  i think they are the 2 used for setting and
usetting the session.


On Feb 4, 2008 1:14 AM, Feris Thia C. <[EMAIL PROTECTED]> wrote:

> Resetting all session variables or one of those session vars ?
>
> If you need to reset all then use *session_destroy() *function.
>
> Hope it helps..
>
> Regards,
>
> Feris
> http://top-10.bigspacehosting.com
>
> On Feb 4, 2008 1:14 AM, Ron Piggott <[EMAIL PROTECTED]> wrote:
>
> > What is the command to reset a session variable --- essentially deleting
> > all of the values it contains?  Ron
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>



-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] Session and Multi Server Architecture

2008-02-11 Thread chetan rane
Hi all
can you please let me know where i can find about Mem cache.

On Feb 11, 2008 11:11 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote:

> On Feb 11, 2008 12:33 PM, chetan rane <[EMAIL PROTECTED]> wrote:
>
> > HI All
> >
> >  Can any one tell me what will be the best way to maintain session
> > information on a Multi Server Architecture i.e a Web Cluster.
>
>
> implement session_set_save_handler() with a database, or
> ideally, memcache.
>
> -nathan
>



-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] Session and Multi Server Architecture

2008-02-11 Thread chetan rane
HI All

 Can any one tell me what will be the best way to maintain session
information on a Multi Server Architecture i.e a Web Cluster.

-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] Multiple Inheritance

2008-02-27 Thread chetan rane
Hi All

Dose anyone know how to implement multiple inheritance in PHP 5.
Interfaces dosent work . I have already Tried it.

-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] Multiple Inheritance

2008-02-27 Thread chetan rane
Thanks Nathan, I had already done that using the Objects of the 2 classes as
shown by you in the example 1.
but there are one thing in that.
If i create the Objects i cannot access the Protected Data from teh parent
classes.

On Thu, Feb 28, 2008 at 4:33 AM, Nathan Nobbe <[EMAIL PROTECTED]>
wrote:

> On Wed, Feb 27, 2008 at 12:05 PM, chetan rane <[EMAIL PROTECTED]>
> wrote:
>
> > Hi All
> >
> > Dose anyone know how to implement multiple inheritance in PHP 5.
> > Interfaces dosent work . I have already Tried it.
>
>
> the idea in a single inheritance language is to implement
> 'multiple inheritance' in the following way.
> implement several interfaces an then compose a common
> classes that implements said interfaces.  this is the workaround
> for single inheritance languages.  here is a trivial example,
>
> interface CommonStuff {
>   function commonFunction($a, $b);
>   function moreCommonFunction($x, $y, $z);
> }
>
> interface OftenUsed {
>   function imSpecial($c, $d);
>   function imMoreSpecial($u, $v, $w);
> }
>
> now you might have standard or common implementations
> of these, sometimes referred to as mixins (taken from ruby,
> i believe [<-- here i go again greg ;)])
>
> class CommonStuffImpl implements CommonStuff {
>   function commonFunction($a, $b) {
> return $a + $b;
>   }
>
>   function moreCommonFunction($x, $y, $z) {
> return $x + $y + $z;
>   }
> }
>
> class OftenUsedImpl implements OftenUsed {
>   function imSpecial($c, $d) {
> return $c - $d;
>   }
>
>   function imMoreSpecial($u, $v, $w) {
> return $u - $v - $w;
>   }
> }
>
> and now finally for the multiple inheritance workaround;
> suppose you have a class that needs to be both
> CommonStuff and OftenUsed; you simply implement
> both the interfaces, then delegate to the mixins, and
> viola!  multiple inheritance the single inheritance way ;)
>
> class MultiInherit implements CommonStuff, OftenUsed {
> private $commonStuffImpl = null;
> private $oftenUsedImpl = null;
>
> public function __construct() {
>$commonStuffImpl = new CommonStuffImpl();
>$oftenUsedImpl = new OftenUsedImpl();
> }
>
>/// now make sure to implement the interfaces and delegate
>function commonFunction($a, $b) {
>   return $this->commonStuffImpl->commonFunction($a, $b);
>}
>
>function moreCommonFunction($x, $y, $z) {
>   return $this->commonStuffImpl->moreCommonFunction($x, $y, $z);
>}
>
>   function imSpecial($c, $d) {
> return $this->oftenUsedImpl->imSpecial($c, $d);
>   }
>
>   function imMoreSpecial($u, $v, $w) {
> return $this->oftenUsedImpl->imMoreSpecial($u, $v, $w);
>   }
> }
>
> bear in mind i just typed that straight into my mail client, so it
> might not be perfect, but you get the idea.
> and also, dont forget about interface inheritance :)
>
> interface Somethingable {
> public function doSomething();
> }
>
> interface Crazyfiable {
> public function getCrazy();
> }
>
> interface Extendable extends Somethingable, Crazyfiable {
> public function extend();
> }
>
> class SuperClass implements Extendable {
> public function doSomething() {
> echo 'i did something ..' . PHP_EOL;
> }
>
> public function extend() {
> echo 'i extended something..' . PHP_EOL;
> }
>
> public function getCrazy() {
> echo 'im a crazy bastard now!' . PHP_EOL;
> }
> }
>
> -nathan
>



-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] dont print echo

2008-02-28 Thread chetan rane
>
> I think that will solve your problem
>
>  if(isset($_POST['submit'])){
> $folder = 'pictures;
>
> $load = copy($_FILES['file']['tmp_name'] , $folder . '/' . $_FILES
> ['file']['name']);
>
> if ( $load ) {
>
>   echo "Picture upload!";
>
> } else {
>
>   echo "no picture =(";
>
> }
> }
> ?>
>
> 
>
>
>
>
>
>
>
>
>
>
>
> 
>
>
>
> When I try the php the echo "no picture =("; is there. How can I do to
> don't
> appears the message before I upload de picture.
>
> Thanks.
>
>
>
>
>
> +
>  _
>   // Emiliano Boragina _
>
>   // Diseño & Comunicación //
> +
>  _
>
>   // [EMAIL PROTECTED]  /
>   // 15 40 58 60 02 ///
> +
>  _
>
>
>
>


-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] PHP on Windows

2008-03-01 Thread chetan rane
hi

try XAMMP from xampp.org it is packaged with apace PHp mysql and filezilla

On Sat, Mar 1, 2008 at 9:51 PM, Andrés Robinet <[EMAIL PROTECTED]>
wrote:

> > -Original Message-
> > From: Erik SJMN [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 29, 2008 9:41 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] PHP on Windows
> >
> > I'm completely new to php and I'm trying to setup an online trouble
> ticket
> > system.  After the user logs in and submits the ticket, they're supposed
> to
> > receive an email confirmation with the ticket number.  I have my
> Exchange
> > server setup on another server in the same domain that I'm trying to use
> to
> > send these emails - this server requires SMTP authentication.  So I've
> > installed the PEAR Mail package, as it was my understanding that this
> would
> > allow me to do the authentication for the SMTP server - I installed it
> in
> > the C:\PHP5\PEAR directory.  Do I need this mail package for the
> > authentication?  In any case, where do I setup the authentication
> variables
> > to send this email?  I tried adding the authentication vars to the
> > smtp.phpfile in the  C:\PHP5\PEAR\Mail directory, but still not
> > authenticating.  I'm
> > completely lost, any help is greatly appreciated.
> >
> > ; PHP 5.2.5 installed on Windows Server 2003 with IIS 6
> > ; Mail-1.1.14 mail pkg with Net_SMTP-1.2.11 pkg
> >
> > --Erik
>
> Did you try this
> http://email.about.com/od/emailprogrammingtips/qt/et073006.htm
> ?
>
> Regards,
>
> Rob
>
>
> Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
> 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL
> 33308 |
> TEL 954-607-4207 | FAX 954-337-2695 |
> Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
> bestplace |
>  Web: bestplace.biz  | Web: seo-diy.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] SESSIOn when cookies are disabled

2008-03-07 Thread chetan rane
Hi all

how  can we manage session variables when cookies are disabled.

-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] SESSIOn when cookies are disabled

2008-03-07 Thread chetan rane
Thank you very much its worked great!!!

On Fri, Mar 7, 2008 at 11:50 PM, Bastien Koert <[EMAIL PROTECTED]>
wrote:

>
> > Date: Fri, 7 Mar 2008 23:45:51 +0530> From: [EMAIL PROTECTED]> To:
> php-general@lists.php.net> Subject: [PHP] SESSIOn when cookies are
> disabled> > Hi all> > how can we manage session variables when cookies are
> disabled.> > -- > Have A pleasant Day> Chetan. D. Rane> Location: India>
> Contact: +91-9986057255> other ID: [EMAIL PROTECTED]>
> [EMAIL PROTECTED]
>
>
> pass the session id in the URL or add it as a hidden field
>
>
> Bastien
> _
>
>


-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP] Curl Javascript

2008-03-11 Thread chetan rane
HI

i think it is a bit difficult. CURL can actually help you get Response on a
cross Domain platform. Javascript dosenot.
Espesially Ajax is not cross domain for security reasons.

On Wed, Mar 12, 2008 at 3:40 AM, William Piper <[EMAIL PROTECTED]> wrote:

> I have been using php's curl for quite a while now and it has never
> allowed to run javascript... bummer! I read on an article
> http://blogs.zdnet.com/Stewart/?p=627 that the new curl v6 allows this.
>
> There are a few ajax sites that I would like to scrape, but they are a
> pain to read through all of the functions to figure out how everything
> is displayed. I'm hoping that with this addition to the curl library,
> this could be more easily done.
>
> Does anyone know when or if the javascript addition will be implemented
> to php's curl?
>
> Thanks,
> bp
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] eval uquestion

2008-03-19 Thread chetan rane
HI All

I have the follwoing code

function cleanufx($str){
  return ucase($str);
}

$value="xyz";
$var ="ufx";
$fn="clean$var($value);
$val =eval("$fn;");
echo $val;

can anyone tell me what is wrong in this as the eval is returning 0 (false);

-- 
Have A pleasant Day
Chetan. D. Rane
Location: India
Contact: +91-9986057255
other ID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


[PHP] the Y2K38 BUG

2008-05-06 Thread Chetan Rane
Hi all

 

Have guys heard of the the Y2K38 Bug more details are on this link

 

http://www.codeproject.com/KB/bugs/The-Year-2038-Bug.aspx

 

Can there be a possible solution. As the system which I am developing for my
client uses Unix timestamp.

This might effect my application in the future

 

Thank you, in Advance.

 

 

With Regards

 

Chetan Dattaram Rane

Software Engineer

 

 

 

<>

RE: [PHP] Get array as string --Help

2008-05-09 Thread Chetan Rane
What is the format you want it to be

You can use JSON_encode(array());

To get into a text like representation 

Chetan Dattaram Rane
Software Engineer
 
 

-Original Message-
From: Shelley [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 09, 2008 3:11 PM
To: PHP General list
Subject: [PHP] Get array as string --Help

Hi all,

If I have an array like this:
$arr = array (
'c' => 'd',
'e' => 'f');

How can I convert this array into a string? I want to write an array into a
file.

Thanks in advance.

-- 
Regards,
Shelley


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



RE: [PHP] Get array as string --Help

2008-05-09 Thread Chetan Rane
Yet another option is use serialize(array())

Chetan Dattaram Rane
Software Engineer
 
 

-Original Message-
From: Shelley [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 09, 2008 3:11 PM
To: PHP General list
Subject: [PHP] Get array as string --Help

Hi all,

If I have an array like this:
$arr = array (
'c' => 'd',
'e' => 'f');

How can I convert this array into a string? I want to write an array into a
file.

Thanks in advance.

-- 
Regards,
Shelley


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



RE: [PHP] Get array as string --Help

2008-05-09 Thread Chetan Rane
Yea but implde will loose the "Keys"

Chetan Dattaram Rane
Software Engineer
 
 
-Original Message-
From: Thiago Pojda [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 09, 2008 5:30 PM
To: 'Zoltán Németh'; 'Chetan Rane'
Cc: 'Shelley'; 'PHP General list'
Subject: RES: [PHP] Get array as string --Help

Depending on your needs you could also use implode() and then save it to a
file.


Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
[EMAIL PROTECTED]
Excelência em Softwares Financeiros


-Mensagem original-
De: Zoltán Németh [mailto:[EMAIL PROTECTED] 
Enviada em: sexta-feira, 9 de maio de 2008 08:37
Para: Chetan Rane
Cc: 'Shelley'; 'PHP General list'
Assunto: RE: [PHP] Get array as string --Help

> Yet another option is use serialize(array())

or you could use var_export if you need php code
http://php.net/var_export

greets,
Zoltán Németh

>
> Chetan Dattaram Rane
> Software Engineer
>
>
>
> -Original Message-
> From: Shelley [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 09, 2008 3:11 PM
> To: PHP General list
> Subject: [PHP] Get array as string --Help
>
> Hi all,
>
> If I have an array like this:
> $arr = array (
> 'c' => 'd',
> 'e' => 'f');
>
> How can I convert this array into a string? I want to write an array into
> a
> file.
>
> Thanks in advance.
>
> --
> Regards,
> Shelley
>
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mysql_pconnect issue

2008-05-12 Thread Chetan Rane
Hi

The host name is localhost, username: root, and the password is blank "".
If you have selected the option to allow anonymous login during installation
you can even give the user name and password dboth blank. It will log you in
as an anonymous user.

Chetan Dattaram Rane
Software Engineer
 
 
-Original Message-
From: Forcey [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 12, 2008 10:08 AM
To: Chris
Cc: bruce; php-general@lists.php.net
Subject: Re: [PHP] mysql_pconnect issue

On Mon, May 12, 2008 at 12:27 PM, Chris <[EMAIL PROTECTED]> wrote:
> bruce wrote:
>  > hi...
>  >
>  > running into a problem that i can't seem to solve...
>  >
>  > using mysql_pconnect() and i'm trying to figure out what parameters
have to
>  > be used in order to connect to a local mysql session, where mysql is
>  > accessed using the defaults (ie, no user/passwd/hostIP)
>
>  Use 'localhost' for the host, no idea what you'd use for the user/pass,
>  but mysql requires a username at least. If you're not entering one, it's
>  using the username you are logged in as.
>
I guess the default user is 'root' and password is empty.

- forcey

>  --
>  Postgresql & php tutorials
>  http://www.designmagick.com/
>
>
>
>  --
>  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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] tracking Mials Which were bounced.

2008-05-12 Thread Chetan Rane
Hi All

I am using a PHP Mailer to send mass mails.
How can I Identify how mails have bounced.


Chetan Dattaram Rane
Software Engineer
 
 






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



[PHP] Magis_qoutes + linux + smarty

2007-07-05 Thread chetan rane

Hi Guys

I have a Problem wioth Smarty
i have set the MAGIC_QOUTES_GPC =ON
and the templates are not getting created.
however when it is off ther created and everything is working fine.

thsi happens only on linux.
On windows it has no problem




--
Have A plesant Day
Chetan. D. Rane
Location: India
Contact: +91-9844922489
otherID: [EMAIL PROTECTED]
[EMAIL PROTECTED]


RE: [PHP] class as default property

2008-06-23 Thread Chetan Rane
You can use a contructor in this case

But this does not work:



Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com



-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 23, 2008 2:21 PM
To: "Osman A. Osman (عثمان)"
Cc: php-general@lists.php.net
Subject: Re: [PHP] class as default property

On 23 Jun 2008, at 09:36, Osman A. Osman (عثمان) wrote:
> I had a quick question.  How come I can do this:
>  class Foo {
> }
> class Bar {
>  public $f = 'SomeFoo';
> }
> ?>
>
> But this does not work:
>  class Foo {
> }
> class Bar {
>  public $f = new Foo();
> }
> ?>
> *(Parse error: syntax error, unexpected T_NEW in test.php on line 8)*
> **

Those assignments are evaluated at compile-time when no code can be  
executed. As such it is only possible to set them to literal values.

If you need to set the default value of member variables to new  
objects the place to do it is the constructor.

-Stut

-- 
http://stut.net/


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


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



RE: [PHP] unset in foreach breaks recrusion

2008-06-30 Thread Chetan Rane
yes

Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: Per Jessen [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 30, 2008 12:09 PM
To: php-general@lists.php.net
Subject: Re: [PHP] unset in foreach breaks recrusion

David Sky wrote:

> Hello everyone!
> 
> A couple of days ago I submitted a bug to PHP
> http://bugs.php.net/bug.php?id=45385
> But I was mistaken, apparently it's not a bug.
> And I was "sent" here to get help.
> [snip]
> So before I write a reply to the bug i submitted, I wanted to know
> if there's something I'm missing with this?

Did you read the explanation wrt foreach() operating on a copy of the
array? 


/Per Jessen, Zürich


-- 
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] Newbie problem: Php script not running in browser.

2008-08-06 Thread Chetan Rane
Hi

You need to check if your Apache is up and running do the following

Right click on My Computer and select "manage"
Next click on Services and Applications
After that Click on Services

And check if Apache is running



Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 2:53 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:

> On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat <[EMAIL PROTECTED]> wrote:
>> I have put the first php script to hello.php file:
>>
>> 
>>  
>>   PHP Test
>>  
>>  
>>  Hello World'; ?>
>>  
>> 
>>
>> I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b
>>
>> http://localhost/ is E:\wamp\www
>>
>> I put the hello.php file to E:\wamp\www. drag/dropping it to browser
>> shows the above source code in ff3/ie6
>>
>> putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
>> to browser shows the same source code.
>>
>> However, putting it to E:\wamp\www\php_ex but giving
>> http://localhost/hello.php shows a blank screen
>>
>> I have forgotten some situation where it had appeared as
>>
>> Hello World
>>
>> '; ?>
>>
>> on the browser.
>>
>> E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
>> LoadModule php5_module "e:/wamp/bin/php/php5.2.6/php5apache2_2.dll"
>> AddType application/x-httpd-php .php
>> AddType application/x-httpd-php .php3
>>
>> On double clicking the php file in windows explorer, it opens in notepad
>> for edit, instead of getting opened in firefox that is my default.
>>
>> Please give me the starting push.
>> -- V
>>
> 
> 
> If you simply drag-and-drop the file from an explorer window into
> Firefox, Firefox will display the page directly from the file system
> instead of serving it through your web server. (You can tell this
> because your address bar will say file:///E:/wamp/www/hello.php.) Your
> browser won't parse the PHP as script; it will just think it is
> malformed HTML and it would show the output you listed above.
> Double-clicking the file, or dragging it into IE will try to open the
> file with whatever program is associated with that extension in
> Windows. (If there isn't a file association for *.php files, it will
> either prompt you for a program to handle the file or it might do the
> same as Firefox. I'm not sure, and I'm not really interested in
> changing my file associations to test.)
> 
> IF the file is located at E:\wamp\www\hello.php AND PHP is configured
> correctly AND your web server's document root is E:\wamp\www\, THEN
> opening http://localhost/hello.php should work.
> 
> Andrew

Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a 
blank screen. What has gone wrong?

-- 
V

-- 
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] Newbie problem: Php script not running in browser.

2008-08-06 Thread Chetan Rane
Can you please check what the Document Root in http.conf

Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 7:22 PM
To: Chetan Rane
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 4:20 PM India Time, _Chetan Rane_ wrote:

> Hi
> 
> You need to check if your Apache is up and running do the following
> 
> Right click on My Computer and select "manage"
> Next click on Services and Applications
> After that Click on Services
> 
> And check if Apache is running

Hi Chetan,

Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local 
system, and

wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the 
following entries in apache_error.log

[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal -- 
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled. 
Child process is ending.
[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have 
exited.
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited 
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 
configured -- resuming normal operations
[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said "your port 80 is 
not used" and the following entry got added in error_log:

[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to 
listen on port 80.

Thanks.
-- 
V

> 
> 
> 
> Chetan Dattaram Rane | Software Engineer | Persistent Systems
> [EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
> Innovation in software product design, development and delivery- 
> www.persistentsys.com
> 
> 
> 
> 
> -Original Message-
> From: V S Rawat [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 06, 2008 2:53 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Newbie problem: Php script not running in browser.
> 
> On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:
> 
>> On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat <[EMAIL PROTECTED]> wrote:
>>> I have put the first php script to hello.php file:
>>>
>>> 
>>>  
>>>   PHP Test
>>>  
>>>  
>>>  Hello World'; ?>
>>>  
>>> 
>>>
>>> I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b
>>>
>>> http://localhost/ is E:\wamp\www
>>>
>>> I put the hello.php file to E:\wamp\www. drag/dropping it to browser
>>> shows the above source code in ff3/ie6
>>>
>>> putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
>>> to browser shows the same source code.
>>>
>>> However, putting it to E:\wamp\www\php_ex but giving
>>> http://localhost/hello.php shows a blank screen
>>>
>>> I have forgotten some situation where it had appeared as
>>>
>>> Hello World
>>>
>>> '; ?>
>>>
>>> on the browser.
>>>
>>> E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
>>> LoadModule php5_module "e:/wamp/bin/php/php5.2.6/php5apache2_2.dll"
>>> AddType application/x-httpd-php .php
>>> AddType application/x-httpd-php .php3
>>>
>>> On double clicking the php file in windows explorer, it opens in notepad
>>> for edit, instead of getting opened in firefox that is my default.
>>>
>>> Please give me the starting push.
>>> -- V
>>>
>>
>> If you simply drag-and-drop the file from an explorer window into
>> Firefox, Firefox will display the page directly from the file system
>> instead of serving it through your web server. (You can tell this
>> because your address bar will say file:///E:/wamp/www/hello.php.) Your
>> browser won't parse the PHP as script; it will just think it is
>> malformed HTML and it would