PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of manish kuikel   Google Image Download   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: index page for example
Class: Google Image Download
Download images from Google Image search results
Author: By
Last change:
Date: 12 years ago
Size: 1,715 bytes
 

Contents

Class file image Download
<?php
if (isset($_POST['Submit']) && ($_POST['Submit'] == 'Submit')) {

include(
'gimage.class.php');

$foldername = $_POST['search'];
$from = 0;
$to = $_POST['to'];
$to = $to * 20;

$size = $_POST['size'];
if (
$size == '1') {
       
$size = '&tbs=isz:l';
    } elseif (
$size == '2') {
       
$size = '&tbs=isz:m';
    } elseif (
$size == '3') {
       
$size = '';
    }

$sf = $_POST['sf'];
    if (
$sf == '1') {
       
$sf = '&safe=off';
    } else {
       
$sf = '';
    }
   
$download = new downloadgimag;
$download -> downloadto($foldername,$to,$size,$sf);

} else {
?>
<form id="form1" name="form1" method="post" action="">
  <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td colspan="2">Download Google search Images | <a href="index.php">Refresh</a> </td>
    </tr>
    <tr>
      <td width="100">Search Term </td>
      <td><input name="search" type="text" id="search" /></td>
    </tr>
    <tr>
      <td>Image Size </td>
      <td><input name="size" type="radio" value="1" checked="checked" />
        Large
          <input name="size" type="radio" value="2" />
          Medium
          <input name="size" type="radio" value="3" checked="checked" />
        Any</td>
    </tr>
    <tr>
      <td>Safe Search </td>
      <td><input name="sf" type="radio" value="1" checked="checked" />
        Off
        <input name="sf" type="radio" value="2" />
        On</td>
    </tr>
    <tr>
      <td>To page </td>
      <td><input name="to" type="text" id="to" value="5" size="2" maxlength="2" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
  </table>
</form>
<?php
}
?>