hi all
what is the maximum value can we give in php max_execution_time
I have the following code where i am trying to display langitude and latitude so the upload section takes more than 2 hours to do for 78 records, if my records count extends more than 78 then the i don't know what time it gets please help me how to solve my problem
<?php
if(isset($_GET['module']) && !empty($_GET['module']))
{
$module = $_GET['module'];
$table='habitat_coupon_subscribers4';
switch ($module)
{
case 'upload' :
{
$target_path = '';
$csvfilename=$_FILES['userfile']['name'];
$fp = fopen($_FILES['userfile']['tmp_name'], 'r') or die('Could not open file!');
$target_path = "temp/". basename( $_FILES['userfile']['name']);
$ext = substr(strrchr($target_path, '.\.'), 1);
$userid = $_COOKIE["TestCookie"];
if($ext == "csv")
{
$file_content = file($_FILES['userfile']['tmp_name']);
for($i=1; $i<count($file_content); $i++)
{
$varia= explode(",", $file_content[$i]);
if(sizeof($varia) > 1)
{
foreach($varia as $k=>$v)
{
$v = trim($v,"\x7f..\xff\x0..\x1f");
}
// insert new record into database
if( ($varia[0]=="") && ($varia[1]=="") && ($varia[2]=="") && ($varia[3]=="") )
{
}
else{
$conn=mysql_connect("localhost","root","");
$db=mysql_select_db("testdatabase");
$insert = "INSERT INTO $table ( Address,City,State,Zip)
VALUES('".trim($varia[0],"\x7f..\xff\x0..\x1f")."','".trim($varia[1],"\x7f..\xff\x0..\x1f")."','".trim($varia[2],"\x7f..\xff\x0..\x1f")."','".trim($varia[3],"\x7f..\xff\x0..\x1f")."')";
$res=mysql_query($insert);
//$address ='1350 Leah Ave San Marcos TX 78666 ';
$query="select id,Address,city,state,zip from ".$table;
//echo $query; die;
$res=mysql_query($query);
while($row=mysql_fetch_row($res))
{
$address = $row['1']. ' '. $row['2']. ' ' . $row['3']. ' '. $row['4'];
$address_with_id = $row['0'].' '.$row['1']. ' '. $row['2']. ' ' . $row['3']. ' '. $row['4'];
//echo $address;
echo "<br>";
printf("Get geocode for address: %s\n",$address);
$wsdl = 'http://geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl';
$client = new SoapClient($wsdl);
$result = $client->geocode($address);
echo "Updating values for ".$row['1']. ' '. $row['2']. ' ' . $row['3']. ' '. $row['4'] ."Langitude is ".$result[0]->long. " Latitude is :".$lat= $result[0]->lat."<br>";
// var_dump($result);
$lat= $result[0]->lat;
$long= $result[0]->long;
echo $lat;
echo " ";
echo $long;
echo "<br>";
$table1='tbl_langitude_latitude';
$insert = "INSERT INTO $table1 ( string,langitude,latitude)
VALUES('".trim($address)."','".$long."','".$lat."')";
}//close while loop
}//if($x>0){$x++;}
}
}
echo $insert; die;
}
}
$_SESSION['errMessage'] = "upload failed";
}
if($_GET['module']=='upload'){
$_SESSION['errMessage' ] = 'List uploaded successfully';
}
}
//unlink($target_path);
?>
<form enctype="multipart/form-data" name="Import" method="POST" action="uploadsubscribers.php?module=upload">
<input type="hidden" name="plugin" value="contacts" />
<input type="hidden" name="importType" value="VCard" />
<input type="hidden" name="visibility" value="private" />
<input type="hidden" name="action" value="importContacts" />
<input type="hidden" name="parentId" value="0" />
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr class="mangtableyellow" >
<td colspan="4" align="left" nowrap bgcolor="#FFFFFF"><font color="#FF0000">
<?php if(!empty($_SESSION['errMessage'])) echo $_SESSION['errMessage']; $_SESSION['errMessage'] = '';?></font></td>
</tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="6" class="tabForm">
<tr class="mangtableyellow">
<th align="left" class="dataLabel" colspan="4">SELECT FILE TO IMPORT</th>
</tr>
<tr>
<td class="mangtablewhite">
<input type="hidden" />
<input size="60" name="userfile" type="file"/>
</td>
</tr>
<tr class="mangtablewhite">
<td align="left"><p>
<input title="IMPORT" accessKey="" class="button" type="submit" name="button" value="Import" onclick="return verify_data(this.form);">
</p>
<p> </p></td>
</tr>
</table> </td></table>
</form>