How to pass a variable from php to a modal?

How to pass a file name from one page to another using php in linux?

  • hi! I m working in linux platform and using php .I want to pass the absolute file path browsed by the client from one page to another using php.I tried with the codes given below but i am not able to do so? the codes are: s.php: <?php session_start(); ?> <html> <body> <form name="fupload" enctype="multipart/form-data" action="s2.php" method="post"> <input type="file" name="picture" /> <input type="submit" value="Submit" /> </form> </body> </html> s2.php: <?php $nn =$_FILES['picture']; echo $nn; ?> o/p : Array. Now how can i display the full path name of the file entered by the client in the previous page in this page..plz help me to get rid f this problem..

  • Answer:

    * picture - 'picture' is the reference we assigned in our HTML form. We will need this to tell the $_FILES array which file we want to play around with. * $_FILES['picture']['name'] - name contains the original path of the user uploaded file. * $_FILES['picture']['tmp_name'] - tmp_name contains the path to the temporary file that resides on the server. The file should exist on the server in a temporary directory with a temporary name. So, try using $_FILES['picture']['name'] or $_FILES['picture']['tmp_name']

sweta agarwal at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.