• (3 Pages)
  • +
  • 1
  • 2
  • 3

Uploading Images with PHP Build the next Flickr! (DICr???) Rate Topic: ***** 7 Votes

#31 azizmuda  Icon User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 33
  • Joined: 14-February 11

Posted 17 March 2011 - 08:22 PM

hai..i try to but why the data not insert into my database??
Was This Post Helpful? 0
  • +
  • -

#32 Kkarinisme  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 07-February 09

Posted 21 March 2011 - 04:02 AM

In a class I took on PHP, we were taught to create a blob record for the image in our database and then use that to create a thumbprint. I see that your method would significantly reduce database size and probably time to open a webpage.

But, I wonder if you could list pros and cons for the two ways to handle images. I am right now creating a webpage using images in a storefront and think I should change my method and use yours but am wondering why I was taught the other method and if there are downsides to your method.
Was This Post Helpful? 0
  • +
  • -

#33 jagadish_c  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 31
  • Joined: 10-January 11

Posted 29 March 2011 - 10:12 PM

Hi all. This tutorial have been useful for newbies like me. Now it has been easy to upload and fetch the images from database while executing on localhost. But I am having the problem with uploading the image when I am executing program on server. can anybody help me with this?
Was This Post Helpful? 0
  • +
  • -

#34 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Posted 27 September 2011 - 02:07 AM

$image = $_FILES['image'];

$image['name'] = mysql_real_escape_string($image['name']);

problem is, it is clear we can pass data to image varibale but how do we passe $image['name'] to mysql_real_escape_string instead of $image variable.

can anybody explain this?

thx
Was This Post Helpful? 0
  • +
  • -

#35 javafreak  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 97
  • Joined: 21-September 09

Posted 27 September 2011 - 02:55 AM

please show me tutorial to upload on server lol
Was This Post Helpful? -2
  • +
  • -

#36 yusf22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 28-September 11

Posted 28 September 2011 - 06:53 PM

Really easy one for beginner like me, thank you!
Was This Post Helpful? 0
  • +
  • -

#37 EnvXOwner  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 357
  • View blog
  • Posts: 2,319
  • Joined: 10-August 09

Posted 11 December 2011 - 10:49 AM

Lovely tutorial. I may use the concepts that you provide with Codeigniter :P
Was This Post Helpful? 0
  • +
  • -

#38 marowincyin  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-September 12

Posted 06 September 2012 - 02:21 AM

I must congratulate you, this tutorial is most useful! Great job!
I have 2 questions though:

1.) When my users upload images, they come on the bottom of the website. What do I need to do for new images to come on top of the previously published images?

2.) I know this is probably foolish question (new to websites'n'codes) but how can I put a restrict on uploaded images, lets say that their width must be less than 600 and height less than 500 for them to be uploaded? Can you write the code for this? I would be most grateful.
Was This Post Helpful? 0
  • +
  • -

#39 ersaan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 31-May 12

Posted 08 September 2012 - 05:38 AM

Can u make a tutorial that it with PHP and MSSQL (not MySQL) ... cuz there is a lot of function different between MSSQL - MySQL .....
Was This Post Helpful? -1
  • +
  • -

#40 mynowrose  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-November 12

Posted 02 November 2012 - 05:48 AM

Nice ur my best developer

How to create with thumbnail image in this scrip

for exp:
large images in path /images
thumbnail images in path /image_th

image width 100px and height 150px

please i don't PHP
Was This Post Helpful? 0
  • +
  • -

#41 mrzell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-July 13

Posted 15 July 2013 - 12:14 AM

Hi..how to display only current image after upload?
Was This Post Helpful? 0
  • +
  • -

#42 mrzell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-July 13

Posted 15 July 2013 - 12:26 AM

Sorry I have test the script but it shows list of all images that are stored recently.
How can I make the display page only shows only current or latest image i have upload?

Please help...Thanks
Was This Post Helpful? 0
  • +
  • -

#43 kreatiff  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-May 14

Posted 12 May 2014 - 06:43 AM

mod: removed quote of entire tutorial.

Getting response around sessions from index.php

Warning: session_start() [function.session-start]: open(c:\php\sessiondata(session name), O_RDWR) failed: No such file or directory (2) in (filepath) on line 3



First Name
Last Name
Upload Image


Warning: Unknown: open(c:\php\sessiondata\(session name), O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:\php\sessiondata) in Unknown on line 0
PHP Warning: session_start() [function.session-start]: open(c:\php\sessiondata\(session name), O_RDWR) failed: No such file or directory (2) in \\(filepath) \index.php on line 3 PHP Warning: Unknown: open(c:\php\sessiondata\(session name), O_RDWR) failed: No such file or directory (2) in Unknown on line 0 PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:\php\sessiondata) in Unknown on line 0

This post has been edited by modi123_1: 12 May 2014 - 06:45 AM
Reason for edit:: please do not quote the entire tutorial

Was This Post Helpful? 0
  • +
  • -

#44 kcenny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-June 14

Posted 25 June 2014 - 11:27 PM

Hi Everyone,

Firstly, this is a brilliant tutorial! Thank you very much as I have been trying to find out how to upload images like this for a while.

I only have one problem at the moment:

I am attempting to let various users log onto my site and post something similar to a blog entry and then read everyone else's posts. I have used the code from this tutorial to give me the upload functionality and it works just fine. The only thing is that because the "images.php" will be using php to take each row in my db and put it onto the page, every post has the same images that get uploaded. And they repeat.

Is there any way to make it see what post is being posted and link the image that the user uploaded then only upload those?

And how do i upload multiple images at once?

I am very new to php and most of my stuff is using tutorials but I have been searching for weeks and weeks about how to do this?

Please help.
Was This Post Helpful? 0
  • +
  • -

#45 kcenny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-June 14

Posted 27 June 2014 - 03:48 AM

Is there something like this for videos as well?

I have a website that im trying to build, i want to allow the user to log on and upload multiple videos and or images...

your code has helped me drastically with the images part however, as i said before, i need to upload multiple at one time and an option for video or images.

Please help, thanks in advance
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3