mysql - PHP code is suddenly showing up in my web page rather than executing - wasn't doing this before? -


The blocks or pieces of PHP code are suddenly appearing in my web page, such that they are not being recognized as PHP codes. I was already working it and I think that whatever I have changed or done, I can not think of it being stopped from working! I was working Apache, MySQL and PHP together for the first time so long and now it's working. I am ready to take my hair out!

Example 1: example 1 Example 1 Code: (Note that a PHP code block is being shown in the web page, while others do not!)

   <- - Display any SQL errors here -> "Hello world"; & lt php echo, if (isset ($ _post ['select']) {if ($ Result = mysql_query ($ _ post ['select!'])) Die ("Error:". Mysql_error ());}?   

Example 2: Example 2

Example 2 Code:

  & lt; fieldset> & lt; legend & gt; tag:? & Lt; / a 'Tag' recipes like the & gt; & lt; table class = "tagstable" & gt; & lt; tr class = "tagsrow" & gt; & lt; / tr & gt; & lt; php $ query = " Show column from "(; (retired = mysql_query ($ query)) if die (" error - no column can show: "mysql_error ().); If (mysql_num_rows ($ retired)> 0) { $ Row = mysql_fetch_row ($ ret); $ option = explosion ("','", preg_replace ("/ (enum | Set) \ ('$?)' \ ('$?)' \ / /, "\\ 2", $ line [1]))}} Forex ($ option as $ tag) {echo '& lt; script type = "Text / JavaScript" & gt; addTag ('. $ Tag' ", incorrect) & lt; / Script & gt; ';?} & gt; & Lt; / Table & gt; & Lt; Br> & Lt; Input type = "text" id = "addtag" & gt; Input type =;     

The page works as expected

  • The folder containing php.exe is included in my path
  • Tried to restart Apache
  • All in reply Steps were followed
  • Using Apache 2.2 .22, MySQL Server 5.5.24, PHP 5.4.3, Windows 7

    Apache included in httpd.conf Are:

      LoadModule php5_module "c: / websites /php/php5apache2_2.dll" & lt; IfModule dir_module & gt; DirectoryIndex index.html index.htm index.php & lt; / IfModule & gt; AddType application / x-httpd-php .php PHPIniDir "C: / websites / php"   

    left anything which I have not thought of ??

    Thank you!

    What is the path of the phpinfo () page? Compare that path that is using to use your script. My guess (when yo yo says "php.exe is included in my path"), that you are not accessing the file on your web root, rather trying to access it directly through the file system Are there. You need to access it through the webserver. If you do this right, then it will probably look like this:

      http: //localhost/myscript.php    

  • Comments