close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Getting a warning re:WAVT_Scripts_PHP.php

Thread began 8/07/2009 2:52 pm by iggymak198560 | Last modified 8/19/2009 2:14 pm by Eric Mittman | 4040 views | 9 replies |

iggymak198560

Getting a warning re:WAVT_Scripts_PHP.php

I'm having difficulty getting it to send mail and then go to the thank you page. I am a PHP neophyte so I'm not sure how it all works, having only a marginal understanding. I tried searching through here but didn't see anything...
It's on a Linux server at Datapipe.

For this site - contact.php, when I hit submit I get this message...

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/www.skylaire.com/web/ContactForm_GMC/contact.php:1) in /home/sites/www.skylaire.com/web/ContactForm_GMC/WA_ValidationToolkit/WAVT_Scripts_PHP.php on line 68

Here are the lines around 68:

61: if (isset($_SERVER['QUERY_STRING']) && ($_SERVER['QUERY_STRING'] != '')) {
62: if (strpos($thePostURL,"?") !== false) {
63: $thePostURL.= "&" . ($_SERVER['QUERY_STRING']);
64: } else {
65: $thePostURL.= "?" . ($_SERVER['QUERY_STRING']);
66: }
67: }
68: header("Location: ". $thePostURL);
69: exit;
70: }

I tried doing this - changing a line on the contact page as noted in other posts here to if ($_SERVER["REQUEST_METHOD"] == "POST") {, but it didn't help. I have 5 other sites on the same server (I think it's the same, at least) and they all worked after changing that request method line so I'm kind of stymied. None of the others gave a warning, they all just refreshed the contact page.

A programmer said it might have a different IP #... but I'm not sure how that'd affect it.

I think I have to take something out somewhere to let it work, as somewhere it already tried to send it it seems... but I've no idea what or where!

Can someone have a look?

Thanks,
Iggy

Sign in to reply to this post

Eric Mittman

When you get the headers already sent message like this it is usually because of some white space or other characters that occur outside of the php blocks. This can normally be corrected by examining the tags on the page near the error so that you find and remove any white space.

When you get the error like this at line one it can sometimes be due to a special character that is encoded and set as the first character of the page. In DW you can test for this by doing a save as for the page, in the dialog that appears make sure that you do not have the option for 'Include Unicode Signature (BOM)' checked. Having this option enabled can put this extra character at the beginning of your file and cause this error.

Please try these things and post back with what you discover.

Sign in to reply to this post

iggymak198560

better, but...

Thanks, we are farther along!

I looked for white spaces, and believe I found one, which I got rid of, but the big one was that it had indeed been set to include the BOM, (also on the thankyou.php page).

When I saved it with that setting off, things changed...

Now, I no longer get that warning, but, it still doesn't send the mail or go to the thank you page.

We're getting there for sure... I did try both setting of the request method, just in case... no difference noted...

What do you think's up?

Sign in to reply to this post

Eric Mittman

What page do you go to when you submit the form? You should be going to a thank you page of some type after the email has been sent. If you are not getting to the thank you page then this would indicate a problem elsewhere on the page when being processes.

Sign in to reply to this post

iggymak198560

it just refreshes the contact page

...taking away the field contents as if you hadn't started yet, no thank you redirect.

So far I've tried both versions of the request line as shown in other posts, and with and without the email server named in Globals... Do you think you possibly could spot the strangeness? Do you need to see anything else?

contact.php

the top php code is the same as all the other sites I have there, I checked again for white spaces after the lines end.

Sign in to reply to this post

Eric Mittman

It sounds like you are getting some type of server validation failure on the page. Take a look at the code toward the top of the page and look for this php code:

php:
if ($WAFV_Errors != "")  {

    PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
  }



When you find this you should update it so it looks like this:

php:
die("the validation errors are: " . $WAFV_Errors);

if ($WAFV_Errors != "")  {
    PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
  }



After you make this update upload and test the page, if you get the message about the validation errors please post back with the results. If you do not see any message let me know and I can open a ticket for you on this.

Sign in to reply to this post

iggymak198560

okay, here's what I got...

Thanks, Eric,

I made that change and I got this message on an otherwise blank page:

the validation errors are: ,4,5

Hope that tells you what you need to know!

Iggy

Sign in to reply to this post

Eric Mittman

Thanks for the info, this tells me that you have validations that are failing on the page. The validations that are failing on the page are the CAPTCHA and the security question. There should be some validation show if regions that will let you know that these values were not entered correctly.

Please try removing the debug code and testing again to determine if you are getting the validation errors to show on the page.

If you want to make it so the fields retain what was entered into them you will need to set their values like this:

Contact_Name:

php:
<?php echo(ValidatedField("contact","Contact_Name")) ?>



Email_address:

php:
<?php echo(ValidatedField("contact","Email_address")) ?>



Comments:

php:
<?php echo(ValidatedField("contact","Comments")) ?>



The security code and question should not be defaulted to the previous values.

Sign in to reply to this post

iggymak198560

Working!

It's now working. At first it wouldn't, though. After the last test I erased everything from local and server and started all over again, using all the precautions you mentioned. And at first that didn't work either so I did it all again, this time copying my code from the existing page onto the premade one, instead of the other way around, just in case, and that last time it worked perfectly. It must have been just the BOM code in concert with some hidden anomaly, perhaps caused by a fault in copying or pasting. Not 100% sure, but that's what I think. As I say, it now works as it should.
Thanks, Eric, be well :)

Sign in to reply to this post

Eric Mittman

That is awesome to hear, I'm not sure if you will ever know specifically what the problem was but at least you have it working now. I have a feeling like yours that it may have been a combination of issues including the BOM.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...