Jump to content

Samuz

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Samuz

  1. No firewall rules have been set as far as I can see in cpanel. Also i'm going to contact the host to enable SSH for us and see how it goes from there. And I received the same cURL here: (couldn't connect to host)
  2. Thanks for your reply. The thing is the file i'm trying to access is under a subdomain of the site the script is running from which confuses me even more, so they are on the same server - I know this for sure. And @dalecosp, the script works for other sites, just not this subdomain.
  3. You shouldn't use first name & last name as unique identifiers, because anyone could have the same problem. Use email or a specific ID number, like National Insurance or whatever, as long as its completely UNIQUE. Then before you insert anything into the database, run a select query to check if that unique field appears in your table more than once. If it appears more than once, display an error message saying that user is already in the database, else you simply insert as you have been doing
  4. This code works nice on my personal remote server and my local one. But I need it on another remote server. Here's code: function getVer($url) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_NOBODY, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FILETIME, true); $result = curl_exec($curl); if ($result === false) { die(curl_error($curl)); } $final = 1; $timestamp = curl_getinfo($curl, CURLINFO_FILETIME); if ($timestamp != -1) { //otherwise unknown $final = $timestamp; } else { $final = 1; } $test = substr($url, -2, 3); if($test == 'ss') : return str_replace('.css', '-'.$final.'.css', $url); elseif($test == 'js') : return str_replace('.js', '-'.$final.'.js', $url); endif; } If I attempt to it on this url getVer('http://static.trainingdragon.co.uk/assets/css/style.css') it doesn't work and returns an error 'couldnt connect to host'. I looked around and I was under the assumption this was cause the site was being blocked or something. Anyone have a hunch what the problem could be? But I can easily view that url in the browser with no problem
  5. I think you need to start this again. You're floating EVERYTHING to the left and not even clearing them
  6. Thanks for your reply, just realized 'Time' was referring to a custom Time object I had created previously.
  7. Hey guys, i'm at university and we've been given a piece of practical work that I need a little help wiith. I'm coming from a PHP background so I understand OOP and the concept etc. Unlike PHP, in java you have to specify the data type of the variable or 'field' your setting. e,g private int cost; And that seems right to me, because I understand 'int' is a java keyword and it lights up in my IDE. But what if I needed the data type of that variable to be a string or time (as specified in my course)? 'String' or 'Time' doesn't seem to be a keyword in java because the keyword 'String' or 'Time' doesn't light up as it would do for 'boolean', 'char', 'int' etc. So how would I set a variable or 'field' with the data type 'String' ?
  8. I don't exactly need help here. I'm just looking to start a discussion on the use of these two elements. First off, these two work essentially the same (correct me if i'm wrong). I can submit a form with <input type="submit" /> or <button type="submit"></button> And they can be styled to essentially look the same. (With the use of :hover & :active) I'm currently in the process of redesigning one of our old sites and i've noticed in th previous developers code he has used <input> in one place & <button> in others. Normally i've always stuck to <input> and have never bothered to use <button>, because I just like the look of my code when creating forms all showing <input>. :v So I just wanted to know if there was any REAL difference - apart from the default browser styles - from a semantic POV and if there are if somebody could point out when i'm really supposed to use <button> and when i'm supposed to use <input>. Also pros/cons if any. Thanks!
  9. Samuz

    resize()

    actually ignore this thread, found a plugin. for anyone else that may come across with the same problem the url's found here: http://benalman.com/projects/jquery-resize-plugin/
  10. Samuz

    resize()

    Maybe I didn't explain properly. But I essentially need a method to determine when the height of an element has changed..
  11. Samuz

    resize()

    So basically I have certain elements that are positioned based on the size of their window and i'd use the resize handler to reposition those elements if the window size is changed. But what do I do if I want to bind the 'resize' handler to an element? this wouldn't work $('html').resize(function() { // code }); I guess what I want to test is when the height of a specific element has changed?
  12. Really?! There are two problems with that statement. 1) You could EASILY put the values into a single dimensional array when processing the DB results. 2) If you need to know the count of unique names - then just do that using your DB query! Something such as: SELECT name, COUNT(name) as count FROM table GROUP BY name I actually have a very simple solution for getting the result you asked for using the multi-dimensional array, but that is not the solution that you should be using. Thanks mate. Someone needs to slap me for not looking for easier approaches first. heh
  13. Thanks for your reply. It's a direct pull from my database. So the array comes in the format of my structure (index = field name, values = field values) array_count_values() I saw this function but I don't see how that will work for a multidimensional array? Unless if possibly I can just merge everything into a single array while keeping their original indexes & values?
  14. I have an array with something along the lines of.. Array ( [0] => Array ( [name] => Michael ) [1] => Array ( [name] => Michael ) [2] => Array ( [name] => Jordan ) [3] => Array ( [name] => Marie ) [4] => Array ( [name] => Marie ) [5] => Array ( [name] => Michael ) ) My final result should produce an array something like.. Array ( [0] => Array ( [Michael] => 3 ) [1] => Array ( [Jordan] => 1 ) [2] => Array ( [Marie] => 2 ) ) Or something like that. I have a pretty good idea that'll i'd need to use foreach twice to get 2 layers 'deep' but i'm just stuck from there.
  15. Samuz

    Lists. br or li

    The only alternative to doing it proper is not doing it at all. It's people who take shortcuts and throw code against the wall because "it works" that makes the internet ugly. That's why I took the route of posting it on these forums to get a broader opinion before implementing it. But obviously you didn't come here to share your input. Troll elsewhere yo.
  16. Samuz

    Lists. br or li

    Why is this even a question? Because it has an answer? Thank you jesirose.
  17. Okay all I need to do is create a simple list, something like.. I was wondering what the best practice would be for this. I mean doing something like this below is fairly straight forward hi <br/> bye <br/> go <br/> come But doing it the 'proper' semantic way requires more effort, such as styling and what. e.g <ul> <li>hi</li> <li>bye</li> etc.. </ul> and thats not including the css. What would you guys say? "Proper" way or quicker?
  18. Samuz

    SQL Update

    Ha sorry about that. I'll have a go doing that. Thanks!
  19. Samuz

    SQL Update

    Yeah I hear you guys, but the problem remains because of how the data was initially being stored. That's what I need to convert into a more SQL friendly format.
  20. I'm not sure if this is explicitly a MYSQL situation so please move the thread to that forum if it is. Anyway I have a table which was storing dates in this format: '3/31/2012 12:13:21 AM' I can currently convert it so that it stores the data in a more british format, with no time values: '31/03/2012' My problem is I have about 100,000 rows of data in my table, all with the American format & timestamp. Can anyone suggest how I will convert & update all those rows into the English format above? I did abit of googling before hand and I came across some of the MYSQL functions, but i'm not too sure how i'd implement those in an update query? I'd appreciate if anyone could share some advice please.
  21. Thanks. Funnily enough I tried that earlier, seems I had to apply it to the container to make it work
  22. Let's say I have markup along the lines of.. <ul> <li> <a href="">bla bla</a> <ul> <li><a href="">more bla bla></li> <li><a href="">more bla bla></li> </ul> </li> </ul> And then I do something along the lines of.. $('ul li a').click(function() { // stuff }); How do I select only the primary link (<a href="">bla bla</a>) and ignore the nested links within (<a href="">more bla bla>)
  23. I have an array like this.. ( [0] => Array ( [0] => Array ( [test] => hello ) [1] => Array ( [test2] => hello2 ) ) ) Array ( [active] => 1 ) I'm trying to merge the above array into each of the sub arrays to achieve something like this.. ( [0] => Array ( [0] => Array ( [test] => hello [active] => 1 ) [1] => Array ( [test2] => hello2 [active] => 1 ) ) ) I have a faint idea i'm going to have to incorporate some form of loop, i'm just stumped on the logic of this.
×
×
  • 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.