Jump to content

Archived

This topic is now archived and is closed to further replies.

a246530

PHP self vs ajax external php

Recommended Posts

Hey guys, 

I am fairly new to php and have been working on a project for about a week. I am currently running all of my queries and all of my events inside of my site. When i submit a form it checks for isset on that button then i run a function to process data. 

As far as readability, its getting pretty long and finding things when i need to change them is taking some time. I was looking into ajax for php form submit so i can do it without refreshing (with php self i dont have to refresh and i like it this way). 

As far as performance goes....which is better; the ajax form process or php self form process?

Share this post


Link to post
Share on other sites

Ajax won't stop you from having to process things and validate on the back end.  Remember: JavaScript can be turned off.

 

For performance, if everything is written well, the initial page hit will be a bit bigger with Ajax than without, simply because you'll have more code coming through the pipe to be processed by the browser.  Subsequent hits (like form submissions) will be better, though, because you'll only be handing that data and not having to re-render the rest of the page.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.