Jump to content

Redirct URL ending .htm


rubywolff

Recommended Posts

Hi,

I am trying 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, i put in the file name click submit but it cannot fidn the page. if i put in filename.htm it redirects me to the page.

 

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 with .htm for me. the best i can do is get it ending in VAL01htm but not VAL01.htm.

 

 

???

 

<?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

Link to comment
https://forums.phpfreaks.com/topic/82465-redirct-url-ending-htm/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.