quick easy ( I think) help on a contact form (PHP)

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

24-Oct-12 20:59
I have a contact page at
michaelapeterson.com/contactform.php
The contact works, but the person is supposed to then be redirected to a contact page and that DOESN'T work. . just leaves them on a blank page, all navigation gone.

Can anyone help? Here is the redirect code (complete code for the page below)
[CODE]if(isset($_POST['submitted']))
{
if($formproc->ProcessForm())
{
$formproc->RedirectToURL("index.html");
}
}[/CODE]


Compete code

[code]
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>

<title>Michael A. Peterson</title>

<link rel="stylesheet" type="text/css" href="main.css"/>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-color.js"></script>
<script type="text/javascript" src="main.js"></script>
<style type="text/css">
p {font-size:15px; }
</style>
</head>

<?PHP
require_once("./include/fgcontactform.php");

$formproc = new FGContactForm();



$formproc->AddRecipient('michael@michaelapeterson.com');
$formproc->SetFormRandomKey('CnRrspl1FyEylUj');


if(isset($_POST['submitted']))
{
if($formproc->ProcessForm())
{
$formproc->RedirectToURL("index.html");
}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>Contact us</title>
<link rel="STYLESHEET" type="text/css" href="contact.css" />
<script type='text/javascript' src='scripts/gen_validatorv31.js'></script>
</head>
<body>
<div id="Me"P { text-align: center }
H2 { text-align: center }>


<center>
<h1><a href="index.html">Michael A. Peterson<BR />
</a>Contact Page</h1></center>
<div id="pageWrap">
<div id="pageBody">



<a class="hoverBtn" href="Notary Services.html">Notary Services</a>
<a class="hoverBtn" href="Signing Agent.html">Signing Agent</a>
<a class="hoverBtn" href="Franchise Consulting.html">Franchise Consulting</a>
<a class="hoverBtn" href="contactform.php">Contact Me</a>
<BR /><BR />

<div id="Agent">
<p> To contact me, please either call me at (949) 892-7862, email me at Michael@michaelapeterson.com, or use the form below. <BR /></div>
</p><br /><div id="form">

<!-- Form Code Start -->
<form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
<fieldset >
<legend>Contact Me</legend>

<input type='hidden' name='submitted' id='submitted' value='1'/>
<input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/>
<input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' />


<div><span class='error'><?php echo $formproc->GetErrorMessage(); ?></span></div>
<div class='container'>
<p>Why would you like to contact me?<select name="myselect">
<option value="Notary">Mobile Notary</option>
<option value="Signing">Signing Agent</option>
<option value="Franchise">Franchise Consulting</option>
<option value="Other">Other</option>
</select><br />
<label for='name' ><p>Your Full Name: </label><br/>
<input type='text' name='name' id='name' value='<?php echo $formproc->SafeDisplay('name') ?>' maxlength="50" /><br/>
<span id='contactus_name_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='email' ><p>Email Address:</p></label><br/>
<input type='text' name='email' id='email' value='<?php echo $formproc->SafeDisplay('email') ?>' maxlength="50" /><br/>
<span id='contactus_email_errorloc' class='error'></span>
</div>

<div class='container'>
<label for='message' ><p>Message:</label><br/>
<span id='contactus_message_errorloc' class='error'></span>
<textarea rows="10" cols="50" name='message' id='message'><?php echo $formproc->SafeDisplay('message') ?></textarea>
</div>


<div class='container'>
<input type='submit' name='Submit' value='Submit' />
</div>

</fieldset>
</form>


<script type='text/javascript'>

var frmvalidator = new Validator("contactus");
frmvalidator.EnableOnPageErrorDisplay();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("name","req","Please provide your name");

frmvalidator.addValidation("email","req","Please provide your email address");

frmvalidator.addValidation("email","email","Please provide a valid email address");

frmvalidator.addValidation("message","maxlen=2048","The message is too long!(more than 2KB!)");

// ]]>
</script>

</body>
</html>
<>
26-Oct-12 11:24
And the code in the class looks like?

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/
26-Oct-12 12:11
Sorry, I am not sure what you mean by that? I am a serious novice here, but if you can point me towards what I need to answer your question I will gladly provide it.
28-Oct-12 13:08
These


if($formproc->ProcessForm())
{
$formproc->RedirectToURL("index.html");
}


Are class methods there must be some code that defines them and has the PHP code that makes them function (or not).

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/

 
New posts
Old posts

Follow Elated