Jump to content

PHP self vs ajax external php


a246530

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?

Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.