Jump to content

[SOLVED] url- go to webpage


MDanz

Recommended Posts

i know i did this wrong... it says header already sent..

 

<body><form enctype='multipart/form-data' action='link.php' method='post' name='changer'>
<label>URL
<input type="text" name="url" />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>

</form>

<?php header("Location: " . $_POST['url']);?>
</body>

You can't output any html before calling header.

 

<?php
  if (isset($_POST['url'])) {
    header("Location: " . $_POST['url']);
  }
?>
<body><form action='' method='post' name='changer'>
<label>URL
<input type="text" name="url" />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
</body>

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.