Tuesday, September 16, 2008

Fix the bug!!

It had been mind-boggling why the Chronoform component on my Joomla site always stumbles upon the 500 Internal Server Error problem. The component seems to do wonders for the 1st few rounds of a form submission, and probably after >30 submissions, the error is displayed when the user clicks the SUBMIT button. I don't know if there's a problem with the hosting agent that we're using, or because of the platform we're on (Windows Server), or the compatibility of the component with the Joomla version, but what ever the problem is, there is none in the web that is helpful to solve my problem! I've tried searching under the forums of Chronoengine, tried their methods, yet, nothing works!

What's weird is, if I uninstall and re-install the component, everything works fine again. Until it reaches its certain number of submission, and the error WILL BE displayed again! i've so far uninstall and re-install the component TWICE! and i can't keep doing it, right? i need a solution! yikes~

today, i got that error again. and my boss annoying-ly said (as usual):"you never got it right!" heck boss, didn't i tell you that i am not good with web programming??!! well as though you know this stuff! aahh shoot! she knows nothing of web programming!

ok, back to the bug thingy! although i am getting the error message, the form is still successfully submitted because my database is able to pick them up. so, when i got the error, i tried to refresh the page and see what happens... still getting that error on IE! maybe i should try on firefox... aahh, that's better! i finally saw another error message displayed onto my webpage! it says: "You are not allowed to access this URL directly, POST array is empty." darn it! but i thought the form is completed?! yikes~

so, i checked the chronocontact.php file and found nothing wrong with functions and loops and cases...well, at least that's what i thought! some of the coding that i think might cause the problem is as below:

$posted = array();
$posted = $_POST;
/**
* Main switch statement
*/
switch( $task ) {
case 'send':
uploadandmail();
break;
default:
showform($posted);
break;
}

..
..
..
..
..
..

function uploadandmail()
{
..
..

// Block SPAM through the submit URL
if ( empty($_POST) ) {
echo "You are not allowed to access this URL directly, POST array is empty";
return;
}

this shows that POST IS EMPTY! (ergh, ok, the error had made its statement LOUD & CLEAR!). but that couldn't be true since it worked earlier on. anyway, i changed the coding to:

function uploadandmail()
{
..
..

// Block SPAM through the submit URL
if ( empty($posted) ) {
echo "You are not allowed to access this URL directly, POST array is empty";
return;
}

i tried the form again, click on SUBMIT, walaa - the displayed error is "You are not allowed to access this URL directly, POST array is empty". so, i don't get that 500 Internal Server Error anymore. ok, since this error is displayed ON my webpage, why not change the error message to....

function uploadandmail()
{
..
..

// Block SPAM through the submit URL
if ( empty($posted) ) {
echo "Thank you for your registration. You will be notified via e-mail.";
return;
}

WAKAKAKA!!!~ so I CHEATED! so what!! as long as i don't see that error NO MORE! haha~

ok, at least for the time being this is fine (DAMN fine!)...will fix the fix ONE day... (when my workload is lesser). right now, all i know is.... THERE IS NO ERROR!! YEEHAWW!!!

0 other story teller(s):

Post a Comment

Hi Anonymous, you are such a coward! Please, I beg you, FLAME me!

  © 2008-2009 'Morning Drink' template by ourblogtemplates.com. Edited by atreyu strange.

Back to TOP