473,325 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

how to save image in dynamically created folder using session?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. if(isset($_SESSION['username']))
  4. {
  5. echo" welcome ".$_SESSION['username']." to your profile";
  6. $file=$_SESSION['username'];
  7.  
  8. }
  9. elseif(isset ($_SESSION['id']))
  10. {
  11.  echo" welcome ".$_SESSION['id']." to your profile";   
  12.  $file=$_SESSION['id'];
  13. }
  14. echo $name=$_FILES['file']['name'];
  15. /*size=$_FILES['file']['size'];
  16. $type=$_FILES['file']['type'];*/
  17. $tmp_name=$_FILES['file']['tmp_name'];
  18.  
  19. if(isset($name))
  20. {
  21.     if(!empty($name))
  22.     { 
  23.         $path='userdata/'.$file;
  24.        $location= mkdir($path); 
  25.        if(move_uploaded_file($tmp_name,$location.$name))
  26.        {
  27.            echo"uploaded";
  28.        }
  29.        else
  30.        {
  31.            echo"there was an error";
  32.        }
  33.     }
  34.  
  35.    else
  36.     {
  37.  
  38.     echo "please choose file";
  39.     }
  40. }
  41. ?> <form action="http://bytes.com/register/" method="POST" enctype="multipart/form-data"> <br> <br> <input type="file" name="file" value="" /><br><br> <input type="submit" value="submit" /> </form>
Mar 5 '14 #1
0 1133

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
by: GP | last post by:
I have created a datagrid that is creating columns dynamically at runtime using the template columns.Edit ,add & delete works fine. The only problem I face is with sorting,I am setting the sorting...
0
by: Julia | last post by:
Hi, I have a search control which render drop down list box controls according to XML file all control have EnableViewState=False I would like to use the Application dictionary in order to...
3
by: Tim | last post by:
Hello All, Hope someone can point me in the right direction here. I have a ASPX page that is being created dynamically. My function adds Labels and Text Boxes to a Table ready for the user to...
4
by: Hrvoje Vrbanc | last post by:
I would like to know the most efficient way to copy an image from an Internet URL to the local hard disk by means of using an ASP.NET page. So, I would like to click the button on the ASP.NET...
0
by: kalyanij | last post by:
hi, I have created a barchart as a gif image in a web application it works fine but when trying to save it by passing file path in objBitmap.save("C:\Inetpub\wwwroot\graph.gif",...
1
by: Dica | last post by:
i've got a script that loops through a dataset and creates dynamic web controls and event handlers: while (oDr.Read()){ RadioButton oRb = new RadioButton(); oRb.ID = oDr.ToString();...
4
by: pooja8389 | last post by:
Good evening.. how can i save the value of dynamically created textbox in data base using System; using System.Data; using System.Configuration; using System.Collections; using...
12
by: pooja8389 | last post by:
good evening... how can store the text value of dynamically created textbox in database. using System; using System.Data; using System.Configuration; using System.Collections; ...
2
by: Maya16 | last post by:
I am stuck with a Event Procedure Issue. I have created one Dynamic report in MS access using VBA. For the same I have created some dynamic controls like lables, Textbox, buttons, etc. I am able to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.