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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,330
» Latest member: Nome
» Forum threads: 67,790
» Forum posts: 423,540

Full Statistics

Latest Threads
A month passed after last...
Forum: Lounge
3 hours ago
» Replies: 8   » Views: 210
Save textarea content and...
Forum: General Help
3 hours ago
» Replies: 0   » Views: 20
Loading a SQL file to run...
Forum: General Help
4 hours ago
» Replies: 0   » Views: 12
Concept of OAuth login - ...
Forum: General Help
8 hours ago
» Replies: 1   » Views: 158
PHP 7.2 released
Forum: News & Discussion
8 hours ago
» Replies: 30   » Views: 15,349
Custom library available ...
Forum: CodeIgniter 4 Support
9 hours ago
» Replies: 2   » Views: 105
I have a problem
Forum: General Help
Yesterday, 11:33 AM
» Replies: 5   » Views: 1,731
join failed
Forum: General Help
Yesterday, 07:29 AM
» Replies: 3   » Views: 90
Documentation recommendat...
Forum: General Help
Yesterday, 05:18 AM
» Replies: 3   » Views: 124
A more efficient paginati...
Forum: Libraries & Helpers
Yesterday, 02:38 AM
» Replies: 2   » Views: 92

 
  SOLVED: CI + jQuery forms
Posted by: El Forum - 08-29-2007, 04:38 PM - Forum: Archived Development & Programming - Replies (3)

[eluser]stevefink[/eluser]
Does anyone have any experience with using jQuery forms within CI?

I have a really simple target: callback which works fine outside of CI:

Code:
$(document).ready(function() {
    // bind 'form2' and provide a simple callback function
    $('#form2').ajaxForm(function() {
        // Server should send data back in json encoding
        target: '#container'
    });  
});


all that should do is pop in the response of my script into <div id="container></div>. I'm not getting any errors, just not seeing updated content. My action method looks like this:

Code:
function photo_mod()
    {
        /**
         * Process photo modifications here. The form from photos_view.php
         * gets process in this method.
         */    
        echo  "<pre>DEBUG TEXT</pre>";
    }

Thanks all.


  Ajax Tabs: Loading views into containers!! Possible?
Posted by: El Forum - 08-29-2007, 04:37 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]danfloun[/eluser]
Hi,

I am wondering if I can use this Ajax tab script to work with my CI Project.
Basically all the Ajax script does is load the pages into the tab container.

Now obviously I am using model, containers and views and because of this my tab links will be written like &lt;?php echo site_url('main/file_view'); ?&gt; instead of simply file_view.php.

The rel="ajaxcontentarea" in lthe link simply loads the content of file_view into a container.

However this doesn't work and I'm wondering if it's actually possible to use this script this way! or with slight modification.

Tabs:

Code:
<ul id="maintab" class="shadetabs">
<li class="selected"><a href="#default" rel="ajaxcontentarea">Default Tab</a></li>
<li><a href="test.htm" rel="ajaxcontentarea">Test</a></li>
<li><a href="&lt;?php echo site_url('main/file_view'); ?&gt;" rel="ajaxcontentarea">File List</a></li>
</ul>

<div id="ajaxcontentarea" class="contentstyle">
<p>This is some default tab content, embedded directly inside this space and not via Ajax. It can be shown when no tabs are automatically selected, or associated with a certain tab, in this case, the first tab.</p>
<p><b><a href="[removed] expandtab('maintab', 2)">Select 3rd tab of "maintab"</a></b></p>
</div>


//Start Ajax tabs script for UL with id="maintab" Separate multiple ids each with a comma.
startajaxtabs("maintab")

Thanks

Danny


  is this a bug?
Posted by: El Forum - 08-29-2007, 04:24 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]alpar[/eluser]
I use sessions stored in a database, and enabled user agent matching.
Actually i had modified the original library to store all the data in the database, but i also checked the original library, and it seems that is the same.

when sawing the session id only 50 characters are saved like so

Code:
substr($this->CI->input->user_agent(), 0, 50)


Now imagine that the user agent is computed in such a way that the last character is a space. When you insert it in the database, MySQL will strip that off, inserting a string of length:49 characters. When re matching a string of 50 characters (with the last space) will not match a 49 character string(without it). So the session system gets useless for the user that is unfortunate enough to have such a user agent. I got one with suse linux 10.2 + firefox...

a solution: store and compare the md5 hash of the first 50 characters of the user agent.


  Nusoap in Code Igniter 1.5.4
Posted by: El Forum - 08-29-2007, 03:58 PM - Forum: Archived Development & Programming - Replies (19)

[eluser]Leonardo Radoiu[/eluser]
Hello!

After some hard time trying to figure out how I can implement nusoap library in 1.5.4 version I came up with a solution I want to share with all of you who came across the very same problem.

First, the nusoap library file that you must put in the system/libraries folder (we assume we have already there the nusoap base class named nusoap.php). I named this Nusoap_lib.php:

Code:
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Nusoap_lib
{
   function Nusoap_lib()
   {
       require_once(BASEPATH.'libraries/nusoap'.EXT);
   }
}
?&gt;

Let's say we have a nusoap webservice named MemberWSVC saved as a controller file named MemberWSVC.php:

Code:
&lt;?php
class MemberWSVC extends Controller {
    function __construct() {
        parent::Controller();
        
        $this->load->library("Nusoap_lib");
        
        $this->nusoap_server = new soap_server();
        $this->nusoap_server->configureWSDL("MemberWSDL", "urn:MemberWSDL");
        
        $this->nusoap_server->wsdl->addComplexType(
            "MemberRecordset",
            "complexType",
            "array",
            "",
            "SOAP-ENC:Array",
            array(
                "id"=>array("name"=>"id", "type"=>"xsd:int"),
                "firstname"=>array("name"=>"firstname", "type"=>"xsd:string"),
                "lastname"=>array("name"=>"lastname", "type"=>"xsd:string")
            )
        );    
        
        $this->nusoap_server->register(
            "selectMemberInfo",
            array(
                "id" => "xsd:int",
            ),
            array("return"=>"tns:MemberRecordset"),
            "urn:MemberWSDL",
            "urn:MemberWSDL#selectMemberInfo",
            "rpc",
            "encoded",
            "Get member's info"
        );
    }
    
    function index() {
        // this just expose webservice's methods. if you put this in every method of the webservice to describe it you won't get it to work because of some post/get issues i guess


        // this is a workaround for not having get params enabled in ci
        // usually you get the nusoap webservice's wsdl by appending "?wsdl" at the end of its url

        if($this->uri->segment(3) == "wsdl") {
            $_SERVER['QUERY_STRING'] = "wsdl";
        } else {
            $_SERVER['QUERY_STRING'] = "";
        }
        
        $this->nusoap_server->service(file_get_contents("php://input"));
    }
    
    function select_member_info() {
        function selectMemberInfo($member_id) {
            $CI =& get_instance();
            $CI->load->model("Member");
            
            $CI->Member->_id = $member_id;
                        
            $row = $CI->Member->selectMemberInfo(); // the method we use to retrieve member's info as array
    
            return $row;
        }
        
        $this->nusoap_server->service(file_get_contents("php://input"));
    }
}
?&gt;

Finally, we consume the webservice with a controller named Client.php:

Code:
&lt;?php
class Client extends Controller {
    function __construct() {
        parent::Controller();

        $this->load->library("Nusoap_lib");
    }

    function index() {
        $id = $this->uri->segment(3);

        $this->nusoap_client = new soapclient($this->config->item('base_url')."/webservice.php/MemberWSVC/select_member_info/wsdl");
        
        if($this->nusoap_client->fault)
        {
            $text = 'Error: '.$this->nusoap_client->fault;
        }
        else
        {
            if ($this->nusoap_client->getError())
            {
                $text = 'Error: '.$this->nusoap_client->getError();
            }
            else
            {
                $row = $this->nusoap_client->call(
                    'selectMemberInfo',
                    array($id),
                    'urn:MemberWSDL',
                    'urn:MemberWSDL#selectMemberInfo'
                );
                
                if(count($row) > 0 && is_array($row)) {
                    $text = "The member's name is ".$row['firstname']." ".$row['lastname'];
                } else {
                    $text = "There is no such member with ID ".$id;
                }
            }
        }

        etc.
    }
?&gt;

Let's say this client will be accesible at http://localhost/webservice.php/client/12345

That's it! I hope it works for you.


  Upload files with UTF characters
Posted by: El Forum - 08-29-2007, 03:28 PM - Forum: Archived General Discussion - Replies (4)

[eluser]Référencement Google[/eluser]
Hi,

Uploading a file with a name wich contains UTF-8 characters, let's say : Céà&erfd;-0215.jpg (test name, but I am french and some people in my country will use this characters in files)

Result of uploading such a file is : CéÃ_erfd-0215.jpg

As you see, CI already make some cleaning, but not enough for this characters.
Wich way do you think I should try (maybe a hack of the upload library) to clean the file name at upload time ?


  Form routing
Posted by: El Forum - 08-29-2007, 02:38 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]stevefink[/eluser]
Good afternoon, igniters!

Quick inquiry. I have a routed URL with the following semantics:

http://f1auto/console/addvehicle/photos/1

that's actually just controller->photoupload, method->uploads and $this->uri->segment(4) gives me access to the 1.

This page has a form on it. I'd like to process the form in something separate than the method->uploads, however I want the page to load back to the same URL.

What's my best bet for accomplishing this? Do I have to use redirect() and end up making the user go through two page refreshes to get to the proper URL?

I hope this isn't too confusing.

Thanks. :-)

- sf


  Blog system for CI?
Posted by: El Forum - 08-29-2007, 02:05 PM - Forum: Archived General Discussion - Replies (2)

[eluser]Unknown[/eluser]
Does anyone know of a blog system for CI? I looked at CIForge, but there didn't seem to be one.

... or does anyone have experience with embedding a standard blog system into a CI installation?

Thanks in advance
Henrik


  Help with SSL and .htaccess please!
Posted by: El Forum - 08-29-2007, 11:31 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]Oliver New[/eluser]
Hi,

I would like to have a couple of controllers on my site served via https - for example mysite.com/account and mysite.com/checkout.

My web server is capable of hosting both http and https files in the same web root so I'd like to take advantage of that rather than the alternative - which as I see it would be to have a separate https directory and therefore a separate install of CI in it.

So I guess this should be possible via mod_rewrite in the .htaccess file? I've looked around for a few examples but I'm getting nowhere. I'm using a pretty standard .htaccess at the moment:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|common_funcs\.js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I'd be very grateful for any ideas!


  [SOLVED] how to access $config['base_url'] in my controller?
Posted by: El Forum - 08-29-2007, 09:50 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]ppeemm[/eluser]
just a quick one: I need to store the URL of a picture in my database and I am wondering if I can access this config variable here ($config['base_url']) which contains the begining of the URL?

if so, can can I do that from my controller?

cheers


  Implementing a mail system like RoundCube etc.
Posted by: El Forum - 08-29-2007, 09:37 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]tobben[/eluser]
Hello,

have anyone successfully implemented some sort of mail system/application into CI?

For example RoundCube. RoundCube project



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.