Welcome Guest, Not a member yet? Register   Sign In
  ModRewrite for Lighttpd?
Posted by: El Forum - 05-27-2008, 05:45 AM - Replies (5)

[eluser]Philip Pryce[/eluser]
Does anyone have a clue how to make ModRewrite work in Lighttpd, i've got the module installed, but i'm not sure how to layout the .htaccess file.
I'm also not the greatest with Regular Expressions, so if someone could translate the default Apache 2 one into a Lighttpd one that would be amazing.

Thanks, Phil


  Help required with Update statement
Posted by: El Forum - 05-27-2008, 05:41 AM - Replies (2)

[eluser]fusionblu[/eluser]
I am updating a row only if a certain column is null. I am using the null check in the SQL statement.
My statement is -

Code:
$query = $this->db->query("update t_temp_topics set verified_date=now() where id=10 and token='mytoken' and verified_date is null");

I need to check how many rows ( 1 or 0) were updated and perform some actions. In the above case the result ($query) is always 1 even if the update statement did not update any rows.
How do I check for 'no rows updated' condition ?
Thanks.


  backup to variable don't work
Posted by: El Forum - 05-27-2008, 04:18 AM - Replies (6)

[eluser]Chalda Pnuzig[/eluser]
Hi all,
I have this code:

Code:
function backup(){
    $this->CI =& get_instance();
    $this->CI->load->dbutil();
    $this->CI->load->helper('file');
    $backup = & $this->CI->dbutil->backup();
    $filename='backup/db.'.date("YmdHi").'.sql.gz';
    write_file($filename, $backup);
}

The problem is the function don't create the file, but do a "force download" to a empty file called like the url...
Why?

This is the log:
Code:
DEBUG - 2008-05-26 01:57:32 --> Database Forge Class Initialized
DEBUG - 2008-05-26 01:57:32 --> Database Utility Class Initialized
DEBUG - 2008-05-26 01:57:32 --> Database Forge Class Initialized
DEBUG - 2008-05-26 01:57:32 --> Database Utility Class Initialized
DEBUG - 2008-05-26 01:57:32 --> Helpers loaded: file


  Programming without GET
Posted by: El Forum - 05-27-2008, 03:56 AM - Replies (6)

[eluser]ytjohn[/eluser]
Ok, so I've read this:

http://ellislab.com/codeigniter/user-gui...s/uri.html
and the routing: http://ellislab.com/codeigniter/user-gui...uting.html
and even this:
http://codeigniter.com/wiki/alternative_to_GET/

So, while configuring a route produced the desired effect, it just seems very backwards to me to have this modular approach with a controller, and then having to go to a routes file to pass variables in the URL.

For example, if I want http://www.example.com/categories/edit/categoryid/56 to load an edit form for categoryid # 56, I can go outside of my controller and define a route. Or, I can try the uri->segment approach (which is what I'm doing currently):

$categoryid = $this->uri->segment(4, 1);

That works, until I decide to pass a second parameter or move my categories controller to a sub-directory. At that point, I have to count my url segments and update the code.

I haven't tried the alternative_to_GET yet (looks like it will work, but seems kind of a step back), but I wanted to see how other people were coping with this.

To be perfectly honest, I would be happy to have something that takes everthing after
the "controller/function" and associates the segments as key/value pairs. Maybe this or similar functionality already exists, and I'm just missing it?

-John


  Problem about change URL ?
Posted by: El Forum - 05-27-2008, 03:29 AM - Replies (2)

