Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Post your rewrite rule here. PHP will not be affected by mod_rewrite rules.
  2. I'd create a dedicated function to parse code tags. I'd then use str_replace to convert [ and ] to their html entities equivalent. function parse_code($code) { $code = str_replace(array('[', ']'), array('& #91;', '& #93;'), $code); // remove the space between & and #. The forum messes this up $output = '<div class="code"><div class="head">code:</div><pre>' . $code . '</pre></div>'; return $output; } $text = '[b]Bold test[/b] [code]Add code here no [b]bbcode[/b] should get parsed '; // replace code tags first $text = preg_replace('|\ [code\](.+?)\[/code\]|es', "parse_code('$1')", $text); $text = preg_replace('|\[b\](.+?)\[/b\]|s', '<b>$1</b>', $text); echo $text;[/code]
  3. You need to wrap quotes around the value for the question field: $sql="UPDATE question SET question='$question' WHERE questionid=".$_GET['editid'];
  4. Is an error displayed with my changes applied? Could you post the error here
  5. Make sure the requested page ($page) is in the $pages array too. Change if( !isset($_POST['page']) ) $page = 'home'; else $page = $_POST['page']); to $page = (isset($_POST['page']) && !empty($_POST['page'])) ? $_POST['page'] : 'home'; // check that the requested page exists if(array_key_exists($page, $pages)) { include $page; }
  6. What error(s) are you getting? Is it the Question not Added/Updated message? If so there is more than likely a problem with your query change: $res=mysql_query($sql,$link); to: $res=mysql_query($sql,$link) or die('MySQL Query Error!<br />Query: <tt>' . $sql . '</tt><br >Error: ' . mysql_error()); If there is a problem within your sql query then an error will be displayed.
  7. Apache is controlled by XAMPP. So there is more than likely a central service called XAMPP. You should be saving your .php files in C:\xampp\htdocs You then ensure XAMPP is running. Then open your browser and go to http://localhost/ to run your script.
  8. PHP supports a wide range of databases as seen here. Yes you can connect to a local database from a remote site. Just make sure your computer has a static IP address and that your localhost database allows remote connections. You'll also need to make sure the port your database uses to listen to for TCP/IP connections accepts remote connections too.
  9. Aliases cannot be used in a WHERE clause. Use HAVING instead: $s = "SELECT x, y, POW(x,y) as z FROM test_math HAVING (z > 16) ORDER BY z";
  10. I recommend you to add PHP to PATH. ALso read this thread
  11. Easiest solution would be to search google for a javascript countdown timer script.
  12. Remove the @ symbols from infront of mysql_connect and mysql_select_db function calls The @ suppresses errors.
  13. You'll need to use javascript yes. Not unless you keep refreshing the page every secound using a meta refresh.
  14. Do you get any output after the changes I suggested for login.php?
  15. Has WAMP loaded the mysqli extension? I have not used WAMP but from what I remember you should be able to load/unload extensions via WAMP's control panel from the taskbar icon.
  16. Do you get any output if yo change: <?php include_once("survconfig.php"); $TheDB = dbConnect($dbsurv); to <?php echo 'Starting Login.php'; include_once("survconfig.php"); echo '<br /> include srvconfig.php'; $TheDB = dbConnect($dbsurv); echo '<br />Call dbConnect...'; What is in servconfig.php too?
  17. Strange! PHP is reading your php.ini (which is C:/program files/php/php.ini) according to phpinfo display_errors is enabled too and error_reporting is set to 6143 (E_ALL) yet no errors are displayed. accesscontrol.php is working as it redirects me to login.php. Its login.php that does not outut anything. The issue I have is that you have register_globals enabled, but it appears your script replys on register globals to function. I do not recommend you to rely on register_globals in your scripts. It is depreciated and is being removed as of PHP6. I also see you have compiled PHP yourself for some reason. Why is this? PHP comes pre-compiled for Windows.
  18. use s instead of m
  19. Is your textarea that you post the HTML code in called input?
  20. Mod rewrite is not enabled. You'll need to enable the mod_rewrite.so module in the httpd.conf Make sure you restart Apache after enabling the module.
  21. Better of using preg_match_all $input = $_POST['input']; preg_match_all('/name="id_([\d]+)"/', $input, $matches); echo '<pre>' . print_r($matches[1], true) . '</pre>';
  22. Could you explain what you are trying to achieve? What is in $_POST['input'] ?
  23. Are you wanting to match the quote after the numbers too: id_1234567" Also 'input' should be $input <?php $input = $_POST["input"]; preg_match('/^id_[\d]+"$/', $input, $matches); echo '<pre>' . print_r($matches, true) . '</pre>'; ?>
  24. preg_match returns an array of matches. use: preg_match('/^id_[\d]+$/', 'input', $matches); echo '<pre>' . print_r($matches, true) . '</pre>'; To see the matches returned from the expression.
  25. Use: preg_match('/^id_[\d]+$/', 'input', $matches);
×
×
  • 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.