Jump to content

Help with Freetag


ice1000

Recommended Posts

I'm having trouble using Freetag. Has anyone used this application?

What I'm trying to do is add a tag to the freetag table using the freetag functions. I have gotten this two work only twice. After it worked, I re-ran the script and nothing happened. I made no changes to the code, I just reran it, but no dice.

Is there some thing wrong with my code?

Thanks
[code]
<?php
session_start();
$user_id = $_SESSION['user_id'];
require_once('config.inc.php');
require_once('freetag.class.php');
?>
<html>
<head>
<title>Test tags</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>
<body>
<div class="formbox">
<div class="title">Be the first to add some tags!</div>
<form name="addTags" method="post">
<input type="hidden" name="id" value="<? $id ?>" />
<input type="text" name="tags" maxlength="40" />
<input type="submit" name="Add" value="Add" />
</form>
</div>

<?php
$freetag_options = array (
'db_user' => 'admin',
'db_pass' => 'pass',
'db_host' => 'localhost',
'db_name' => 'muse'
);
print $_POST['tags'];
$freetag = new freetag($freetag_options);
if (isset($_POST['tags']) && trim($_POST['tags']) != "") {
#$freetag->tag_object($user_id, $_POST['id'], $_POST['tags']); # per the tutorial
$freetag->tag_object( $user_id, 1, 'test'); #this worked once
}
?>
</body>
</html>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/27790-help-with-freetag/
Share on other sites

Archived

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

×
×
  • Create New...

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.