[eluser]MrSmith[/eluser]
I create the form view (called mainpage.php) to input data from users and insert to database (When load this page the URL is http://localhost/index.php/). After I pass the data to controller (method postdata) - the url is http://localhost/index.php/postdata, I want to load mainpage view again. The url should be http://localhost/index.php/ but it is not change so if I refresh this webpage in this state it will insert old data from last input to database again. Please help me how to correct them...T_T


  How to check CodeIgniter session variable ?
Posted by: El Forum - 05-27-2008, 03:19 AM - Replies (6)

[eluser]MrSmith[/eluser]
I use CodeIgniter session class to create session variables so in some web pages I want to check the session variable is created before display the content. Does CodeIgniter have function to check that ?


  FreakAuth_light 1.1 bug?
Posted by: El Forum - 05-27-2008, 02:19 AM - Replies (8)

[eluser]Unknown[/eluser]
Hi

Having installed FreakAuth_light 1.1 and enabled user profiles, I have a problem! As admin, if I edit a record, when I hit "Save" I get a database error. The precise error is:

Code:
A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

SELECT * FROM (`fa_user`) WHERE `id` =

From my digging, this seems to be coming from application/controllers/admin/users.php and in particular the first line of function edit($id = '') which says:

Code:
function edit($id = '')
    {

        // security check:
        // admins or superadmins cannot be edited in the users controller
        $edited_role = getUserPropertyFromId($id, 'role');
        $allowed = ($edited_role != 'admin' AND $edited_role != 'superadmin');
        if (!$allowed) $this->freakauth_light->denyAccess(getUserProperty('role'));

The problem seems to be that the $id is not getting passed to the function by the edit form (and is being explicitly blanked by the function declaration), resulting in the security check failing - getUserPropertyFromId causes the database error as the WHERE clause in the query has nothing for $id.

Tracking this back, I've found application/views/FreakAuth_light/template_admin/users/edit.php and in particular the form open statement:

Code:
<?=form_open('admin/users/edit/')?>

By changing this to:

Code:
<?=form_open('admin/users/edit/' . (isset($user['id']) ? $user['id'] : $this->fal_validation->{'id'}))?>

I can make the problem go away (i.e. I can edit users), but I'm a bit concerned that (a) this seems like a big problem that surely somebody would have seen before if it was "real", and (b) am I opening up other problems later?

Apart from that, great work, well done and thank you!


  Codeigniter Shop and Email Scripts?
Posted by: El Forum - 05-27-2008, 01:40 AM - Replies (2)

[eluser]Devon Lambert[/eluser]
Not sure if this is the appropriate place for this question but I thought it may fit here.

1) Are there any Codeigniter Email Scripts out there that extend upon the Email class?

2) What about a Codeigniter Shop Script? Anything that extends the code nicely? or am I stuck rebuilding something that is already out there?

Anyone currently developing one of these two and looking for support in the open source community?

:-)


  Need suggestion
Posted by: El Forum - 05-27-2008, 01:38 AM - Replies (1)

[eluser]nandish[/eluser]
when the user successfully registered.I am sending confirmation email for the particular user.if the user accidently deleted or whatever..so how can i send confirmarion mail again to that particular user.


which option is correct to send confirmation Email ?
1)when the user try to login

2)place link to send confirmation mail to that particular user in confirmation page


  GMT and time localization
Posted by: El Forum - 05-27-2008, 01:30 AM - Replies (2)

[eluser]jiggs[/eluser]
Hi!

i have set my time_reference from the config file to be 'gmt', when i run the application and echo the gmt time its not showing the right answer.

Code:
echo date("m d Y h:i a", now());


I tried verifying this by going to some websites that generate the gmt time like http://www.timeanddate.com/worldclock/

the time on that site is using gmt and my CI is configured already to use 'gmt' yet both times shows a big difference!!


How is this?


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

Username
  

Password
  





Latest Threads
TypeError when trying to ...
by kenjis
2 hours ago
Webhooks and WebSockets
by InsiteFX
8 hours ago
Retaining search variable...
by pchriley
Today, 05:46 AM
Reading a session variabl...
by xanabobana
Today, 05:05 AM
Update to v4.5.1, same us...
by kenjis
Yesterday, 07:47 PM
Codeigniter 4 extend core...
by Semsion
Yesterday, 05:08 AM
v4.5.1 Bug Fix Released
by lokman
04-16-2024, 02:12 PM
problem with textarea
by Nitin Arora
04-16-2024, 05:07 AM
Showing pdf on browser
by aarefi
04-16-2024, 04:38 AM
[4.5.1] Disabling the deb...
by keto
04-16-2024, 02:43 AM

Forum Statistics
» Members: 84,470
» Latest member: shopifyfree1
» Forum threads: 77,558
» Forum posts: 375,891

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB