danlito

Experience

775

0 Best Reply Awards

  • Member Since 3 Years Ago
  • 32 Lessons Completed
  • 1 Favorite

23rd March, 2015

danlito started a new conversation Changing The User Table Names And Adding New Fields? • 3 years ago

Hi guys,

I am trying to extend the users table by adding more fields and also i changed the user column name to username. Now i am getting an error:

"Column not found: 1054 Unknown column 'name' in 'field list'..."

I have migrated the table with new column name and also some new fields but its not working. Is this user column name somewhere hard-coded?

Any suggestion?

Thanks in advance.

19th January, 2015

danlito left a reply on How Do You Guys Deal With Poiting Domain On Server To /public Folder? • 3 years ago

@bashy

Where can i find (Apache) on server.

danlito started a new conversation How Do You Guys Deal With Poiting Domain On Server To /public Folder? • 3 years ago

Hi guys,

So far i have made possible to work this out on local server. I have tried some options around the net using .htaccess file but no success.

i'am pretty sure you know this trick :)

Thanks in advance.

17th January, 2015

danlito started a new conversation How Do You Protect .env File From Public? • 3 years ago

Hello guys, I am trying to understand how to use this cool feature of. The only thing that i don't get it is how to make this file protected from public.

If i go to mydomain.com/.env i can see all the variables. Is there anyway to hide it?

Thanks

15th December, 2014

danlito left a reply on Rendering HTML From Database Table To View {{ Blade Issue Or... }}?. • 3 years ago

@RachidLaasri My HTML is stored as text into database table. So it should render correct obviously .

danlito left a reply on Rendering HTML From Database Table To View {{ Blade Issue Or... }}?. • 3 years ago

I get the same result as before, the above one shows the content as plain text and the second one shows nothing. same as i did without html_entity_decode.

danlito started a new conversation Rendering HTML From Database Table To View {{ Blade Issue Or... }}?. • 3 years ago

I am having a problem by rendering some html stuff from a database table. I have a function that is calling and returning some html content from databse table, when i use {{ }} double curly braces it shows the content on page but as a plain text not rebdered as html. After i try to use {!! !!} it does not show anything on page. It's pretty weird, i don't understand why and what's the solution in this case.

Please advice.

11th December, 2014

danlito left a reply on Add Session Value With Ajax Post Seems Not Very Accurate. • 3 years ago

Yes i always check it , when it fails it does not extend the session with the new values, the all sudden it happens.

danlito left a reply on Add Session Value With Ajax Post Seems Not Very Accurate. • 3 years ago

It's the default one, i haven't touch anything on that session.php file

danlito left a reply on Add Session Value With Ajax Post Seems Not Very Accurate. • 3 years ago

The session drive is:

    'driver' => getenv('SESSION_DRIVER') ?: 'file',

danlito left a reply on Add Session Value With Ajax Post Seems Not Very Accurate. • 3 years ago

I can explain it, i know it's weird but is the only way i can make it work. When i do the first call the (if) statement checks if there is a session or not then try to push the session, i know that sometimes it will fail so for the first attempt i turn a "no" to tell to ajax try it again. Next time when ajax tries again the (if) checks if there is session or not if yes it turns an yes if not it tries again. :) i know is ridiculous but i have spend more then 7 hours to fix this and it looks like the only way is this. Most of the ways i end up with two ajax calls because the first attempt fails.

10th December, 2014

danlito left a reply on Add Session Value With Ajax Post Seems Not Very Accurate. • 3 years ago

What i am doing now is this

$j(document).ready(function(){
$j('#codebtn').click(function(e){
    var code = 'TESTME';
    var codec = $j('#codec').val();
    if(codec != code){
        alert('This is not a valid');
    }else{
        $j.post("addcode", {cname: code, _token: _token}, function(data){
        if(data == 'no'){
        $j.post("addcode", {cname: code, _token: _token});
      }
});
    }
});
});
public function addCode(){

        if($_POST['cname']){

            if(!Session::has('__cp')){

                Session::put('__cp', $_POST['cname']);
                Session::save();
             return 'no';
            }else{
         return 'yes';
}
        }
    }

so basically i am forcing to try it again and again. so at the second try it works. It should not be like this.

danlito left a reply on Add Session Value With Ajax Post Seems Not Very Accurate. • 3 years ago

Yes bashy i have try lets at my function return 'Yes' and it seems to work most of the time, but in some cases not. This is really weird to me.

danlito started a new conversation Add Session Value With Ajax Post Seems Not Very Accurate. • 3 years ago

What i am doing is grabbing a value from an input field , passing it through ajax post which is pointed to a function. This function checks if session is empty or not then if false adds this session.

Then i have a simple place where i check this session and do some maths.

The trouble i am having it is not accurate, sometimes it fires sometimes not, maybe this is a bug or i am missing something here. I have tried to keep my code as simple as possible to see what is causing this issue.

Here is me code.

(_ This is my jquery code

$j(document).ready(function(){ $j('#couponbtn').click(function(e){ var code = 'TESTME'; var codec = $j('#codec').val(); var name = $j('input:checked').val(); var shipp = $j('select').val(); if(codec != code){ alert('This is not a valid'); }else{ $j('#codenarea').fadeOut(300); $j('#codemsg').fadeIn(300); $j.post("addcode", {cname: code, _token: _token}); } }); }); _)

(_This is my function that adds the session

public function addCode(){

    if($_POST['cname']){

        if(!Session::has('__cp')){

            Session::put('__cp', $_POST['cname']);
            Session::save();
        }
    }
}

_)

As i said before, in 20 tries 15 are successful and 5 not. I don't understand why.

Please advice. Thanks

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.