Welcome Guest, Not a member yet? Register   Sign In
  Rerouting a function or changing its url
Posted by: El Forum - 04-22-2008, 12:10 PM - Replies (5)

[eluser]Zac G.[/eluser]
Hi,

I have a function that logouts out a user. I would like it to send the user back to the homepage after they logout. How would I do this? Or can I change the url from site/logOut to just site after the logOut function runs?

I think this should be a pretty simple process, but I am a new to working with CI and not sure how to do this.

Thanks!


  Kohana 2.1.1 vs CodeIgniter 1.6.1
Posted by: El Forum - 04-22-2008, 12:06 PM - Replies (51)

[eluser]Unknown[/eluser]
Hi everyone,
I'm pretty much in a little dilemma right now. I'm writing an enterprise-level software application that will be deployed on the internet on a subscription basis. I'm debating between using Kohana and CodeIgniter. Here's what I have come up with:

Kohana 2.1.1 PRO
- Fast(er)
- Community-based
- Strict PHP5 + OOP
- Retention of GET/etc
- namespace normality
- builds in Forge, Markdown, HTML Pur, etc.

Kohana 2.1.1 CON
- Rapidly changing, code must be updated per every update
- Scraps tons of CodeIgniter functionality
- Will scrap future CodeIgniter functionality (as per fork)
- Not sure if you can carry over CI functionality over to Kohana if needed

CodeIgniter 1.6.1 PRO
- More functionality
- Updates and new features, etc
- Company-based (is this a pro?)

CodeIgniter 1.6.1 CON
- Slower? (not sure)
- Still needs to retain PHP4 legacy code
- Not PHP5 strict OOP

What do you guys think I should go with? Thanks!


  How to load a 3rd party library -> scope problems??
Posted by: El Forum - 04-22-2008, 10:01 AM - Replies (2)

[eluser]andjules[/eluser]
I'm having problems with the PHP library for the scribd api (follow the client libraries link).

When I run commands against the library OUTSIDE of CI, it performs fine. When I try to incorporate it inside CI and call it from a controller, I get undefined variable and undefined index PHP errors (it's definitely finding the library, instantiating the class, etc. as the errors are dealing with the XML response from Scribd). I'm not sure how the scope changes inside CI, so I was wondering if anyone might be able to explain that to my not-so-smart brain ;-)

[Interestingly, I was able to include some other Zend Framework libraries with no problems, using the 'lazy' method (create a helper that simply defines the base path, load the helper, then do a require once of the file)]

my controller code looks something like:

Code:
function scribd() {
            $this->load->helper('scribd');
            require_once "Scribd/scribd.php";
            // also tried: load_class('Scribd', FALSE);
            $scribd_api_key = "XXXYYYYXXXXYYY"; //add your own!
            $scribd_secret = "sec-123456789uvwxyz"; //add your own!
            $scribd = new Scribd($scribd_api_key, $scribd_secret);
            $newdoc = $scribd->getList();
            print_r($newdoc);
    }

the part of the Scribd library that deals with the response looks like this (note the author's comment... something's not quite right):
Code:
if($result['stat'] == "ok"){
                
                //This is shifty. Works currently though.
                $result = $this->convert_simplexml_to_array($result);
                if(urlencode((string)$result) == "

" && $this->error == 0){
                    $result = "1";
                    return $result;
                }else{
                    return $result;
                }
            }

and the convert_simplexml_to_array function from the Scribd library (the PHP errors trace to the "if($arr[$k]){" line):
Code:
public static function convert_simplexml_to_array($sxml) {
        $arr = array();
        if ($sxml) {
          foreach ($sxml as $k => $v) {
                if($arr[$k]){
                    $arr[$k." ".(count($arr) + 1)] = self::convert_simplexml_to_array($v);
                }else{
                    $arr[$k] = self::convert_simplexml_to_array($v);
                }
            }
        }
        if (sizeof($arr) > 0) {
          return $arr;
        } else {
          return (string)$sxml;
        }
    }
Thanks is advance for considering.


  Object : Class not found
Posted by: El Forum - 04-22-2008, 09:23 AM - Replies (18)

[eluser]TDSPower[/eluser]
Hello the CI'boyz,

I work on a project for my studies.

I have two classes :

Code:
class Visiteur extends Controller

Code:
require_once('visiteur.php');
class Membre extends Visiteur {
        public $id_membre;
        public $login;
        public $password;
        public $status;
        public $email;

I would like to create a Membre Object in the Visiteur class (when the visitor login).

So i put this :
Code:
$lemembre = new Membre();

And I have this error :
Quote:Fatal error: Class 'Membre' not found in Q:\wamp\www\deezer\system\application\controllers\visiteur.php on line 157

Thanks a lot,

François


  Add start to debug log (using tail)
Posted by: El Forum - 04-22-2008, 08:32 AM - Replies (5)

[eluser]louis w[/eluser]
I am using tail so that I can watch the debug execute live in the terminal so I do not have to keep opening it.

Code:
tail -f 100 log-2008-04-22.php

I would like to add a debug message at the very beginning (or end) of the CI chain of log message so that I can easily see where the latest request started.

What would be the best way to do this without hacking the core.


