File upload, check, make private!

Status
Not open for further replies.

Gibbo

Active Member
Jun 4, 2010
163
27
Hello, well im doing version 2 of imagelocks and i need help so when someone uploads a file and checks private, it makes the image private so no one can see it on the front page, but still access from there link.

Thanks guys, hope you can help :).
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,934
3,933
What exactly do you need help with?

You'd just add a colum in your SQL table called private, and if it's set to one, skip that file on the front page.
 

RyanMK

Still alive
May 27, 2010
802
117
PHP:
<?php
$connection = mysql_connect('localhost', 'root', 'password') or die ("<p class='error'>Sorry, we were unable to connect to the database server.</p>");
$database = "database";
mysql_select_db($database, $connection) or die ("<p class='error'>Sorry, we were unable to connect to the database.</p>");
?><html>
<form method="post">
<input type='checkbox' value="1" name='privacy' />Private?
<input type="submit" name="save" class="form" value="Submit" />
</form>
</html>
<?php
$private = isset($_POST['privacy']) ? 1 : 0;
$query="INSERT INTO `table` (`private`) VALUES ('".$private."');";
mysql_query($query);
?>
Then in the database make the column ENUM '1','0'
 
Status
Not open for further replies.

Users who are viewing this thread

Top