[eluser]Near[/eluser]
yes im using anchor tags and my $config['base_url'] are set to "http://localhost/Oceano";
heres my code
_________________________________
TIDES CONTROLLER
<?php
Class Tides_Controller extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->model('tides_model');
$this->load->helper('form');
$this->load->helper('html');
}
function Index()
{
$this->load->view('Index');
}
//get the list of distinc stations in the database
function getStation()
{
$data['query1'] = $this->tides_model->getStation();
$this->load->view('main',$data);
}
function hourlyQuery()
{
$this->load->view('hourlyHeights');
}
function hourlyMonth()
{
$month = $_POST['month'];
$year = $_POST['year'];
$datum = $_POST['datum'];
$hidden = $_POST['hidden'];
$key = $_POST['key'];
$date = $year."-".$month;
$data2['query2'] = $this->tides_model->getMonthly($date,$datum,$hidden);
$data2['key'] = $key;
$data2['datum'] = $datum;
$this->load->view('/viewers/hourly_viewer',$data2);
}
}
?>
__________________________________________
TIDES_MODEL
class Tides_model extends CI_Model {
function Events_model(){
parent::__construct();
}
function getStation(){
$query1 = $this->db->query('SELECT DISTINCT location FROM proc_tides');
return $query1;
}
function getMonthly($date,$datum,$hidden){
$query2 = $this->db->query("SELECT height FROM proc_tides where date_p like '$date%' and location='$hidden'");
return $query2;
}
function getHourlyYear($date,$location,$datum){
$query4 = $this->db->query("SELECT height FROM proc_tides where date_p like'$date%' and location ='$location'");
return $query4;
}
}
_____________________________________
INDEX (VIEW)
<?php echo anchor('tides_controller/getStation','Query Center')?>
<br />
<br />
<?php echo anchor('tides_controller/call_database_main','Database'); ?>
</body>
</html>
__________________________________
MAIN (VIEW)
<html>
<form action="category_view" method="post">
<select name="station">
<?php
foreach ($query1->result() as $row)
{
?>
<option><?php echo $row->location; ?></option>
<?php
}
?>
</select>
<input type="submit" name="submit" value="SUBMIT">
</form>
</html>
_______________________
CATEGORY_VIEW
<?php
echo anchor('tides_controller/hourlyQuery/'.$station,'HOURLY HEIGHTS');
?>
<?php
echo anchor('highlow_controller/test/' .$station, 'HIGH AND LOW TIDES');
?>
_____________________________
HOURLY_HEIGHTS (VIEW)
<?php $station = $this->uri->segment(3)?>
<?php echo 'Enter your Query for'.' '.$station?>
<html>
<h1>Monthly Query</h1>
<form action="hourlyMonth" method="post">
<label for="year">Enter Year</label>
<input type="text" name="year">
<label for="month">Enter month</label>
<input type="text" name="month"><br><br>
<label for="datum">Datum</label>
<input type="text" name="datum" value="0"><br>
<input type="submit" value="Submit Query">
<input type="hidden" name="hidden" value="<?php echo $station;?>">
<input type="hidden" name="key" value="1">
</form>
my problem is when i click the submit button at hourly_Heights the page is loaded in the same page?