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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,171
» Latest member: paolooo
» Forum threads: 66,432
» Forum posts: 416,949

Full Statistics

Latest Threads
Filename: libraries/Sessi...
Forum: General Help
1 minute ago
» Replies: 3   » Views: 60
Pagination only displays ...
Forum: General Help
4 hours ago
» Replies: 2   » Views: 56
share data between server...
Forum: Best Practices
5 hours ago
» Replies: 8   » Views: 169
CI & NGINX with PHP-FPM -...
Forum: Installation & Setup
9 hours ago
» Replies: 1   » Views: 65
Error with complex Oracle...
Forum: General Help
Yesterday, 03:30 PM
» Replies: 16   » Views: 464
What is the best IDE for ...
Forum: Installation & Setup
Yesterday, 01:45 PM
» Replies: 24   » Views: 12,361
Moving everything from ro...
Forum: Installation & Setup
Yesterday, 01:36 PM
» Replies: 7   » Views: 677
Performance Problem [solv...
Forum: General Help
Yesterday, 01:12 PM
» Replies: 17   » Views: 278
Best estimates on 3.x LTS...
Forum: Choosing CodeIgniter
Yesterday, 01:11 PM
» Replies: 2   » Views: 74
What should we call the C...
Forum: CodeIgniter 4 Development
Yesterday, 11:29 AM
» Replies: 16   » Views: 343

 
  I think the code is correct. But.........
Posted by: El Forum - 06-23-2007, 12:12 AM - Forum: Archived Development & Programming - Replies (1)

[eluser]java[/eluser]
Here is my code in processing file upload :
Controller:

Code:
class Ungxu extends Controller
{
  function Ungxu()
{
    parent::Controller();
    $this->load->model('tintuc_model','tintuc');
    $this->load->helper('form','url');
}
}
function index()
{
       $this->load->view('ungxu', array('error' => ' ' ));// pass error argument
       // attach file upload (if have)
            
            if(isset($_POST['filename']))
            {
                $this->doUpload();
                $this->email->attach('/uploads/folder/$file_name');
        }
}
function doUpload()
    {
        $config['upload_path'] = '/uploads/ungxu/';
        $config['allowed_types'] = 'doc|txt|rar';
        $config['max_size']    = '100';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';
        
        $this->load->library('upload', $config);
            
            if ( ! $this->upload->do_upload())
            {
                $error = array('error' => $this->upload->display_errors());
                $data['content'] = $this->load->view('dangky', $error, true);
            }    
            else
            {
                $upload_data = $this->upload->data();
                $filename = $upload_data['file_name'];
            }

    }
and view:
Code:
<tr>
&lt;?=$error;?&gt;
    &lt;?=form_open_multipart('ungxu/doUpload'); ?&gt;

      <td style="width: 198px">
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Tài liệu đính kèm</td>
      <td>&lt;input name="filename" type="file" id="filename" /&gt; (Tối đa 1MB)</td>
</tr>
<tr>
    <td align="center" colspan="2">
     &lt;input type="submit" name="submit" value="Gửi" id="send" style="width:70px;"
&lt;input type="reset" value="Làm lại" /&gt;                            
    </td&gt;
</tr>
   </table>                
  &lt;/form&gt;
My idea is if a visitor upload a file and webpages will automatically attach file to send mail. But when i try it, an error generated:
Quote:An Error Was Encountered
Unable to load the requested language file: language/upload_lang.php
My code have some problems? Please tell me how can resolve it? Thank you..


  Interfacing to a Windows web service advice
Posted by: El Forum - 06-22-2007, 10:36 PM - Forum: Archived General Discussion - Replies (4)

[eluser]Pete Smith[/eluser]
Forgive me if this has been discussed. Some of the terms are used in so many ways that I'm finding searching to be problematic.

I'm building a shopping cart that has to authorize a credit card against a pre-determined Web Payment Service (EFSNet, to be precise). I have 3 options: SOAP, XML, or Name/Value Pairs. The server I'm going to be running on has PHP 4, so I can't use PHP's SOAP Extension. I've heard of nuSOAP but I don't know if it's still being developed and I'm not sure its secure enough to be sending credit card data back and forth with. Thoughts on that?

XML seems promising and I was wondering if there's a way to somehow use the XML-RPC Class to send and receive XML files, perhaps by modifying the code somehow? The only example EFSNet provides (they're clearly a MS shop) uses COM:

Quote:This sample demonstrates an XML POST using the XMLHttpRequest object
found in Microsoft® XML Parser (MSXML), version 3.0 or higher. The example
provided is written in Visual Basic; however, this can be used from any language
that supports Component Object Model (COM) objects.

