- This topic is empty.
-
AuthorPosts
-
August 5, 2014 at 11:13 pm #177863
Anonymous
InactiveDid you also make the appropriate addition to the $_option property?
Nope, missed it completely.
I added that and
if( $this->_option["value.ci"] ){ $value = mb_strtolower( $value ); }
and now I get a white page. select “General Inquiry/Comment” when testing here.
Best Regards.
August 5, 2014 at 11:21 pm #177865__
ParticipantSo, we’ve got a fatal error somewhere. I don’t remember if you said you have access to the error logs on your new server…?
Could you post (a gist/pastebin of) the current class definition you are using?
August 5, 2014 at 11:34 pm #177870Anonymous
InactiveI’m sorry but I don’t understand what you mean by “current class definition.” I’m still green around the gills on this.
It seems that the array for the antispam is working as I tested a couple of variables.
Very much appreciate you taking the time for all of this!
EDIT: I just noticed that the messages are not being sent now. I stated this hoping it would help pinpoint the issue.
EDIT 2: I’m going through your coding and what I have comparatively and I notice in line 311 on yours it states
if( isset( $_post["spam"] ) && $this->_validateAntispam( $_post["spam"] ) ){ // submission was good! return $v;
on mine instead of return $v; it is return true;
EDIT 3: I’ve completed the comparative and see no differences other than noted above. I did change the return true to return $v just to see if it made a difference, and it did not. I have changed it back to true. I hope that something I added here helps.
Many thanks!
August 6, 2014 at 4:15 am #177903Anonymous
InactiveI forgot to mention above that I noticed this difference as well:
Mine:
'<p class="cform-notice">'.htmlspecialchars( $this->_notice ).'</p>': false; }
Yours:
'<div class="cform-notice">'.$this->_notice.'</div>': false; }
The above mentioned in case it could be a source of the white page.
A question:
Do commas need to go after each challenge like so:
“How many apples are in a dozen?” => array (“12″,”Twelve”,”twelve”),
“What is 5-4?” => array (“1″,”One”,”one”),
Etc……Best Regards.
August 6, 2014 at 10:03 am #177992__
Participanton mine instead of
return $v;
it isreturn true;
It should be
return $v;
. That’s the bugfix we made earlier.Do commas need to go after each challenge like so:
Yes, commas need to go between each item in each array.
I noticed this difference as well: …
htmlspecialchars( $this->_notice )
…That’s the change we made to allow HTML in the success/failure messages. Leaving it in or taking it out is fine (I’d say take it out, as in my version; no harm in it and it makes things more flexible in the future).
I’m sorry but I don’t understand what you mean by “current class definition.”
The
contactMichael1961.php
script.“1″,”One”,”one”
Side note: if you put in the
value.ci
(“case-insensitive”) option (and I think we did do that that earlier), then the script will do a case-insensitive comparison and you only need to specify"1","one"
in your challenges.→ can you check your error logs?
August 6, 2014 at 8:41 pm #178061Anonymous
InactiveGreetings traq,
I’ve made the changes and doubled checked everything and still the white page with no email received. I am looking into how to access my error files and will email you a link to a pastebin of the class definitions if the logs show nothing definitive.
Sorry for the slow reply.
Best Regards.
August 7, 2014 at 2:27 am #178088Anonymous
Inactivetraq,
I am STILL waiting on Stablehosts tech rep to catch up with what’s going on. For about a half-an-hour this morning everything went well, then it was passed to another rep who seemingly never has a clue. I’ve worked with him before and he has rarely been a help. We are five hours into this and he asks repetitive questions, restates things previously stated, and still has no clue as to what is going on.
Hopefully with the next shift change I will be able to deal with someone at Stablehost who can find the issue sooner than 5+ hours since initially asked as to why my PHP error logs aren’t recording and why PHP errors are not showing up on the page when that module is enabled.
Absolutely Amazing!
Best Regards.
August 7, 2014 at 2:03 pm #178183__
ParticipantGo ahead and post/send a link to your current script and I’ll look it over.
I forget if I’ve asked before, but what program do you use for editing your code?
August 7, 2014 at 11:53 pm #178245Anonymous
InactiveGreetings traq,
I sent you an email moments ago with the script and explaining everything.
Best Regards.
August 8, 2014 at 8:25 am #178302Anonymous
InactiveGreetings traq,
I just heard from Stablehost and they report that error reports are being generated, and created a test page to demonstrate that is indeed so. They also stated they added an error_report(-1) (whatever that is) to the form script and it still prints a blank white page which they said suggests an error in the code, or perhaps the usage of a class in the form is not compatible with the PHP 5.5 I am using.
Best Regards.
August 8, 2014 at 1:00 pm #178331__
ParticipantThey also stated they added an error_report(-1)
Won’t help you, in this case. To understand why: PHP scripts run in two phases. First, the PHP engine parses the script and converts it into bytecode. After this, it executes the bytecode.
error_reporting
is a function, like any other. It does its work when the script is executed. If there is an error that prevents the code from executing at all, then it will never have a chance to do anything. PHP’s “White Page” indicates that there was a fatal error when the script was being parsed —that is, before it was executed.Have you asked them if there is a PHP error log? There should be. Be specific that you are not asking them to troubleshoot your script, just asking where the error log is so you can do the troubleshooting yourself.
I there is no php error log, ask if they could set up your account to generate one.
August 8, 2014 at 1:01 pm #178332__
ParticipantWould you right click and view the source on the “blank page”? Does it say “1”?
August 8, 2014 at 1:11 pm #178333__
ParticipantAlright. There is no PHP error: we’re triggering our own “spam trap.” The case-insensitive option is causing the Recipient to not validate.
There’s a simple fix. We’ll just remove it from the
validate
method, and put it in the_validateAntispam
method instead.protected function _validateAntispam( $value ){ // case insensitive? if( $this->_option["value.ci"] ){ $value = mb_strtolower( $value ); } // get antispam key from session, make sure the value is the correct answer $correct = ( isset( $_SESSION[__CLASS__]["antispam"] ) && isset( $this->_antispam[$_SESSION[__CLASS__]["antispam"]] ) && in_array( $value, (array)$this->_antispam[$_SESSION[__CLASS__]["antispam"]] ) ); // remove used questions from session to prevent re-use unset( $_SESSION[__CLASS__]["antispam"] ); if( ! $correct ){ $this->_errors["antispam"] = "Please try the antispam challenge again."; return false; } return true; }
tested; works.
August 8, 2014 at 10:51 pm #178366Anonymous
InactiveWould you right click and view the source on the “blank page”? Does it say “1″?
Yes, it did.
Ok, I’ve made the changes and it does work. I am having one problem however and I’m not sure why it is occurring. After the form is submitted the success message is showing like this:
<p class="cform-success">Your message was sent successfully. Thank you!</p>
I have the CSS styles for all notices like this:
p.cform-notice, p.cform-failure, p.cform-success {
What am I doing wrong?
I sent a request to Stablehost regarding the generation of PHP errors. That appears to still be an issue (they aren’t being recorded in the error logs)
Many thanks.
August 9, 2014 at 10:38 am #178396__
ParticipantWhat am I doing wrong?
The HTML is showing up as text because your still using
htmlspecialchars
in thehtmlMarkup_userNotice
method.If you do not want to use HTML markup in the user notices, simply remove the HTML markup from the notices (the
$_notice_success
and$_notice_failure
properties).If you want the option of using HTML markup in the messages, now or in the future, then also remove the call to
htmlspecialchars
in thehtmlMarkup_userNotice
method:// find this line: // '<div class="cform-notice">'.htmlspecialchars( $this->_notice ).'</div>': // change it to: '<div class="cform-notice">'.$this->_notice.'</div>':
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.