I am trying to add dynamic Facebook og meta tags to my Wordpress site. I am adding them to single.php instead of the usually recommended functions.php file because I have code below that for a Facebook app I've created that needs to execute every time someone views an individual blog post because it then posts to their Facebook timeline that they've read that particular post. I don'
我正在尝试为我的Wordpress网站添加动态的Facebook og元标签。 我将它们添加到single.php而不是通常推荐的functions.php文件中,因为我的代码低于我创建的Facebook应用程序,需要在每次有人查看单个博客帖子时执行,因为它会发布到他们的Facebook时间表,他们已经阅读了特定的帖子。 我不想使用一个插件,因为我的一些插件曾经互相冲突,并且弄得一团糟。 我最大的问题是我需要og:url标记是动态的,但og:title , og:descript
I have set up a simple log in page on a mobile app to take in user name and password. I have also set up a server and it displays {"loggedIn":true} if I insert the correct password and username on the url. I want the same think to happen but this time I want to insert the password/ username info on the mobile app. This is the url of the server: http://softwarehuttest.x10.mx/public/a
我在移动应用程序上建立了一个简单的登录页面,以获取用户名和密码。 我还设置了一台服务器,如果我在URL上插入正确的密码和用户名,它会显示{“loggedIn”:true}。 我希望发生同样的想法,但是这次我想在移动应用程序中插入密码/用户名信息。 这是服务器的网址:http://softwarehuttest.x10.mx/public/account/login/?id=param&password=param URL中的参数将被来自html表单的输入替换。 我不确定我将如何在移动应用程
I am just getting a grasp on the MVC framework and I often wonder how much code should go in the model. I tend to have a data access class that has methods like this: public function CheckUsername($connection, $username) { try { $data = array(); $data['Username'] = $username; //// SQL $sql = "SELECT Username FROM" . $this->usersTableName . " WHERE Use
我只是掌握了MVC框架,我经常想知道模型中应该有多少代码。 我倾向于有一个类似这样的方法的数据访问类: public function CheckUsername($connection, $username) { try { $data = array(); $data['Username'] = $username; //// SQL $sql = "SELECT Username FROM" . $this->usersTableName . " WHERE Username = :Username"; //// Execute statement return $
I have to get properties from multiple classes stored in one directory. I have no problems collecting protected and public properties. I'm after public only, so all's fine up to now. What I do: $foo = new Foo(); $reflect = new ReflectionClass($foo); $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED); foreach ($props as $prop) {
我必须从一个目录中存储多个类的属性。 我在收集受保护和公共财产方面没有问题。 我只追求公众,所以一切都很好。 我做的事: $foo = new Foo(); $reflect = new ReflectionClass($foo); $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED); foreach ($props as $prop) { print $prop->getName() . "n"; } 但是,有些类确实有保护方法,例如: class Foo {
i was following an ACL tut. which has used this piece of code. class ACL { var $perms = array(); var $userID = 0; var $userRoles = array(); function __constructor($userID = '') { } } however i am unable to understand some of the above declarations. a) the class property is declared starting with var keyword in the above class, in data encapsulation is it not necessa
我正在关注ACL啧啧。 它使用了这段代码。 class ACL { var $perms = array(); var $userID = 0; var $userRoles = array(); function __constructor($userID = '') { } } 但是我无法理解上面的一些声明。 a)class属性在上面的类中声明以var关键字开头,在数据封装中,我们不需要在属性声明之前使用public,private或protected关键字。 上述方法是否适用于PHP4? 或者它也适用于php5吗? b)
I have wrote a code that has been working for the last past 3 month. Now suddenly, I noticed that my PHP _Session variable no longer persists between the different page for my login. Please note that the code actually works on local, but not on my server (papahost). Here's a very simple version of what i'm trying to do (SESSION persists from class A to B): class function.php <?p
我写了一个在过去3个月里一直工作的代码。 现在突然间,我发现我的PHP _Session变量不再在我登录的不同页面之间持续存在。 请注意,代码实际上适用于本地,但不适用于我的服务器(papahost)。 下面是我想要做的一个非常简单的版本(SESSION从A到B): class function.php <?php function sec_session_start() { //other code goes here session_name('sec_session_id'); $secure = SECURE;
I've had a rather out of the blue issue crop up with a project I've been working on for a while now. I setup the sessions portion of my code over a month ago and this morning, when I logged into a test account on my code, it seems my $_SESSION data is no longer passing through between pages. The login script is working fine and successfully triggers header. But when I get to portalroo
我已经有了一个相当突出的问题,因为我现在正在研究一个项目。 我在一个月前和今天早上设置了我的代码的会话部分,当我登录到我的代码的测试帐户时,似乎我的$ _SESSION数据不再通过页面之间传递。 登录脚本工作正常,并成功触发标题。 但是当我到达portalroom.php时,print_r正在生成“Array()”。 portalroom.php以session_start()开头。 我也确认register_globals已关闭在我的php.ini中。 在这一点上,我完全失去了
I started developing a platform mainly in php and sessions worked fine, until I stopped my Apache Server and started working on it a week later. This is my problem : index.php <?php include_once 'backend/login.php'; // DB connect + functions include_once 'menu.php'; // menu include check_logout(); // check if user logged out ?>
我开始主要在php中开发一个平台,并且会话运行良好,直到我停止了我的Apache服务器并在一周后开始工作。 这是我的问题: 的index.php <?php include_once 'backend/login.php'; // DB connect + functions include_once 'menu.php'; // menu include check_logout(); // check if user logged out ?> <?php include_once 'widgets/widgets.php'
I am looking for a way to read the contents of a PHP session without actually replacing the running session of the current request. Lets say I have a running session (started before with session_start(), using the default session handler and the session_id given by the PHPSESSID cookie) Now I have another (valid) session_id and I want to read some of the data stored in that session. The only
我正在寻找一种方法来阅读PHP会话的内容,而不实际替换当前请求的运行会话。 比方说,我有一个正在运行的会话(以session_start()开始,使用默认会话处理程序和PHPSESSID cookie给出的session_id)现在我有另一个(有效)session_id,我想读取存储在该会话中的一些数据。 我能想到的唯一方法是用$ oldSession = session_id()替换当前会话,使用session_id($ newId)设置新会话,然后从$ _SESSION读取数据,然后使用sess
I am getting two PHPSESSID while printing $_SERVER['HTTP_COOKIE'] . Actually I don't know how it is set twice, its only in my local system. When I check the SERVER cookie it like: echo $_SERVER['HTTP_COOKIE']; //result 'fe_toolbar=false; fe_toolbar=false; PHPSESSID=4tvbovcjk0msf9dvibeb31c2b7; langId=1; backendLangId=2; PHPSESSID=46aagg1hg7as2uh9bihjlpp8h7' When I check my
打印$_SERVER['HTTP_COOKIE']时,我得到两个PHPSESSID 。 其实我不知道它是如何设置两次的,它只在我的本地系统中设置。 当我检查SERVER cookie时,它像这样: echo $_SERVER['HTTP_COOKIE']; //result 'fe_toolbar=false; fe_toolbar=false; PHPSESSID=4tvbovcjk0msf9dvibeb31c2b7; langId=1; backendLangId=2; PHPSESSID=46aagg1hg7as2uh9bihjlpp8h7' 当我单独检查我的cookie时,如: print_r($_COOKIE);