Jump to content


Photo

Need Help Making Blog Posts Private


  • Please log in to reply
1 reply to this topic

#1 saadlive

saadlive
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 20 April 2006 - 03:22 PM

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?

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 20 April 2006 - 03:41 PM

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



follow me on twitter @PHPsycho




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users