SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need help in php script

    hi..
    im running a forum with chipmunk forum script..i want help on this to fix some bugs.hope here i get some good php coder to help..thanks

  2. #2
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    please fix my problem..thx

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    i wonder how people are supposed to help you fix something when you keep the problem a secret
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Either post a proper PHP question, and maybe show us some code that you need help with, or go to the Marketplace and hire someone to fix your problems for you.

  5. #5
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah,im a mad..coz i cant tell my problem here im unable to wrap code my php here.site stop me as a spam count..

  6. #6
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In an effort to stamp out forum SPAM only members with 10 posts or more can post website links or email addresses.

    I have taken all addresses and links out of my php and still I cannot post....how can I get help on a forum which doesnt have correct php in the first place :-)))))

  7. #7
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could post code here at the first time. That's when I have 0 post.

    Make sure you wrap tour code properly, or else check if the policy changed

  8. #8
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do I wrap the code?

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    like this --

    [php]dis be my code[/php]
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  10. #10
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doesnt work for me bro BUT
    I have uploaded the code @

    intro-web DOT com/code.txt

  11. #11
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    PHP Code:
    <?
     ob_start
    ();
    require_once(
    $_SERVER['DOCUMENT_ROOT'].'/db_connect.php'); 

    if(isset(
    $_SESSION['username']) && isset($_SESSION['password'])) {
           
    //REDIRECT TO USERS PROFILE...
           
    header("Location: http://php.example.com/usersPage.php");
    //end if logged in


    //IF SUBMIT BUTTON PRESSED
    if(isset($_POST['submit'])) {

       if(!
    $_POST['username']) die("Error: You must enter your username before logging in.");
       if(!
    $_POST['password']) die("Error: You must enter your password before logging in.");
       
     
    //set cookie if checked
       
    if(!empty($_POST['stay_in'])) {  
             
    $joined =''.$_POST['username'].'[]'.md5($_POST['password']).'';
             
    setcookie('login_cookie'$joined2147483647'/''.http://php.example.com/usersPage.php');   
        } 
    //end if

    //verify user...
    $get_user mysql_query("SELECT * FROM `users` WHERE username = '".$_POST['username']."' AND 

    password = '"
    .md5($_POST['password'])."'");
    $q mysql_fetch_object($get_user);
        if(!
    $q) die("Login Failure: An error occured, please verify your username and password are correct.");
    //set session variables 
    $_SESSION['logged_in'] = 1;
    $_SESSION['username'] = $_POST['username']; 
    $_SESSION['password'] = $_POST['password']; 
    session_write_close();

    header("Location: http://php.example.com/usersPage.php");
    } else {
    //show login form
    ?>
    <form name="login" method="post" action="<? $_SERVER['PHP_SELF']; ?>">
    <table>
    <tr>
      <td>Username:<input type="text" id="username" name="username"></td>
    </tr>
    <tr>
      <td>Password:<input type="password" id="password" name="password"></td>
    </tr>
    <tr>
      <td>Submit: <input type="submit" value="Submit" name="submit" id="submit"></td>
    </tr>
    <tr>
    <td>Remember? <input type="checkbox" name="stay_in[]" checked="yes"></td>
    </tr>
    </table>
    </form>
    <?
    }//end else
    ?>
    there you go, i did it for you

    now, what was your question?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  12. #12
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why one cannot log in, although I have password and login details in a database all right

  13. #13
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok my login works now i need to fix session


Bookmarks

Posting Permissions

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