Jump to content

maexus

Members
  • Posts

    191
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maexus's Achievements

Member

Member (2/5)

0

Reputation

  1. Stupid mistake, it can't be less than 0. Duh. Can't believe I missed that.
  2. Ok, this is a little complicated to explain so I will put down my code first. Here is what I have: <?php header('Content-Type: text/plain'); $hours = array(); for ($a=0; $a < 35; $a++) { $hours[$a] = array(); for ($b=0; $b < 6; $b++) { $seconds = mt_rand(1, 5); $hours[$a][$b] = '0:0:'.$seconds; } echo (implode("\t", $hours[$a]))."\n"; } ?> and this is what it generates: 0:0:3 0:0:2 0:0:1 0:0:3 0:0:3 0:0:3 0:0:5 0:0:4 0:0:5 0:0:3 0:0:2 0:0:5 0:0:1 0:0:2 0:0:3 0:0:3 0:0:4 0:0:1 0:0:4 0:0:1 0:0:5 0:0:5 0:0:3 0:0:4 0:0:1 0:0:1 0:0:2 0:0:1 0:0:4 0:0:5 0:0:4 0:0:4 0:0:2 0:0:4 0:0:3 0:0:3 0:0:2 0:0:4 0:0:3 0:0:1 0:0:2 0:0:4 0:0:1 0:0:1 0:0:2 0:0:5 0:0:2 0:0:1 0:0:1 0:0:3 0:0:5 0:0:4 0:0:1 0:0:2 0:0:3 0:0:4 0:0:3 0:0:1 0:0:4 0:0:1 0:0:4 0:0:3 0:0:4 0:0:2 0:0:1 0:0:5 0:0:2 0:0:2 0:0:1 0:0:1 0:0:3 0:0:4 0:0:1 0:0:2 0:0:5 0:0:2 0:0:5 0:0:1 0:0:4 0:0:3 0:0:5 0:0:5 0:0:4 0:0:2 0:0:5 0:0:3 0:0:2 0:0:1 0:0:4 0:0:1 0:0:4 0:0:4 0:0:3 0:0:1 0:0:5 0:0:1 0:0:2 0:0:1 0:0:1 0:0:1 0:0:2 0:0:2 0:0:4 0:0:3 0:0:4 0:0:3 0:0:1 0:0:3 0:0:2 0:0:5 0:0:2 0:0:2 0:0:5 0:0:5 0:0:5 0:0:3 0:0:2 0:0:1 0:0:4 0:0:5 0:0:5 0:0:4 0:0:5 0:0:2 0:0:1 0:0:4 0:0:2 0:0:5 0:0:1 0:0:1 0:0:2 0:0:5 0:0:5 0:0:3 0:0:5 0:0:3 0:0:4 0:0:3 0:0:2 0:0:2 0:0:1 0:0:3 0:0:4 0:0:1 0:0:2 0:0:3 0:0:2 0:0:4 0:0:5 0:0:5 0:0:2 0:0:4 0:0:5 0:0:3 0:0:1 0:0:2 0:0:2 0:0:3 0:0:5 0:0:2 0:0:5 0:0:4 0:0:1 0:0:5 0:0:2 0:0:2 0:0:2 0:0:1 0:0:2 0:0:1 0:0:1 0:0:4 0:0:4 0:0:2 0:0:4 0:0:1 0:0:2 0:0:3 0:0:2 0:0:5 0:0:1 0:0:3 0:0:5 0:0:1 0:0:1 0:0:5 0:0:4 0:0:4 0:0:1 0:0:4 0:0:2 0:0:1 0:0:2 0:0:4 0:0:5 0:0:5 0:0:4 0:0:2 0:0:4 0:0:4 0:0:5 0:0:1 0:0:2 0:0:4 0:0:5 0:0:1 0:0:4 0:0:5 0:0:1 0:0:5 Here is what I've tried but it only pulls from the random(1,10) not choosing between the 1,10 and 1,5: <?php header('Content-Type: text/plain'); $hours = array(); for ($a=0; $a < 35; $a++) { $hours[$a] = array(); for ($b=0; $b < 6; $b++) { if($a < 0){ $previous = $a - 1; if($hours[$previous] > 5){ $seconds = mt_rand(1, 5); }else{ $seconds = mt_rand(1, 10); } }else{ $seconds = mt_rand(1, 10); } $hours[$a][$b] = '0:0:'.$seconds; } echo (implode("\t", $hours[$a]))."\n"; } ?> Can anyone help? If you need more information, please check http://codeigniter.com/forums/viewthread/103084/
  3. I'm using the CI framework and home is my default controller. Redirecting to home is more aesthetic than functional. Just wondering how to do it.
  4. That didn't work unfortunately. Maybe I should reword it. I need http://domain/app to redirect to http://domain/app/home but I don't know what the "app" is going to be named so is there a way to set the mod_rewrite to be relative to the current directory?
  5. I’m trying to figure out what to add to my htaccess to redirect “/” to “/home” but to complicate things, the app may not be in the root directory. It could be a sub directory, like this: http://localhost/app/ to http://localhost/app/home I have tried looking at mod_rewrite tutorials but still can’t get it to work. This is what I’ve tried. RewriteRule ^/$ /home Which, does nothing. Please help!
  6. JSON is javascript object notation. http://en.wikipedia.org/wiki/Json and I don't think that will work. I still have to assign the object to something so I can access the data inside. It's a moot point at this point anyways.
  7. Here is the issue. I'm building an app entirely from JS script at work as we can not use server side scripting, at all which means I can't use a database. Since my dataset is small, I decided to put the information in to a *.json file. I know writing to it will be an issue but right now my issue is getting the json in to my javascript and in to a usable form. What is the best way to import the contents of that json file in to an array or object I can use? BTW, this is my first major use of javascript so be kind
  8. What ever works best for you and the project you are working on. Your welcome.
  9. For results I store in the object as well as return them so it gives me options. You can certainly use the many DB objects/abstractions that are out there if you wish.
  10. I'm not sure if I'm understanding what you are trying to do but here is what I gathered. You want users to create forum like posts where they are able to have both text and images. You can do this a couple of different ways. You can allow HTML and they can use the <img/> tag OR You can implement a simple BBcode system that uses or [image] or however you choose to implement that.
  11. You are declaring the document as a jpeg yet you are trying to output text. That doesn't make any sense.
  12. Directly in PHP? No.. Or I should say not realistically. You can use PHP to call external programs to do it or if you have an video converter extension for PHP you could.
  13. Ajax is simply a way to send and recieve data to and from the server asynchronously. That's it. I think a lot of people completely misunderstand what Ajax is. The bottom line is, ajax can be very useful for some applications but your site should still be 100% functional if javascript is disable. This is true anytime you use ajax.
  14. You will most likely need to import the contents of the css file in PHP, regex the javascript out and then display the css as inline vs linking to it.
  15. You posted: $username = md5($username); it should be: $password = md5($_POST['password']); No offense but why don't you try it to see if it works.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.