about summary refs log tree commit diff
path: root/favs.php
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2018-11-04 19:03:18 -0500
committerZach DeCook <zachdecook@gmail.com>2018-11-04 19:03:18 -0500
commit452b129ff5c30bc3a58cf69e0435b00d5975ab58 (patch)
treea102a1018c43608affcd78d59c441cd1abf1597f /favs.php
parent1ae91210f38f0599702973a3e1664b3598fc52ae (diff)
downloadprosongsa-452b129ff5c30bc3a58cf69e0435b00d5975ab58.tar.gz
* Add simple page to view favs
Diffstat (limited to 'favs.php')
-rw-r--r--favs.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/favs.php b/favs.php
new file mode 100644
index 0000000..ab1e751
--- /dev/null
+++ b/favs.php
@@ -0,0 +1,16 @@
+<a href=".">Go back</a>
+<?php
+$db = new SQLite3( "db/favs.db");
+$name = str_replace("'", "", $_GET['name'] );
+$res = $db->query("SELECT * FROM favorites where name='$name';");
+if ( $res )
+{
+	echo "<ul>";
+	while ( $ar = $res->fetchArray() )
+	{
+		$song = str_replace( "'", "", $ar['song'] );
+		$song = strip_tags( $song );
+		echo "<li><a href='./?song=$song'>$song</a>";
+	}
+	echo "</ul>";
+}