Just to let everyone know, I have solved this, please find the 3 files I use:
1. the values page is a comma seperated pair file.
2. the process page
<?php
// Get a file into an array. In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file('values.inc');
// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {
$pair = split (',' , $line);
if ($pair[0] == $_GET['id'])
Header("Location: " . $pair[1]);
}
the 3rd file, which does the work (and can be tweaked more)
<html>
<body>
<?php
$short = $_POST['shortname'];
$redirect = $_POST['redirect'];
?>
<form action="editlink.php" method="post">
<p>short name <input type="text" name="shortname" /><br />
re-direct to: COMPLETE ADDRESS PLEASE.<input type="text" name="redirect" /></p>
For example:<br>
short = help_en<br>
re-direct = http://www.site.com/Help/en <br>
The example gives you the option to use: http://www.site.com/pid.php?id=[sHORTVALUE]<br>
and it will redirect you the the long url.<br>
<p><input type="submit" value="Send it!"></p>
</form>
<?php
$lines = file('values.inc');
$newval = true;
echo "<P><B>You can send the first URL to the customer</B> <BR>";
foreach ($lines as $line_num => $line) {
$pair = split (',' , $line);
echo "http://www.site.com/pid.php?id=" . $pair[0] . "\t --> <a href='" . $pair[1] ."'>" . $pair[1] . "
</a><BR>";
if ($pair[0] == $short)
$newval = false;
}
if ( !empty($short) && $newval ) {
$MyFile = fopen('values.inc', 'a+');
fwrite($MyFile, $short . "," . $redirect . "\n");
fclose($MyFile);
$newval = false;
}
?>
</body>
</html>
Cheers, and thanks