Archive for 'Programing'

Create URL Shortener With Your Domain

Posted on 17. Sep, 2009 by Yao Yuan.

0

We use shortening URL services like TinyURL, Bit.ly, su.pr, etc on daily basis. These services are great, but have you thought of creating something similar your own? Setting up such service on your own is fairly easy, and if you are using WordPress it too comes with a plug-in that work seamlessly well.

YOURLS (Your Own URL Shortener) is what we’re talking about. It’s a free PHP script created by Lester Chan and Ozh Richard that allow you to create something similar to TinyURL and Bit.ly. We’ve installed and played around with it for a while, and here are our thoughts:

  • Easy to install – If you’ve got no problem installing WordPress, then setting YOURLS is a piece of cake.
  • Customizable links – You can customize the links instead of the random characters that make no sense.
  • Statistics – An admin page that allows you to manage and keep track of details like date of creation, IP, clicks, etc.
  • Public/Private links- You control whether this service is available for public to use or yourself only.
  • Bookmarklet – Easy bookmarklet to create your own short URL on the fly. [...]

Continue Reading

Variable transmission Between two pages in php

Posted on 15. Feb, 2009 by Yao Yuan.

0

在网站设计中,我们常常用到用户登陆这一方法,在登陆后,一般的网站都会根据不同的用户来给定不同的页面,在链接到该站的一个新的网页或者打开一张新网页时,我们也会看到用户的信息能够被记住,现在尤其常用的是,登陆后链接或打开该站的其它网页都会看到诸如”XXX,晚上好”之类的问候语,这些当然都是在登陆后变量传送的结果,在我做个人主页的过程中,曾尝试几种变量传送的方法,现写出来与大家探讨一下。 [...]

Continue Reading

superglobals variable

Posted on 15. Feb, 2009 by Yao Yuan.

0

In PHP 4.2.0 and later, the default value for the PHP directive register_globals is off. This is a major change in PHP. Having register_globals off affects the set of predefined variables available in the global scope. For example, to get DOCUMENT_ROOT you’ll use $_SERVER['DOCUMENT_ROOT'] instead of $DOCUMENT_ROOT, or $_GET['id'] from the URL http://www.example.com/test.php?id=3 instead of $id, or $_ENV['HOME'] instead of $HOME.

For related information on this change, read the configuration entry for register_globals, the security chapter on Using Register Globals , as well as the PHP » 4.1.0 and » 4.2.0 Release Announcements.

Using the available PHP Reserved Predefined Variables, like the superglobal arrays, is preferred [...]

Continue Reading

variable variable, PHP and you

Posted on 14. Feb, 2009 by Yao Yuan.

0

什么叫作变量的变量?根据PHP手册,变量的变量是指取得一个变量的值并把它作为另一个变量的变量名。这表述显得相当的直接,容易和那些在一个句子中使用 “变量”这个词弄混淆。给一个简单的例子,你定义一个变量 — x 等于 this — 然后定义一个变量的变量,意味着你把 x 的值作为新变量的名,在这个例子中,这个新变量的值是 is cake。用PHP来表示如下: [...]

Continue Reading

The use of varible in PHP

Posted on 14. Feb, 2009 by Yao Yuan.

0

就像大部份的结构化程序,有所谓的全局变量与局部变量,php 在这方面也是有相同的处理方式。 [...]

Continue Reading

Variable type of php

Posted on 14. Feb, 2009 by Yao Yuan.

0

php 的变量类型不多,有以下五种:

  • string
  • integer
  • double
  • array
  • object

[...]

Continue Reading