Archive for March, 2009

Table names are plural and lowercased. Model names are singular and CamelCased: ModelName. Model filenames are singular and underscored: model_name.php. Controller names are plural and CamelCased with *Controller* appended: ControllerNamesController. Controller filenames are plural and underscored with *controller* appended: controller_names_controller.php Associations should use the ModelName, and the order should match the order of the foreignKeys: var $belongsTo = ‘User’; Foreign keys should always …

PHP Advantages

 on March 31, 2009

PHP is a useful programming language because it allows for advanced programming and is easy to integrate with web pages. Another and of PHP is that the language interfaces well with MySQL, a popular type of online database. MYSQL is a commercial grade database application that is made available free under the Open Source to someone. Another and of PHP is that it …

The PHP CURL functions use the libcurl library to allow you to connect to various servers and different protocols. This post shows how to make an HTTP POST with PHP and CURL passing several form fields. This can be useful for testing your own web forms, connecting to APIs that require POST data and so on. The PHP Code The following PHP code …

<?php curl_setopt($ch,CURLOPT_POSTFIELDS,$post); ?> where $post is an array : <?php $post['key1'] = ‘data1′; // like a text field in a POST $post['file1'] = ‘@filename1′ // upload filename1 ?>

You can easily see the SQL queries that CakePHP is running by adjusting the DEBUG constant in config/core.php. 0 is production, 1 is development, 2 is full debug with SQL, and 3 is full debug with SQL and dump of the current object. I typically have debug set at 2, which renders a table at the bottom of the page that contains SQL …

<html> <head> <title>Javascript Form Validation</title> <script type=’text/JavaScript’> function validate() { if(document.form1.textinput.value==”) { alert(‘Fill the Input box before submitting’); return false; } else { return true; } } </script> </head> <body> <form name=’form1′ action=’javascript_validation.php’ method=’post’ onSubmit=’return validate();’> <input type=text name=textinput value=”> <input type=submit value=submit> </form> </body> </html>

Simply write this line in the action of controller for which you don’t want to make .ctp file. $this->autoRender = false;

A web-site gives your company world-wide exposure. round the clock, 365 days a year, your site is obtainable world-wide, and can be so for a modest cost. A web-site can become a live online brochure. You can keep your web-content up-to-date and promote new products as they come obtainable. Even if you do not plan to use e commerce to sell your products …

<?php //These will both output 2. echo strlen("\r\n"); echo mb_strlen("\r\n"); ?>