  Access config from another
Posted by: El Forum - 04-22-2008, 08:26 AM - Replies (4)

[eluser]louis w[/eluser]
Can I access the site config (/config/config.php) from the database config?


  Form action is resulting in 404 [Nevermind, Issue Resolved]
Posted by: El Forum - 04-22-2008, 07:24 AM - Replies (1)

[eluser]Razz[/eluser]
Alrighty. Another problem with my dabblings in CI.

Iʻm trying to pass info from a form to a function located in my home.php controller.

Form: (localhost/CodeIgniter/index.php/home/edit/8

Code:
<?php echo form_open('home/modify_info');?>

(manual sql query up here)

<?php echo form_hidden('user_id', $this->uri->segment(3));?>

<p> First Name: &lt;input type="text" name="FirstName" value="&lt;? echo $row-&gt;FirstName;?&gt;"/></p>
<p> Last Name: &lt;input type="text" name="LastName" value="&lt;? echo $row-&gt;LastName;?&gt;"/></p>
<p> Email Address: &lt;input type="text" name="Email Address" value="&lt;? echo $row-&gt;Email;?&gt;"></p>
<p> &lt;input type="submit" value="Update Profile"/&gt;</p>

&lt;/form&gt;

and Controller:
Code:
&lt;?php
class Home extends Controller   {
        function Home(){
             parent::Controller();
             ......
             ....
             ..
        }

        function index(){
             .....
             ...
             .
        }
        function edit(){
             .....
             ...
             .
        }
    function modify_info()
    {    
        echo 'this function displays a 404';
    }
...

and my browsers throws a 404 whenever i visit
http://localhost/CodeIgniter/index.php/home/modify_info and every other one of my functions work fine.

Note: iʻm following the CI screencasts on codeigniter.com exactly, except for the changes in form and names on the most recent CI. anyone catch any blatant errors of mine?


  [resolved] Weird Character Set Issue
Posted by: El Forum - 04-22-2008, 07:12 AM - Replies (1)

[eluser]kevinprince[/eluser]
Hey,

Ive got an odd character issue, ive built a newsletter builder which fetches an RSS feed and integrates into a HTML template.

The problem im having is this:

Code:
[b]Altek launches world’s first integrated GPS sat nav camera[/b]

Altek has introduced a satellite navigation digital camera with integrated GPS and DSC functionalities.

CI is set to use UTF-8 and the RSS feed is also in UTF-8 format.

Help please Smile


  Active Record Insert not escaping values? [solved]
Posted by: El Forum - 04-22-2008, 06:34 AM - No Replies

[eluser]bapobap[/eluser]
Hi there,

I'm trying the following SQL insert:

Code:
$this->db->set('user_location_text', $this->input->post('location'));
$this->db->set('addr_text', $xml->AddressFriendly);

which generates:

Code:
INSERT INTO `location` (`user_location_text`, `addr_text`) VALUES ( 'Dublin', Dublin, OH, USA)

Usually this would be no problem but because the "Dublin, OH, USA" is not escaped in the generated SQL query, the value count is greater than the column count.

I'm aware that AR is supposed to escape these values automatically but it doesn't seem to be happening. Is there something else I should be doing?

I've turned magic quotes off in both php.ini and in .htaccess. I'm thinking there may be something else, as I changed my PHP installation from the Apple default to the Entropy one, for Imagemagick support. Maybe there is another setting that should be off?

Thanks if you can help!

[Edit] Was an object rather than a string. Doh


  has anyone successfully integrated PHPBB 3 and CI?
Posted by: El Forum - 04-22-2008, 05:58 AM - Replies (2)

[eluser]ICEcoffee[/eluser]
Hi all

Before embarking on my first project built using the CodeIgniter framework, I'd like to know if anyone has successfully integrated PHPBB 3 (or vBulletin) and CI?

There are a number of threads that discuss this point, but nobody seems to have made any conclusive statements to say if they have or have not, managed to have them integrated and fully functional.

If someone has managed it, is there a tutorial/howto/roadmap?


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

Username
  

Password
  





Latest Threads
Codeigniter4 version 4.5....
by kenjis
5 hours ago
SQL server connection not...
by kenjis
5 hours ago
Problem with session hand...
by kenjis
5 hours ago
Is it possible to go back...
by kenjis
5 hours ago
Cannot access protected p...
by xsPurX
7 hours ago
Update to v4.5.1, same us...
by xsPurX
Today, 08:31 AM
How to use Codeigniter wi...
by kenjis
Today, 05:06 AM
CVE-2022-40834 SQL Inject...
by kenjis
Today, 03:44 AM
Retaining search variable...
by pchriley
Today, 03:15 AM
Disable debug output in v...
by groovebird
Today, 02:26 AM

Forum Statistics
» Members: 85,389
» Latest member: cafethethaocom
» Forum threads: 77,581
» Forum posts: 376,007

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB