php-general Digest 24 Apr 2009 12:52:59 -0000 Issue 6084

Topics (messages 291901 through 291925):

Re: MySQL -- finding whether there's a transaction started
        291901 by: Chris
        291918 by: Bogdan Stancescu

Re: Encrypting email
        291902 by: Ross McKay

Re: Multiple return statements in a function.
        291903 by: Brad Broerman
        291909 by: Richard Heyes

[php] graph with two or more input display
        291904 by: Andrew Williams
        291908 by: kranthi
        291912 by: Jan G.B.

Re: How can I detect an exception without using try/catch?
        291905 by: Andrea Giammarchi
        291914 by: Bill Moran
        291917 by: 9el
        291919 by: Stuart
        291920 by: Bill Moran
        291922 by: Andrea Giammarchi

[php] embedding excel chart/graph
        291906 by: Andrew Williams
        291907 by: kranthi

Re: MAIL Error
        291910 by: Jan G.B.
        291911 by: Jan G.B.

Re: MySQL, MD5 and SHA1
        291913 by: Per Jessen

Re: how to determine if a mysql query returns an empty set?
        291915 by: Baptiste Clavie
        291916 by: Baptiste Clavie

Debugging
        291921 by: George Larson

Using scandir()  in a Novell Netware Volumen or a Windows Shared Folder
        291923 by: Deivys Delgado Hernandez

Self-Process php forms or not?
        291924 by: MEM
        291925 by: Sándor Tamás (HostWare Kft.)

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Bogdan Stancescu wrote:
Hello list,

I'm developing a library and would need to know if the code calling my
library has already started a MySQL transaction or not. I want to know
whether I should start one or use savepoints instead -- starting a
transaction if one is already in progress commits the existing
transaction, and setting a savepoint silently fails outside
transactions. And I was unable to find any non-destructive way of
retrieving that information -- is there any?

I don't think mysql has any way of finding that out. If you're using an abstraction layer, it's easy enough in code - though rollback's are a little harder - should they do a complete rollback or just to a savepoint?

class db
{
....
  private $transaction_count = 0;

  public function startTransaction()
  {
    if ($this->transaction_count == 0) {
      mysql_query("BEGIN");
    } else {
      mysql_query("SAVEPOINT");
    }
    $this->transaction_count++;
  }

  public function commitTransaction()
  {
    // you can't commit a transaction if there's more than one "open"
    // so just decrement the counter
    if ($this->transaction_count > 1) {
      $this->transaction_count--;
      return;
    }
    $this->transaction_count = 0;
    mysql_query("COMMIT");
  }
}

Now you can just call
$db->startTransaction();
and
$db->commitTransaction();

and it'll handle the stuff for you.

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
On 24-Apr-09 03:45, Chris wrote:
> I don't think mysql has any way of finding that out. If you're using an
> abstraction layer, it's easy enough in code - though rollback's are a
> little harder - should they do a complete rollback or just to a savepoint?

Thank you for taking the time to sketch that mock-up -- yes, we were
also thinking about something similar as a last resort, but I just can't
believe you can't simply ask MySQL whether it's going to autocommit the
next query or not...

Bogdan

--- End Message ---
--- Begin Message ---
On Tue, 21 Apr 2009 08:39:25 -0400, Bob McConnell wrote:

>I have been asked by a product manager what our options are for
>encrypting email messages with sensitive information. We are currently
>using PHPMailer to send email. What can be done to encrypt those
>messages? Can it be done without OOP?
>
>Server configuration:
>  RHEL 5
>  Apache 2.0
>  PHP 5.2.3
>  PHPMailer 1.73

Use S/MIME, and nearly all of your clients will be able to decrypt your
emails. There are a few exceptions: Forté Agent still doesn't handle
S/MIME, and Eudora needs a plug-in to handle it. However, all mainstream
email programs support it directly, without need to install new
software.

You need to generate (or purchase - I prefer generate for free in
OpenSSL) email certificates for encrypting emails, then distribute the
certificates to allow people to decrypt them. Once they have the key,
the emails generally just automatically decrypt when you view them
(depending on the email program). NB: give your clients individual
certificates, and keep the public keys to encrypt the emails to them.

PHP has support for this, and it's easy to use:

http://au2.php.net/manual/en/function.openssl-pkcs7-encrypt.php

Apparently, PHPMailer supports it too so check that out.
-- 
Ross McKay, Toronto, NSW Australia
"Let the laddie play wi the knife - he'll learn"
- The Wee Book of Calvin

--- End Message ---
--- Begin Message ---
Well, the latter method is generally easier to understand later. Most
programming style books preach this method, and it's the one that most of my
previous employers use.

Cheers...

-----Original Message-----
From: Peter van der Does [mailto:[email protected]]
Sent: Thursday, April 23, 2009 8:13 AM
To: [email protected]
Subject: Multiple return statements in a function.


I tend to put my return value in a variable and at the end of the
function I have 1 return statement.
I have seen others doing returns in the middle of the function.

Example how I do it:
function check($a) {
  $return='';
  if ( is_array( $a ) ) {
    $return='Array';
  } else {
    $return='Not Array';
  }
  return $return;
}

Example of the other method:
function check($a) {

  if ( is_array( $a ) ) {
    return ('Array');
  } else {
    return ('Not Array');
  }
}

What is your take? And is there any benefit to either method?


--
Peter van der Does

GPG key: E77E8E98
Blog: http://blog.avirtualhome.com
Forums: http://forums.avirtualhome.com
Jabber ID: [email protected]

GetDeb Package Builder
http://www.getdeb.net - Software you want for Ubuntu


--- End Message ---
--- Begin Message ---
Hi,

> your function could be condensed to this:
>
> function check($a)
> {
>    return is_array($a) ? true : false;
> }

Or even better, this:

function check($a)
{
   return is_array($a);
}

Not that I'd imagine it makes a great deal of difference.

-- 
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)

--- End Message ---
--- Begin Message ---
Hi All,

Does anyone know of any php grahp that will enable you to show/analyse more
than one inputs like price versus time?

-- 
Best Wishes

Andrew Williams
willandy.co.uk

--- End Message ---
--- Begin Message ---
http://pchart.sourceforge.net/documentation.php?topic=exemple8

but may be a 2-D graph will be more simpler to understand
http://teethgrinder.co.uk/open-flash-chart/gallery-bar-4.php

Kranthi.

--- End Message ---
--- Begin Message ---
2009/4/24 Andrew Williams <[email protected]>:
> Hi All,
>
> Does anyone know of any php grahp that will enable you to show/analyse more
> than one inputs like price versus time?
>

Hi Andrew,

we're using PEAR:Image_graph here and it's good for our needs. Maybe
you should check it out.

PEAR:Image_graph   http://pear.veggerby.dk/

Regards

--- End Message ---
--- Begin Message ---
http://uk2.php.net/set_exception_handler
http://uk2.php.net/manual/en/function.set-error-handler.php


> Date: Thu, 23 Apr 2009 12:19:30 -0400
> From: [email protected]
> To: [email protected]
> Subject: [PHP] How can I detect an exception without using try/catch?
> 
> 
> Specifically, the __destruct() method of certain objects will be
> called if an object goes out of scope due to an exception.  Since
> the __destruct() method didn't call the code that caused the
> exception, it can't catch it.
> 
> I need the __destruct() method to behave differently if it's
> called while an exception is in progress than if it's called
> simply because the object is unset.
> 
> Searches of the docs has yet to turn up anything and Google isn't
> helping.  Anyone have any pointers?
> 
> -- 
> Bill Moran
> http://www.potentialtech.com
> http://people.collaborativefusion.com/~wmoran/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx

--- End Message ---
--- Begin Message ---
In response to Andrea Giammarchi <[email protected]>:
> 
> http://uk2.php.net/set_exception_handler
> http://uk2.php.net/manual/en/function.set-error-handler.php

Thanks for the reply, Andrea.  However, you either didn't read my
entire message, or didn't understand it.  I can't use either of
those to detect an exception that's already in progress, I can only
use them to catch the exception before the script ends if nothing
else catches it.

What would be nice is a function like get_current_exception() that
would either return the current exception object, or return false
if there is no exception.

> > Date: Thu, 23 Apr 2009 12:19:30 -0400
> > From: [email protected]
> > To: [email protected]
> > Subject: [PHP] How can I detect an exception without using try/catch?
> > 
> > 
> > Specifically, the __destruct() method of certain objects will be
> > called if an object goes out of scope due to an exception.  Since
> > the __destruct() method didn't call the code that caused the
> > exception, it can't catch it.
> > 
> > I need the __destruct() method to behave differently if it's
> > called while an exception is in progress than if it's called
> > simply because the object is unset.
> > 
> > Searches of the docs has yet to turn up anything and Google isn't
> > helping.  Anyone have any pointers?
> > 
> > -- 
> > Bill Moran
> > http://www.potentialtech.com
> > http://people.collaborativefusion.com/~wmoran/
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> _________________________________________________________________
> Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
> 
> http://www.microsoft.com/windows/windowslive/products/photos.aspx


-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

--- End Message ---
--- Begin Message ---
>
>
> What would be nice is a function like get_current_exception() that
> would either return the current exception object, or return false
> if there is no exception.
>
> I guess the try catch pair works like this:

you  try to  run a part of script which you know it could be under errors

You tell your boy to play(but a bulley comes often):
try {
Go boy try to play
}

catch (street_bulley_came) {
do not cry or dont swear at the bulley dont be afraid
}

Lenin

www.twitter.com/nine_L

--- End Message ---
--- Begin Message ---
2009/4/23 Bill Moran <[email protected]>:
>
> Specifically, the __destruct() method of certain objects will be
> called if an object goes out of scope due to an exception.  Since
> the __destruct() method didn't call the code that caused the
> exception, it can't catch it.
>
> I need the __destruct() method to behave differently if it's
> called while an exception is in progress than if it's called
> simply because the object is unset.
>
> Searches of the docs has yet to turn up anything and Google isn't
> helping.  Anyone have any pointers?

