Hello,
I am currently working on a site that is being built on codeigniter, I am currently querying the data at the moment I think there could be possible 3 arrays that could be returned as array each with a varying amount of results, my question I cannot for life of me loop through the array I have at the moment,
my model looks like...
I'm trying to match everything, but everything between [ and ].
everything between [ and ] is
\[.+\]
everything, but everything between [ and ] is
[^(\[.+\])]+
The search text is
valid[REGEX_EMAIL|REGEX_PASSWORD|REGEX_TEST]
It matches "valid" and "REGEX_EMAIL|REGEX_PASSWORD|REGEX_TEST".
It is supposed to match "valid", but not...
UPDATE: I'm making progress, but this is hard!
The test text will be valid[REGEX_EMAIL|REGEX_PASSWORD|REGEX_TEST].
(The real life text is required|valid[REGEX_EMAIL]|confirmed[emailconfirmation]|correct[not in|emailconfirmation|email confirmation].)
([^|]+) saves REGEX_EMAIL, REGEX_PASSWORD and REGEX_TEST in an array.
^[^[]+\[ matche...
Can I load multiple language files for the same view in CodeIgniter?
...
Hello, I am working on a codeigniter site, in which a page is built using multiple views, I have come to a point where I need to work with a variable that is being set in another view is it possible to access it from another view?
This is code I have
Controller:
public function index() {
// $this->output->enable_profiler(TRUE);
...
I am creating a site where users can upload there own background images, after upload they see each background they uploaded in a menu represented by a number, clicking on the number will in theory load in the new background, however I have noticed that does this calls in the view again as well (the view is already loaded from another fu...
Hi
I have some CodeIgniter controllers which should only be accessed by users who have logged in (i.e. where $this->session->userdata('username') is not null). If a non-authenticated person attempts to access said controllers they should receive:
header('location: /auth/login');
There has got to be a better way to do this than to put...
Which is right? notice in the second option, I'm passing the form values using the $_POST variable. Whereas the first option, I call and assign variables for each form field.
I've seen this ...
<validation code> ....
$todo = array(
'name'=>$this->input->post('title'),
'description'=>$this->input->post('description')
);
$t...
Hi,
I wonder, what are the pros and the cons of these two approaches to access variables:
1) CodeIgniter -style (does this have a name?)
public function doSomething()
{
$database = $this->database; // or just $this->database
}
2) The Singleton pattern
public function doSomething()
{
$database = Framework_Database::getInstance();
...
I'd like to format a datetime entry stored in a SQL db in a friendly format.
I'm just returning a simple query as a row(date)...
Is there a quick/easy way to do this?
I can post examples, if need be.
Right now the query is in a foreach loop:
<?php print $row['exp_date']?>
...
I have the following controller and view. I am trying to learn jquery in codeigniter.
The code does not work. So I am hoping someone spot out what I am doing wrong and correct me.
Thanks in advance.
class PhpJqueryBook extends Controller
{
function __construct()
{
parent::Controller(); }
public function index()
{
... }
funct...
Hello,
I'm a heavy Codeignitor user and currently I have to build a page with extensive AJAX bits and pieces. I have been using JQuery all along the website and it's AJAX handling was perfect up until now. There is something that just doesn't feel right when i use a MVC with JQuery.
For example:
in Jquery I setup the callback URL easily...
Hello, I am trying to get some data from a database on the fly and place it into a div, currently my javascript file looks like this,
<script type="text/javascript">
$(document).ready(function() {
//accordians for when the AJAX loads the content
// hides the main_menu as soon as the DOM is ready
// (a little sooner than pag...
Because I thought of ajax posting my form to a specific function in my controller and do a sql-insert, but I want to stay on the same page. So is it necessary to load a view in the posted url (=destination)?
...
Elliot Haughin wrote a lovely library for using the twitter api
I got it up and running smoothly but I have an issue when using paged requests (cursors), for instance in statuses/friends.
If I do this:
$test = $this->twitter->call(’statuses/friends’, array(’id’ => ‘dennis_decoene’, ‘cursor’=>’-1′));
echo $test->next_cursor;
I get “1...
I'm having a tough time getting this to work. Maybe my logic is all wrong, but I figure someone with more experience can help me.
I have a page "http://domain.com/account/settings" where users can edit their account information. When the form submits, it triggers the "settings_save" method. All is fine if the form submits successfully, ...
I have a form that pulls data from a database.
Code works fine if it’s an input box but I can’t get the latest $_POST data for radio buttons.
This works for input text box. I get default values pulled from the DB on first load, and I can get the new input (if any) from the user modifies the input box on a failed validation.
<?php echo ...
$arr = $results->row();
$score = 0;
foreach ($arr as &$i) {
switch($i){
case ($i <= 4 AND $i >= 1):
$score += 1;
break;
case ($i < 8 AND $i > 4):
$score += 3;
break;
case ($i >= 8):
$score += .5;
break;
}
}
echo $score
This is my...
I have this format on links:
blah/link/11
where blah is the controller and link is a function inside it. But now I want to send a number in the querystring. In normal non-MVC way I would have done like this:
page.php?id=11
So what should I do for getting the eleven in my link function?
...
I have a xml declaration in top of my page like this
echo "<?xml version="1.0" encoding="ISO-8859-1" ?><rss version="2.0">";
and ?> in the echo seems like php thinks it's a closing statement or something. Am I missing something or is there some other workaround this?
By the way the page is a view in my codeigniter project, if th...