Opening a pop up window using Javascript

I was in need of a JS function of opening a pop up window. I found a wonderful tutorial about this from Here Here is the Javascript Function for POP UP window named popitup() The interesting part is, the the window.open() function. The arguments of this function are mainly three. First one is URL, second is NAME. and in third one we can put many … Continue reading Opening a pop up window using Javascript

sending php array variable as link to argument of javascript function

I have got a javascript function popitup() which will be used for opening a pop up window. I have PHP Array variable $row_rstest[‘id’] which holds the ID of a data set fetched from database. I have a page named print_data.php. To view the data of this page the url should be like print.data?id=12 I have taken this in variable $url. Then passed this $url in … Continue reading sending php array variable as link to argument of javascript function

A wonderful Calendar for picking date in PHP Input/Update forms

I was writing PHP scripts the other day where I needed a calendar to pick dates. My user needs to pick date of any month or year. Problem was — Manual input of dates are tiresome and inefficient. On the other hand, if inputs are in string, I need to convert them to “datetime” as my datatype is such in the MySQL DB.

I found a wonderful Calendar a website. He made it in javascript and works very well. There are several layouts in the calendar from which developers can choose anyone. The more important thing is, you just need to pass the PHP variable which will store into the DB. You can have this Javascript Calendar from downloading from this link .

This code segment is for taking input and inserting into database

/*include this section*/
<?php require_once('calendar/classes/tc_calendar.php'); ?>

<!-- calender js link-->
<script language="javascript" src="calendar/calendar.js"></script>
<!-- finished-->
<?php
	  $myCalendar = new tc_calendar("date5", true, false); //date5 is similar to the column name of DB 
	  $myCalendar->setIcon("calendar/images/iconCalendar.gif");
	  $myCalendar->setDate(date('d'), date('m'), date('Y'));
	  $myCalendar->setPath("calendar/");
	  $myCalendar->setYearInterval(2000, 2015);
	  $myCalendar->dateAllow('2008-05-13', '2015-03-01');
	  $myCalendar->setDateFormat('j F Y');
	  $myCalendar->setAlignment('left', 'bottom');
	  $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-04", "2011-12-25"), 0, 'year');
	  $myCalendar->setSpecificDate(array("2011-04-10", "2011-04-14"), 0, 'month');
	  $myCalendar->setSpecificDate(array("2011-06-01"), 0, '');
	  $myCalendar->writeScript();
	  ?>

Continue reading “A wonderful Calendar for picking date in PHP Input/Update forms”