Jump to content

doddsey_65

Members
  • Posts

    902
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by doddsey_65

  1. Care to mention which input?
  2. Posting a big block of code and asking where the errors are is not going to get any reasonable answers. What errors are being shown to you?
  3. The best thing to do when that happens is take a break. Like Phailip I usually go for a run or drive somewhere. Then, while out, I usually have an idea or the motivation comes back so I rush home. The worst thing to do is force yourself through the wall.
  4. You will need to escape the parenthesis in your search query like so $search = "test\(test\)test\[test\]\.zip
  5. You have a trailing comma at this line which would cause an error in your sql syntax eventdate = '".$mysqli->real_escape_string($_POST['eventdate'])."', You also have a syntax error here where eventid = S'".$mysqli->real_escape_string($_REQUEST['eventid'])."'"; "S" should be within the quotes
  6. No problem, remember to mark as answered
  7. Sorry for being in the wrong forum but I couldn't post in the Code Snippets section. Here is a quick function that will sort a multidimensional array by a given value function subval_sort(array $array, $subkey, $reverse = false) { if (empty($array)) { return array(); } $temp_array = array(); foreach ($array as $key => $value) { $temp_array[$key] = strtolower($value[$subkey]); } if ($reverse) { arsort($temp_array); } else { asort($temp_array); } $_array = array(); foreach ($temp_array as $key => $value) { $_array[] = $array[$key]; } return $_array; } It can be used as such: $array = [ 0 => [ 'value' => 6 ], 1 => [ 'value' => 2 ], 2 => [ 'value' => 1 ] ] $array = subval_sort($array, 'value'); This would return: [ 0 => [ 'value' => 1 ], 1 => [ 'value' => 2 ], 2 => [ 'value' => 6 ] ] And it can be reversed by specifying a third parameter (bool) $array = subval_sort($array, 'value', true);
  8. If I understand correctly you are populating the select boxes with the categories array? If so then in the onchange you would check to see if the selected value is in the next object array. So if they chose Product Name in the startList select box you would remove Product name from the Software manufacturer object array.
  9. <select name="year" > for ($year = 1960; $year <= 2030; $year++) { if (!empty($_POST) && $_POST['year'] === $year) { echo '<option selected value="'.$year.'"><h4>' .$year.'<h4></option>'; } else { echo '<option value="'.$year.'"><h4>' .$year.'<h4></option>'; } } </select> You need to check if there is post data and if the posted data matches the value of the option
  10. <td>Code:</td> <td><input type='text' name='user' value='$getcode' /></td> Shouldnt that input name be "code"?
  11. Assuming that it is always 10 characters after the url you could try something like: $string = '<html><stuff>dsadfsdasfasfasfasfsafasfasfasf superman was awsome hehe https:\/\/superman.com\/Jmd8KKtjIj <html><stuff>dsadfsdasfasfasfasfsafasfasfasf superman was awsome hehe https:\/\/superman.com\/Jmd8KKtjIj <html><stuff>dsadfsdasfasfasfasfsafasfasfasf superman was awsome hehe https:\/\/superman.com\/Jmd8KKtjIj'; $string = str_replace('\/', '/', $string); preg_match_all('|https\:\/\/superman.com\/([a-z0-9]{10})|i', $string, $matches); die(var_dump($matches)); That would give you array (size=2) 0 => array (size=3) 0 => string 'https://superman.com/Jmd8KKtjIj' (length=31) 1 => string 'https://superman.com/Jmd8KKtjIj' (length=31) 2 => string 'https://superman.com/Jmd8KKtjIj' (length=31) 1 => array (size=3) 0 => string 'Jmd8KKtjIj' (length=10) 1 => string 'Jmd8KKtjIj' (length=10) 2 => string 'Jmd8KKtjIj' (length=10)
  12. http://gamebu.co.uk/phpfreaks.txt Hi, I have recently created http://www.gamebu.co.uk and would like some testing done before I add more features. Gamebu is a site where you can play online games for free. Game types include Flash, Unity3D and HTML5. I have a collection of over 1000 games so far from sites such as MochiGames, FreeOnlineGames and FlashGamesDistribution. I would like to know if there are any security vulnerabilities and if everything works as expected (ie no dead links). Thanks Carl
  13. I logged in and the message said your reply has been posted. XSS problems here http://forum.inobb.net/viewforum.php?forum=4 Should use strip_tags() here http://forum.inobb.net/viewthread.php?topic=17&page=1 Got this when saving a signature Warning: include(includes/lang/lang.Choose a Language.php) [function.include]: failed to open stream: No such file or directory in /home/content/44/10959644/html/forums/header.php on line 8 Warning: include() [function.include]: Failed opening 'includes/lang/lang.Choose a Language.php' for inclusion (include_path='.:/usr/local/php5_3/lib/php') in /home/content/44/10959644/html/forums/header.php on line 8
  14. Most people I know learnt PHP and general web development by experimenting, myself included. I used to look through other peoples code, change things and see what happened. To this day I have never read a book on web development (or atleast a teaching book). The most important thing to becoming a "good" developer is enjoying what you do. I frequently stay up til 4am writing scripts that are for personal use or experimentation. If you don't enjoy it then you may aswell learn something else.
  15. I usually use pathinfo() to get the extension of files. $ext = pathinfo($_FILES['file'], PATHINFO_EXTENSION);
  16. Just to add to the point You should add an exit() or die() because the rest of the script will still be executed unless you exit() or die()
  17. As far as validation is concerned, you have the string "Thank you for submitting your application." outside of your if statement if ($_SERVER["REQUEST_METHOD"] == "POST") { which means that this will always be outputted to the browser. Instead of adding errors to a different variable each time add the to a single array. if (empty($_POST["name"])) { $errors[] = "Missing"; } Then you can do something like if (!empty($errors)){ die(var_dump($errors)); } Or output the errors however you would like. this would stop execution of the script if there are errors. Secondly, you say that the script is not sending an email on success, yet i see no mail() function which is an internal php function to send emails.
  18. You are missing a semi colon at the end of line 2 include 'core/init.php'
  19. Thanks for the advice. The boss at the end of level one has 200 HP so it will take a while. This is just for development purposes to see how many times I would die with the tracer bullets ( I died alot ). I haven't paid much attention to UI or a help system mainly because I want to get the game working well enough before I do. Believe it or not, yesterday the game used to use the mouse to control, and a few days before it was keyboard again .
  20. Hi, I have been working on a side scrolling shooter for the past couple of weeks and I would like to get some testing done. The game is similar in style to many retro shooters like Gradius, UN Squadron etc. The game play is a simple wave style, where you complete a level that has certain groups of enemies come at you in different patterns/amounts. This version only contains 1 level and is quite short to help with debugging and testing. Let me know what you think and if there are any issues that you can see. The graphics are basic atm, I will be getting better ones made once the games mechanics are stable. Thanks http://cjmarkham.co.uk/projects/canvas-shooter-2 http://cjmarkham.co.uk/projects/canvas-shooter-2/php_freaks.txt
  21. Hi, the template has been changed in every way, the only things I kept off it are the header image and the color scheme. I just wanted to know if the layout was okay and easy to navigate. Stuff like the profile pages and when viewing tutorials I am not too sure about.
  22. Thanks Kicken, that error has been taken care of.
  23. Hi, I've started a new project called Tutalicious. It's a tutorial repository where users can upload their youtube tutorials, or create text tutorials. I am in the process of bug testing (on the Beta test thread) but would also like some crits on the design of the site. I bought the template off a friend but had to change it quite a bit to fit the sites content. I have just recently added a content slider at the top of the home page but I don't quite like it, so any tips/ideas on that too would be great. The images used in the slider are temporary. http://beta.tutalicious.com/ Thanks.
  24. Thanks, the error has been taken care of
  25. Sorry, You would need to remove the AM/PM from the date that you are using
×
×
  • 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.