
31st July 2009, 08:34
|
|
Junior Member
|
|
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
.php Page Refresh
Hi,
I am beginer in PHP,HTML.We have deisgn a web in php for google map display+weather information with multi-language options.We want page to refresh ,if person enter weather data in msql server it will keep on refershing the webpage so that it will show updated information on page.Kindly help me what are additional things neede to added in code so that keep on refreshing the page after certain time duration.
Below are code .php file :
-----------------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Remote Weather Monitoring</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAZp4rKdeeazZB Q3EH922UUBTIorwmHn2vzvETmozy_EzYqHAPGRRS5FVIpoR9Ki hjOtSDuHwlbGw8LA"
type="text/javascript"></script>
<?php
include_once("include_files_map.php");
include_once(PATH_TO_MAIN_PHYSICAL_LANGUAGE.$langu age.'/'.FILENAME_INDEX);
include_once(FILENAME_BODY);
//print_r($_POST);
if($_POST['language'])
{
switch($_POST['language'])
{
case 'oriya':
define('TEXT_LANGUAGE','or_');
break;
case 'hindi':
define('TEXT_LANGUAGE','hi_');
break;
case 'tamil':
define('TEXT_LANGUAGE','ta_');
break;
case 'telugu':
define('TEXT_LANGUAGE','te_');
break;
case 'bengali':
define('TEXT_LANGUAGE','be_');
break;
case 'kanada':
define('TEXT_LANGUAGE','ka_');
break;
default :
define('TEXT_LANGUAGE','');
break;
}
}
$search_location_name=$_POST['TR_name'];
$display_size=$_POST['size_of_display'];
$map_type=$_POST['type_of_map'];
//getting from data base
$data=getAnyTableWhereData(LOCATION_TABLE,"name='" .$search_location_name."'","*");
$location_name=$data['name'];
$latitude=$data['lat'];
$langitude=$data['lng'];
$weather=$data['weather'];
$temp=$data['weatherinfo_temp'];
$humidity=$data['weatherinfo_humidity'];
$distance_from=$data['distance_from'];
$distance_to=$data['distance_to'];
$depth_from=$data['depth_from'];
$depth_to=$data['depth_to'];
// $fish_info=$data['fish_info'];
$warning=get_name_from_table(WARNING_TABLE,TEXT_LA NGUAGE.'warning','id',$data['weatherinfo_warning']);
//echo aaa;
//die();
$wind_direction_from=$data['wind_direction_from'];
-
-
-
-
-----------------------------------------------------------------------------------------------------
|

