Miga
18 Jul 2010, 11:36 PM
Hello
I am looking for a way to increase the speed of my php code.
I have built a page with contact form and newsletter form that would validate with php/jquery.
If newsletter form is entered, it will generate confirmation code, insert into db, and then email it. It does not actually send emails to all the members. It just sends the first confirm email to the new member.
If contact form is filled out, it just sends an email.
p-code would be like this...
init vars
if contact form is submitted {
validate the form
if no errors found {
send email
}
} else if newsletter form is submitted{
validate the form
if no errors found {
generate confirm code
insert confirm code and email into db
send email
}
////HTML START///
if var newsletterSent is set {
echo thank you, email successfully sent
}
re-init the form vars
HTML CONTACT FORM
if var newsletterSent is set {
echo confirm code is sent to your email, thank you
}
re-init the form vars
HTML NEWSLETTER FORM
HTML END
My problem is that the page takes like 10 seconds to load. This code is built in procedural way. If I make this object-oriented, would that improve it?
Also, I read about eaccelerator. Is it worth giving a shot?
Thank you
I am looking for a way to increase the speed of my php code.
I have built a page with contact form and newsletter form that would validate with php/jquery.
If newsletter form is entered, it will generate confirmation code, insert into db, and then email it. It does not actually send emails to all the members. It just sends the first confirm email to the new member.
If contact form is filled out, it just sends an email.
p-code would be like this...
init vars
if contact form is submitted {
validate the form
if no errors found {
send email
}
} else if newsletter form is submitted{
validate the form
if no errors found {
generate confirm code
insert confirm code and email into db
send email
}
////HTML START///
if var newsletterSent is set {
echo thank you, email successfully sent
}
re-init the form vars
HTML CONTACT FORM
if var newsletterSent is set {
echo confirm code is sent to your email, thank you
}
re-init the form vars
HTML NEWSLETTER FORM
HTML END
My problem is that the page takes like 10 seconds to load. This code is built in procedural way. If I make this object-oriented, would that improve it?
Also, I read about eaccelerator. Is it worth giving a shot?
Thank you