Request for tutorial

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nobleman
Forum Newbie
Posts: 1
Joined: Mon Sep 01, 2014 8:51 pm

Request for tutorial

Post by nobleman »

can some one write for me a additional function for my website.
i need a function where limited user to create only one post with their account, if the post id detected in db the submit post button will be disable or hidden.

Button code:
<a href="javascript:document.schedulepost.submit();" title="" class="btn rt"><span class="ico publish">Publish post</span></a>

If you have any other better method please show me here. thank you..
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Request for tutorial

Post by Celauran »

Javascript can easily be disabled in the browser. You'd do better to check for this sort of thing server side. Simply query the DB for a post authored by the user in question and, if you get any results, don't allow further submissions. You can redirect away from the form page, not draw the form, discard the form submission, or all of the above.
Post Reply