Welcome Guest, Not a member yet? Register   Sign In
  iframe
Posted by: El Forum - 09-25-2008, 02:58 AM - Replies (4)

[eluser]PHP Programmer[/eluser]
I want to use iFrame in my web application but I am unable to assign a path to that.

I am using:
<iframe src="jobs/ViewMap" name="mapView"></iframe>

I have a file ViewMap.php to be displayed in iFrame.

What should I write in 'src' to make it work?


  Screencast: The Advanced Form Handling Series
Posted by: El Forum - 09-25-2008, 02:57 AM - Replies (48)

[eluser]Colin Williams[/eluser]
This series lays out a standard approach to form handling in CodeIgniter that you can use again and again, keeping your controller methods clean, straight-forward and on-task. The series is broken up into 5 minute sections. I got through part 7 tonight and expect several more.

Here's what's available so far:

[url="http://www.thisloadview.com/afh_ci_part_1.swf"]Part I: Overview of the application[/url]

[url="http://www.thisloadview.com/afh_ci_part_2.swf"]Part II: Explaining the concept and principles of the approach[/url]

[url="http://www.thisloadview.com/afh_ci_part_3.swf"]Part III: Defining the form[/url]

[url="http://www.thisloadview.com/afh_ci_part_4.swf"]Part IV: Constructing the form view[/url]

[url="http://www.thisloadview.com/afh_ci_part_5.swf"]Part V: Setting up validation in the add() method[/url]

[url="http://www.thisloadview.com/afh_ci_part_6.swf"]Part VI: Handling errors and repopulating form fields[/url]

[url="http://www.thisloadview.com/afh_ci_part_7.swf"]Part VII: Saving the submitted data[/url]

UPDATE: [url="http://codeigniter.com/?ACT=51&fid=53&aid=7190_t53AR9PEbLv2sAWcgG6F&board_id=2 "]Download files[/url]

Coming up next, I'll look at how we can apply our methodology to the edit form, we'll look at handling other types of form controls (selects, radios, checkboxes), and finally we'll conclude everything and look ahead to CI 1.7's Form Validation library and see what implications it has on this proposed methodology.

Please excuse the mistakes, my voice, and anything you don't like (ha! when doesn't that make sense to request.)

Hope it helps some people out. Comments welcome!


  Custom validation function doesn't work.
Posted by: El Forum - 09-25-2008, 02:08 AM - Replies (4)

[eluser]loathsome[/eluser]
Hello,

I've tried this numerous times now, and I can never get the validation class to accept my custom rules. Take this example.

Code:
<?php

class Welcome extends Controller {
    
    function __construct()
    {
        parent::Controller();
    }
    
    function index()
    {
        $this->load->helper('form');
        $this->load->library('validation');
        
        $rules['name'] = 'mekk';
        $fields['name'] = 'username';
        
        $this->validation->set_rules($rules);
        $this->validation->set_fields($fields);
        
        if(FALSE == $this->validation->run())
        {
            $this->load->view('theform');
        }
        /**
         * the form won
         **/
        else
        {
            $this->load->view('success');
        }
    }
    
    /**
     * callback functions
     **/
    
    function mekk($input)
    {
        if($input == 'hello')
        {
            return true;
        }
        else return false;
    }
    
}

No matter what I type into the field, it goes through. I want it ONLY to validate if I write "hello".

Appreciate any help. Thanks a lot!


  Where to put classes of business logic?
Posted by: El Forum - 09-25-2008, 01:58 AM - Replies (16)

[eluser]meglio[/eluser]
If I have developed PHP class (for business logic) with my own constructor (with obligatory parameters), I can't put it to libraries because I then can't load it using

Code:
$this->load->library(...);

This code will raise warning:
Quote:Missing argument 1 for <MyClassName>::__construct(), called in...

Also I can't put this class to helpers - because CI documentation declares helper as collection of functions and not classes.

So where must I put my business logic objects?

P.S. ... answer or just direct me to another topic discussin similar question. Unfortunately I have not found any.

Thanks,
Anton


  More tutorials
Posted by: El Forum - 09-25-2008, 01:10 AM - Replies (5)

[eluser]Kikloo[/eluser]
Hi,

It would have been really helpful if more video tutorials or step by step instructions were there which would teach:

1. How to do a simple yet secure login (by username / password through db) in CI.
2. How to store / retrieve data from cookies / sessions.
3. Simple Templating in CI.

Thanks.


  CI does not load on Mediatemple GS
Posted by: El Forum - 09-25-2008, 12:10 AM - Replies (5)

[eluser]suprb[/eluser]
Hello everyone,

This is my first post.
I've been developing an application, fully tested on a dedicated server on Mediatemple.
Now, I need to move it to a Gris Server and with all config settings set up correct, i return this:

No input file specified.

when trying to access the site.

I've seen other having the same problem, http://ellislab.com/forums/viewthread/55620/ but i've tried all this with no luck.

