Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Sure it is, but sometimes people may not be able to code a feature/function themself. But looking at other people's code is a great way to improve your own coding skills if you are not very good in a certain language, I think.
  2. Daniel0

    Add mUsic

    If you are going to add background music on your website, make sure you can turn it off, because I believe many people, like myself, find it extremely annoying.
  3. Chances are that the MP3 file exceeds 1000000 bytes (0.95 mb). Either change the value of the hidden field MAX_FILE_VALUE or completely remove it.
  4. You might want to look at this site's [url=http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php]pagination tutorials[/url] :)
  5. And remove the inline frame
  6. You would have to use [url=http://php.net/intval]intval[/url] or [url=http://php.net/mysql_real_escape_string]mysql_real_escape_string[/url] on the variable $tutid if you choose not to enclose the value in quotes in the query to ensure that people to not exploit your code inject another query the initial query.
  7. You could [url=http://php.net/serialize]serialize[/url] the array, put it in the link and then [url=http://php.net/unserialize]unserialize[/url] at the other page. Example: [code] <?php $data = serialize($_REQUEST); echo "<a href='what-ever-page.php?data={$data}'>Back</a>"; ?> [/code] (If you'd like to use POST or GET instead of REQUEST you just replace it) Another solution would be to use [url=http://php.net/http_build_query]http_build_query[/url] to build a query string automaticly for you. You need to use PHP5 though. Example: [code] <?php $data = http_build_query($_REQUEST); echo "<a href='what-ever-page.php?{$data}'>Back</a>"; ?> [/code]
  8. You could use [url=http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html]mod_rewrite[/url] to make it look in another way.
  9. It's used to display the value of a variable inside a string enclosed in double quotes.
  10. I made an example script for you here: [code]<?php /** * Check password level script * * A script made to demonstrate how password levels could be calculated * * @author Daniel Egeberg */ /** * Password level * * A function made to calculate password strength * * @param string $password The password to check * @return integer */ function password_level($password) { $level = 0; if(strlen($password) >= 6) { $level++; } if(preg_match('/[0-9]/',$password)) { $level++; } return $level; } /** * Display form * * Used to display the form with an optional message * * @param string $message An optional message * @param string $password Used to fill-out the form */ function display_form($message=null,$password=null) { $message = !empty($message) ? "<strong>{$message}</strong>\n\n" : null; echo <<<EOF {$message}<form action='{$_SERVER['REQUEST_URI']}'> <label>Password: <input type='text' name='password' value='{$password}' /></label> <button type='submit'>Calculate password level</button> </form> EOF; } if(!empty($_GET['password'])) { display_form("Your password strength is at level ".password_level($_GET['password'])); } else { display_form(); } ?> [/code] I am not sure what you mean with if it contains characters, so I did not implement that, but I'm sure you can figure out how to do so based on this example script.
  11. Hey, You might want to check out the [url=http://pear.php.net]PEAR[/url] package called [url=http://pear.php.net/package/HTML_BBCodeParser]HTML_BBCode_Parser[/url]. It's a package already written for people who would like to use it and it comes with a [url=http://pear.php.net/package/HTML_BBCodeParser/docs]documentation[/url].
×
×
  • 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.