SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    canada
    Posts
    153
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    user form process problem when returning back to the calling script

    Hello everybody,

    Problem:
    form processing script throws error when returning back to the calling script which is the user entry form.

    error message

    Notice: A session had already been started - ignoring session_start() in /inc/utilities.inc.php on line 3 Fatal error: Cannot redeclare class Connection in /inc/dbconn.php on line 5

    The code is a bit too large to copy past all of it so im just going to focus on the problem area.
    newproject.php calls -> savenewproject.php. if savenewproject.php finds error it returns back to newproject.php to display error message.


    PHP Code:

    <?php
    //newproject.php - parts of the code that i believe is  the problem area.
    include('../inc/utilities.inc.php'); 
    include(
    'header.php');
    if (!empty(
    $errorString))
        {    echo 
    '<div class="error">' $errorString '</div>';    }

        if (!empty(
    $successString))
        {    
    $emailaddress ''
            
    $budget '';
            
    $projecttitle ='';
            
    $projectdescription '';
            echo 
    '<div id="divfadeout" class="success">' $successString '</div>';
        }
    ?>
    <form name ='newProject' action="../inc/savenewproject.php" enctype="multipart/form-data" method="POST">
    the rest are form fields
    </form>
    PHP Code:
    // include('../inc/utilities.inc.php'); - appears in both script
    <?php
    session_start
    ();
    $user = (isset($_SESSION['user'])) ? $_SESSION['user']: null;
    include(
    "../inc/dbconn.php");
    ?>
    PHP Code:
    // savenewproject.php - copy/pasting what i believed to be the problem area.
    if(count($fieldErrors) > 0)
    {    
    $errorString '<p>There was an error processing the form.</p>';
        
    $errorString 'ul>';
        foreach(
    $fieldErrors as $errorVal)
        {    
    $errorString .= "<li>$errorVal</li>"; }
            
    $errorString .= '</ul>';
        include (
    '../layout/newproject.php');               
    }
    else

    any help you can provide would be greatly appreciated..
    thanks

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    canada
    Posts
    153
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    solved by replacing the include with request_once..


    Quote Originally Posted by robin01 View Post
    Hello everybody,

    Problem:
    form processing script throws error when returning back to the calling script which is the user entry form.

    error message

    Notice: A session had already been started - ignoring session_start() in /inc/utilities.inc.php on line 3 Fatal error: Cannot redeclare class Connection in /inc/dbconn.php on line 5

    The code is a bit too large to copy past all of it so im just going to focus on the problem area.
    newproject.php calls -> savenewproject.php. if savenewproject.php finds error it returns back to newproject.php to display error message.


    PHP Code:

    <?php
    //newproject.php - parts of the code that i believe is  the problem area.
    include('../inc/utilities.inc.php'); 
    include(
    'header.php');
    if (!empty(
    $errorString))
        {    echo 
    '<div class="error">' $errorString '</div>';    }

        if (!empty(
    $successString))
        {    
    $emailaddress ''
            
    $budget '';
            
    $projecttitle ='';
            
    $projectdescription '';
            echo 
    '<div id="divfadeout" class="success">' $successString '</div>';
        }
    ?>
    <form name ='newProject' action="../inc/savenewproject.php" enctype="multipart/form-data" method="POST">
    the rest are form fields
    </form>
    PHP Code:
    // include('../inc/utilities.inc.php'); - appears in both script
    <?php
    session_start
    ();
    $user = (isset($_SESSION['user'])) ? $_SESSION['user']: null;
    include(
    "../inc/dbconn.php");
    ?>
    PHP Code:
    // savenewproject.php - copy/pasting what i believed to be the problem area.
    if(count($fieldErrors) > 0)
    {    
    $errorString '<p>There was an error processing the form.</p>';
        
    $errorString 'ul>';
        foreach(
    $fieldErrors as $errorVal)
        {    
    $errorString .= "<li>$errorVal</li>"; }
            
    $errorString .= '</ul>';
        include (
    '../layout/newproject.php');               
    }
    else

    any help you can provide would be greatly appreciated..
    thanks


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
  •