close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Redirect using ID from Database and fill in fields on error

Thread began 8/29/2009 11:22 am by Travis250923 | Last modified 9/03/2009 6:52 pm by Travis250923 | 2613 views | 3 replies |

Travis250923

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>

Sign in to reply to this post

Travis250923

So I got the redirect to work. I added a hidden field that populates from the database and used this:

$WAFV_Redirect = "mommatalk_detail.php?ID=".((isset($_POST["idblog"]))?$_POST["idblog"]:"") ."";

I also used a cookie to load most of the form on the redirect however I am having trouble with the comments field that is using iRite as it is not populating. I'll have to look more into that.

Sign in to reply to this post

Jason ByrnesWebAssist

Instead of binding the form elements value to the posted element, validation toolkit creates a Validated Entries Group for you to use.

In the Bindings panel, expand the validated entries, bind the initial value of each form element to the corresponding element in the validated entries group.

Sign in to reply to this post

Travis250923

That was it thanks.

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