|
just another regularban.info web blog |
| MEMBERS: | Using Perl To Convert Hyperlinks And Filenames To Lowercase
Like a lot of web developers, I'm not always that disciplined when it comes to the file naming convention I use and I sometimes end up with a situation whereby I have some files that are in lowercase, some that begin with a capital, and some that are a bit of a mixture. One web site I maintain contains about 2000 web pages and has about 20,000 hyperlinks. As you can imagine, I had one of those sinking feelings when I was told that in order to migrate the web site to a new content management system, all the file names and hyperlinks would need to be changed to lowercase. Whenever I am presented with a problem like this, my instinct is always to write a Perl script using one or more regular expressions to solve the problem. This particular situation was no exception. Change a string to lowercase The following regular expression changes all the characters in a string to lowercase. The first part of the regular expression finds a hyperlink, and the second part converts the string. (Just in case this article is not displayed correctly, there should be a single backslash in front of the 'L$1'). Change a filename to lowercase Likewise, changing a filename itself is very simple. The following two lines perform the task quite nicely: (Again, there should be a single backslash in front of the 'L$name'.) If you need more information on how to incorporate the above code snippets into a complete script, feel free to contact me directly.
The Beginners Guide to PHP
What Is PHP? The full form of PHP is Hypertext PreProcessor and is a server-side scripting language. The PHP code can be combined with regular HTML tags and parsed on the server. The creator of PHP, Rasmus Lerdorf first displayed the language in the form of a Perl script . In 1997 it was adapted by Andi Gutmans and Zeev Suraski to use a C-written compiler. They completely reconstructed the original PHP into the web language that we know and use today. Uses of PHP It is used in the creation of dynamic web pages. Web developers like it because of its fast parsing and flexibility and versatility. PHP is a popular tool for managing a form's data after it is submitted and comes built in with many different interfaces and API's. It has database capability built into the language, the most common database being MySQL. Typically the PHP can connect to any SQL enabled database. The Syntax of PHP is similar in structure to Perl and C where curly braces { } define blocks of code and semi-colons specify the end of a statement PHP is as easy to learn as Perl. It maintains all the traditional loops, if/else, and subroutines that are expected in a programming language. One difference between the two is that the code'?' is embedded in with the HTML; you could however, use a separate file. The PHP code is different from HTML code by use of the opening and closing tags. When it finds a PHP file, it tells the server to scan through for these tags, and execute the code in between them. The server recognizes a PHP enabled file by its extension, .php. These are essentially HTML files with PHP codes in them. Getting Started To start PHP requires a server with PHP installed and a simple ASCII text editor such as Notepad or VI, eMacs, Kate, etc. for a UNIX/Linux machine. What are the problems faced by PHP? It is case sensitive. For example if you name a variable $MyVar, you cannot call it as $myvar or $mYvAr. In case you forget to close your curly brackets, then it helps to indent lines inside the curly braces so that any missing braces can be spotted easily.
Website Success
Getting your website done up for your online marketing business? What are your expectations for a good website? What are the important factors that you are emphasizing on to get the desired results from your website? How do you plan to achieve such desired results that will project your website favorably with visitors and customers alike? Designing a good website and making it work for you and your online business requires tremendous effort in meticulous planning, serious consideration and purposeful fine-tuning. Without all these factors, the vast amount of time, money and effort spent on starting up the website can all be wasted easily. To achieve website success, it is imperative to consider the following points: (1) Planning Draft the plan for your website. What is the exact purpose for the website? This is important because it will set the direction that should be taken for the whole process of designing your website. (2) Content consideration Content is the meat and forms an integral part of the website. It is important to think about what content should be included on the website. Another aspect will be how often the content should be updated and how to get reoccurring content. (3) Designing the website This plays an important role in keeping your visitors for the first four seconds. The design of your website must speak its intention and desirability very clearly. What it has to show to the visitors must be made known in that very short time span. No beating around the bush whatsoever. It must be distinctly clear in sending its message across. (4) Encouraging visitor participation The website for whatever reason it is being designed must attempt to bring in visitors not only for the sake of traffic but also getting them involved by participating in the signing up of the free articles and newsletters that you are offering. The whole process must one of interaction, not just a one-way communication. (5) Setting up the website This poses no problems simply because there are professional web designers that you can approach for a certain fee, or alternatively, there are nowadays user-friendly software that you can purchase to design and build your own website, bearing in mind that the design has to be somewhat agreeable within limits to the intention of the website. (6) Execution of follow-up It will be extremely damaging if some visitor poses you a question but it is not being followed up within the same day. This reflects poorly on the efficiency on your part. It tarnishes the image of your online customer service. (7) Promoting your website In any marketing campaign, there is the element of promotion. After having posted your new website, it is crucial to spend some time in promoting it. It is new and therefore it has not garnered recognition or publicity withing this short period of time. It must be given some push through promoting it. There would be teething problems initially, so the website must be given close attention and nurturing, at least in this initial phase of being hosted. (8) Executing maintenance of the website Having set up the website on the internet, it is very important to maintain it. Enliven it with new and fresh content. Make it appealing as each day passes by and visitors returning looking forward to reading new information. Put a warm smile on your website everyday. It will be like what honey is to bees. The path to website success is being subtly laid ahead. The prerogative after the website is being hosted is obviously getting visitors to know and come to your website. Without visitors to your website, the whole purpose of designing and hosting it will be defeated. How do you plan to attract visitors to your website? There are several ways of realizing this plan: (1) Submission of your website to various search engines Submitting your site to various search engines will help in some way. Of course, it would be advisable not to place full reliance on them as they can be inconsistent. If budget permits, bidding for a spot on the search engine would be a more viable alternative simply because an extra bit of control can be exercised. Overture.com is one good choice. (2) Put up various free offers Who would not want to accept free offers if given? This can be best executed by explaining why the visitors in accepting the free offers would understand more about their problems on hand. "Grab free information relating to your backaches. You'll receive more of such information if your just sign in and allow me to mail you these free related information on a weekly basis". (3) Put up ads online It is a good opportunity to put up ads online. Run your paid ads in e-zines. Put your ad buried in another person's e-zine, or you can choose to buy a full page ad. The whole process will induce the source of incoming traffic to your website. (4) Use word-of-mouth This method is viral and is usually effective. Let the world know about your website by inserting your personal signature file on your name cards, brochures, leaflets, just to name a few. Inevitably, as this usually turns viral, it will lead to more website visibility. The internet provides the opportunities for online success. All that is needed to be done is to leverage ourselves with technology. It is equally crucial to understand that website success needs good effort in planning, designing, hosting, promotion and maintenance of the website. Nothing is further from the truth that a well-maintained website is one guaranteed of success in the long run.
|
* About Archives
Categories:
Last Updated: |
| regularban.info
is proudly powered by WordPress MU running
on regularban.info.
Create a new blog and join in the fun! Entries (RSS) and Comments (RSS). |