Anyone who's on a GS and been having the same problem?


  How do i use Codeigniter or any existing library to generate pdf files using a blank pdf file
Posted by: El Forum - 09-24-2008, 09:59 PM - Replies (12)

[eluser]natleumas[/eluser]
Hi all, i'm new to this framework.

I am working on a project which requires me to

Open up a pdf file (think of it as a template) with all the logos and boxes done up.
Then put text into the pdf file using php and finally save it as a new pdf file.

Anyone have done something similar to this?

i think the closest library that i found is FPDF_TPL.

How do i set up FPDF in codeigniter?


  Sample Model/View/ Controler for inserting data?
Posted by: El Forum - 09-24-2008, 09:09 PM - Replies (1)

[eluser]slaction[/eluser]
I'm working on inserting some data into a database but I'm having trouble putting my model/view/controller together since I'm new to CI and OOP in general.

I can create the HTML form and send it back to a controller but I'm sort of lost from there.

I did watch the video tutorial for making a blog, but my form data doesn't match my database fields like it did in the tutorial so I can't use the same code.

I've looked at a few open source CI apps, but they seem to be doing so much that its hard to pick out the code I need.

Any help would be great. I'm just looking for a good starting point.


  sef urls issue when CI installed in sub directory
Posted by: El Forum - 09-24-2008, 08:15 PM - Replies (3)

[eluser]nvhack[/eluser]
my pages load correctly when I use a url like
http://localhost/ci/index.php?mytest
but not when I use urls like this
http://localhost/ci/mytest

It routes me back to
http://localhost/
not
http://localhost/ci/

I use XAMPP as my laptop server and I develop many sites from subdirectories So I really want it installed in the subdirectory.

Is there a way of fixing this? Perhaps via the route.php?

I have my base_url set

Code:
$config['base_url']= "http://localhost/ci/";

and have tried all of these options instead of AUTO
Code:
| 'AUTO'            Default - auto detects
| 'PATH_INFO'        Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'        Uses the REQUEST_URI
| 'ORIG_PATH_INFO'    Uses the ORIG_PATH_INFO


$config['uri_protocol']    = "AUTO";

my htaccess file is
Code:
RewriteEngine on
#RewriteBase /ci163     ## Tries this but no difference.

RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Any ideas?


  timestamp woes
Posted by: El Forum - 09-24-2008, 07:26 PM - Replies (1)

[eluser]jbads[/eluser]
Hi, I'm having trouble with some dates and hopefully someone could shed some light.

On my form users can enter 2 dates: the date that they would like their advertisment to become live on my website and a date for the event they are advertising.

This is the code in my controller for converting the input dates to timestamps:

Code:
$e_date        =     $this->input->post('event_date_day').'/'.$this->input->post('event_date_month').'/'.$this->input->post('event_date_year');
                $a_date        =    $this->input->post('active_date_day').'/'.$this->input->post('active_date_month').'/'.$this->input->post('active_date_year');    
                
                
                //$date is for activation date
                $date                    =            explode('/', $a_date);
                $a_timestamp            =            mktime(00,00,01,$date[1],$date[0],$date[2]);
                
                //x_date is for event date
                $x_date                    =            explode('/', $e_date);
                $e_timestamp            =            mktime(00,00,01,$x_date[1],$x_date[0],$x_date[2]);

If I echo out these variables. I get this:
Code:
print_r($a_date);
                print_r($date);
                print_r($a_timestamp);
                print_r($e_date);
                print_r($x_date);
                print_r($e_timestamp);

Quote:25/09/08 Array ( [0] => 25 [1] => 09 [2] => 08 ) 1222257601 04/12/08 Array ( [0] => 04 [1] => 12 [2] => 08 ) 1228302001

I would like to create a timestamp for 1 second past 12am on the date the user entered.
However when I put the generated timestamps into a timestamp converter I get
Wed, 24 Sep 2008 12:00:01 GMT (should be 25 sep 2008 00:00:01) and
Wed, 03 Dec 2008 11:00:01 GMT (should be 04 dec 2008 00:00:01)


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Do not use the CI 4 sessi...
by joho
7 hours ago
Codeigniter 4 Model set()...
by kenjis
11 hours ago
CI Builder Question
by InsiteFX
Yesterday, 10:56 PM
SecurityException Status ...
by kenjis
Yesterday, 03:50 PM
E-mail and UTF-8, mb_, et...
by joho
Yesterday, 07:13 AM
Shield validation questio...
by Codinglander
Yesterday, 07:07 AM
CI4 support MariaDB?
by joho
Yesterday, 07:06 AM
Using phpCas in CI4 (Comp...
by Zeff
Yesterday, 04:55 AM
where clause with order_b...
by kenjis
Yesterday, 01:55 AM
Transient support for Set...
by kenjis
Yesterday, 01:52 AM

Forum Statistics
» Members: 82,376
» Latest member: kharidsamak
» Forum threads: 77,479
» Forum posts: 375,531

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB