Welcome Guest, Not a member yet? Register   Sign In
CI + Uploadify issues on Mac
#1

[eluser]superfake123[/eluser]
Hello,

My code works perfect on any PC that I try, but when I try from a Mac I get http error 302?!?!? The controller that has the JS for the uploadify has sessions, but the controller that processes the files does not require sessions so I'm very confused... When I copy the code from the file handler and put it in it's own PHP file outside of CI it works on Macs, but it will not work from within CI Sad
#2

[eluser]superfake123[/eluser]
anyone?
#3

[eluser]superfake123[/eluser]
ok I figured out it was because I was using relative paths in my JS code. Is it safe to just use base_url() . 'folder' ? Also what should I be using in my PHP files for paths etc? What's best for maximum compatibility?
#4

[eluser]CroNiX[/eluser]
For PHP paths, check out the constants defined at the bottom of index.php, like APPPATH, etc.

What I do for js paths, is in the header of my page I do:
Code:
<skript type="text/javascript">
// &lt;![CDATA[
var base_url = "&lt;?php echo base_url(); ?&gt;";
// ]]>
</skript>

So, base_url is now defined globally and all of my external js scripts (that don't parse php) can use.
Then in ajax calls just use site_url + the rest of the url.
#5

[eluser]Aken[/eluser]
You've got a bad habit of adding a $ sign to the base_url() function when you suggest this to people, CroNIX. Big Grin
#6

[eluser]CroNiX[/eluser]
I do that a lot?
#7

[eluser]Aken[/eluser]
I've seen it more than once, yeah, lol. Smile
#8

[eluser]superfake123[/eluser]
ahhh ok thank you! What should I use for root CI folder? I don't see that? Like if I wanted to do root/assets/js/functions.js ??
#9

[eluser]superfake123[/eluser]
bad example, I need php path for root so I can add js files or uploads to the assets folder




Theme © iAndrew 2016 - Forum software by © MyBB