Jump to content

darksniperx

Members
  • Posts

    113
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

darksniperx's Achievements

Member

Member (2/5)

0

Reputation

  1. I am using ajax to get an array of data. I then output the contents of array to the screen. Is there any pagination that will work with array, and without reloading the page. Thank you!
  2. got it soved by returning a string of data in new controller.
  3. I was thinking of json, but the server what i am trying to do it is running php 5.1.6, but json_encode needs 5.2.0. i wonder if there is anything that i could do, to use one of the following: print_r(), var_dump(), var_export() or anything else, to dump the information on the screen, then grab with ajax and save it as a javascript array. thx.
  4. my ajax function: function getGroupDataWithAjax(){ $(document).ready(function() { var data = $.ajax({ url: "groupData.php", async: false }).responseText; return data; }); } function in my controller: function getGroupData(){ $groupData = $this->HomeModel->returnGroups(); return $groupData; } what i would like to do, is to call groupData.php with ajax, and store in a variable for later use.
  5. I figured out the issue somewhat. I am using and mvc design. And when i research it, i found out that i either need to make a library to handle session variables or use cookies. Since i used the code for mvc of tutorial on build your own mvc that i found on some site, its pretty bugged. When i tried cookies, they seem to work, but i will test them out more concretely tomorrow.
  6. I have a header.php which is included to all php files. Header.php has the following: <?php session_start(); if(isset($_SESSION)|| $_SESSION != null){ if(isset($_SESSION['message'])){ echo '<br />Login status: '. $_SESSION['message'] ; } } ?> I have a login.php which has header.php included. <?php include header.php ...code if($validate){$_SESSION['message'] = 'Validated';} else{$_SESSION['message'] = 'Unautorized';} ?> when i refresh the page after submit , and check for $_SESSION['message'] it is always empty. same thing is i created another php page, included header.php, and when i redirect to it after login.php the session variable is still empty? Cant figure out why.
  7. the issues what with mvc directory rewrite, i figured out the actual path needed the firebug.
  8. I tried: <link rel="stylesheet" href="<?php echo dirname(__FILE__); ?>/css/a3.css" type="text/css" /> or <link rel="stylesheet" href="css/a3.css" type="text/css" /> I get The file is physically there. Yet i cannot access it.
  9. thank you for all of the info!
  10. Yes, Home is object of class home. The MVC that i am using, there isnt much documentation explaining every little detail. I searched though codes from various tutorials from the same author of MVC until l i came upon that line. And when i modified to work with my model and function it work. And it also did not required for me to do any includes. The main issues as i have stated above, i haven't touched php for a couple of years. Thats why it is a little slow for me at this time.
  11. As far as i understand, $this refers to current class. Most likely there is an instance of Home class too somewhere. Since there is an instance of home class, calling its function works no problem. This is as far as i can explain it for now.
  12. Edit: Ok, I have figured out what i needed to have: $this->Home->printText('123'); Home is the name of the model, while printText the name of the function.
  13. Here is what i did: <?php class HomeController extends Controller { function __construct() { $model = new Home(); } function index($id = null,$name = null) { $this->set('title',$name.' - First Test page'); //$this->set('todo',$this->Item->select($id)); $model->printText('123'); } } Here is what it tells me only when i add __construct: controller.class.php <?php class Controller { protected $_model; protected $_controller; protected $_action; protected $_template; function __construct($model, $controller, $action) { $this->_controller = $controller; $this->_action = $action; $this->_model = $model; $this->$model =& new $model; $this->_template =& new Template($controller,$action); } function set($name,$value) { #this line# $this->_template->set($name,$value); } function __destruct() { $this->_template->render(); } }
  14. here is what i did: <?php include('home.php'); class HomeController extends Controller { $model = new Home(); function index($id = null,$name = null) { $this->set('title',$name.' - First Test page'); $model->printText('123'); } } I get the following:
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.