Jump to content

Perad

Members
  • Posts

    287
  • Joined

  • Last visited

    Never

Everything posted by Perad

  1. I want the following to work. document.getElementById('country').onChange = function() { alert(1); } Basically, when the country select box is changed I want something to happen. I do not want to use the onchange attribute within the html. I would rather have this functionality separate. Once I find out how to do this I can do the rest. Help is very much appreciated.
  2. App is OOP. The functions are somewhat irrelevant. Here is the user function. The rest of the functions are identical with different table / row names. public function get_latest_users() { $array = array(); $query = $this->db->from('users')->order_by('id', 'desc')->limit('10')->get(); foreach ($query->result() as $row) { $array[strtotime($row->joined)] = '<tr> <td class="profile_image"> {img} </td> <td class="info"> <h3>A user has registered</h3> </td> </tr>'; } return $array; }
  3. Hi, I have 3 arrays as shown below. $users = $this->get_latest_users(); $flirt = $this->get_latest_flirts(); $hotlist = $this->get_latest_hotlist(); These arrays for a key have the strtotime value of whenever something was posted. They then have some html as a value. So.. $users = array ('1257785194' => 'html'); What I need to do is merge the 3 above arrays and sort them so it shows the soonest first. The structure of arrays can be changed, thats not a problem. I just need to get this working. Any ideas? EDIT: I need to preserve the strtotime value.
  4. Hello, could someone tell me how I change my default homepage from '/' to '/home'? This shouldn't affect any other pages such as /about etc. I would greatly appreciate it if someone could demonstrate how to do this. Thanks EDIT :: I only just noticed the htaccess forum after posting. I apologize for putting this in the wrong forum.
  5. Hey, I have created an 'awesome' - as in it works! - routing library. However it is somewhat limited and I don't have the knowledge to take it to the next level. It works something like this. Please note this isn't the actual code. $segments = explode('/', $url); // Trim and reorganise array if (count($segments) == 0) { // Use default route } if (count($segments) == 1) { // Load module/segment0.php - start class segment0 - load the index function or return 404 if this does not exist } if (count($segments) == 2) { // Same as above with the exception that segment1 is the function instead of index } This is where I am. I have tested it a lot. Either returns correct function/class or a 404 error. What I want to do is allow for more than 2 segments. I would like segments 3+ to become function parameters. How do I do this?
  6. I would definately recommend making a backup of all of your data and your original 2.5.1 website. The update to 2.8 is pretty smooth so you shouldn't face any problems. The backup is just in case something goes a little wrong.
  7. I am trying to create a dynamic function caller. It should execute like this. $url is an array. $url[1] contains the function. $class->$url[1](); Any idea how I can make this work? Is there some sort of php function to do this?
  8. I have a date time field. How do I grab all fields where the date time field is older than one day?
  9. Hi, does anyone know how I can use PHP to get the current Euro / Dollar exchange rate? I need to get it twice a day so I can update the Euro prices on a website.
  10. Hey, Can anyone tell me what are must have security features in a user system? Stuff like salting passwords, hash strength, session handling etc. Thanks
  11. Hello, can someone explain to me why this query isn't working? What I am trying to do is get the entire coupon table out. Coupons are linked to companies via coupon.company + company.id I am trying to get all coupons where a company begins with letter b. What I think I am doing is this. Selecting all fields from the coupon table, selected data from coupons table, I am then joining the companies and coupons table with the company/id fields. I am then getting all results based on the company name. Obviously something is wrong. Could someone tell me what please.
  12. The folder can be found @ domain.com/test/uploads/job_files. What permissions would you recommend, job_files currently has 777 as its permissions.
  13. Hi, nope, no joy. Its bizarre, I really don't get it.
  14. Hey, why isn't this working? I have also tried using getcwd() with the path, even though the path isn't valid it still doesn't work. Can anyone make any sense out of this? // Upload $path= '/test/upload/job_files/'; $tmpname = $_FILES['docs']['tmp_name']; $to = $path . $_FILES['docs']['name']; move_uploaded_file($tmpname, $to); Errors:
  15. Ah ofcourse, thats perfect. Thanks for the help.
  16. Hey, I am having a bit of trouble with the code below. It works in Firefox but not in Safari / IE. If I alert the class it works fine. However, somewhere in assigning a variable I am getting an error. Any ideas? $('tr').click ( function () { // get this class name alert($(this).attr('class')); var class = $(this).attr('class'); // Error is on this line. $.post("http://localhost/example/ajax/read", {id: class}, function() { }); // now toggle the tr element matching this class if there is one $('.content-' + class).toggle(); $('.'+class + ' td').css('font-weight', 'normal'); });
  17. Table 'term_taxonomy' Table 'terms' What I need to do is this.. SELECT term_taxonomy_id FROM term_taxonomy WHERE taxonomy='category' I then need to reference term_taxonomy_id with term_id to get the name. How do I do this in a single query?
  18. Got it. $friends[$i]->screen_name;
  19. print_r($friends); Gives me the following. How do I loop through this array and echo out the id value?
  20. Hello, Could someone show me what line of code I would need to add to a script to check a string to see if it contains anything other than 0-9, a-z, A-Z Thanks
  21. Hi there, Could someone help me with a copy button? This is my html. <table border="1" cellSpacing="2" cellPadding="1" width="341" align="center" height="64"> <tbody> <tr> <td height="54" width="151"> <img border="0" src="http://gotyou.co.uk/wp-content/uploads/2009/04/copy-button.jpg" onclick="copyit()" width="112" height="32"> </td> <td height="50" width="100%"> <textarea id="copy" style="width:450px; height:70px; font-size:10px; overflow:hidden;"><embed src='http://gotyou.co.uk/wp-content/plugins/wordtube/player.swf' height='300' width='300' allowscriptaccess='always' allowfullscreen='true' flashvars='volume=80&bufferlength=5&displayclick=none&controlbar=none&linktarget=_self&autostart=true&title=leeds-0036.jpg&file=http%3A%2F%2Fwww.gotyou.co.uk%2Fwp-content%2Fgallery%2FNurses%2FAbb_0056.JPG&plugins=viral'/></textarea> </td> </tr> </tbody> </table> What should happen is when you click an image, it copies the code from the textarea to the users clipboard so they can paste it where every they want it. Is this possible? How do you do it? I haven't got very far. So far I have gathered the textarea id. function copyit() { var element = document.getElementById('copy')); }
  22. Hello, Having a torrid time here. The site is Portuguese. The MySQL character set is ut8, the collation is ut8_general_ci In the database i have this word. 'MATENÇÃO'. It appears correctly in phpMyAdmin When it outputs to the webpage it becomes distorted. There are several things which I do not understand here. If I write this page into my default template file. (main_page.php) it works. It displays fine. If I write this word into my header file (header.php), it becomes distorted. If I echo this word instead of calling it from the database it displays correctly. The page in question can found here. 69.89.31.108/~nortavia/ntv/ Please check the various comments above the page, in the nav menu and below the menu. Do you have any idea what is going on?
  23. To be honest, the url should be like this. sitename.com/pagename/ However, I have been told that I must, MUST keep existing url's. I have no choice on this matter, this is despite my best arguing. All I want to do is this. When someone goes to this page. http://localhost/iraqidinars/iraqidinars/newiraqidinars.html The URL should show the above. However the server needs to show this page. http://localhost/iraqidinars/index.php?page/1 I thought that this was what mod_rewrite was for. To make sitename.com/page into sitename.com/index.php?page=... All I want to do is make a php page display when a html page is called. I hope that makes sense.
×
×
  • 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.