Guest user has readonly access to all pages. Is that what you asking?
Hi, Sergy,
I solved everything with phprunner and mySQL
I set up a database for a friend, he can log into database and add/edit file by himself. What I need is, a public display html page on the site, where other people can view downloaded image/text files after he had added and edited on the database.
I am learning as I go with a book, but somehow my tweaking the code skill from the book is not up to par.
I made a sample "browse.html" and made a link to "browse.php."
What is wrong with this script?
I am guessing I am requesting a page without a username or pass word, and it is creating a conflict with deconnection.php.
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/reasonab/public_html/browse.php on line 5
DB Selection failed.
Error # Error msg:
<?php
include("include/dbconnection.php");
if (!mysql_select_db('tablename', $db)) {
echo 'DB Selection failed. <br/>Error # ', mysql_errno(), ' Error msg: ', mysql_error();
exit;
}
$sql = "SELECT picture, title, blogin, tenet FROM tablename";
$result = mysql_query($sql, $db);
if (!$result) {
echo 'Query failed. SQL: ', $sql, '<br/>Error # ', mysql_errno(), ' Error msg: ', mysql_error();
exit;
}
while($row = mysql_fetch_assoc($result)) {
echo $row['picture'], '<br />';
echo $row['title'], '<br />';
echo $row['blogin'], '<br />';
echo $row['tenet'], '<br />';
}
if (!mysql_free_result($result)) {
echo 'Freeing results failed. <br />Error # ', mysql_errno(), ' Error msg: ', mysql_error();
exit;
}
if (!mysql_close($db)) {
echo "Couldn't close database <br />";
exit;
}
?>