Jump to content

doddsey_65

Members
  • Posts

    902
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by doddsey_65

  1. The first thing I noticed is that you are using bootstrap. But why? You only use it in one place ( the nav ). You have also added empty divs to add a clear to floating elements.

    Have a read on bootstrap and you will find that adding the clearfix class to the parent will remove the need to add empty divs.

     

    Also your text looks a little big, try decreasing the size.

    And use relative urls for serving static content unless they are coming from a different domain

     

    Also W3C has a few complaints.

  2. Just an update for you guys.

     

    I have a few new features that have been implemented on the staging subdomain http://staging.gamebu.co.uk

     

    The features include:

     

    • User profiles
    • Adding friends (from profiles)
    • Activity timeline (of your friends)
    • Internal comment system
    • Session tracking (number of active users and guests)
    • Newest users indicator (under "logo")
    • Profile completion percentage (visit your profile for info)

     

    If you could test these out and make sure everything is working I can begin deploying them to the live site.

     

    Thanks

  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 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

  5. 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);
    
  6. 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.

  7. <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

  8. 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)
  9. 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

  10. 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
    
  11. 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.

  12. 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.

  13. 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 :P.

×
×
  • 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.