31st July 2009, 09:24
|
|
Senior Member
|
|
Join Date: Sep 2008
Location: The Netherlands
Posts: 911
Thanks: 12
Thanked 95 Times in 92 Posts
|
|
Put this in your head (just above the <title> tag):
Code:
<meta http-equiv="refresh" content="SECONDS; ,URL=http://URL_TO_YOUR_WEBSITE">
SECONDS = Number of seconds to wait for a refresh (f.e.: 60)
URL_TO_YOUR_WEBSITE = The URL to your webpage (f.e.: htp://www.domain.tld/weather.php)
|

31st July 2009, 12:51
|
|
Junior Member
|
|
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Below are the changes as suggested above in forum
----------------------------------------------------------------------------------------------------------
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="refresh" content="10"; ,URL="http://localhost/google/map_display.php">
---------------------------------------------------------------------------------------
Page is refreshing.kindly see in attachment refreshing page.Kindly let know the solution of this or guide where is problem.
*screenshot1 attachment is page real page when not refresh.
*screen shot attachment is page after adding refresh header in php.
Last edited by dinesh.4126; 31st July 2009 at 13:27.
|

1st August 2009, 09:45
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
I guess there's a problem with an SQL query - the column TEXT_LANGUAGEwarning does not exist in the database table that you're querying.
|

3rd August 2009, 09:18
|
|
Junior Member
|
|
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Below are the MYSQL table.In id filed table is with default null value so is their deafult value is needed??.
+----------------------+---------------+------+-----+------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+------------+----------------+
| id | int(10) | NO | PRI | NULL | auto_increment |
| name | varchar(40) | NO | | | |
| lat | decimal(10,4) | NO | | 0.0000 | |
| lng | decimal(10,4) | NO | | 0.0000 | |
| weather | varchar(20) | NO | | | |
| weatherinfo_temp | decimal(3,2) | NO | | 0.00 | |
| weatherinfo_humidity | decimal(3,1) | NO | | 0.0 | |
| weatherinfo_warning | text | NO | | NULL | |
| wind_direction_from | smallint(5) | NO | | 0 | |
| wind_direction_to | smallint(5) | NO | | 0 | |
| windinfo_speed | decimal(6,1) | NO | | 0.0 | |
| wave_height | decimal(10,4) | NO | | 0.0000 | |
| inserted | date | NO | | 0000-00-00 | |
| updated | date | NO | | 0000-00-00 | |
| distance_from | decimal(6,1) | YES | | NULL | |
| distance_to | decimal(6,1) | YES | | NULL | |
| depth_from | decimal(6,1) | YES | | NULL | |
| depth_to | decimal(6,1) | YES | | NULL | |
+----------------------+---------------+------+-----+------------+----------------+
Thng is that without using refresh it show google map+weather information but when <meta http-equiv="refresh" content="SECONDS; ,URL=http://URL_TO_YOUR_WEBSITE"> is inserted it shows on page.
----------------------------------------------------------------------------------------------------
1054 - Unknown column 'TEXT_LANGUAGEwarning' in 'field list'
select TEXT_LANGUAGEwarning from warning where id in ('')
-----------------------------------------------------------------------------------------------------
It might be because of in MYSQL data base id field deafult null is present in table??
Last edited by dinesh.4126; 3rd August 2009 at 11:50.
|

3rd August 2009, 15:32
|
|
Member
|
|
Join Date: Nov 2006
Posts: 85
Thanks: 5
Thanked 4 Times in 3 Posts
|
|
My guess it has something to do with this line
Code:
$warning=get_name_from_table(WARNING_TABLE,TEXT_LA NGUAGE.'warning','id',$data['weatherinfo_warning']);
What is the code for the function get_name_from_table()?
|

4th August 2009, 07:08
|
|
Junior Member
|
|
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
Below is code for function get_name_from_table
------------------------------------------------------------------------------------------------------------------
function get_name_from_table($table_name,$select_name,$fiel d_name_id,$field_name_ids)
{
$name="";
if($field_name_ids=='')
$query="select $select_name from $table_name where $field_name_id in ('')";
else
$query="select $select_name from $table_name where $field_name_id in ($field_name_ids)";
$result=tep_db_query($query);
while($row=tep_db_fetch_array($result))
{
$name.=$row[$select_name].", ";
}
if(substr($name,-2,2)==", ")
{
$name=substr($name,0,-2);
}
tep_db_free_result($result);
return $name;
}
----------------------------------------------------------------------------------------------------------------------
Has Anybody got any idea How to tackle this problem???
|

6th August 2009, 12:18
|
|
Junior Member
|
|
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
In my Table Location :
+----------------------+---------------+------+-----+------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+------------+----------------+
|
| weatherinfo_warning | text | NO | | NULL | |
+----------------------+---------------+------+-----+------------+----------------+
If I want to change default attributes as shown below,then can somebody help what should be command to change default attributes.I search a lot in google but failed to do that.
+----------------------+---------------+------+-----+------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+------------+----------------+
|
| weatherinfo_warning | text | NO | | | |
+----------------------+---------------+------+-----+------------+----------------+
|

9th September 2009, 10:16
|
|
Member
|
|
Join Date: Dec 2006
Posts: 56
Thanks: 1
Thanked 3 Times in 1 Post
|
|
Try removing the comma, i.e.
Code:
<meta http-equiv="refresh" content="10"; ,URL="http://localhost/google/map_display.php">
becomes
Code:
<meta http-equiv="refresh" content="10"; URL="http://localhost/google/map_display.php">
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 23:00.
|
Recent comments
1 day 53 min ago
1 day 3 hours ago
1 day 15 hours ago
1 day 17 hours ago
1 day 22 hours ago
2 days 4 hours ago
2 days 13 hours ago
2 days 15 hours ago
2 days 23 hours ago
3 days 1 hour ago