设置一个数据库来跟踪哪些用户点击了哪些链接? [英] setting up a database for tracking which users have clicked which links?

查看:137
本文介绍了设置一个数据库来跟踪哪些用户点击了哪些链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我最近在我的大学获得了一个入门级兼职开发人员的职位,努力提高锐化速度。我的开发技能。虽然我过去曾经使用过MySQL,但它只是在一门课程中简单介绍过,因为我大部分都是前端人员(HTML / CSS / JS)。

无论如何,雇用我的部门有一个专门面向新生的网站,让他们适应大学生活。它有教程和视频供他们观看等。为了访问该网站,他们必须登录他们的大学帐户(使用LDAP)。帐户名称格式为abc1234。

现在,我的问题是我需要为工作人员创建一种方法来跟踪新生看过的教程/视频。他们希望我使用数据库来做到这一点。可能会有数千名学生,他们希望能够确切地看到哪些学生没有点击每个链接/观看每个视频。



我应该如何设置为此数据库?将会有多个他们想要跟踪的链接/教程/视频。奖励积分,如果有一种方法可以跟踪哪些用户观看了视频直到最后,但不是必需的。



我相信我需要使用PHP来处理交换在浏览器和数据库之间,正确吗?



感谢您的任何帮助或提示。 :)

解决方案

您可以简单地创建一个PHP脚本来检索所需的链接,同时为MySQL添加一个值。

如果我打算这样做,我可能会这样做:

 < a href =getResource.php?res = video1.mpg& type = video> Video 1< / a> 

在PHP中,我只是从会话中获取资源,类型和用户标识,他们到数据库中,然后检索他们正在寻找的资源。要跟踪他们是否观看了整个视频,可以使用javascript观看播放器即将结束的事件,然后使用没有拖动条的外观。


I'll try and elaborate on my problem a bit more.

I recently got an entry-level part time developer position with my university, in efforts to sharpen my dev skills. While I have used MySQL in the past, it was only briefly covered in a single course, as I am mostly a front end guy (HTML/CSS/JS).

Anyways, the department that hired me has a website designed for incoming students, to get them acclimated to college. It has tutorials and videos for them to watch, etc. In order to access the site, they must log in to their university account (which uses LDAP). Account names are in the format of abc1234.

Now, my problem is I need to create a way for the staff to track which tutorials/videos the freshman have watched. They would like me to do this using databases. There will potentially be thousands of students, and they want to be able to see exactly which students have / have not clicked each link/watched each video.

How should I set up databases for this? There will be multiple links/tutorials/videos that they want to track. Bonus points if there was a way of tracking which users watched the videos through to the end, however not required.

I believe I will need to use PHP for handling the exchange between the browser and the database, correct?

Thank you for any helps or tips. :)

解决方案

You could simply make a PHP script that would retrieve the requested link for them, while also adding a value to MySQL.

If I were going to do this, I'd probably do something like this:

<a href="getResource.php?res=video1.mpg&type=video">Video 1</a>

And in PHP, I'd simply get the resource, type and the userid from the session, put them into the database, then retrieve the resource they were looking for. To track if they watched the video the entire way through, you could use javascript to watch for the event of the player coming to an end, then just use a skin that doesn't have a scrub bar.

这篇关于设置一个数据库来跟踪哪些用户点击了哪些链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