Jump to content

23.12.2012

Members
  • Content Count

    246
  • Joined

  • Last visited

Community Reputation

1 Neutral

About 23.12.2012

  • Rank
    Member
  • Birthday 07/23/1995

Previous Fields

  • Languages
    XHTML, CSS (Advanced), PHP, SQL (Intermediate)

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Iasi, Romania
  • Interests
    Spoken languages, web development, understanding how computers work
  1. I was thinking the other day about website defacement and I was struck by this idea. What if we manually generated the MD5 for the index file and checked it against the MD5 of the file to be loaded by the browser? This way, if someone uploaded a hacked file to the server, we would have a way to prevent it from being displayed to the users. So the code would look like this // ...if(md5_file('index.php') == GEN_MD5) { // GEN_MD5 is the manually generated MD5 require_once 'index.php';} else { require_once 'backup_index.php';}// ... Would it be a good way to protect a website against this type of vulnerability? The only downside I see is that if you forget to generate a new MD5 after altering the index file, the application breaks. Let me know what you think! Thank you in advance!
  2. They are dynamically generated, I have just written a fast example in the code above. So would this be a good practice?
  3. I've been teaching myself C for quite some time and now I'm trying to write a new PHP application, just to catch up a little bit. So I was thinking of actually creating a PHP file containing all the function declarations and definitions and including it in the header.php file, like I'm doing below. Would this be a good idea, or would there be a better way to go about it? Thanks in advance!libirr.php function irr_title_display();function irr_header_display();/* Some other prototypes */function irr_title_display() { echo 'Title';}function irr_header_display() { echo 'Header';}/* The rest of the definitions */ header.php <?php require_once "libirr.php" ?><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <title><?php irr_title_display(); ?></title> </head> <body> <div id="header"> <div id="title"> <h1><?php irr_header_display(); ?></h1> <h4><?php irr_subheader_display(); ?></h4> </div> <div id="login"> <p>Welcome, <strong><?php irr_user_display(); ?></strong>!</p> </div> <div id="nav"> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> </ul> </div> </div>
  4. Thanks a lot for your responses! I've given Zend a try (not the first one), but it simply doesn't suit me (or I don't suit it, I can't say for sure). And that's how I've got to Kohana. The documentation sucks big time, but I've found this tutorial which seems to have me up and running quite efficiently.
  5. I'm about to start working on a new project, and I was thinking of actually using a framework this time around. Although most online resources agree that a framework is the better way of doing things, some book authors said that they preferred writing all the code from scratch. So how would you go about this? Do you recommend me to use a framework (I'm thinking Kohana right now), or is writing everything from the ground up just as good? Thanks in advance!
  6. 23.12.2012

    gd not supported!

    Did you try restarting the web server?
  7. 23.12.2012

    download page

    Are you sure it's a MINE type and not MIME type?
  8. What's wrong with ctype_alnum()?
  9. Use a Firebug-like software for your web browser for testing out the JS. Code with PHP error level set to E_ALL | E_STRICT, displaying the errors on screen. If you get no errors in either tests, there is a problem with your PHP installation.Anyway, you haven't given us any code or setup information. No one will be able to help without these.
  10. I think you want to do something like $db_query = "SELECT * FROM table WHERE condition is met"; # Create the query$db_result = mysql_query($db_query); # Query the database$db_row = mysql_fetch_assoc($db_result); # Get the row from the database/* Display the info */echo $db_row['column1'] . "\n<br />";echo $db_row['column2'] . "\n<br />";echo $db_row['column3'] . "\n<br />"; For more information, check the official PHP manual for mysql_fetch_assoc().
  11. 23.12.2012

    gmp code

    Since I'm not a Windows user and WAMP's site does not show what comes with it (or makes it too hard for me to find), I can't tell for sure, but you could read this entire thread, and, if it still doesn't solve your problem, keep digging. XAMPP does not support GMP by default, as far as I can tell.
  12. 23.12.2012

    gmp code

    Has PHP 5.3 been compiled with GMP support? What you want to do will not be possible if the PHP development team have committed any changes to the dlls.
  13. I agree with Sami. Is The Website yours, or an external one, from which you'd like to fetch information?If it's external, you'll want to look for an API of theirs. Otherwise, I'm afraid it's hardly possible. If it's local, you'll want to use the GET request.
  14. This is all you can do with PHP by default.
×
×
  • Create New...