Hi I have a very complex php directory submission form I have just included a sample of it here it is very long, what i want to do is on submitting a website the user is taken to another webpage rather than as it is a script displays " your website has been submitted" and the user stays on that original submission page, help appreciated. Let me know if more of the code is required. <form action="{'/webmaster/saveNewWebsite'|url}" method="post" id="itemForm"> <input type="hidden" name="siteType" value="{$siteType}"/> Code (markup): toward the end of the form this is how it is configured <div class="form"> <label class="title">{'webmasterSubmitWebsite_backlink_url'|lang}</label> <div class="infos"><input type="text" class="input_text_large" name="returnBond" value="" /></div> </div> {if $setting.backLinkHtmlCode1Enabled} <div class="form"> <label class="title">{'webmasterSubmitWebsite_backlink_html1'|lang}</label> <div class="infos"><textarea class="textarea_return" name="backLinkCode1" cols="50" rows="5"><a href="{if $setting.backLinkHtmlCode1Url}{$setting.backLinkHtmlCode1Url|htmlspecialchars}{else}{$setting.siteRootUrl|htmlspecialchars}{/if}">{if $setting.backLinkHtmlCode1Text}{$setting.backLinkHtmlCode1Text|htmlspecialchars}{else}{$setting.siteTitle|htmlspecialchars}{/if}</a></textarea><img src="{"/templates/$templateName/images/icone_info.gif"|resurl}" alt="" class="aide_description" title="{'webmasterSubmitWebsite_backlink_html_tooltip'|lang}"></div> </div> {/if} {if $setting.backLinkHtmlCode2Enabled} <div class="form"> <label class="title">{'webmasterSubmitWebsite_backlink_html2'|lang}</label> <div class="infos"><textarea class="textarea_return" name="backLinkCode2" cols="50" rows="5"></textarea><img src="{"/templates/$templateName/images/icone_info.gif"|resurl}" alt="" class="aide_description" title="{'webmasterSubmitWebsite_backlink_html_tooltip'|lang}"></div> </div> {/if} </fieldset> <div class="title_h"> <h2>{'webmasterSubmitWebsite_step'|lang} {counter}/{$totalSteps} {'webmasterSubmitWebsite_submit_website'|lang}</h2> </div> <fieldset class="column_in"> {if $setting.newsletterEnabled} <div class="form"> <label class="title">{'webmasterSubmitWebsite_subscribe_newsletter'|lang}</label> <div class="infos"><input type="checkbox" name="newsletterActive" value="1"></div> </div> {/if} {if $setting.captchaEnabledOnSiteInscription && (empty($session.role) || $session.role != "webmaster")} <div class="form"> <label class="title">{'webmasterSubmitWebsite_security_code'|lang} <span class="text_color_mandatory">*</span></label> <div class="infos captchaCode"></div> </div> {/if} <div class="form"> <label class="title"> </label> <div class="infos_terms">{'webmasterSubmitWebsite_terms_use_desc'|lang} <a href="{'/info/useCondition'|url}" class="link_small_underline" target="_blank">{'webmasterSubmitWebsite_read_terms'|lang}</a></div> </div> <div class="form"> <label class="title"> </label> <div class="infos"><div id="siteLoader" style="display:none;"> {'webmasterSubmitWebsite_checking'|lang} <img src="{"/templates/$templateName/images/loader.gif"|resurl}"></div> <input type="submit" class="button" value="{'webmasterSubmitWebsite_button_submit'|lang}" /></div> </div> </fieldset> </div> </form> {include file="includes/footer.tpl"} Code (markup): the end of form this is how it is configured
That would be in this url: /webmaster/saveNewWebsite You didn't supply that code, so can't say where exactly ...
sleuth1, An example would be to post the form to itself and do error checking on the fields you want required or other formats. After that then redirect to the final page. Example below... //---- page.php <?php $error = false; if($_POST){ if(!empty($_POST['name'])){ header("Location: thanks_page.php"); exit; }else{ $error = true; } } ?> <form action="page.php" method="post"> Name: <input type="text" name="name" id="name" value=""> <?php if($error){ print 'Name is required.'; } ?> <input type="submit" name="send" id="send" value="Send Name"> </form> //----- thanks_page.php Thank you for your submission Let me know if you have any questions.
PHP header only works if you did not generate page output, yet. If you need to redirect after some output, use javascript: <script>document.location = "new url here"</script>