In the last part of this tutorial PHP Message Board Part 2 I set up the database access file, some security stuff and a user registration page. In this part of my message board tutorial I finish off the user registration page.

In this tutorial I’ll show you how to do the following:

Using Regular Expressions to Secure your Website

How to Perform Form Validation

Implement a Captcha System

Issue MySQL Common Queries

Generate Random Numbers

How to Generate a Email Verification System

And, a bunch more! I bring up many topics in this tutorial and you may also need these tutorials:

9 Responses to “PHP Message Board Pt 3”

Hello,
I have got a question.
here we have used mysql_insert_id()
I’m now trying to program an upload script that when the image has been uploaded.
That he will redirect to a page an get a link for the image.
I will do it that when there are 2 peoples uploading a image at the same time and press the upload button.
Each uploader will get his image information.
I hope you can help me!
Thanks

I’m sorry I’m not certain what you want me to do. It is very hard to securely allow people to upload content to a website. If you did you would want to rename everything like you mentioned. Then you would allow them to access the file, but never tell them the true filename for the file. Does that help?

That’s not my question!
My question is The up loader(Person) uploads an image the image will be moved to the folder and the directory will be inserted to the database.
Can I use mysql_insert_id();
in the show file.
If yes will it help to give the right link for the up loader?
Example:
Derek Musti(are up loaders at the same time.)
That means the press the upload button at the same time.
Derek after the upload gets a link (localhost/up/image.php?id=1)
That show image number 1
Musti
Gets also a link (localhost/up/image.php?id=2)
Thats shows image number 2
I wanna prevent that Derek don’t get link (localhost/up/image.php?id=2)
And Musti gets link (localhost/up/image.php?id=1)
That means that each of them gets the wrong link.
To prevent that can I use mysql_insert_id();
or session.
Hope you can help me!
Thanks

I always base the file name on the date time and milliseconds. You can do what you are thinking, but there is a slim chance of duplication. Create file names in the same way encryption is handled and you won’t have any problems