close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Need Help With Form that's Not Working

Thread began 5/14/2012 5:16 pm by kathy.bankston359922 | Last modified 5/15/2012 5:09 pm by Jason Byrnes | 2489 views | 17 replies |

kathy.bankston359922

Need Help With Form that's Not Working

If anyone has a moment can you look at this form and tell me why it's not working?
I have tried everything I can think of to make it work.

contactus.php

This is the second form on the web site, so I renamed the global file and linked to it as I read in another post.

Attached Files
employment.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Give the submit button a name:

php:
<input type="submit" value="Submit" class="inputButton" name="submit" />




then change this line:

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 ((isset($_POST['submit']) && $_POST['submit'] != ""))     {
Sign in to reply to this post

kathy.bankston359922

thank you for trying to help me, but I made the changes and still it's not working. I'm thinking I might just be better off to start over, but this is a big form to recreate.

I've attached the current set of files as is, and the link above reflects the form in it's current state.

If you have time could you please look again?

I really appreciate it.
Kathy

Attached Files
employment.zip
Sign in to reply to this post

Jason ByrnesWebAssist

this code block:

php:
<?php 

if ($_SERVER["REQUEST_METHOD"] == "POST")  {
  
$WAFV_Redirect "";
  
$_SESSION['WAVT_contact_Errors'] = "";
  if (
$WAFV_Redirect == "")  {
    
$WAFV_Redirect $_SERVER["PHP_SELF"];
  }
  
$WAFV_Errors "";
  
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Contact_Name"]))?$_POST["Contact_Name"]:"") . "",true,1);
  
$WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,2);
  
$WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);
    
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_question"]))?strtolower($_POST["Security_question"]):"") . "",((isset($_SESSION["random_answer"]))?strtolower($_SESSION["random_answer"]):"") . "",true,5);
  
$WAFV_Errors .= WAValidateRX(((isset($_POST["addblock"]))?$_POST["addblock"]:"") . "","/^$/i",false,6);
  
$WAFV_Errors .= WAValidateRX(((isset($_POST["seconddblock"]))?$_POST["seconddblock"]:"") . "","/^$/i",false,7);

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




is trying to validate form elements that do not exist in your form.

delete that block of code do that it will not try validating these non existing elements.

Sign in to reply to this post

kathy.bankston359922

Ahh! Making progress. It is emailing me the form now. BUT it is not taking me to the thank you page. It just submits and stays on the page- acts like it's not working. But it is. Just not redirecting.

:)

Since this is the second form on the web site, am I missing something about the redirect with regards to that?

Sign in to reply to this post

Jason ByrnesWebAssist

probably a php error preventing the redirect, add the following code at line 1 to turn on error reporting:

php:
<?php
error_reporting
(E_ALL);
ini_set('display_errors','on');
?>




most common problem is the headers already sent error, see this post for details:
showthread.php?t=19285

Sign in to reply to this post

kathy.bankston359922

Parse error: syntax error, unexpected '.' in /home/allensai/public_html/employment/contactus.php on line

Sign in to reply to this post

kathy.bankston359922

this is line 5
<?php require_once('../WA_Globals/WA_Globals_employment.php');?>

I know nothing about php??

Reading link you sent...

Sign in to reply to this post

kathy.bankston359922

okay, fixed the missing ) in the script...

now it says:
Parse error: syntax error, unexpected T_STRING in /home/allensai/public_html/employment/contactus.php on line 12

this is line 12
<?php
if ((isset($_POST['submit']) && $_POST['submit'] != "")) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "".($WAGLOBAL_Contact_Email_To) ."";include("../WA_Universal_Email/WAUE_contact_1.php");

//Send Mail All Entries
if ("index.php"!="") {
header("Location: thankyou.php");
}
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

I had a typo in my code that i sent you, it should be:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>




send the latest copy of your file so i can see the code in context to troubleshoot,

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