Welcome Guest, Not a member yet? Register   Sign In
  Controller flow when processing forms
Posted by: El Forum - 10-17-2008, 02:17 PM - Replies (3)

[eluser]vendiddy[/eluser]
Hi all! Is there a standard way that form processing is implemented in CodeIgniter? Here are the high-level steps I have in mind:

1. Display empty form
2. Submit
A. If there are validation errors, redisplay the form with the errors.
B. If there are no validation errors, display a success page.

How would I set up my controller methods? Would I have one method to display the view and another method to process the view? (Or would both go in the same method?)

Btw, I already know the basics of CodeIgniter (including the validation library).

Thanks!


  Messed with page IDs, can't fix, help?
Posted by: El Forum - 10-17-2008, 02:08 PM - No Replies

[eluser]Unknown[/eluser]
Hey all...

Basically I accidentally edited one of my pages' ID within CodeIgniter because I was making a clumsy attempt to have CI recall my pages as (for example) www.your-site.com/index.php/products/shoes/shoes.htm instead of the default www.your-site.com/index.php/products/shoes/123. (The ID was a number and i tried to change it to a word...) Now none of my page IDs can be recalled and the site is down, I'm fairly new to PHP so hopefully this is an easy fix... any help is greatly appreciated, thanks!


  I like CI but I am Scared! :(
Posted by: El Forum - 10-17-2008, 11:28 AM - Replies (6)

[eluser]Kikloo[/eluser]
Hi,

I am working on a php project which was developed by someone else long time back...which is being used till date, but then I decided to re-write the whole thing with bug fixed etc. so I started and making it, and adding new advanced features etc like seo url's and what not.

When I was doing this suddenly I felt that instead of using native php functions I should be using something easy yet powerful and I found CI. I tried the demo video tutorial and I was quite impressed with the features it has to offer.

Now the thing is that I am good with php's native function and CI is completely a new thing for me as I barely work/worked with functions etc. So I am scared to use CI. What if I stuck somewhere while developing the project, my all hard-work and time will be wasted.

So what should I do ?

1. Will someone be here to help when I am stuck with some part of coding ?
2. How CI deals with sql injections, will my application be protected ?
3. I don't know how to use Sessions in CI. What to do about it ? My application is all based on php sessions.

Please help.

Thanks.


  + in post?
Posted by: El Forum - 10-17-2008, 10:30 AM - Replies (5)

[eluser]gRoberts[/eluser]
Hi all,

My client has just asked why when he uses an ajax feature i've implemented that it doesn't remember +'s?

The content is escaped prior to being sent and using firebug, it is still there when i call open (ajax) but when its received in the controller and parsed using the input->post (with and without xss), it converts the + to a single space.

Any idea's on how i can overcome this?

Cheers


  in praise of user summer student
Posted by: El Forum - 10-17-2008, 10:00 AM - Replies (4)

[eluser]dorjeduck[/eluser]
Just realized that I am also called summer student here.

The last two days (my first two codeigniter days) I was quite impressed that Mr/Ms summer student seems to be a quite active person here, all the posts I looked at he was involved with. Smile

That reminds me of some guy during university time who mentioned in a speech the researcher "et al", properly some Arabian researcher who seems to have published in many fields but our beloved speaker added that he couldn't find out more details about this outstanding person.

Thanks to summer student anyway

martin


  New CI project launched
Posted by: El Forum - 10-17-2008, 09:47 AM - Replies (1)

[eluser]jstrebel[/eluser]
Did this in about 12 hours with CI 1.6.3 and some libs I had lying around.

http://bestcostumeever.com/


  is CI being regularly developed?
Posted by: El Forum - 10-17-2008, 09:23 AM - Replies (3)

[eluser]ICEcoffee[/eluser]
Hi all
Apart from bug fixes, is CI being regularly developed? NEW classes ie ORM etc?


  Get name of controller from view (without passing it as a variable)
Posted by: El Forum - 10-17-2008, 09:14 AM - Replies (4)

[eluser]blasto333[/eluser]
Is there a native way to get the name of the controller from within a view?


  Google Website Optimizer and CodeIgniter
Posted by: El Forum - 10-17-2008, 09:06 AM - Replies (5)

[eluser]Andreas Krohn[/eluser]
I want to use Google Website Optimizer to do A/B and multivariable tests on one of my sites in order to improve clickthroughs etc. To be able to do a test in website optimizer I need to define a conversion page, ie the goal page I want people to go to. This page has to be an existing web page and can not be defined by a regular expression. Unfourtunatly the goal page is on the format domain.com/redirect/XYZ, where XYZ is a variable that tells my system where to redirect my users to. That means that I really need the pattern domain.com/redirect/.* for my conversion page, but as I just mentioned this is not supported by website optimizer.

My options as I see are:
- to start using GET parameters, ie domain.com/redirect.html?target=XYZ, which is frowned upon by CodeIgniter.
- to reach the redirect page via a form submitt and set XYZ in a POST parameter, damn complicated since this would require changes in a lot of places in my system
- using a cookie to set/get XYZ
- or to not use Google Website Optimizer and live with pathetic click through rates

Have anyone used CodeIgniter and Website Optimizer together and can share the experience?
Does somebody smarter than me have some other idea of how I can solve this?


  Redundant or Safer?
Posted by: El Forum - 10-17-2008, 08:56 AM - Replies (6)

[eluser]Jesse Schutt[/eluser]
Hello All,

I am collecting info from a form and posting it to my db using the following code. It occurred to me that the $post_data array that I have created might be redundant. Should I pass the _POST array to the model instead of writing my own $post_data array?

Code:
if ($this->validation->run() == FALSE)
        {
            $this->load->view('wt08/wt08_view');
        }                                
        else
        {
        
        $post_data = array(
            'first_name' => $this->input->post('first_name'),
            'last_name' => $this->input->post('last_name'),
            'gender' => $this->input->post('gender'),
            'address' => $this->input->post('address'),
            'city' => $this->input->post('city'),
            'state' => $this->input->post('state'),
            'zip' => $this->input->post('zip'),
            'camper_email' => $this->input->post('camper_email'),
            'birthdate' => $this->input->post('birthdate'),
            'age_at_time_of_camp' => $this->input->post('age_at_time_of_camp'),
            'first_time_camper' => $this->input->post('first_time_camper'),
            'father_guardian' => $this->input->post('father_guardian'),
            'mother_guardian' => $this->input->post('mother_guardian'),
            'home_phone' => $this->input->post('home_phone'),
            'cell_phone' => $this->input->post('cell_phone'),
            'parent_email' => $this->input->post('parent_email'),
            'church_group' => $this->input->post('church_group'),
            'buddy_1' => $this->input->post('buddy_1'),
            'buddy_2' => $this->input->post('buddy_2'),
            'payment_pref' => $this->input->post('payment_pref'),
            'payment_received' => '0',
            'timestamp' => date("Y-m-d-h-i-s"),
            'additional_notes' => $this->input->post('additional_notes', TRUE)
            );


            $this->load->model('wt08/wt08_model', '', TRUE);
            $this->wt08_model->add_participant($post_data);

In other words, is this better practice? Is it safe?

Code:
if ($this->validation->run() == FALSE)
        {
            $this->load->view('wt08/wt08_view');
        }                                
        else
        {
        
            $this->load->model('wt08/wt08_model', '', TRUE);
            $this->wt08_model->add_participant(_POST);

Thanks in advance!

Jesse


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

Username
  

Password
  





Latest Threads
Heads up for users using ...
by davis.lasis
1 hour ago
curl + response body
by okatse
2 hours ago
Tool bar not showing
by grimpirate
3 hours ago
The Hidden Cost of “Innov...
by fcoder
10 hours ago
tool bar not showing
by InsiteFX
Yesterday, 09:09 PM
Validation does not appea...
by grimpirate
Yesterday, 01:55 PM
Block IP addresses of bad...
by grimpirate
Yesterday, 01:47 PM
Override Router
by grimpirate
Yesterday, 01:30 PM
CodeIgniter.com - Report ...
by Vikas Mehta
06-30-2025, 10:30 AM
best way to store tokens ...
by ahallrod
06-30-2025, 10:03 AM

Forum Statistics
» Members: 154,366
» Latest member: Michal788
» Forum threads: 78,436
» Forum posts: 379,709

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB