Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.