As far as I'm aware what you're asking for is not possible. Exception
handlers run without any context - check the return value from
debug_backtrace() in a catch block to see what I mean.

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---
Ok, the details of the problem obviously aren't being understood.
Let's assume that I explained it poorly and I'll try again.  Take the
following code (It's complete, cut/paste to see what happens.):

<?php

class running {
 private $running;
 
 public function __construct() {
  $this->running = true;
 }
 
 public function stop() {
  $this->running = false;
 }
 
 public function __destruct() {
  if ($this->running) {
   throw new exception('I have not stopped running yet!');
  }
 }
}

function fail_horribly() {
 throw new exception('This is the real error that I want a stack trace from');
}

function do_that_thing() {
  $running = new running();
  fail_horribly();
  $running->stop();
}

try {
 do_that_thing();
}
catch (exception $e) {
 echo $e->getMessage();
}

?>

While putting this together, I discovered lots of interesting
behaviour.  Depending on exactly where I put the try/catch, there are
different things that happen and different errors that occur.  It's
kinda interesting.

The thing is, that none of those errors is the result that I _want_
which is to ignore the fact that $running was unset and just report
the error that started everything going wrong.

If I could put my fictional function (get_current_exception()) in the
__destruct() method, I could detect that an exception was already in
progress and avoid throwing another one.

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

--- End Message ---
--- Begin Message ---
uhm, I did not read it, you are right ... well, take this code as a joke, OK?

<?php
function exception_handler($exception) {
    echo "Error: " , $exception->getMessage(), "\n";
    if($checkSomethingAndEventuallyContinue = true){
        $line = $exception->getLine();
        $php = explode(PHP_EOL, file_get_contents($exception->getFile()));
        while($line--)
            array_shift($php);
        eval(implode(PHP_EOL, $php));
    }
}

set_exception_handler('exception_handler');
throw new Exception('Uncaught Exception');
echo "Not Executed\n";
?>


> Date: Fri, 24 Apr 2009 07:07:10 -0400
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [PHP] How can I detect an exception without using try/catch?
> 
> In response to Andrea Giammarchi <[email protected]>:
> > 
> > http://uk2.php.net/set_exception_handler
> > http://uk2.php.net/manual/en/function.set-error-handler.php
> 
> Thanks for the reply, Andrea.  However, you either didn't read my
> entire message, or didn't understand it.  I can't use either of
> those to detect an exception that's already in progress, I can only
> use them to catch the exception before the script ends if nothing
> else catches it.
> 
> What would be nice is a function like get_current_exception() that
> would either return the current exception object, or return false
> if there is no exception.
> 
> > > Date: Thu, 23 Apr 2009 12:19:30 -0400
> > > From: [email protected]
> > > To: [email protected]
> > > Subject: [PHP] How can I detect an exception without using try/catch?
> > > 
> > > 
> > > Specifically, the __destruct() method of certain objects will be
> > > called if an object goes out of scope due to an exception.  Since
> > > the __destruct() method didn't call the code that caused the
> > > exception, it can't catch it.
> > > 
> > > I need the __destruct() method to behave differently if it's
> > > called while an exception is in progress than if it's called
> > > simply because the object is unset.
> > > 
> > > Searches of the docs has yet to turn up anything and Google isn't
> > > helping.  Anyone have any pointers?
> > > 
> > > -- 
> > > Bill Moran
> > > http://www.potentialtech.com
> > > http://people.collaborativefusion.com/~wmoran/
> > > 
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > 
> > 
> > _________________________________________________________________
> > Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
> > 
> > http://www.microsoft.com/windows/windowslive/products/photos.aspx
> 
> 
> -- 
> Bill Moran
> http://www.potentialtech.com
> http://people.collaborativefusion.com/~wmoran/

_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx

--- End Message ---
--- Begin Message ---
* I have been to  see how to embed excel charts and graph to php code. does
any knows how*

willandy.co.uk

--- End Message ---
--- Begin Message ---
y specifically an excel chart.... ?
see http://teethgrinder.co.uk/open-flash-chart/

Kranthi.

--- End Message ---
--- Begin Message ---
2009/4/22 tedd <[email protected]>:
> At 6:31 PM +0200 4/22/09, Jan G.B. wrote:
>>
>> I believe that you all should just overread the huge signature.
>> You've wasted a lot bandwidth with this discussion about the signature.
>> :-)
>> It's not interesting.
>> You could have send your pointless replies to the person, skipping the
>> mailing list, so that we aren't annoyed by your drivel which is send
>> to thousnads of mail servers.
>>
>> 2009/4/22 tedd <[email protected]>:
>>>
>>>  Second, if they insist on continuing this idiotic practice, then get a
>>>  different email account for yourself. There are many places where you
>>> can
>>>  get an email account (i.e., gmail, yahoo, etc.) and it's pretty simple
>>> to
>>>  set one up so that you can use it from work.
>>>
>>
>> Some companies will fire you for using private email at work. => VERY GOOD
>> TIP.
>>
>>>  Just because your company has idiotic practices doesn't mean that you
>>> have
>>>  to follow suit.
>>>
>>
>> It's idiotic to speak about that crap!
>>
>>
>> thanks for your time. time to get back on topic.
>
> Jan:
>
> Thanks for your input and you may be right, but you must also realize that
> this list governs itself, right?
>
> If I get tried of reading the same pointless excessive signature over and
> over again and want to comment about it, I will.
>

Sure, do it. My point was that it seems ineffective to me to argue on
such topics at all. But surely you can do whatever you want. Just like
... I or other readers can fill their killfile if such threads come
more often.


> Your opinion as to IF I should say something, or not, carries little weight.
> When you've donated enough time helping others on this list, then perhaps
> that will change.

Sorry, but that's a bad attitude in my opinion. It's like "No matter
how right or wrong you are, I will not listen to you unless you've
kissed Johns feet 10 times, like I did."

> But for the moment, I think it's best for the OP to check
> with his work and see if he can reason with them. If not, I certainly have
> no reason to read the same "drivel" again and again. As such, I can skip
> questions posted by him -- and who does that hurt?
>

