How to reload or redirect a page after a definite time interval


For reloading or refreshing a page JavaScript is as follows —

window.location.reload();

and for redirect a page after define time interval in JavaScript is as follows–

<script type=”text/javascript”>
setTimeout(“location.href=’https://ruzdi.wordpress.com&#8217;,10000);
</script>

here in the setTimeout() Javascript functon first parameter is the location where to redirect and second parameter is the time interval

In Html inside the head tag use following meta tag for redirection —

<head>

<meta http-equiv=”refresh” content=”10;https://ruzdi.wordpress.com”&gt;

</head>

here in this meta tag on content 10 is the time interval and next address is the address where to redirect

Advertisements

How to submitting from inside of iFrame from Outside of iFrame


In case of situation like that a form which is inside of iframe but I  need to submit it from outside of iframe.

<iframe name=”displayframe” src=”display.php” width=”100%” height=”650px” style=’border:none’ >

<form action=”<?php echo $base_index.$action;?>” method=”post” enctype=”multipart/form-data” name=”formdisplay” id=”formwork”>
<input type=”hidden” id=’base’ value='<?php echo $base_index?>’ />

<table width=”522″ border=”0″ align=”center”>
<tr>
<td align=”right”><b>Title:</b></td>
<td colspan=”4″><label>
<input name=”title” type=”text” id=”title” size=”50″  />
</label></td>
</tr>
<tr>
<td align=”right”><b>Description:</b></td>
<td colspan=”4″><label>
<textarea name=”description” rows=”5″ cols=”30″ style=”width:600px” >
</textarea>
</label></td>
</tr>

</table>
</form>

</iframe>

<input type=”button” name=”insert” id=”button” onclick=”submitDisplayForm()” value=”submit” />

and my JavaScript code is

<script type=”text/javascript”>

window.frames[‘displayframe’].document.forms[‘formdisplay’].submit();

</script>

in this javascript code “displayframe” is the name of iframe and “formdisplay” is the name of form which is inside of iframe.

Thats all i have done so far.

Creating Image Border


<?php

/*

* This function is for creating image border . Here image1 is the full path of the

* image and border is the border size.

*

* This function returns the image which one is input with a definite image border

* defined by $border varible

*/

/*

* @author : ruzdi + (internet browsing help)

* @parameters : $image is full path of the image , $border is the border size

* @return : null

* @output : image1 will be replaced by the new image

*/

//THIS FUNCTION REPLACE OLD IMAGE BY THE NEW IMSGE AS THE NAME OF $image1 ON THE SAME FOLDER

function imageBorder($image1='image1.jpg',$border=10) {

$im = ImageCreateFromJpeg($image1);

$width = ImageSx($im);

$height = ImageSy($im);

$newimage_width = $width + ( 2*$border ); // this is the new width after adding border

$newimage_height = $height + ( 2*$border ); // this is the new height after adding border

$newimage = imagecreatetruecolor( $newimage_width, $newimage_height );

$border_color = imagecolorallocate( $newimage, 255, 255, 255 ); //here first paremeter is image name and next three are rgb value

imagefilledrectangle($newimage,0,0,$newimage_width,$newimage_height,$border_color);

imageCopyResized($newimage,$im,$border,$border,0,0,$width,$height,$width,$height);

ImageJpeg($newimage,$image1,100);

chmod($image1,0666);

}

/*

* This function is for creating image border . Here image1 is the full path of the

* image and border is the border size.

*

* This function returns the image which one is input with a definite image border

* defined by $border varible

*/

/*

* @author : ruzdi + (internet browsing help)

* @parameters : $image1 is full path of the image , $image2 new imagename, $border is the border size

* @return : null

* @output : A new $image2 will be created on the same folder

*/

//THIS FUNCTION PRODUCE NEW IMAGE AS THE NAME OF $image2 ON THE SAME FOLDER

function imageBorder2($image1='image1.jpg',$image2='image2.jpg',$border=0) {

$im = ImageCreateFromJpeg($image1);

$width = ImageSx($im);

$height = ImageSy($im);

$newimage_width = $width + ( 2*$border ); // this is the new width after adding border

$newimage_height = $height + ( 2*$border ); // this is the new height after adding border

$newimage = imagecreatetruecolor( $newimage_width, $newimage_height );

$border_color = imagecolorallocate( $newimage, 255, 255, 255 ); //here first paremeter is image name and next three are rgb value

imagefilledrectangle($newimage,0,0,$newimage_width,$newimage_height,$border_color);

imageCopyResized($newimage,$im,$border,$border,0,0,$width,$height,$width,$height);

ImageJpeg($newimage,$image2,100);

chmod($image2,0666);

}

imageBorder('replace.jpg',10);

imageBorder2('old.jpg','new.jpg',20);

?>;

click to download

About Me


This is Md. Ruzdi Islam. I am  Web Developer and now I am working on BJIT Group. I live PHP and Java. I like frameworks and I am familiar to  PHP framework — CodeIgniter, Kohana,  CakePHP and Zend FrameWork. I like to work as a agile team member.

I am passed my B.Sc Engineering ( Computer Science and Engineering ) from Rajshahi University of Engineering and Technology ( RUET ). I like my university very much and I love Rajshahi  City.