Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. Hi, Does anyone know of a javascript script which can parse php? I tried finding it via google but all turned up were javascript parser written in php. So that i can do: parser.isValid('<?php ..php code.. ?>'); Thanks
  2. K found it! modified my variables_order to egpcs added APPLICATION_ENV to my system variables instead of user variables logged off, logged on worked
  3. w00t got it! <LocationMatch "(\$RECYCLE.BIN|System Volume Information)"> Order allow,deny Deny from all </LocationMatch>
  4. didn't work, i also used this which didn't work either <DirectoryMatch "^\$"> Order allow,deny Deny from all Satisfy All </DirectoryMatch>
  5. Hi How can i exclude a directory from being viewed? When i go to my localhost i get an additional $RECYLE.BIN folder
  6. Well i know it is possible because i've seen people do it, they added an environment variable to their os and then launched their script the environment variable was needed to modify the mode (production, development, staging or testing) in which the script was operating and/or it could/couldn't throw errors/exceptions. I was only dumb enough not to ask how they did it as i assumed that just adding it to your environment variable would suffice
  7. And how am i supposed to call putenv() in htaccess or my os? I need a solution whereby i can add VARIABLE to my environment variables and that i can use getenv() to retrieve that value so far i haven't been able
  8. Hi, I have created a .htaccess file with the following line: SetEnv VARIABLE value in my php script i do: define('VARIABLE', getenv('VARIABLE') ? getenv('VARIABLE') : 'default-value'); But this doesn't work it always gives me default-value. I also tried export VARIABLE=value which also doesn't work anyone know how i can get this working on both linux and windows?
  9. What if none of these websites have a tos? But their products are listed on other websites? Can i then also just show their products?
  10. <?php $found_files = search_r("somefile.ext", "/path/to/some/directory"); ?> Please note that i didn't check the code when i wrote it
  11. Well if application design isn't the correct forum which is? Because i don't see any other forums which are fit for these kind of questions. And actually it somehow does fall under application design as my question is part of the analysis process and the analysis process is part of application design. If i'm wrong please move it as i don't know which forum this topic falls under. By TOS you mean Terms Of Service?
  12. Hey, I want to build a website which combines products from different shops (all hardware related) Anyone got any experience with this? Can i just use and show their products on my website? Or do i need a contract of some sort?
  13. Keep it simple Store the date the user last visited. When he returns to your forum you mark every topic unread if the creation date of the topic is greater then the date he last visited your forum.
  14. Add ob_start(); to the beginning of your script or remove the first div btw read this before posting? http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  15. This script assumes that register_globals = On modify the script to: <?php $sitestyle = isset($_COOKIE['sitestyle']) ? $_COOKIE['sitestyle'] : 'orange'; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo $sitestyle ?>.css" /> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </meta> </head> <body> <a href="switcher.php?set=red">red</a> <a href="switcher.php?set=green">green</a> <a href="switcher.php?set=blue">blue</a> <a href="switcher.php?set=orange">orange</a> </body> </html>
  16. <?php $array = mysql_fetch_assoc($result); $correct_answers = array_intersect($array, $_POST); ?>
  17. This function already exists: http://be.php.net/manual/en/function.file.php use as: <?php $fileLines = file('filename.txt', FILE_SKIP_EMPTY_LINES); ?>
  18. <?php $GLOBALS['_db_connection']; function _display_error($error) { if (ini_get('display_errors') !== false) { echo $error; } } function db_connect($username, $password, $dbname = null, $host = 'localhost') { global $_db_connection; $_db_connection = mysql_connect($host, $username, $password) or _display_error(mysql_error()); if (null !== $dbname) { mysql_select_db($dbname) or _display_error(mysql_error()); } } function db_query($query) { global $_db_connection; return mysql_query($query, $_db_connection); } function db_close() { global $_db_connection; if ($_db_connection) { mysql_close($_db_connection); } } /** * In here comes all the signup logic */ function newsletter_signup($email) { $sql = "INSERT INTO contact (email_address) VALUES ('$email')"; db_query($sql); mail(..); } ?>
  19. Use MySQL instead: SELECT DATE_FORMAT(NOW(), '%X');
  20. You can not get such information like a MAC address from PHP at a minimum you can get it's ip or his ip when he is using a proxy
  21. I have actually no idea to what role you are referring are you using an access control list? and have you got a roles table in your database? <?php $username = mysql_real_escape_string($_POST["username"]); $password = mysql_real_escape_string($_POST["password"]); $query = "SELECT roles.role FROM roles, users WHERE roles.id = users.roles_id AND (username = '$username' AND password = '$password')"; $result = mysql_query($query) or exit(mysql_error()); list($role) = mysql_fetch_array($result, MYSQL_FETCH_NUM); .. ?>
  22. Add: <?php if ($gallery != '' && $vids != '') .. ?> However your query doesn't allow to select both gallery and vids you need a many-to-many table to store this kind of relation.
  23. You probably are referring to degrees in php which can be: 1) Self-Study webdevelopment is a fast moving thing what is hot today is out tomorrow you need to keep up, the best way in doing this is by subscribing to rss feeds from people in the industry, following what they are doing through twitter and ofcourse make sure they know you! Get involved in open-source programs, create stuff and share it with others to get noticed.. The other options are: 2) communication and multimedia technology (mostly php and the material is outdated) as teachers like to believe that what they studied in their younger years still applies.. :S 3) computer science - top notch and helps you in understanding computers, what are bits? how are they used? and besides that algorithms, design patterns, and lots and lots more..
  24. I would say no as html shouldn't be messed in with php, so yes.
  25. Won't this do? $doc->getElementsByTagName('pubDate');
×
×
  • 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.