Redirect using ID from Database and fill in fields on error
I can't seem to get two this to happen with Validation toolkit
1. When the validation fails I want it to redirect to the same page. THe page it is on needs to pull the ID from the database to get the same content but when I do this I get errors when trying to load the page.
The error is:
Parse error: syntax error, unexpected '.' in C:\Apache2\htdocs\ecochic\mommatalk_detail.php on line 16
This works:
$WAFV_Redirect = "mommatalk_detail.php";
This does not:
$WAFV_Redirect = "mommatalk_detail.php?ID=" . $row_rsBlogEntry['idblog']; . "";
How can I get it to redirect to the same page?
2. I want a failed redirect to keep what same information in form fields they filled out but when it redirects it doesn't do that.
This is the code in one of the form fields:
<input name="Name" type="text" id="Name" value="<?php echo((isset($_POST["Name"]))?$_POST["Name"]:"") ?>" size="32" />
This is the entire form code:
<form action="mommatalk_detail.php" method="post" name="commentsForm" id="commentsForm">
<p>
<label><strong>Name:</strong><br />
<input name="Name" type="text" id="Name" value="<?php echo((isset($_POST["Name"]))?$_POST["Name"]:"") ?>" size="32" />
</label>
</p>
<p>
<label><strong>Website URL:</strong><br />
<input name="URL" type="text" id="URL" value="<?php echo((isset($_POST["URL"]))?$_POST["URL"]:"") ?>" size="32" />
</label>
</p>
<label>
<strong>Comments:</strong><br />
<?php
// WebAssist iRite: Rich Text Editor for Dreamweaver
$WARichTextEditor_1 = CreateRichTextEditor ("Comments", "WA_iRite/", "225px", "150px", "Basic", "../custom/mommatalk_detail_Comments2.js", "".((isset($_POST["Comments"]))?$_POST["Comments"]:"") ."");
?>
</label>
<p><span id="spryStopSpam">
<label><strong>Help fight SPAM. Enter Mom into the box below:</strong><br />
<input name="botCheck" type="text" id="botCheck" />
<input name="botCheckAnswer" type="hidden" id="botCheckAnswer" value="Mom" />
</label>
<span class="textfieldRequiredMsg">Please enter 'Mom' in this field without the quotes</span></span>
<?php
if (ValidatedField('mommatalkdetail','mommatalkdetail')) {
if ((strpos((",".ValidatedField("mommatalkdetail","mommatalkdetail").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<span class="Required">Enter exactly as 'Mom' without the quotes.</span>
<?php //WAFV_Conditional mommatalk_detail.php mommatalkdetail(1:)
}
}
}?>
</p>
<input type="image" src="WA_DataAssist/images/Desert Spice/Traditional_insert.gif" name="Submit" id="Submit" value="Submit" />
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" />
<input name="idblog" type="hidden" id="idblog" value="<?php echo $row_rsBlogEntry['idblog']; ?>" />
</form>