If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

problem in uploading image

Good Day,

There's a sticky that TUT about uploading image but i want the restrictions to be in this manner. But my problem here is no notice, no errors but the image file won't upload eventhough the other data has been updated, Here, check my codes. this quite long to be detailed.

Although I'm not sure if the above code is going to solve your problems it's less prone to errors. Also note that I haven't tested the code so I'm not sure if there's any syntax error or something like that...

BTW - another thing to warn you of is the way you're writing your data to a database. You're not using the mysqli function nor the PDO object. Your're also not applying any filter function, regex... to the user-input data prior to writing it to a database. YOU SHOULDN'T DO THAT!!!

thank you for that complete advise tech_soul8, i have started this project on mysql as my thesis and my professor just allow me for the sake of the subject but im planning to covert this to mysqli after i have solve this uploading image problem.
I am just starting to learn php language and not fully understood the regex maybe i must get focus that later after i solve this case so i can focus one thing at a time.

i am glad for that you edited my codes and this is my current focus now. I just want to clarify something about the modification of codes.
1. If ill be replacing my codes with your suggested codes do i still need to include codes below in it like the QUERY UPDATED and the rest below?

solved notices and warnings

Hello tech soul,

i've got brand new codes now and it solves now the 3 errors. i am so delightful and inspired by your last step by step tutorial in helping me undisplaying those errors. I have also modified some codes in HTML page.
No notices, no warnings, no errors all other data are updating, the only fault is the image won't upload.

notice anything? You're trying to move your uploaded file to a destination folder images/student_id but there's no actual file to move.... you're only specifying the folder path, without the actual file name. That should raise a warning message!

The logic you're using is also a good candidate for a discussion. First you're trying to upload your file to a server and then you're checking if the destination folder exists etc... It should be done conversely. The actual action of moving a file to a destination folder should be performed at the end, after all the checking have been made (file type, size, destination folder exists...).

TIP - If you're referencing a variable just once there's no need to create another variable that will hold its value. It bloats your code.

profle photo problem

Hello tech soul,

i realize this is a profile photo adding problem. I choose to remodify my codes for clean and better understanding. Let me give sometime to recode it and i hope you will still be there to guide when i repost it.