[thelist] PHP Jump to Anchor Tags?

Jeremy Ashcraft ashcraft at 13monkeys.com
Fri Oct 12 10:26:33 CDT 2001


Hey ron,

in your validation script, do the validation before you output any html.  If 
something doesn't validate, then redirect back to the form and the anchor 
server side.  here's some quick code:

<?php

#assume data is valid
$valid = 1;

#validate the form, if there is an error, set $valid = 0
#php code to validate form goes here

#if not valid, jump to anchor in form page
if(!$valid) {

	header("Location: formpage.php#anchor\n\n");
	exit(0);

}

?>

HTH, let me know if you have any questions

jeremy

On Thursday 11 October 2001 11:05, you wrote:
> I am learning php and need a little help.  I am using embedded php in
> html, field validation script, I want it to jump to an anchor tag within
> the body of the page if there are errors.  This seems simple but I have
> not been able to get to work or find info about it.
>
> Any help would be greatly appreciated.
>
> Ron D.
>
>
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list