Jump to content

Can't Login, help updating old code.


Lucuis

Recommended Posts

Ok so basically i followed a tutorial to build an e-commerce website.  Part way through i started getting errors, and stuff wasn't working right.  I then realized the tutorial i had been following was 8 years old.  I was told that some of the code i was using was depretiated, and might not work right.

 

The tutorial gave me a lot of code without a ton of info on how it works.  That is my dilemma.  I have a lot of the site structure done, but i don't know a whole lot of why it does certain things.  The code was mostly 'copy pasted,' so i don't really know why one bit of code does this, or doesn't do that.

 

What i'm asking is if someone can walk me through the old code and help me update it.  Also to help me fix any problems along the way.

 

My main problem with it at present is i cannot log in using my admin account.  I'm certain i set it up right in mysql.  Also i can't make a new account, it give my an alert " The URL is not valid and cannot be loaded."  I'm guessing that's mostly due to the older code, and the rest my ignorance.  I also try inputting incorrect login info, and nothing happens.  The screen refreshes which clears what i type, the same as when i try to login legit.

 

I'm attaching the the website file to this post.  A lot of the code is spread out into folders, etc.  So instead of putting every page of code into this post i figured it'd be easier to just upload the whole file.

 

I'm really in over my head at this point, so i would appreciate every bit of help.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/128077-cant-login-help-updating-old-code/
Share on other sites

personal opinion, scrap it and start over. if you dont know how your code works you cant upgrade it, add new features, fix security problems etc..

i was using php4 for a project and then my hosting company upgraded my hosting plan to php5 as part of an automatic thing i couldnt stop.

anyways i will still look at the files

yer i definitely recommend starting again.. 8 years is a very long time i computer talk. Also if you google hard im sure you will find similar tutorials that will explain what each piece of code is doing as you create your site. There are hundreds of tutorials for log in scripts and there pretty simple.

 

If you get stuck anywhere along the way or have some code you don't understand then post here and i am sure some one will explain it to you if its just one function or a section of code. Don't post a thousand lines though  lol...

If it's 8 years old I presume it'd be using PHP3 or 4 which isn't good. Although PHP4 scripts will most probably run on PHP5 its best to create your applications from a PHP5 environment. Some tutorials, I agree are so not helpful they are practically there for copy/paste work, but learning PHP is really easy. Having small scripts and learning and modifying them is a good option but learning the fundamentals is really essential. I recommend searching Google for 'Basics on PHP' before proceeding looking at PHP applications. When you're ready to look at small apps, search some from Hotscripts.com.

An application tutorial is not intended to teach you how to program or how to read code. The purpose of an application tutorial is to show or teach how to create an application. It assumes that you already know the basics of the programming language and that you can read each line of code and understand (or be able to look up in the programming language reference manual) what it does. If that is not the case, you need to get a basic php book from your local book store and study it first. Also become familiar with the php programming language reference manual (its' free from php.net.)

 

A programming help forum is only able to help with specific problems and one at a time. If you are getting an error, you need to post the error and the relevant code where that error is occurring. If a piece of code is not functioning the way that is intended, than you must attempt to troubleshoot what it is doing yourself first. If you just post all the code in one file (and even worse, if you just post your entire application) and state it does not work, you will not get a lot of people taking on the task of finding where in 12 different files the current problem is occurring at and to find out why it is not working. You must at least pin down at what point and in which file the code is not doing what it is supposed to. If you are not able to do this, that is where getting up to speed with the basics of the programming language comes in to play.

 

You would not pick up a parachute and attempt to put it on and use it without first learning what each piece on it does and where each piece belongs. Programming is the same, you cannot effectively write code or make use of code that someone else wrote without first learning what each piece of it does or where each piece belongs.

...if you dont know how your code works you cant upgrade it, add new features, fix security problems etc..

 

I like that, even through you did not write each line of it yourself, as soon as you opened it or copy/pasted it in your programming editor, it becomes your code.

Thanks everyone for your input, it looks like i'm starting over.

 

Quick question.  I followed the same tutorial for setting up the mysql database.  Is that going to have to be redone as well?  So far i haven't had any problem with it, and the queries i've sent have all done what they're supposed to old or new.

 

Thanks again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.