Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['save'])){
- $image = $_FILES['img']['name'];
- $target_dir = "../blog/upload";
- $target_file = $target_dir . basename($_FILES["img"]["name"]);
- move_uploaded_file($_FILES['img']['tmp_name'],$target_file);
- //get rid of all database operation and connection
- }
- ?>
- <form action="add_posts.php" method="POST" enctype="multipart/form-data">
- <div class="form-group">
- <label for="img"><span class='name'>Select Image:</span></label>
- <input type="file" class="form-control" name="img" id="img"
- placeholder="Image">
- </div>
- localhost/sensive_blog/admin_panel/add_posts.php
- admin_panel
- ->otherScript.php
- ->somefolder
- ->add_post.php
- blog
- ->someotherscripts.php
- ->folder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement