wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Preventing Access to Directory Path From Client Browsers
wildteen88 replied to parka's topic in Apache HTTP Server
Post your rewrite rule here. PHP will not be affected by mod_rewrite rules. -
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]
-
You need to wrap quotes around the value for the question field: $sql="UPDATE question SET question='$question' WHERE questionid=".$_GET['editid'];
-
Is an error displayed with my changes applied? Could you post the error here
-
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; }
-
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.
-
i want to work on PHP but my apache not working
wildteen88 replied to aman_batra's topic in Apache HTTP Server
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. -
[SOLVED] Two questions about PHP and Databases
wildteen88 replied to doctor_james's topic in PHP Coding Help
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. -
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";
-
Easiest solution would be to search google for a javascript countdown timer script.
-
You'll need to use javascript yes. Not unless you keep refreshing the page every secound using a meta refresh.
-
im using WAMP2.0...but having problems!!
wildteen88 replied to darkmonk's topic in PHP Installation and Configuration
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. -
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.
-
use s instead of m
-
" No ending delimiter '^' found in " What Have I done ?
wildteen88 replied to JChilds's topic in Regex Help
Is your textarea that you post the HTML code in called input? -
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.
-
" No ending delimiter '^' found in " What Have I done ?
wildteen88 replied to JChilds's topic in Regex Help
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>'; -
" No ending delimiter '^' found in " What Have I done ?
wildteen88 replied to JChilds's topic in Regex Help
Could you explain what you are trying to achieve? What is in $_POST['input'] ? -
" No ending delimiter '^' found in " What Have I done ?
wildteen88 replied to JChilds's topic in Regex Help
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>'; ?> -
" No ending delimiter '^' found in " What Have I done ?
wildteen88 replied to JChilds's topic in Regex Help
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. -
" No ending delimiter '^' found in " What Have I done ?
wildteen88 replied to JChilds's topic in Regex Help
Use: preg_match('/^id_[\d]+$/', 'input', $matches);