Hi Ray
It works fine with the form field; it's the code supplied as a Dreamweaver snippet.
UPDATE - I've got it working!
Many, many thanks
Cheers
Chris
------------------------
<?php
function create_slug($string, $charset = 'utf-8'){
$string = htmlentities($string, ENT_NOQUOTES, $charset, false); // convert accented characters to entities
// strip unwanted parts of entities to leave unaccented character
$string = preg_replace('~&([A-za-z])(?:acute|cedil|caron|circ|grave|orn|ring|slash|th|tilde|uml);~', '\1', $string);
$string = preg_replace('~&([A-za-z]{2})(?:lig);~', '\1', $string);
$string = preg_replace('~&[^;]+;~', '', $string); // remove other entities
return preg_replace('~[\s!*\'();£:@&=+$,/?%#[\]]+~', '-', $string); // replace spaces and illegal characters with hyphens
}
$newSlug = create_slug("".$rsPg->getColumnVal("pg_slug")."")."";
?>
<?php
if ("" === "") {
$UpdateQuery = new WA_MySQLi_Query($connEGM_i);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "page_content";
$UpdateQuery->bindColumn("pg_url", "s", "".($newSlug) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("pg_sortorder", "i", "", "WA_DEFAULT");
$UpdateQuery->addFilter("pg_id", "=", "i", "".($_GET['pg_id']) ."");
$UpdateQuery->execute();
$UpdateGoTo = "3-pages-main-pic.php?pg_id=".$rsPg->getColumnVal("pg_id")."";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>