DOMDocument XML POST Example
Code:
‘ Note: Add project reference to Microsoft XML, Ver 3.0 or 4.0
Dim sXML As String
Dim iDocument As New MSXML2.DOMDocument
Dim iHttp As New MSXML2.XMLHTTP30
sXML = "<Request StoreID='myStoreID'" & _
" StoreKey='myStoreKey'" & _
" ApplicationID='EFSnet samples 1.0'>" & _
"<SystemCheck/>" & _
"</Request>"
iHttp.Open "POST", "https://test.testserver.com/test.dll",
False
iDocument.async = False
iDocument.loadXML sXML
iHttp.Send iDocument
MsgBox iHttp.responseText

Is there a clean way to send/receive XML using CI?

Last is the CGI, Name/Value pairs option which feels like it'd be messy, but maybe CI helpers could make it easier? Is an https GET secure enough that I should be comfortable doing it? Here's what the spec guide has to say:
Quote:Example of Name/Value Pair Send (HTTPS GET)
https://test.testsite.com/
test.dll?Method=SystemCheck&StoreID=myStoreID&StoreKey=mykey&ApplicationID=Test+samples+1&#x2e;0

Example of Name/Value Pair Reply
ResponseCode=0&ResultCode=001&ResultMessage=ON+LINE

I'm sorry if this all sounds a little vague. I've been researching myself into circles to the point where its all a blur. I just need a kick in the butt to send me looking in the right direction. (This is the first time I've ever done anything like this in PHP, let alone in CI. I could do it in Tcl! Much good that does me these days... Smile )


  Troubles with PostgreSQL
Posted by: El Forum - 06-22-2007, 09:53 PM - Forum: Archived General Discussion - Replies (4)

[eluser]hrundel[/eluser]
Hi, all. I'm not long ago begin to use CodeIgniter, it's nice and light for understanding framework.
But when I face to some troubles when I try to work with postgresql.
I edited database.php as needed and when loading database library thereis no errors i.e. connecting and selecting database passed successfully, but such construction

Code:
$query = $this->db->query("SELECT * FROM some_table");
echo "<pre>";
var_dump($query);
echo "</pre>";
return empty result_array, although some_table not empty. I'm use latest version of codeigniter and version of postgresql sever is 8.0
Doe's enybody know reason of my trouble.
Thanks.


  Sessions....... :(
Posted by: El Forum - 06-22-2007, 08:33 PM - Forum: Archived Development & Programming - Replies (3)

[eluser]Unknown[/eluser]
I am taking a stab at CI, and I have hit a bit of a wall. I created a user login function in my user controller, and it works dandy right up until I navigate away from the landing after sucessfully authenticating. My sessions disapear.


I will be using sessions to secure pages, so if your session user id value is not populated then you will be redirected to log in. Anyhow here is what I have.

Code:
function login()
    {


    $this->load->library('validation');
        $this->load->helper('url');
    $this->load->library('session');

    if($_POST['username'])
    {
        $this->load->database();
            $query = $this->db->query("SELECT * FROM users WHERE username = '".$_POST['username']."' and password = '".md5($_POST['password'])."'");
        
        if($query->num_rows() > 0){
            //return true;
            $status = "0";
            
             foreach ($query->result() as $row)
                 {
                 $username = $row->username;
                 $id = $row->id;
            
                }
            
            $sid = array('id' => $id);
            
            
            $this->session->set_userdata($sid);
            $data['goodz'] = $this->session->userdata('id');
            $data['status'] = $status;
            }
                
                else {
                    $status = "1";
                    $data['status'] = $status;
                    $data['goodz'] = $this->session->userdata('id');
                    }    
        }
$this->load->view('login_vals',$data);
    }


  IIS + CI Problems!
Posted by: El Forum - 06-22-2007, 07:49 PM - Forum: Archived Development & Programming - No Replies

[eluser]Roosevelt![/eluser]
Hi there,
Recently I started to test out my CI products in IIS Server environment, and I noticed this problem. And I really hope somebody can help me solve this problem Smile.

If I visit CI Application homepage like (http://localhost/ci/) by not modifying config.php file, I get 404 Page Not found error.

Then if I change $config['uri_protocol'] = "AUTO"; to $config['uri_protocol'] = "PATH_INFO";

The welcome page loads just fine Smile.

However, if I visit http://localhost/ci/index.php/welcome, it doesn't work Sad. The error HTTP Error 502.2 - Bad Gateway by IIS.

Any ideas on how to fix this other than using query strings? I LOVE FRIENDLY URLS! Sad.


  How to effectively search in the userguide?
Posted by: El Forum - 06-22-2007, 02:05 PM - Forum: Archived General Discussion - Replies (13)

[eluser]baZzz[/eluser]
Hi all,

As a n00b to CI (and frameworks in general) I'm relying heavily on the (excellent) user guide. However, using it search function will almost always give me just 1 result in Google and that one is the change log. That's not helping me a lot, so is there another way of searching the user guide more effectively? (Or should I built a CI app for it? ;-) )


  modrewrite users
Posted by: El Forum - 06-22-2007, 01:04 PM - Forum: Archived Development & Programming - No Replies

[eluser]Unknown[/eluser]
is there anyway to mod rewrite users names? im trying to work out a social networking site.


  URL via javascript into CodeIgniter
Posted by: El Forum - 06-22-2007, 10:29 AM - Forum: Archived General Discussion - Replies (4)

[eluser]Doncqueurs[/eluser]
Hi,

I ran into a little problem and couldn't really find an answer in this forum. It seems like there has been a closely related issue a year ago, but unfortunately that didn't help me to solve the problem.

I try to do the following. With this piece of javascript I would like to add url and sitename to my application.

Quote:java_script:location.href='http://localhost/index.php/bookmarks/add/'+encodeURIComponent(location.href)+'/'+encodeURIComponent(document.title)

(bookmarks is the controller and add the function within the controller)
(Of course java_script should be javascript but I am not allowed to use that word in this forum (or at least it gets automatically removed)

This results in the following URL:

Quote:http://localhost/index.php/bookmarks/add/http&#x3A;&#x2F;&#x2F;www.codeigniter.com&#x2F;/CodeIgniter%20-%20Open%20source%20PHP%20web%20application%20framework

On the receiving end I have this script:
Quote:&lt;?php
class Bookmarks extends Controller {

function add($url, $name){ //
echo "URL: " . $url ."<br />";
echo "Name: " . $name;
}
}
?&gt;

If things were working fine this would display something like:
Quote:URL: http://www.codeigniter.com
Name: CodeIgniter

Instead I get:
Quote:Not Found

The requested URL /collaboration/index.php/bookmarks/add/http://www.codeigniter.com//CodeIgniter - Open source PHP web application framework was not found on this server.

Apache/1.3.33 Server at powerbook.local Port 80

Conclusion, it seems that CodeIgniter decodes the javascript urlencoded before it is told to do so. This results in requesting a URL that doesn't exist. Is there anybody who found a way to work around this?

Thanks, Jochem

PS. I tried to give full information I hope that I succeeded in it. In case you miss something please drop me a note. (I use a recent - last two weeks - download - last two weeks - of CodeIgniter).


  ociserverversion() error
Posted by: El Forum - 06-22-2007, 09:22 AM - Forum: Archived Development & Programming - No Replies

[eluser]phpworker[/eluser]
Hi there and thanks for Code Igniter framework! It's great :O

Here is my problem:

For about 2 days I am fighting with (suppose silly) error message that obstinately appears on the screen. This is the msg:

Code:
An Error Was Encountered

Unable to connect to your database server using the provided settings.

I am trying to connect with Oracle db using oci8 driver. I tested the connection on the same server with strip php code and I see another message:

Code:
Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries in /usr/local/apache2/htdocs/krzysztofk/oracle.php on line 42

from time to time there's no error from oracle.php file at all and data is received from database.

Here is my oracle.php file source:

Code:
&lt;?php
$active_group = "default";

$db['default']['hostname'] = '(DESCRIPTION =
           (ADDRESS =
        (PROTOCOL = TCP)
        (HOST = 192.168.99.109)
        (PORT = 1521)
        (HASH =1111)
     )
         (CONNECT_DATA =(SID = devtst))
     )';
$db['default']['username'] = "ap";
$db['default']['password'] = "ap";
$db['default']['database'] = "devtst";
$db['default']['dbdriver'] = "oci8";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['active_r'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
?&gt;

$db['default']['hostname'] value is taken originally from tnsnames.ora config file.

I also connect with db using Oracle PL/SQL Developers (from my computer) and everything is OK.

We have apache server on Fedora Linux and oci8 is already activated there.

I understand that this is Oracle-like problem and maybe I am knocking on wrong door, but if you see any solution here, please help!

We are planning to reinstall the server next week, so I want to be sure we do not get this error next time.

Thanks for your help!


  news story titles in urls
Posted by: El Forum - 06-22-2007, 08:54 AM - Forum: Archived Development & Programming - Replies (7)

[eluser]adrian westlake[/eluser]
I have been doing the tutorials, including the one to create a simple blog. At the moment the urls, use the unique id field as the last segment to point to the blog story. However, sites like digg seem to use the title of the story as the last segment in the url. How is this possible, bearing in mind the title is not a unique identifier?



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