Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 3 123 LastLast
Results 1 to 15 of 36
  1. #1
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts

    New project - Website Backend

    I am working on a project site for my mother. Where people can get plants, etc. identified. In order for the users to be able to interact with the site I am working on a "back end" where there is a

    1) login/register process. That allows the user to upload images for ID purposes. Allow the user to comment on photos (guest posting not an option to help prevent spam).

    Upon registering the script creates a /~user/username/ folder and contains the user_panel.php page.

    The sample login scripts I have looked at online are stated as not being secure. I am not including "personal info" like credit card numbers, etc. So security is not that big an issue, just need the info so it's privatised and not open to MySQL injections, etc.

    2) Image Uploads - The plan is to have the upload script on the user's page, so upon upload the photo(s) go into the respective /~user/username/images/ folder based on the login process.

    The sample upload script I found, is fairly easy to modify, but I need assistance on modifying it even more (i.e. file type limits, and placement of the photos, and renames the files to be lowercase on the server).

    The login script I am using as a base: http://www.dreamincode.net/forums/to...ript-with-php/

    And the upload script: http://www.htmlgoodies.com/beyond/ph...ding-Files.htm

    These features are the bare minimum. There are aspects that will get discussed later. Thanks

  • #2
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New project - Website Backend

    Quote Originally Posted by Ctechinfo View Post
    I am working on a project site for my mother. Where people can get plants, etc. identified. In order for the users to be able to interact with the site I am working on a "back end" where there is a

    1) login/register process. That allows the user to upload images for ID purposes. Allow the user to comment on photos (guest posting not an option to help prevent spam).

    Upon registering the script creates a /~user/username/ folder and contains the user_panel.php page.

    The sample login scripts I have looked at online are stated as not being secure. I am not including "personal info" like credit card numbers, etc. So security is not that big an issue, just need the info so it's privatised and not open to MySQL injections, etc.

    2) Image Uploads - The plan is to have the upload script on the user's page, so upon upload the photo(s) go into the respective /~user/username/images/ folder based on the login process.

    The sample upload script I found, is fairly easy to modify, but I need assistance on modifying it even more (i.e. file type limits, and placement of the photos, and renames the files to be lowercase on the server).

    The login script I am using as a base: http://www.dreamincode.net/forums/to...ript-with-php/

    And the upload script: http://www.htmlgoodies.com/beyond/ph...ding-Files.htm

    These features are the bare minimum. There are aspects that will get discussed later. Thanks
    Hi,

    We have gone through your project requirement.
    Pls PM me for detail discussion.

    thanks,
    tech-sters

  • #3
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    What is the question mate? So that we can help you.

  • #4
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Based on what I posted above, just looking to get pointed in the right direction..

  • #5
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    Use PDO and prepared statements to prevent SQL injections. But if you plan to use mysql, ensure data security by using the required functions to sanitize data.

    to rename files, that is trivial as you can assign names to the files during storage through the $_FILES. You just get the current files name and use strtolower.

    Just remember to never store passwords in plaintext and use salts - for security off course.

  • #6
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Redcoder View Post
    Use PDO and prepared statements to prevent SQL injections. But if you plan to use mysql, ensure data security by using the required functions to sanitize data.

    to rename files, that is trivial as you can assign names to the files during storage through the $_FILES. You just get the current files name and use strtolower.

    Just remember to never store passwords in plaintext and use salts - for security off course.
    Well I am still a reletive newb to databases. I know a bit more about PHP versus MySQL. The only MySQL stuff I have done really is from tutorials (copying scripts) or modifying existing db's (phpBB2 stuff).

    As far as PDO and prepared statements. Would need assistance modifying code to use..

    As far as MySQL, would also need assistance on tweaking the code.

    I did locate a sample register/login/logout script but cannot seem to get it to work. When I try "register" it reloads the same page, and does not enter anything into the database that I created.

    http://forum.codecall.net/topic/3637...#axzz2GLY0xe9A

  • #7
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    For the log-out script, you only need to clear sessions and cookies...that is if you use sessions or cookies to validate a user.

    You can then add stuff like time-stamp for the time he logs out so that that will be the last time the user was logged in.

    You cannot just copy paste different scripts into a system and expect them to work. Learn the fundamentals behind them and you can make your own systems independently and it will be easy for you to debug them.

  • #8
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Redcoder View Post
    For the log-out script, you only need to clear sessions and cookies...that is if you use sessions or cookies to validate a user.

    You can then add stuff like time-stamp for the time he logs out so that that will be the last time the user was logged in.

    You cannot just copy paste different scripts into a system and expect them to work. Learn the fundamentals behind them and you can make your own systems independently and it will be easy for you to debug them.
    Not to sound like a complete *** but my options are limited then?
    1.) don't do it at all.
    2.) find a script that works as is and hope nothing bad happens.
    3.) spend money to hire somebody to do the project.


    The only option that make sense to me is find a sample script and ask for advice on tweaking the code, as I can learn. Options 1 & 3 wont do me a bit of good since I wouldn't be doing anything with the code. And I could have simple posted a bunch of and asked for advice like I wrote and never mentioned the fact it was sample code..

    As far as learning the fundamentals. I have been doing that with php. MySQL on the other hand I never truely got the hang doing databases from scratch, thus I can't learn the fundamentals due to it all being greek to me..

  • #9
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    This is a project you are doing for your mum...I'm not sure whether it is supposed to be a learning experience for you or your mum just wants it.

    Making such code for such a project is easy. But using scripts from other places and customizing them - terrible Idea. SQL is easy, just take a day and leanr how to use PHP and MySQL. If you still decide to use scripts from others, you will hit a brickwall because you don't understand the code well, the code is not speciifc fo that problem.

    But off course ofr things such as Image Uploads, you can use other people's scripts as they are tried and tested in security and such but constructing the project from the ground up on borrowed code - bad idea.

    Whatever small knowledge you have, use that and start expanding on that. If you reach a module you have no idea how to make, ask here and we will give you ideas and guide you on what to do.

    Just my 2 cents worth.

  • #10
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,092
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by Ctechinfo View Post
    Not to sound like a complete *** but my options are limited then?
    1.) don't do it at all. Wrong
    2.) find a script that works as is and hope nothing bad happens. Won't really happen.. you'll never find anything that 100% suits you
    3.) spend money to hire somebody to do the project. Nope - YOU are doing this remember?
    4) Man-up and learn

    Quote Originally Posted by Ctechinfo View Post
    The only option that make sense to me is find a sample script and ask for advice on tweaking the code
    Or look at examples on google, go through them line by line until it starts to make sense and then have a go at writing something yourself.

    Quote Originally Posted by Ctechinfo View Post
    As far as learning the fundamentals. I have been doing that with php. MySQL on the other hand I never truely got the hang doing databases from scratch, thus I can't learn the fundamentals due to it all being greek to me..
    Rubbish! You've only not got the hang of them because you're too scared to try. To you it all looks complicated and you've no idea where to start. I'll tell you where to start - with the basics. PHP and mysql go hand in hand.

    Let me tell you something.. I first started programming in delphi which is a windows language. I avoided databases like the plague because they seemed boring, overly complicated and frankly I didn't think I needed them when I could just stash all my data and settings into an ini file and be done with it. This went on for years.. avoiding databases thinking they were some sort of black magic and that I didn't need them. Then I switched to PHP years ago and to put it frankly, I was forced to look into it purely because I needed somewhere to store data that was thread safe. In a web environment you could have hundreds of users accessing the same script and overwriting / reading data at the same time and you can't have it stored in a text file using your own basic code because it just won't hack it. I HAD to learn how to use a database. It was all greek to me too but I stuck with it and it started to make sense. Now I couldn't imagine life without one - you can do so many things, pull out data from different tables and join it together in just one query, cross reference things, update multiple tables in one query (and multiple records) etc. It's also thread safe (assuming you're using a database server which mysql is) and frankly, it takes a lot of hard work out of writing your own data storage code. All you do is tell it what it must do and it does it

    You may think you have a long hard haul ahead of you to learn all of that but the thing is.. you haven't really. It's actually pretty easy when you set your mind to it and it takes less time than you think. Ok, you're not going to learn it overnight but you can do it in a few months with ease. The key skill you MUST LEARN is to debug code and be able to follow other peoples code. When you can do that, you're half way there and just need to become better at writing the code yourself. Half of the time you can recycle code from one project to the next too!
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #11
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Redcoder View Post
    This is a project you are doing for your mum...I'm not sure whether it is supposed to be a learning experience for you or your mum just wants it.

    Making such code for such a project is easy. But using scripts from other places and customizing them - terrible Idea. SQL is easy, just take a day and leanr how to use PHP and MySQL. If you still decide to use scripts from others, you will hit a brickwall because you don't understand the code well, the code is not speciifc fo that problem.

    But off course ofr things such as Image Uploads, you can use other people's scripts as they are tried and tested in security and such but constructing the project from the ground up on borrowed code - bad idea.

    Whatever small knowledge you have, use that and start expanding on that. If you reach a module you have no idea how to make, ask here and we will give you ideas and guide you on what to do.

    Just my 2 cents worth.
    She started the project idea with a facebook page, somewhere along the line her husband purchased a domain and hosting package. Through the coarse of conversation I decided to build a sample site and build off it with input from her. All the coding books I have early generation stuff (early php5 and before). And those only offer the extreme basics.

    So while the entire project is indeed up in the air as far as what the final product will be.

    The general concept is to have the site somewhat interactive where people can submit pictures for ID purposes. So some sort of account base will be needed so the photos can be linked to a person so contact can be made. A commenting system that allows registered users the ability to post comments. but dissallows guest commenting (SPAM limiter).

    As far as the file upload script. the basic code function well. but the problem I encountered and was asking advice on. a couple of the sample photos I had on my PC. are .JPG extention. To make things uniform site wide I was looking for something make all the files lowercase, so SomeFileName.XXX becomes somefilename.xxx after upload. The best I was able to get was the success script showing lowercase but the file on the server was still .JPG. And the other part was since the upload script was going to be on the user page that required login, I was unsure how to set the upload folder based on the login.

    As far as registration, would like to get the proposed scipt to as the registration process is complete, the script creates a /~user/user_name/ folder which I know can be done via mkdir but haven't figured out an option do only create the folder upon successful registration.

    SQL is easy, just take a day and leanr how to use PHP and MySQL
    Any suggestions on where to start? since modifying scripts isn't recommended.

    Thanks

  • #12
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,092
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by Redcoder View Post
    SQL is easy, just take a day and leanr how to use PHP and MySQL.
    You make it sound oh so easy. The truth is it can take a few days or weeks to get the hang of php and mysql together. Please don't underestimate that because when new coders can't do it within that 'day' you quoted, it will put them off and they'll think they're useless at coding etc.

    It took me months to get the hang of it. Maybe I'm slower than others? Who knows and who really cares. The point is, not everyone can learn overnight. Even now, although I am decent enough to advise people around here, I'm still nowhere up to other peoples standards like FouLu and Inigoesdr. Mysql is also a bit harder to debug than php as you don't get line numbers to help you in your errors and most people don't have access to sql logs to see whats going on either. It can take time and head bashing to get the hang of it (I've sat at my desk for days sometimes trying to solve a particular problem before I've sussed it out but it makes you a better coder)
    Last edited by tangoforce; 12-28-2012 at 04:14 PM.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #13
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,092
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by Ctechinfo View Post
    Any suggestions on where to start? since modifying scripts isn't recommended.
    tizag.com is one of the best for mysql and PHP together

    PHPs manual rocks if you need to lookup functions, mysqls manual can be a bit more complex and harder to understand so again tizag often makes it easier.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #14
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    332
    Thanks
    2
    Thanked 47 Times in 46 Posts
    I was kidding offcourse when I said it'd take you a day. Personally, it did take me a day or two but I don't know how long it will take you.

    TangForce just told you what you should do - Follow that advice. Grow some balls.

    Use php.net (the best) and W3schools.

    You might also consider investing in a book or ebook. If you don't mind pirating, there are lots of torrents of programming books for PHP and mySQL. Go with those for O'Reilly - They are easy to follow and don't just jump into something new like a lot of other written by people who forget in the heat of writing that they are writing to noobs.
    Last edited by Redcoder; 12-28-2012 at 04:45 PM.

  • #15
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,092
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by Redcoder View Post
    It took me personally a day or two
    You mastered mysql in that short time? - including joins, multiple updates, etc?

    Quote Originally Posted by Redcoder View Post
    I don't recommend W3 to be honest. Some of their tutorials are utter crap, badly worded (and thus confusing) and I still don't understand why they are so highly rated along with their imaginary qualifications

    Tizag explains things much better if you ask me. Google is also rock solid for finding snippets of code and when you need to lookup what a function does, the parameters it uses etc, the php manual (and user comments for each function) is excellent (although it seems daunting at first).
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  
    Page 1 of 3 123 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •