PHP Tutorials

Whether just getting started or an expert, this vast collection of PHP tutorials will help you create dynamic content for powerful web-based applications in no time.

Results via Envato Market

By Mark Musone on July 30, 2000 Don’t you hate it when you are at a friend’s house or visiting relatives and you want to check your email but dont know your POP/IMAP settings. Or even worse, they dont have your POP or IMAP software? Web based email seems to…

By Mark Musone on July 30, 2000 We’ll make a nice and simple 3-script based mail reader. The first script will be to read in your IMAP username and password. We will use the standard PHP authentication for that. login.php3 contains: <?php if (!$PHP_AUTH_USER) {     Header(“WWW-authenticate: basic realm=”Mail Chek””);     Header(“HTTP/1.0 401 Unauthorized”); } else {     $MYDIR=ereg_replace(“/[^/]+$”,””,$PHP_SELF);     Header(“Location: $SERVER_NAME$MYDIR/messages.php3”); } ?>…

By Mark Musone on July 30, 2000 One of the latest crazes on the ‘net has recently been online calendars. with the MCAL library and PHP, writing calendar applications is now easy and fully functional. The MCAL library is very similar to the c-client IMAP library. It offers a common…

By Mark Musone on July 30, 2000 The first thing we’ll probably want to do is pull up a users calendar and display the month view, and the event titles for any of their scheduled events: To do this, we only need to use just a couple of mcal functions….

By Mark Musone on July 30, 2000 The other function we will use is: <?php mcal_days_in_month($month,$leap_year); ?> This simply returns the number of days in a given month, taking into account if it is a leap year or not. To find out what day of the week the first of the month…

By Mark Musone on July 30, 2000 Note, one thing we are doing is allowing people to add events by clicking on and day in the calendar. If there is an event scheduled, it prints out the title, and by clicking on the title, it displays all of the events…

By Mark Musone on July 30, 2000 Finally, we simply call mcal_store_event. This function takes the current event and adds it to the calendar store. addeventaction.php3: <?php $stream=mcal_open(“{/mstore}”,”musone”,”hi”); mcal_event_set_title($stream,$title); mcal_event_set_description($stream,$description); mcal_event_set_category($stream,$category); mcal_event_set_start($stream,$year,$month,$day); mcal_store_event($stream); Header(“Location: index.php3?month=$month&year=$year”); ?> –Mark « Previous Page 1 | 2 | 3 | 4 | 5 | 6

By Mark Musone on July 30, 2000 Following is the complete file, index.php3: <html><head><title>Calendar</title></head><body><center> <?php $montharray=array(“”,”January”,”February”,”March”,”April”,”May”,”June”,”July”,”August”,”September”,”October”,”November”,”December”); $current_date=getdate(); if(empty($month)) {     $month=$current_date[“mon”]; } if(empty($year)) {     $year=$current_date[“year”]; } $stream=mcal_open(“{/mstore}”,”musone”,”hi”); $days=mcal_days_in_month($month,mcal_is_leap_year($year)); $startday=mcal_day_of_week($year,$month,1); $events=mcal_list_events($stream,$year,$month,1,$year,$month,$days); for($x=0;$x<count($events);$x++) {     $event=mcal_fetch_event($stream,$events[$x]);     $start=$event->start;     $date_array[$start->mday]=$date_array[$start->mday] . “<br>$event->title”; } ?> <a href=”<?php echo $PHP_SELF; ?>?month=<?php echo $month-1; ?>”>&lt;</a> <b><?php echo $montharray[$month] – $year; ?></b> <a href=”<?php echo $PHP_SELF; ?>?month=<?php echo $month+1; ?>”>&gt;</a> <table border=1> <tr><th>Sun</th><th>Mon</th><th>Tue</th><th>Web</th><th>Thu</th><th>Fri</th><th>Sat</th></tr> <?php     for($i=0;$i<$startday;$i++) {         echo “<td></td>”;     }     $dayofweek=$startday;     for($i=1;$i<=$days;$i++) {         if (($dayofweek % 7 == 0) && ($dayofweek !=0)) {             printf(“</tr>n<tr>”);         }         echo “<td height=100 width=100>”;         echo “<A href=”addevent.php3?month=$month&year=$year&day=$i”>$i”;         echo “</a>”;…