mecano Posted December 29, 2009 Share Posted December 29, 2009 here is my problem , i have "upload file link" , when some body hits it i want a new page to be opened to ask him for the uploaded file , all of this is ok , but when i try to take the number of which link does he clicked on he cannot get it . example : i have upload to folder 1 upload to folder 2 upload to folder 3 so i want to get which one on these did he clicked on ,, i used ......php?selectedfolder=theclicked one but the problem is am not using this variable when i click on the link , am using it after words when i click upload .. so its a home page with links ----> then upload page -----> user press upload "where i need the variable from the first page " so its not working an spending more than 20 hours in it ,,,,, i dont want code , i only want the idea why this is not working Quote Link to comment Share on other sites More sharing options...
Buddski Posted December 29, 2009 Share Posted December 29, 2009 Let me get this right. A user clicks on one of the folders and it creates a popup for them to upload something? Can we see the main parts of the homepage and the upload page.. Quote Link to comment Share on other sites More sharing options...
mecano Posted December 29, 2009 Author Share Posted December 29, 2009 thanks in advance for your help of course here is the important parts of the code as not to waste your time : here is the main page : echo '<a href="publish_file.php?tselectedyear=' . $yrs[$temp1] .' "> add files </a>'; and here is the publish_file.php page <form action="publish_file.php" method="post" enctype="multipart/form-data"> <p><b>File Title:</b> <input type="text" name="file_title" size="70" maxlength="70" value="<?php if (isset($trimmed['file_title'])) echo $trimmed['file_title']; ?>" /></p> <input type="hidden" name="MAX_FILE_SIZE" value="5000000" /> <p><input name="uploadedfile" type="file" /> <div align="center"><input type="submit" name="submit" value="Upload" /></div> <input type="hidden" name="submitted" value="TRUE" /> </form> and here is the php part : $tselectedyear=$_GET['tselectedyear']; here it tells me the error "Undefined index: tselectedyear " ---------------------------------------------------------------------------------------- i really spent very long time in it , so it will be a miracle for me to get it solved , i made many pages like this before , but we where using the ?url part in the next step , not in the step after the next , i hope you understand me . Quote Link to comment Share on other sites More sharing options...
Buddski Posted December 29, 2009 Share Posted December 29, 2009 Do you get the error when the page loads up the first time or AFTER the user has submitted a file? Quote Link to comment Share on other sites More sharing options...
mecano Posted December 29, 2009 Author Share Posted December 29, 2009 when the user submits a file .. Quote Link to comment Share on other sites More sharing options...
Buddski Posted December 29, 2009 Share Posted December 29, 2009 <form action="publish_file.php?tselectedyear=<?php echo $_GET['tselectedyear']; ?>" method="post" enctype="multipart/form-data"> Quote Link to comment Share on other sites More sharing options...
mecano Posted December 29, 2009 Author Share Posted December 29, 2009 its solved , i ve tried this idea but it didnt work with me ,,, but when i copy pasted what you wrote it worked ,,, am so happy to the point that i want to give you my credit card number ,,, really if you r havin a site or somthing i will 100 % buy your products now ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.