Jump to content

Caesar

Members
  • Posts

    1,025
  • Joined

  • Last visited

    Never

Posts posted by Caesar

  1. First, any reason why you're not closing your anchor tags? Haven't read the other posts...so not sure if there's a practical point to that. Second, You're defining the session variable for username, as "username"...that's why it's outputting that.

  2. what was the point in going to uni and not nowing what you went for?

     

    was it for the sake of a piece of paper?

     

    Most conmputer programmers are self tault in computer programming and dont need uni in any way or form, most good computer programmers dont need proper office jobs they use the net as there income.

     

    you state you no php quite well so earn money then it that easy ok.

     

    i dont no how to spell properly or can see well but i own my own home and get a nice income due to php mysql css and html you as a uni bud should be caking it in what going on?

     

     

     

    Working in an office can pay off.

     

    My friend has been out of the university for less than a year. He is working for a company that develops software for government schools. He will have made roughly 65K this past year. I say, it's not a bad choice...and it looks good on the resume.

     

    Edit: His strength was PHP initially but he is now working with .NET and C++/C# stuff. I'm not doing so bad working in an office (I do side projects as well 8-))

  3. Insert the dates as a timestamp into an INT column/field.

     

    <?php
    
    $mydate = 'January 15, 2005'; //Assuming that is the date submitted in $_POST['fdate'] or whatever
    $formatit = strtotime($mydate);
    
    ?>

     

    When you query for dates later..you can format easily for display....in any format you want using the date() function.

     

  4. It looks to me like you're not formatting your links correctly. What's with the forward slash after the .php page? Also....

     

     

    print '<td NOWRAP>'."<a href=\"Allfields-50.php/$href_top_x\">$href_top_x[/url]".'</td>';

     

    <?php
    
    echo'<td NOWRAP><a href="Allfields-50.php'./.'$href_top_x.'">'.$href_top_x.'[/url]</td>;
    
    ?>

     

    But I'm still not clear on what you're doing. Would have to see the rest of your code...or how the link is actually echo'ing out.

  5. In any page you want to use that session variable....

    <?php
    
      session_start();
      $very = $_SESSION ['very'];
    
      echo $very; //Should still output a value even on diferent pages;
    
    ?>

     

    Though you can also look into constants....doing this once....it has been defined and it's value won't change....so it depends on your script and logic in terms of what approach would be best.

     

    <?php
    
      define('VERY_DEFINED', $your_value);
    
    ?>

     

    Edit: But you must initiate the session (session_start()) before using the session variable in other pages.

  6. Once you define a session variable...it can be used in any page as long as you initiate the session in each page....you can then do whatever you want. keep track of what questions they've already answered....etc...etc.

     

    <?php
    
      sessions_start();
    
        if(isset($_SESSION['current']) && isset($_GET['q'])) {
    
           $question = $survey->clean($_GET['q']);
    
           $query = $db->query("SELECT * FROM sessions WHERE sess_id = '$question'");
           $current = $db->fetch_array($query);
    
           $answer = $survey->check_question($current[$question]); //Check to see if this question has been answered
    
        }
    
    ?>

     

    Keep in mind I just threw that together without much thought so...it is for illustration purposes to give you a basic idea.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.