Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Posts
    215
    Thanks
    74
    Thanked 0 Times in 0 Posts

    wht is the Problem when your PHP IS not PHP

    Hello

    Recently I have made Script , All Ok But Some People Reported to me that the Admin Area Shows as

    (this is Only Example not actual Code )

    if (substr(trim($line), -1, 1) == ';')
    {
    // Perform the query
    mysql_query($templine) or print('Error performing query \'<strong>' . $templine . '\': ' . mysql_error() . '<br /><br />');
    // Reset temp variable to empty
    $templine = '';

    AS if its Not php and Just Shows up as Html its a Php file and seem OK BECAUSE NO ANY PHP ERROR.. Debug mode is on and no any php errors Shown .. its just Like if the code is Html ..

    its Ok with me and Most who used it but Few Reported that problem and Can not Figuer out wht Could it be..
    Last edited by ajloun; 02-18-2010 at 12:43 PM.

  • #2
    New Coder
    Join Date
    Aug 2003
    Location
    Derby, UK
    Posts
    97
    Thanks
    0
    Thanked 14 Times in 14 Posts
    This will happen if the webserver it is running on is not set to process files with a .php extension as php, but rather as straight text. For example if you put php code on a vanilla windows web server this would happen as it does not recognise the .php extension as anything special.

    HTH,

    Dai

  • #3
    Regular Coder
    Join Date
    Aug 2009
    Posts
    215
    Thanks
    74
    Thanked 0 Times in 0 Posts
    Thank you ,

    But they have the Appache and the Script Works But Only the Admin Area.. If it Happens to me i cN GO FROM THERE TO SEE WHTS MATTER it just not happening..But Some Different Users reported to me it Happends to them .. So i'm pretty sure Something is Wrong.

  • #4
    New Coder
    Join Date
    Aug 2003
    Location
    Derby, UK
    Posts
    97
    Thanks
    0
    Thanked 14 Times in 14 Posts
    Sounds very odd. The only other reasons I can think that it would show the PHP if properly configured are:
    • if you have not put php tags around all of your code
    • if you have output an incorrect content-type header (e.g. if you set content type explicitly to text/plain)
    • if the code is somehow getting escaped
    • if there is an .htaccess file in the directory that overrides the server config
    • if the server has been hacked which could involve any of the above or more issues


    As you say the first step in fixing a problem is reproducing it, if you can't see the problem yourself and cannot establish a pattern for what links the clients who are experiencing it then you are going to struggle to fix it. Do you have the ability to call one of the people with a problem and talk them through what they are doing, maybe get them to tyr some test scripts etc.?

    HTH,

    Dai


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •