Basic PHP Programming

Your guide to basic PHP Programming

Using a WYSIWYG editor.

without comments

1.png

Editing or creating a php page can lead to migraines and irregular sleeps due to the complicated nature of its coding. However, you can actually save time (and get more sleeps too!) if you will use a WYSIWYG php editor. WYSIWYG stands for “What You See Is What You Get” and it is basically a visual editor. It was made specifically for those who wish to make web pages but do not know anything about coding. TinyMCE is a nice program for those who wish to make websites using javascript, html and php. You can even control the pictures you are going to use in the website you are making, allowing you to preview and move the pictures as freely as possible—of course, without the hassle of inputting codes you cannot understand.

Photo taken from http://www.thesynapticleap.org

Written by editor

May 15th, 2008 at 11:12 am

Posted in Information

How to create news feeds. (part III)

without comments

1.gif

You are actually halfway through by the time you’re reading this post. If you have religiously done the previous instructions correctly, expect that you will soon have a news feed of your own. Your index.php page serves as your window, so basically, it is just like an interface. What you need to make is an HTML page full of tables (but not too many) so as just to separate the news from each other. And then you have to make use of this coding to shorten and convert lines into a string:

$list = getNewsList();
foreach ($list as $value) {
$newsData = file(”news/”.$value);
$newsTitle = $newsData[0];
$submitDate = $newsData[1];
unset ($newsData['0']);
unset ($newsData['1']);

$newsContent = “”;
foreach ($newsData as $value) {
$newsContent .= $value;
}

echo “$newsTitle
$submitDate”;
echo “”.$newsContent.

________________________________________
“;
}
?>

Photo taken from http://geology.com

Written by editor

May 13th, 2008 at 10:52 am

Posted in Information

How to create news feeds. (part II)

without comments

11.jpg

With the codes posted on the first part of the news feeds tutorial, assuming that the codes were posted to the correct forms, you should now have a storage file system where you can dump all the articles you have and you are now able to post it. But of course, what is the sense of a news display if people can’t see it? So there should be a page where your news can be flashed and displayed. To do this, the index.php page you have created will come into use. You have to use the “opendir” and “readdir” commands so that your news files will be arranged in a chronological order. You then have to put these codes:

function getNewsList(){

$fileList = array();

// Open the actual directory
if ($handle = opendir(”news”)) {
// Read all file from the actual directory
while ($file = readdir($handle)) {
if (!is_dir($file)) {
$fileList[] = $file;
}
}
}

rsort($fileList);

return $fileList;
}
?>

Photo taken from http://news.dmusic.com

Written by editor

May 8th, 2008 at 10:39 am

Posted in Information

How to create news feeds. (part I)

without comments

1.jpg

If you wish to create a news feed system using php, it is actually easier than you thought. The basic news system comprises of a php editor (for easier editing), an index.php page (where your news will be displayed) and an admin.php page (where you will post the news). You must create first a page using html so that you can make forms embedded into a page. Then you must insert this coding in the head area of the admin page:

Insert name of php editor here.init({ mode : “textareas”, theme : “advanced”,
theme_advanced_buttons3 : “”, theme_advanced_toolbar_location : “top”,
theme_advanced_toolbar_align : “left”,});

All you have to do to make sure that your coding works is to add in the processing field these codes:

$newsTitel = isset($_POST['title']) ? $_POST['title'] : ‘Untitled’;
$submitDate = date(’Y-m-d g:i:s A’);
$newsContent = isset($_POST['newstext']) ? $_POST['newstext'] : ‘No content’;

$filename = date(’YmdHis’);
$f = fopen(’news/’.$filename.”.txt”,”w+”);
fwrite($f,$newsTitel.”\n”);
fwrite($f,$submitDate.”\n”);
fwrite($f,$newsContent.”\n”);
fclose($f);

header(’Location:index.php’);
?>

Photo taken from http://blog2.protopage.com

Written by editor

May 6th, 2008 at 9:18 am

Posted in Information

Learning PHP basics

without comments

girl looking at her work on computer
Here are some helpful basics on PHP: Begin, at all times, a PHP page with . (a period) and never neglect to use ; (semi colon) at the close of a variable. Secondly, before manually starting phpmyadmin to make your PHP program run properly, be ready to set up PHP, PHPTriad first. Next, to enable your php program to function, bring a php page in a .php wing. And lastly, don’t forget that security is the main requirement in using this type of PHP language. In developing a page with PHP, high level of security is necessary.

It is also very important to note that if you really want your program to operate, follow instructions to the letter. With this type of system, accuracy is the key.

Written by editor

April 29th, 2008 at 6:50 am

Posted in Info

Programming made easy

without comments

woman studying programming
Contrary to common notion, programming is not really hard, at least at present. Compared to the earlier days of programming about more than twenty years ago when it was totally alien to most people, nowadays, almost anyone can learn this skill. It’s true that during the infant stage of programming there were learning books to assist those who wanted to study and train in this field. However, we are luckier now because there are tutorials, mostly online, that can help us in developing programming skills.

On the other hand though, undergoing tutorials either online or in actual location should be boosted by one’s perseverance and interest. Perseverance requires the learner to read tutorial lessons and later try out some actual programming work while interest pushes the person to really want to acquire and learn said ability.

Written by editor

April 24th, 2008 at 6:13 am

Posted in Benefits

Blogger syndication with PHP

without comments

woman blogging
Blogger is equipped with a superb interface used to tidy up blog entries as well as facilitate endorsement of a blog to attain a better position in its niche. This application only requires an uncomplicated SimpleXML set transported with an entire PHP system, along with some understanding of the Google Blogger API and a small part of PHP scripting to come up with the needed HTML code.

Blogger interface is so excellent that it should be put to full use when promoting a blog because with this method, one need not install blog software on a web server anymore since it is already inbuilt with Blogger. This way the web site owner saves time and effort, plus he is able to maintain his MySQL database allowance and set it aside for better and more advanced use in the future.

Written by editor

April 19th, 2008 at 5:48 am

Posted in Info

What’s up with Mashup?

without comments

radio waves
Mashup, in technological context, refers to a web application that makes use of a combination or mixture of data from two or more sources. This combination is then put together into one single device. A good example for this is the integration of cartographic data from Google Maps to real-estate facts, thus producing a different and fresh web service which is otherwise not provided by either or both sources. Consequently, the end-product of mashup is data or code that can be applied for software purposes.

Interestingly, mashup originated from a certain application in pop music, especially hip-hop in which a special song is created by combining two or more other songs.

Written by editor

April 15th, 2008 at 5:19 am

Posted in Info

Efficient use of output buffer in PHP

without comments

employees working on computer
Output Buffer is a process by which HTML or Javascript code or echo or print is produced in PHP with the information being sent to the browser and consequently to the web as an outcome. This is done by having the information stocked up on the server until the script is done executing, or by you doing something on the buffer itself.

To carry out this process, you should start the output buffer first. This should be done before anything else is fed to the browser. It is very important that you start it right after opening the PHP tag. You have to be very precise and sure that no prior action is done before the PHP tag is opened because even a lull or space can result to mistakes.

Written by editor

April 12th, 2008 at 1:56 am

Posted in Info

Quick glance at PHP

without comments

cd
For those of you browsing on this page and are not so knowledgeable about computer programming and whatnots, here is a bird’s eye view on PHP.

PHP stands for Hypertext Preprocessor. It is a computer scripting language basically intended to generate dynamic web pages. It can be derived from a command line interface or in independent graphical applications though focally, it is applied in server-side scripting.
The person behind the making of PHP is Rasmus Lerdorf. He designed this program in 1995. However it is now The PHP Group that acts as the de facto standard for PHP and is considered as a free software by the Free Software Foundation.

PHP, embeddable into HTML, has major use for all purposes in scripting language for web development. Operating on a web server, PHP code acts as the input and building web pages is the output. As a free software, it can be utilized in web servers on approximately all operating systems and platforms.

Written by editor

April 10th, 2008 at 1:48 am

Posted in Info

Bad Behavior has blocked 151 access attempts in the last 7 days.