SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 37 of 37
  1. #26
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    In basic structure, here's a way to do it.

    PHP Code:
    <?php
    // Decide whether we show the form, or try to process the form details
    $showform true;

    // Set a flag for showing timesheet done message, and doing the redirect
    $timesheet false;

    if (isset(
    $_POST['submit'])) {
        
    // Form has been submitted - try to process
        // All your connection, form variables and SQL code goes here
        // You should already have the necessary code from previous posts

        // Assuming all went OK - allow the page to redirect
        
    $timesheet true;
        
    $showform false;
    }
    ?>
    <html>
    <head>
    Put whatever other header tags are needed here

    <?php
    if ($timesheet === true) {
        
    // Set the redirect metatag
        
    echo '<meta http-equiv="refresh" content="5;url=http://website/page.php">';
    }
    ?>
    </head>
    <body>

    <?php
    if ($showform === true) {
    ?>
    <form action="" method="post">
    <!-- Put the form here -->
    </form>
    <?php
    }
    ?>

    <?php
    if ($timesheet=== true) {
        echo 
    '<p>Your timesheet has been saved.</p>';
    }
    ?>

    </body>
    </html>
    Last edited by siteguru; Aug 8, 2007 at 07:50.
    Ian Anderson
    www.siteguru.co.uk

  2. #27
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've gotten it to show up with all the mysql code. It's just not submitting now. It just reloads the page when you press submit.

  3. #28
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    So please please PLEASE can you show us ALL the code of your page. Don't assume that it won't help us - I'm telling you it WILL.
    Ian Anderson
    www.siteguru.co.uk

  4. #29
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Siteguru, Please check your pm

    I'm getting ready to post the whole page.

  5. #30
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've attached the full page.
    Attached Files Attached Files

  6. #31
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still looking for help.

  7. #32
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I've looked at the file - it does not show ANY of the changes we have suggested. I am not editing your file for you.
    Ian Anderson
    www.siteguru.co.uk

  8. #33
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    ...That code is 9644 lines...and most of it is a big waste...it might be better to hire a professional.

    There is no way anyone can manage or debug that.

    You repeat
    PHP Code:
    <input type="text" name="sunworkjob2" size="12" value="<?php
    mysql_select_db
    (time_timesheet_helloworld_com$connection);

    $result253 mysql_query("SELECT * FROM timesheet
    WHERE username='
    $_SESSION[user_name]'");

    while(
    $row mysql_fetch_array($result253))
      {
      echo 
    $row['sunworkjob2'];
      }



    ?>">
    like 50,000 times with errors no doubt very very ineffeciant and slow. I don't know what you are doing but this is just one big mess its time to trash it and start over with a clean slate.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  9. #34
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @wickedneat:
    Looked into it. You sincerely need to start over.

  10. #35
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The error is with the if then statement at the top... If you press submit... It doesn't follow up in the bottom mysql statement. That is where the error lies.

  11. #36
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The error is with the if then statement at the top... If you press submit... It doesn't follow up in the bottom mysql statement. That is where the error lies.

  12. #37
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow just wow, all i can say is theres TONS of unneeded code in alot of examples in this thread... start over...


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
  •