#1  
Old 31st July 2009, 08:34
dinesh.4126 dinesh.4126 is offline
Junior Member
 
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default .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&amp;v=2&amp;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'];
-
-
-
-
-----------------------------------------------------------------------------------------------------
Reply With Quote
Sponsored Links
  #2  
Old 31st July 2009, 09:24
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

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)
Reply With Quote
  #3  
Old 31st July 2009, 12:51
dinesh.4126 dinesh.4126 is offline
Junior Member
 
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Attached Images
  

Last edited by dinesh.4126; 31st July 2009 at 13:27.
Reply With Quote
  #4  
Old 1st August 2009, 09:45
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 3rd August 2009, 09:18
dinesh.4126 dinesh.4126 is offline
Junior Member
 
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #6  
Old 3rd August 2009, 15:32
Mosquito Mosquito is offline
Member
 
Join Date: Nov 2006
Posts: 85
Thanks: 5
Thanked 6 Times in 5 Posts
Default

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()?
Reply With Quote
  #7  
Old 4th August 2009, 07:08
dinesh.4126 dinesh.4126 is offline
Junior Member
 
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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???
Reply With Quote
  #8  
Old 6th August 2009, 12:18
dinesh.4126 dinesh.4126 is offline
Junior Member
 
Join Date: Jul 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 | | | |

+----------------------+---------------+------+-----+------------+----------------+
Reply With Quote
  #9  
Old 9th September 2009, 10:16
Craig Craig is offline
Member
 
Join Date: Dec 2006
Posts: 56
Thanks: 1
Thanked 3 Times in 1 Post
 
Default

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">
__________________
cass-hacks.com
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving - odd browser redirection, loses page, falls back to starting page stevieb General 2 1st December 2008 10:36
Squid Proxy Caching on Linux obzerver Installation/Configuration 4 13th August 2008 19:51
changes in /web do not affect the page damaltor Installation/Configuration 2 16th March 2008 12:33
not seeing shared IP page andyreynolds Installation/Configuration 2 21st February 2007 23:24
Frequent blank page when first opening site? minezamac Installation/Configuration 3 1st May 2006 19:55


All times are GMT +2. The time now is 03:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.