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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    need help with php code

    hey guys im new to coding and im having some trouble i am trying to crate a login.php file but for some or other reason it just comes up with the code i will post code if need be any help would be much appretiated thanks in advance

  • #2
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    yep, post the code...

    also post the exact name of the file you have this code in

  • #3
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    <?php


    $username = $_post ['username'];
    $password = $_post ['password'];
    $login = $_get ['login'];

    setcookie("username","$username",time ()+86400);

    if($login=='yes') {

    $con = mysql_connect("u627998065_login","login","");
    mysql_select_db(login)

    $_get = mysql_query ("select count (id) From loginwhere user='$username'and pass='$password'");

    $result = mysql_result ($get, 0);
    if ($result!1){
    echo "invalid login.";
    }

    else {
    echo"login successful. Welcome back".$_COOKIE['username']."sir/madam";
    $_SESSION ['username'] = $username;


    }



    }
    ?>

    I am using crimson editor and saved as login.php

  • #4
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    so when you open login.php you actually see this code in the browser?

  • #5
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    yea thats all i see

  • #6
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    then it's a problem with your server ... the server needs to know that a file needs to be parsed as php and not just write the contents to screen

  • #7
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmj001 View Post
    then it's a problem with your server ... the server needs to know that a file needs to be parsed as php and not just write the contents to screen
    how do i do that then

  • #8
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    who owns the server?

    is it a hosting company or you have setup a server yourself locally?

  • #9
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    its a free web hoster address is IAS3.com using phpmyadmin

  • #10
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    so you can login to phpmyadmin? if so then the server can display php...

    are you 100%+ sure that the file name is login.php? not login.html?

  • #11
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    yea it says login file type .php

  • #12
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    is there a way to upload a screenshot for you to see

  • #13
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    if you are ok with it paste the link to your website here and i'll have a look... it sounds pretty weird..

  • #14
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    its not letting my open my url it is currently running off my system drives any ideas

  • #15
    New Coder
    Join Date
    Jan 2012
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts
    its saying that it is active url should be www.space-warsz.com


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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