Results 1 to 6 of 6

Thread: php code displying as plain text

  1. #1
    Join Date
    Apr 2013
    Location
    Modra, Slovakia
    Posts
    265

    Default php code displying as plain text

    I'm trying to create simple registration/login form so users can write into databeses they've privilegies... but the php code isn't runnin it is displaying as plain text, I've installed lamp server like this http://www.unixmen.com/install-lamp-...opensuse-13-1/ and added some other php modules for html support. But I think it smth in php configuration files ???
    13.2 KDE 64bit tumbleweed
    Lenovo G500s, Thinkpad R500

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,734

    Default Re: php code displying as plain text

    You failed to show us an example URL where it goes wrong.
    Henk van Velden

  3. #3
    Join Date
    Apr 2013
    Location
    Modra, Slovakia
    Posts
    265

    Default Re: php code displying as plain text

    sorry actualy php I tried md5('password') it gives hashed output, but what's not runnin
    Code:
    require 'connect.inc.php'; require 'core.inc.php'; include 'loginform.inc,php';  echo $current_file;  ?>
    Code:
      if(!empty($username)) && !empty($passh))
    gives this error
    Code:
      syntax error, unexpected '&&' (T_BOOLEAN_AND)
    what I am supposed to put instead && - AND ?
    13.2 KDE 64bit tumbleweed
    Lenovo G500s, Thinkpad R500

  4. #4

    Default Re: php code displying as plain text

    Quote Originally Posted by roberto68 View Post
    sorry actualy php I tried md5('password') it gives hashed output, but what's not runnin
    Code:
    require 'connect.inc.php'; require 'core.inc.php'; include 'loginform.inc,php';  echo $current_file;  ?>
    Code:
      if(!empty($username)) && !empty($passh))
    gives this error
    Code:
      syntax error, unexpected '&&' (T_BOOLEAN_AND)
    what I am supposed to put instead && - AND ?
    No.
    You just messed up the brackets.

    It should look like this:
    Code:
     if(!empty($username) && !empty($passh))
    And I hope the file does start with this and you only omitted it here when posting, right?
    Code:
    <?php
    Last edited by wolfi323; 27-Feb-2014 at 03:55.

  5. #5
    Join Date
    Apr 2013
    Location
    Modra, Slovakia
    Posts
    265

    Default Re: php code displying as plain text

    stupid mistakes solved, but what annoys me is this
    Code:
     SELECT `id` FROM `users` WHERE `name`='roberto1'
    Code:
     PHP Parse error:  syntax error, unexpected '`' in /srv/www/htdocs/loginform.inc.php on line 9
    but when I executed that qury in phpmyadmin it queried as breeze. And the database is selected right I've another fucntion connect.php and there it si conditioned if it cannot log in and connect to taht database it'll report error
    Last edited by hcvv; 27-Feb-2014 at 12:05. Reason: repaired CODE tag
    13.2 KDE 64bit tumbleweed
    Lenovo G500s, Thinkpad R500

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,734

    Default Re: php code displying as plain text

    Quote Originally Posted by roberto68 View Post
    stupid mistakes solved, but what annoys me is this
    Code:
     SELECT `id` FROM `users` WHERE `name`='roberto1'
    Code:
     PHP Parse error:  syntax error, unexpected '`' in /srv/www/htdocs/loginform.inc.php on line 9
    but when I executed that qury in phpmyadmin it queried as breeze. And the database is selected right I've another fucntion connect.php and there it si conditioned if it cannot log in and connect to taht database it'll report error
    I am not that fluent in PHP and MySQL, but I never used those ` (back-quotes) in such a statement. And the error also complains about it. I have e.g.
    Code:
    $query = 'SELECT id FROM dia WHERE code = "' . $code .
    Henk van Velden

Posting Permissions

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