close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Form not working on site index.php page

Thread began 8/07/2009 8:00 am by eaefaw380137 | Last modified 8/10/2009 2:25 pm by Jason Byrnes | 4479 views | 5 replies |

eaefaw380137

Form not working on site index.php page

Hi - I have searched the forums and tried many different ways but can't get my form (contact solution pack) to work on my site index.php page. The form will work when I go directly to the page using index.php but will not work if I navigate to my site and let the server pull the index.php page automatically.

Why is this? Any assistance is greatly appreciated.

Sign in to reply to this post

Dani Chankhour

It looks like you current server does not have index.php listed as a default file. You will need to add index.php to the list of default files. Usually default files are set to index.html, index.htm, ....

If you are running your site using IIS, then you can use the Default Document setting to add index.php

If you are hosting your website, you might want to contact your hosting provider to add index.php.

Sign in to reply to this post

eaefaw380137

Form not working on site index.php page

Thanks for the reply, however I believe I did not explain myself correctly. I am able to access the index.php when browsing for www.sitename.com, I can see the page and content correctly (including the contact form from the solution pack) and have included index.php as a default page for the webserver on the hosting control panel or else I would not be able to see it when I browse www.sitename.com.

The problem is that the form will not work on index.php when it is served using www.sitename.com. And by "not working" I mean that I am able to view and enter data into the form, but when I click the "submit" button, the page refreshes, the data is cleared from the form but I am not redirected to the thankyou.php page and the data is not sent to the specified email adress. I have confirmed that the form DOES work as expected when I browse directly to index.php.

Thanks for your assistance.

Sign in to reply to this post

Jason ByrnesWebAssist

The Universal Email code uses an if statement to evaluate if the post came from the same page and same server, this must not be working correctly when you access the page at www.sitename.com


You can try changing:

php:
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:
if ($_SERVER["REQUEST_METHOD"] == "POST")  {
Sign in to reply to this post

eaefaw380137

Form not working on site index.php page (SUCCESS!!)

Jason - that was it. Making the change to the code fixed my problem completely. Thank you for following up so quickly today. I really appreciate it. The support from Webassist has been superb and definitely validates my purchases from your company.

Have a great day!

Sign in to reply to this post

Jason ByrnesWebAssist

Excellent, glad to hear it is working.

Sign in to reply to this post

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...