Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 4 of 4

Thread: Whats wrong with my code???

  1. #1

    Whats wrong with my code???

    what i am trying to do is create a my account page so you can review and edit your information and i am trying to pull the proper record by using the session "username"

    here is the code
    Code:
    <?
    session_start();
    if (empty($_SESSION['username'])){
    header("location:index1.php");
    exit;
    }
    
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>My Creative Process</title>
    <style type="text/css">
    <!--
    .style1 {color: #666666}
    -->
    </style>
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    .style2 {	color: #f73602;
    	font-weight: bold;
    }
    .style3 {
    	color: #FFFFFF
    }
    .style4 {color: #F15A25}
    -->
    </style>
    </head>
    
    <body>
    <table width="972" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td><div align="right">Logged in as: <? echo $_SESSION['username'];?></div></td>
      </tr>
    </table>
    <table width="972" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#F73602" id="frame">
      <tr bordercolor="#F15A25">
        <td colspan="4"><div align="center">
          <p><img src="/images/header.jpg" width="942" height="84" /></p>
          <table width="902" border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td width="728"><p><span class="style1"><a href="/index.php">home</a> | <a href="/main_forum.php">review</a> | <a href="/create_topic.php">post</a> | <a href="/mindgames.php">mindgames</a> | <a href="/archive.php">archive</a> | <a href="/brainstorm.php">brainstorm</a> | <a href="/my_account.php">my account</a> | <a href="/suggestion_box.php">suggestion box</a></span></p>            </td>
              <td colspan="-1"><div align="right">
                <?
      //echo "You've been logged in since" . $_SESSION['time'] . "<br>";
      
      echo '<a href="logout.php">Click here to logout</a>';
      //echo "<br>";
     // echo '<a href="' .$_SERVER['PHP_SELF']. '?action=change"> Change Password</a>';
      ?>
                  <?
      include "fns.php";
      $action=$_GET['action'];
      if($action=="change"){
      changepw($_SESSION['username']);
      update($newpass,$_SESSION['username']);
      }else{
      
      }
        ?>
                        </div></td>
            </tr>
          </table>
          <table width="902" border="0" cellspacing="0" cellpadding="5">
            <tr>
              <td width="728" valign="top"><p>
                <?php
    include "config.php";
    $user=($_SESSION['username']);
    $tbl_name="user";
    $sql="SELECT * FROM $tbl_name WHERE uname = '$user' ";
    $result=mysql_query($sql);
    $f_name=$_GET['f_name'];
    
    echo $_SESSION['username'];
    echo $f_name;
    ?>

  2. #2
    wow... this forum is dead!

  3. #3
    Last I checked none of us were your personal code monkeys' ... and with in the span of an hour from your original post you expect an instant answer. Bad form man, bad form.
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  4. #4
    It might help if you actually describe the specific problem that you are having. Also, remember that print_r is your friend when you are trying to figure things out.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012