Jump to content

Plxply

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Plxply's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry about that, I didn't notice there was a separate section for this.
  2. Hello, This is a slightly strange question so bare with me. I've been dabbling in PHP for a while and to help further my PHP skills I created a basic URL shortening service with a login and registration system, this works fine however I'm not sure I organised it in the best manner. What I basically did was have an if statement at the top of the page which would check for example if the username field has been posted if not it would run: include_once("interface/login.php"); die(); interface/login.php will contain the HTML for the login interface along with parts of the code that was ready to accept errors e.g. <body><?php if(isset($pass_error)) { echo $pass_error; }?> Then within the login.php code I would compare the hashed password with the one in the database if it did not match I would then run code similar to this: $pass_error = "<div class='error'>You have entered an incorrect username/password</div>"; include_once("interface/login.php"); die(); However I'm not sure if this is the most "clean" way of handling it and I would appreciate if someone would tell me better ways in which I can structure my code and the interface for it. Thank you,
  3. Hello, I've been searching through the MyBB code to hopefully learn the methods which are currently in use to secure the software as well as implement the various features. On the index.php page near the top I've noticed this on line 28: // Load global language phrases $lang->load("index"); I've also seen similar with variables, I'm wondering what does it do (in context of PHP not MyBB) and what kind of situation would you use it?
  4. Thank you ever so much for your prompt and excellent answer
  5. Hello, I currently have a script that simply runs dns_get_record against a domain which the user enters through a GET, however at the current time to display the information I am running through a large amount of if(isset()) statements so it only echo's if it's actually there. I have looked at using for each however, I seem to be unable to achieve it myself due to the slight complexity of the array. $domain = filter_input(INPUT_GET, 'domain', FILTER_SANITIZE_URL); $result = dns_get_record($domain); echo $result['0']['host']."\n\n"; if (isset($result['0'])) { echo $result['0']['type']." - ".$result['0']['target']." (TTL:".$result['0']['ttl'].")\n"; } if (isset($result['1'])) { echo $result['1']['type']." - ".$result['1']['target']." (TTL:".$result['1']['ttl'].")\n"; } As you can assume it would have to continue on in that fashion indefinitely is there an easy way to accomplish this with a for each statement and if so could you provide an example? Sorry for the rather simple question,
×
×
  • 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.