I for myself would fell in laughter if a collegue comes to my desk,
asking to remove network filters or the mandatory signature of our
company.
But on to your question: I guess it wouldn't hurt at all if you'd skip
the reply regarding his signature. :-)



> Now if you have a problem with the way we "moderate" this list, then post
> your objections and we'll all consider them and adapt what works.

So I have reached the limit of "When you've donated enough time", yet? Great.

> But as I
> see it, refusing to trim excessive signatures is not one that works well on
> this list. Remember, we all donate our time AND we choose who we help.
>

It's clear that you can chose whom to help. But what you actually do
here is argueing on some off topic bytes. Surely, after everyone is
giving opionions about that, it's gonna be the topic. But not a topic
with any conclusions.

> Cheers,
>
> tedd
>
Bye,
Jan

--- End Message ---
--- Begin Message ---
2009/4/22 Daniel Brown <[email protected]>:
> On Wed, Apr 22, 2009 at 12:31, Jan G.B. <[email protected]> wrote:
>> I believe that you all should just overread the huge signature.
>> You've wasted a lot bandwidth with this discussion about the signature. :-)
>> It's not interesting.
>> You could have send your pointless replies to the person, skipping the
>> mailing list, so that we aren't annoyed by your drivel which is send
>> to thousnads of mail servers.
>
>    You still have absolutely no idea of what this community is or was
> before you came along and tried to instill your own sanctimonious
> attitude and ideals on people.  Trust me on this: nothing you ever,
> ever say will change people's minds here, Jan.
>
>

Well, if nothing being said here can change peoples mind, then why do
people argue on signatures here?

--- End Message ---
--- Begin Message ---
Jan G.B. wrote:

> 2009/4/21 Per Jessen <[email protected]>:
>> Jan G.B. wrote:
>>
>>> A web application that uses an external db server would be quite ...
>>> uhm... slow! Anyone did this, yet? ;)
>>
>> Certainly, and it's not slow.  It depends entirely on your connection
>> to the public internet.
>>
> 
> As we're speaking of the internet, it also depends on the route and so
> it depends on servers which are not underlying your administration (in
> most cases at least).
> Having several servers with gigabit internet access also might be more
> expensive than a cat6 patch cable and a gigabit nic. So this setup
> would be just mad.

It's a moot point, but I know for a fact that such a setup can work just
fine.  I'm surprised you didn't even consider performance requirements
when you started making such blanket statements.


/Per

-- 
Per Jessen, Zürich (10.7°C)


--- End Message ---
--- Begin Message ---
Is there a way to determine if a mysql query returns an empty set? I am selecting 10 results at a time with a limit statement and need to know when i've ran out of rows. I've only got 2 rows in the database, so when I start with row 10, it returns an empty set. I have the following code:

//running this query gives "Empty set (0.00 sec)" in mysql console.

$get_requests = "select form_id, full_name, email, phone, division, location, date_format(time_of_request, '%m-%d-%Y %r') as time_of_request, contact_time, problem, accepted_by, date_format(accepted_time, '%m-%d-%Y %r') as accepted_time, resolution, date_format(resolution_time, '%m-%d-%Y %r') as resolution_time from form where ((stage = 'Closed') && (email = 'awilliam' )) order by resolution_time limit 10 , 10"

//checks to see if it returns nothing, then print that you are at the end of the results

if (!$mysqli_get_requests = mysqli_query($mysqli,$get_requests))
                       {
                       echo "You have reached the end of the results.
                       Please press the back button.
                       <form action=/helpdesk/login.php method=post><input
                       type=submit value=Back
                       name=submit></form></body></html>";
                       exit;
                               }

but that doesn't work, because I guess an empty set is not false, 0, or NULL?




Hello,

Something better than *_num_rows() : try a do...while loop :
$res = mysqli_result($sql);

if ($data = mysqli_fetch_*($res)) { // At least one row was found
    do {
       //....
    } while ($data = mysqli_fetch_row);
} else {
    // 0 rows
}

--- End Message ---
--- Begin Message ---
Is there a way to determine if a mysql query returns an empty set? I am selecting 10 results at a time with a limit statement and need to know when i've ran out of rows. I've only got 2 rows in the database, so when I start with row 10, it returns an empty set. I have the following code:

