PDA

View Full Version : form error when submitted via contact/index.php


raabernathy397361
01-05-2010, 06:42 PM
*All I'm really trying to accomplish is using index.php for all of the contact / thank you / php files.




I'm having almost the exact same issue that was discussed via "form not working on site index.php page" post in forum. When trying to make these modifications the form either won't work at all or gives an error message. So I applied the same suggested fix but still get errors:

The form works fine when I access it directly using http://localhost/ContactForm_GMC/contact/index.php

But I still get errors When I access and submit the form via http://localhost/ContactForm_GMC/contact/

- either the form won't submit at all or gives the error message below.

Here is the error message:
Deprecated: Function split() is deprecated in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ContactForm_GMC\contac t

\WA_ValidationToolkit\WAVT_Scripts_PHP.php on line 327


Details on what I've changed:

1) changed "contactus.php" to "index.php"

2) chanaged
PHP Code:
if ((($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode

($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST))) {

to:
PHP Code:
if ($_SERVER["REQUEST_METHOD"] == "POST") {

3) changed "thankyou.php" to "thankyou/index.php"

4) changed
PHP Code//Send Mail All Entries
if ("index.php"!="") {
header("Location: thankyou.php");

to
PHP Code//Send Mail All Entries
if ("index.php"!="") {
header("Location: thankyou/index.php");


*All I'm really trying to accomplish is using index.php for all of the contact / thank you / php files. I've spent allot of time going through the forums and reading over the PHP code and honestly can't figure out how to make that happen. If you could give advice on how I can have my file / directory structure so that this will work I'd be very greatful! I prefer to do this in the least complicated way while also using the least amount of resources on my web server. Thanks for any help!

neilo
01-05-2010, 11:27 PM
The error is pointing to 'function split()'

It may be worth checking out this thread (http://www.webassist.com/forums/showthread.php?t=7418&highlight=function+split)

raabernathy397361
01-10-2010, 09:05 PM
I applied the fix suggested in that thread and it didn't work.

Here is what i did in response to suggested change
WA_ValidationToolkit\WAVT_Scripts_PHP.php on line 327

changed:
$domArr = split("\.",$domainName);

to:
$domArr = explode("\.",$domainName);

Now I keep getting errors when validating the email - on the php side. IE it keeps asking me for an email even when I enter a valid one.

*All I'm really trying to accomplish is using index.php for all of the contact / thank you / php files. I've spent allot of time going through the forums and reading over the PHP code and honestly can't figure out how to make that happen. If you could give advice on how I can have my file / directory structure so that this will work I'd be very greatful! I prefer to do this in the least complicated way while also using the least amount of resources on my web server. Thanks for any help!

Jason Byrnes
01-11-2010, 09:37 AM
all you should need to do is save the contactus.php file as:
contact/index.php

and save the thankyou.php file as:

thankyou/index.php


Then modify the line in the contact us page:
header("Location: thankyou.php");


to:
header("Location: thankyou/index.php");


your php server is useing PHP 5.3 which is why you got the deprecated function error. so you will need to make the edit sugested before.

where it is constantly validating the email address, it sounds like one ofthe form element names has been changed.

To troubleshoot, find the following line:
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}

and change it to:
if ($WAFV_Errors != "") {
die($WAFV_Errors);
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}



this will write a comma separated list of errors, post back the list of errors, a copy of the contact us page and a link to your site so I can examine the code to find the problem.

raabernathy397361
01-18-2010, 09:10 AM
Hi Thanks - I actually kept tooling around with it and managed to get it working. I really do appreciate the follow up on the debug. I still plan to apply your suggestion just to double check my work. Thanks again!