Jump to content

Archived

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

saadlive

Need Help Making Blog Posts Private

Recommended Posts

Hi there,

I made a simple blog and I made a public button. I need to make it so that if the button is not checked then it wont show that post.

What info do you need from me?

Share this post


Link to post
Share on other sites
Non!

in your script that processes the entry of the blog you simply need to check the value of the public button - it sounds like you are using a check box.

If so you only need to check if the variable has been set (checkboxes and radio buttons if not selected do not post that variable to teh accepting script!)

input type=checkbox name=chk id=chk


if (isset($_POST['chk])) {

...

}

Now all you need do then is if it is set add a value to the field (assumed `display` in the following query) in you database that can be compaired to see if it should be displayed or not.

Once that is complete then your query would in clude...

SELECT * FROM blogtable WHERE `display` = 1


Share this post


Link to post
Share on other sites

×

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.