//running this query gives "Empty set (0.00 sec)" in mysql console.

$get_requests = "select form_id, full_name, email, phone, division, location, date_format(time_of_request, '%m-%d-%Y %r') as time_of_request, contact_time, problem, accepted_by, date_format(accepted_time, '%m-%d-%Y %r') as accepted_time, resolution, date_format(resolution_time, '%m-%d-%Y %r') as resolution_time from form where ((stage = 'Closed') && (email = 'awilliam' )) order by resolution_time limit 10 , 10"

//checks to see if it returns nothing, then print that you are at the end of the results

if (!$mysqli_get_requests = mysqli_query($mysqli,$get_requests))
                       {
                       echo "You have reached the end of the results.
                       Please press the back button.
                       <form action=/helpdesk/login.php method=post><input
                       type=submit value=Back
                       name=submit></form></body></html>";
                       exit;
                               }

but that doesn't work, because I guess an empty set is not false, 0, or NULL?




Hello,

Something better than *_num_rows() : try a do...while loop :
$res = mysqli_result($sql);

if ($data = mysqli_fetch_*($res)) { // At least one row was found
    do {
       //....
    } while ($data = mysqli_fetch_row);
} else {
    // 0 rows
}

--- End Message ---
--- Begin Message ---
Understanding that some coders are diametrically opposed to all assistance
from debuggers as crutches, I offer this link for the rest of us:
http://particletree.com/features/php-quick-profiler/

Mine was pointing to the wrong folder and still has some warnings so I think
these guys might have hurried a bit but it still looks awfully cool.

--- End Message ---
--- Begin Message ---
Hi,
Im having problems when i try to use the function scandir()  in a Novell 
Netware Volumen or a Windows Shared Folder
they both are mapped as a windows network drive, so i suppose i could access 
them as local drive, but i can't. instead i receive this message:

Warning: scandir(R:\) [function.scandir]: failed to open dir: Invalid argument 
in C:\WebServ\wwwroot\htdocs\index.php on line 3
Warning: scandir() [function.scandir]: (errno 22): Invalid argument in 
C:\WebServ\wwwroot\htdocs\index.php on line 3


this is the script:

 <?php
  $dir = "R:\\";                        //Some Windows Network Drive (Novell 
Netware Volumen or a Windows Shared Folder)
  $files1 = scandir($dir);
  print_r($files1);
 ?>

i' am logged to novell as a administrator (testing only)
if i use scandir() in a local drive it works fine for example
scandir("D:\\")
so i guess it's not a security problem 

i have appache server 2.0 installed on a WXP SP3 workstation (only for testing) 
and a Novell Netware Server v5.0 used as a File Server, PHP 5.0.2

i have read some message posted before on the list, suggesting to go and search 
in google before asking help to the list. 
I wish i could do that, i live in Cuba and i DON'T!!!!  have access to the 
internet :-((  :-((  :-((
 

sorry for my english.

Saludos,
Dedel.


---------------------------------------
    Red Telematica de Salud - Cuba
          CNICM - Infomed

--- End Message ---
--- Begin Message ---
I’m trying to understand the advantages behind opting by using a
Self-Process PHP Form, instead of having a form and then point the action of
the form to another .php page. 
 
Can anyone point me some resources about this. Why using one instead of
another. What are the main advantages?
 
 
 
Regards,
Márcio

--- End Message ---
--- Begin Message --- I think the main advantage is that if something goes wrong processing the datas, you can show the form again without redirecting again.

And if you have to change the behavior of the page, you have to change only one file instead of two.

SanTa

----- Original Message ----- From: "MEM" <[email protected]>
To: "'PHP-General List'" <[email protected]>
Sent: Friday, April 24, 2009 2:34 PM
Subject: [PHP] Self-Process php forms or not?


I'm trying to understand the advantages behind opting by using a
Self-Process PHP Form, instead of having a form and then point the action of
the form to another .php page.

Can anyone point me some resources about this. Why using one instead of
another. What are the main advantages?



Regards,
Márcio


--- End Message ---

Reply via email to