Hi,
I have the below code to redirect a submit form to a new URL. The problem i cannot get around is that the files i am trying to redirect to end in .htm
Could any1 please help me to figure out how to amend this so that you put in the name of the file but it ends the url in .htm for you. the best i can do is get it ending in VAL01htm but not VAL01.htm.
Sad
<?php
if(isset($_POST['Submit'])){
$base = "http://localhost/AirBIZ%20Site/Data/";
$url = $base . $_POST['url'];
$file = @fopen($url,"r");
if($file){
header("Location: $url");
}
else{
$err = "$url URL does not exist";
}
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Track and Trace</title>
</head>
<body>
<?php
if(isset($err)){
echo $err;
}
?>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="text" name="url" />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
</body>
</html>
Thanks
Ruby
I have the below code to redirect a submit form to a new URL. The problem i cannot get around is that the files i am trying to redirect to end in .htm
Could any1 please help me to figure out how to amend this so that you put in the name of the file but it ends the url in .htm for you. the best i can do is get it ending in VAL01htm but not VAL01.htm.
Sad
<?php
if(isset($_POST['Submit'])){
$base = "http://localhost/AirBIZ%20Site/Data/";
$url = $base . $_POST['url'];
$file = @fopen($url,"r");
if($file){
header("Location: $url");
}
else{
$err = "$url URL does not exist";
}
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Track and Trace</title>
</head>
<body>
<?php
if(isset($err)){
echo $err;
}
?>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="text" name="url" />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
</body>
</html>
Thanks
Ruby