Jump to content

$_POST


Gatsu

Recommended Posts

Hello forum!I am having problem with my website www.planet.zix.se/video/I am using this code:

<form action="upload_file.php" method="post"enctype="multipart/form-data">  <label for="file">Filename:</label>  <br />  <input type="file" name="file" id="file">  <br  />  <label for="world">World:</label>  <br />  <input type="world" name="world">  <br />  <input type="submit" name="submit" value="Submit" /></form>

and in the upload_file.php the $_POST["world"] worksbut little bit down on the index.php I use

if($file[0]!='.') echo 'Video: <a href="video.php?video='.urlencode($file).'">' . $file . ' </a>';	echo "World:" . $_POST["world"] . "<br />";

and it will show "World:" but not the value :)anybody know how I could fix this?

Link to comment
Share on other sites

Well, you can only use the $_POST array on the page that the data gets posted to. So, if you post the data to upload_file.php, you will not be able to access that POST data from any subsequent pages. You could pass in on in a querystring value, or use sessions. A bit more code would help us help you more specifically.P.S. there is no such thing as an input with type="world" - try input type="text" (but that shouldn't be causing a problem as the browser will default to type="text")

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...