Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Try: <script type="text/javascript"> function shortcode() { document.getElementById('shortcode').value = "EP" + document.getElementById('episode').value + "SE" + document.getElementById('season').value; } </script>
  2. preg_match_all('/[^\s]+\.mp4/', $var, $matches); This should work... It assumes that there are no spaces in the file path / name.
  3. Just to be sure, you are adding "http://" infront of "localhost" aren't you?
  4. Yeah that is actually one of the changes I'm planning to make, re-do the side bar and homepage. The roll over effect on the browse page is a good idea as well. Cheers!
  5. I listen to music all the time, but generally nothing classical. Stones, Black Crowes, The Doors, that sort of thing...
  6. I've recently created a small CMS app for a client to upload new products to his website. This includes an image that is resized and saved on the web server. However the permissions set on the file do not allow me to modify them at all from within an FTP client. When the image is resized I'm adding the chmod function to try and stop this but it's not working, I'm currently using: chmod(__img_loc__, 0777); Could anybody think why? Thanks for any help! Adam
  7. Ah yeah you're right! Wouldn't work if some of the HTML is a little messed up as well. Yup, Regex all the way!
  8. I'd probably split the HTML by white space, then run a few regular expressions on each part to determine if it's the opening tag, an attribute, the end, etc. Probs need to watch out for things like "checked" - 1 word arguements. Best place to start is to work out what's distinct for each part, how you can recognize them. For example the start tag will have a '<' on the left, attributes will have the equals: 'something=something'.. etc. etc. More information on regular expressions Using regular expressions with JavaScript Good luck! Glad to help further if you run into troubles.
  9. Regular expressions are very useful for filtering out a custom set of characters. I'd recommend reading the tutorials for in the future. To filer out all characters except a-z A-Z 0-9 _ -: $str = "(-test'String001_),"; $str = preg_replace('/[^\w-]/', '', $str); print $str;
  10. Getting an error on the upload page: View count of videos never increase, they're always on 0. On I think every page there's at least 1 empty box - generally just doesn't feel done at all. On the "Videos" page, perhaps add a 'Search' label to the search form, just to make it a little clearer what it's for. Also on the videos / categories page, I think the user would prefer to read a description of the video more than when it was uploaded? Also you might be better off improving your register e-mail, went straight to my spam folder - using Google mail. Adam
  11. Sheet! My mistake..
  12. I don't know? I like them...
  13. There's a mod for it here.
  14. Great, thanks for the feedback. Once I've completed some of the other upgrades I'm currently making I'll get to work on some of your points - especially the SEO stuff. ...What's wrong with the diagonal lines by the way?
  15. Ha yerrrr I know! Just like the stars!
  16. You could just... search google? http://www.google.co.uk/search?q=php+upload+files+via+ftp
  17. To avoid any problems like that store sensitive information within a private, non-public folder.
  18. With regex you could do it like this: $number = preg_replace('/[^0-9]*/', '', $str);
  19. Too many potential problems with depending on a user though. I think an automated process is definitely the way to go...
  20. Take a look at: http://uk3.php.net/manual/en/reserved.variables.server.php ... And you could use HTTP requests.
  21. Ah clever, I didn't think of that! Of course it does require JavaScript, but in a controlled environment that wouldn't have been a problem. Just to add as well in case anyone else is trying something similar, if you use the method above to place the full file path into a hidden field using JS, if you don't use the enctype attribute on the <form>, then it won't upload the file (obviously saving time and resources). Are you sure it can't be done without security issues? On the network at work we have pretty high security and I've never had a problem accessing local files...
  22. Could use a regular expression? Something like... $url = $_SERVER['PHP_SELF'] . "?" . preg_replace('/theme=[^&]+/', '', $_SERVER['QUERY_STRING']);
  23. Ah yeah my mistake! Haha I wouldn't be surprised if I read his reply a few days ago and that's where it came from!
  24. $query = mysql_query(" SELECT SUM( `SpointsNo` ) totalPoints, `StudentsID` FROM tbl_points t1 INNER JOIN tbl_students t2 WHERE ( t1.`StudentsID` = t2.`StudentsID` ) GROUP BY `StudentsID` "); ... wild shot in the dark! EDIT: Or maybe.. $query = mysql_query(" SELECT SUM( `SpointsNo` ) totalPoints, `StudentsID` FROM tbl_points t1 INNER JOIN tbl_students ON t1.`StudentsID` = tbl_students.`StudentsID` GROUP BY `StudentsID` "); Hard to work out when you can't test the SQL, for me at least...
  25. I'm not sure where I read this but you can only put the hyphen in a character set if its on the far left or right side, and you don't escape it. Also I don't think you need to escape underscores, but if you just use \w you don't need to worry about it. So it could be: /^[\w\+-]+$/ ???
×
×
  • 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.