darph Posted August 23, 2005 Share Posted August 23, 2005 Hii got a problem to get some variable from a formi set the variable with<input type=\"hidden\" name=\"maxt1\" size=\"40\"><input type=\"hidden\" name=\"maxt2\" size=\"40\"><input type=\"hidden\" name=\"maxt3\" size=\"40\">and send them with post to the next file.action="xml.php?id=3"in the new file i will echo all files but don´t know the way i tried thisfor $i = 0; $i <=$_GET['id']; $i++){echo $_POST['maxt$i'];}but the varialbes are empty ?whats the misstake i made ?thxdarph Link to comment Share on other sites More sharing options...
mad_raven Posted August 23, 2005 Share Posted August 23, 2005 Hi DarphThe problem as i see it lies with the following bit of code.<input type=\"hidden\" name=\"maxt1\" size=\"40\"><input type=\"hidden\" name=\"maxt2\" size=\"40\"><input type=\"hidden\" name=\"maxt3\" size=\"40\">although you have set the variables you haven't actually given them a value so you should change the above to something like below.<input type=\"hidden\" name=\"maxt1\" size=\"40\" value=\"1\"><input type=\"hidden\" name=\"maxt2\" size=\"40\" value=\"2\"><input type=\"hidden\" name=\"maxt3\" size=\"40\" value=\"3\">By adding the value attribute to the input tag you are giving the variables a value so when you echo the variables using the code in the other file you will get the following.123Hope that helps Link to comment Share on other sites More sharing options...
darph Posted August 23, 2005 Author Share Posted August 23, 2005 thx for helpi got the misstake i have used['var']but i have to use ["var"]so longdarph Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now