Welcome Guest, Not a member yet? Register   Sign In
$_SESSION blank in included controller
#2

[eluser]bubbafoley[/eluser]
you can't include a controller like that. you need to use javascript.

example w/ jQuery
Code:
<table border="1">
    <tr>
        <td>
            Add a product to your favourites
            &lt;input type="text" id="productIDtoaddtofavourites"&gt;
            &lt;input type="submit" value="Add to favourites" id="addtofavourites"&gt;
        </td>
        <td>
            &nbsp;
        </td>
    </tr>
    <tr>
        <td id="ajaxfavourites" valign="top"></td>
        <td id="ajaxquickbasket" valign="top"></td>
    </tr>
</table>

&lt;script type="text/javascript"&gt;
$(function() {
    $.get('&lt;?php echo site_url('myfavourites/ajaxview') ?&gt;', function(data) {
        $('#ajaxfavourites').html(data);
    });
    $.get('&lt;?php echo site_url('mybasket/ajaxquickview') ?&gt;', function(data) {
        $('#ajaxquickbasket').html(data);
    });
});
&lt;/script&gt;

You can also use curl, file_get_contents() or fopen() but it's harder to maintain the session that way.


Messages In This Thread
$_SESSION blank in included controller - by El Forum - 03-09-2011, 03:17 AM
$_SESSION blank in included controller - by El Forum - 03-09-2011, 11:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB