Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2006, 06:57 AM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Warning: Header may not contain more than a single


Warning: Header may not contain more than a single header, new line
   detected. in /home/invitec/public_html/tgmc/register_process.php on
line 655


Hi Got the following error at the time of redirecting the page.

Please give me the solution for this error...

I am coping the total code



<?php
ob_start();
//print_r($_POST);
$error_msg="";
 if((trim($team_name)=="")
 || (strlen(trim($team_password))<8) || (trim($team_password)=="")
 || ($_POST["lstProject"]=="0")
 || ($_POST["lstUniversity"]=="0" && trim($_POST["other_university"])=="")
 || ($_POST["lstInstitute"]=="0" && trim($_POST["other_institute"])=="")
 || (trim($_POST["principle_name"])=="")
 || (trim($_POST["institute_address1"])=="")
 || (trim($_POST["lstCity"])=="")
 || ($_POST["lstState"]=="0")
 || ($_POST["lstDistrict"]=="" && trim($_POST["t1"])=="")
 || (trim($_POST["institute_phone1"])=="")
 || ($_POST["guide_title"]=="0")
 || (trim($_POST["guide_name"])=="")
 || (trim($_POST["guide_address"])=="")
 || (trim($_POST["guide_phone1"])=="")
 || ($_POST["lstCity2"]=="0")
 || ($_POST["timestamp"]=="")
 || ($_POST["timestamp1"]=="")
 )
 {
$error_msg="Please fill All the fields";
 }

/* Validation */

function check_field1($field_name_1){
if(!preg_match("/[^a-zA-Z0-9\.\-\ \ \ ]+$/s",$field_name_1))
 return TRUE;
else return FALSE;
}

function check_field2($field_name_2){
if(!preg_match("/[^0-9\ ]+$/",$field_name_2)) return TRUE;
else return FALSE;
}

function check_field3($field_name_3){
if(!preg_match("/[^0-9]+$/ ",$field_name_3)) return TRUE;
else return FALSE;
}

/* Validation */

$error=0; // check up variable
/* get it checking */

if(!check_field2($institute_phone1)){
$error_msg="Illagel input $your_zip ";
$error++;
}

if(!check_field2($guide_phone1)){
$error_msg="Illagel input $your_zip ";
$error++;
}
/*if(!check_field3($your_zip)){
$error_msg="Illagel input $your_zip ";
$error++;
}*/

/************************************************** ********/

if($_POST["guide_email_address"]=="")
{
$error_msg.="Please enter a valid email address<br>";
}
else
{
if(!ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $_POST["guide_email_address"]))
$error_msg.="Please enter a valid email address";
}

for($j=0;$j<$total_team_members;$j++)
{
if((trim($team_mem_name[$j]) == "") || ($branch[$j]=="0") || ($studyYear[$j]=="0") || ($completionYear[$j]=="0") || (!check_field2($team_mem_phone[$j])) || ($team_mem_email[$j]==""))
{
$error_msg.="Please enter a valid email address<br>";
}
else
    {
if(!ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $team_mem_email[$j]))
    $error_msg.="Please enter a valid email address";
    }
}

if($error_msg!="")
{

    $link="http://192.168.0.194/tgmc/registration.php"."?err=4&team_name=$team_name&lst Project=$lstProject&lstUniversity=$lstUniversity&o ther_university=$other_university&lstInstitute=$ls tInstitute&other_institute=$other_institute&princi ple_name=$principle_name&ibm_user_id=$ibm_user_id& institute_address1=$institute_address1&institute_a ddress2=$institute_address2&lstCity=$lstCity&other _city=$other_city&lstState=$lstState&lstDistrict=$ lstDistrict&other_district=$other_district&institu te_pincode=$institute_pincode&institute_phone1=$in stitute_phone1&institute_phone2=$institute_phone2& institute_website=$institute_website&team_mem_name =$team_mem_name&completionYear=$completionYear&tea m_mem_email=$team_mem_email&team_mem_phone=$team_m em_phone&team_alt_phone=$team_alt_phone&guide_titl e=$guide_title&guide_email_address=$guide_email_ad dress&guide_name=$guide_name&guide_address=$guide_ address&guide_phone1=$guide_phone1&guide_phone2=$g uide_phone2&lstCity2=$lstCity2×tamp=$timestamp×t amp1=$timestamp1";

    echo "<script language='javascript'>";
    echo "location.href='$link'";
    echo "</script>";
    exit;

/*header("Location:registration.php?err=4&team_name =$team_name&lstProject=$lstProject&lstUniversity=$ lstUniversity&other_university=$other_university&l stInstitute=$lstInstitute&other_institute=$other_i nstitute&principle_name=$principle_name&ibm_user_i d=$ibm_user_id&institute_address1=$institute_addre ss1&institute_address2=$institute_address2&lstCity =$lstCity&other_city=$other_city&lstState=$lstStat e&lstDistrict=$lstDistrict&other_district=$other_d istrict&institute_pincode=$institute_pincode&insti tute_phone1=$institute_phone1&institute_phone2=$in stitute_phone2&institute_website=$institute_websit e&team_mem_name=$team_mem_name&completionYear=$com pletionYear&team_mem_email=$team_mem_email&team_me m_phone=$team_mem_phone&team_alt_phone=$team_alt_p hone&guide_title=$guide_title&guide_email_address= $guide_email_address&guide_name=$guide_name&guide_ address=$guide_address&guide_phone1=$guide_phone1& guide_phone2=$guide_phone2&lstCity2=$lstCity2×tam p=$timestamp×tamp1=$timestamp1");*/

}

//echo $_POST["lstDistrict"];
$other_district=$_POST["t1"];
include("dbConnect.php");
//include('include/config.php');


//************************************************** ************************************************** ************************************************** *****************************

// getting next team identification no.

             $strSelTeamId = "select count(team_id) from team";
             $rsTeamId = mysql_query($strSelTeamId);

             if(mysql_num_rows($rsTeamId) > 0 )
             {
                 $marrSelTeamId = mysql_fetch_array($rsTeamId);
                 $mintTeamCtr = $marrSelTeamId["count(team_id)"];

             } // if(mysql_num_rows($rsTeamId) > 0 )

             if($mintTeamCtr == 0)
             {
                 $mintTeamId = 1;
             } // if($mintTeamCtr == 0)
             else
             {
                 $strSelMaxTeamId = "select max(team_id) from team";
                 $rsSelMaxTeamId = mysql_query($strSelMaxTeamId);
                 if(mysql_num_rows($rsSelMaxTeamId) > 0 )
                 {
                     $marrSelMaxTeamId = mysql_fetch_array($rsSelMaxTeamId);
                       $mintTeamId = $marrSelMaxTeamId["max(team_id)"] + 1;

                 } // if(mysql_num_rows($rsSelMaxTeamId) > 0 )

             }

             $team_id =$mintTeamId;

        // echo "<br>Team ID = ".$team_id;



//************************************************** ************************************************** ************************************************** ***************************

    // getting next guide identification no.

             $strSelTeamGuideId = "select count(team_faculty_id) from team_faculty_details";
             $rsTeamGuideId = mysql_query($strSelTeamGuideId);

             if(mysql_num_rows($rsTeamGuideId) > 0 )
             {
                 $marrSelTeamGuideId = mysql_fetch_array($rsTeamGuideId);
                 $mintTeamGuideCtr = $marrSelTeamGuideId["count(team_faculty_id)"];

             } // if(mysql_num_rows($rsTeamGuideId) > 0 )

             if($mintTeamGuideCtr == 0)
             {
                 $mintTeamGuideId = 1;

             } // if($mintTeamCtr == 0)
             else
             {
                 $strSelMaxTeamGuideId = "select max(team_faculty_id) from team_faculty_details";
                 $rsSelMaxTeamGuideId = mysql_query($strSelMaxTeamGuideId);
                 if(mysql_num_rows($rsSelMaxTeamGuideId) > 0 )
                 {
                     $marrSelMaxTeamGuideId = mysql_fetch_array($rsSelMaxTeamGuideId);
                       $mintTeamGuideId = $marrSelMaxTeamGuideId["max(team_faculty_id)"] + 1;

                 } // if(mysql_num_rows($rsSelMaxTeamId) > 0 )

             }

             $guide_id =$mintTeamGuideId;

             //echo "<br>Team Guide ID = ".$guide_id;

//************************************************** ************************************************** ************************************************** ***************************
    // generating id for other institutes

            if($other_institute != "")
            {
                //echo "<br>other_institute = ".$other_institute;

                $strSelInstitute = "select institute_nm from institute where institute_nm = '".$other_institute."'";
                //print "<br>strSelInstitute = ".$strSelInstitute;
                $rsSelInstitute = mysql_query($strSelInstitute);

                $numInstitute = mysql_num_rows($rsSelInstitute);
                if($numInstitute == 0)
                {
                    // get next id for institute from institute table

                     $strSelInstituteId = "select count(institute_id) from institute";
                     $rsInstituteId = mysql_query($strSelInstituteId);

                     if(mysql_num_rows($rsInstituteId) > 0 )
                     {
                         $marrSelInstituteId = mysql_fetch_array($rsInstituteId);
                         $mintInstituteCtr = $marrSelInstituteId["count(institute_id)"];

                     } // if(mysql_num_rows($rsTeamGuideId) > 0 )

                     if($mintInstituteCtr == 0)
                     {
                         $mintInstituteId = 1;

                     } // if($mintInstituteCtr == 0)
                     else
                     {
                         $strSelMaxInstituteId = "select max(institute_id) from institute";
                         $rsSelMaxInstituteId = mysql_query($strSelMaxInstituteId);
                         if(mysql_num_rows($rsSelMaxInstituteId) > 0 )
                         {
                             $marrSelMaxInstituteId = mysql_fetch_array($rsSelMaxInstituteId);
                             $mintInstituteId = $marrSelMaxInstituteId["max(institute_id)"] + 1;

                         } // if(mysql_num_rows($rsSelMaxInstituteId) > 0 )

                     }

                     $other_institute_id =$mintInstituteId;

                     //echo "<br>Other Institute ID = ".$other_institute_id;
                     //echo "<br>Othe Institute name = ".$other_institute;


                }
            }
//************************************************** ************************************************** ************************************************** ***************************
    // generating id for city

                //echo "<br>other_city = ".$other_city;


             $strSelCityId = "select count(city_id) from city";
             $rsCityId = mysql_query($strSelCityId);

             if(mysql_num_rows($rsCityId) > 0 )
             {
                 $marrSelCityId = mysql_fetch_array($rsCityId);
                 $mintCityCtr = $marrSelCityId["count(city_id)"];

             } // if(mysql_num_rows($rsTeamId) > 0 )

             if($mintCityCtr == 0)
             {
                 $mintCityId = 1;
             } // if($mintTeamCtr == 0)
             else
             {
                 $strSelMaxCityId = "select max(city_id) from city";
                 $rsSelMaxCityId = mysql_query($strSelMaxCityId);
                 if(mysql_num_rows($rsSelMaxCityId) > 0 )
                 {
                     $marrSelMaxCityId = mysql_fetch_array($rsSelMaxCityId);
                       $mintCityId = $marrSelMaxCityId["max(city_id)"] + 1;

                 } // if(mysql_num_rows($rsSelMaxTeamId) > 0 )

             }

             $lstCityID =$mintCityId;

//************************************************** ************************************************** ************************************************** ***************************
    // generating id for other university

            if($other_university != "")
            {
                //echo "<br>other_university = ".$other_university;

                $strSelUniversity = "select university_nm from university where university_nm = '".$other_university."'";
                //print "<br>strSelUniversity = ".$strSelUniversity;
                $rsSelUniversity = mysql_query($strSelUniversity);

                $numUniversity = mysql_num_rows($rsSelUniversity);
                if($numUniversity == 0)
                {
                    // get next id for university from university table

                     $strSelUniversityId = "select count(university_id) from university";
                     $rsUniversityId = mysql_query($strSelUniversityId);

                     if(mysql_num_rows($rsUniversityId) > 0 )
                     {
                         $marrSelUniversityId = mysql_fetch_array($rsUniversityId);
                         $mintUniversityCtr = $marrSelUniversityId["count(university_id)"];

                     } // if(mysql_num_rows($rsCityId) > 0 )

                     if($mintUniversityCtr == 0)
                     {
                         $mintUniversityId = 1;

                     } // if($mintUniversityCtr == 0)
                     else
                     {
                         $strSelMaxUniversityId = "select max(university_id) from university";
                         $rsSelMaxUniversityId = mysql_query($strSelMaxUniversityId);
                         if(mysql_num_rows($rsSelMaxUniversityId) > 0 )
                         {
                             $marrSelMaxUniversityId = mysql_fetch_array($rsSelMaxUniversityId);
                             $mintUniversityId = $marrSelMaxUniversityId["max(university_id)"] + 1;

                         } // if(mysql_num_rows($rsSelMaxUniversityId) > 0 )

                     }

                     $other_university_id =$mintUniversityId;

                     //echo "<br>Other University ID = ".$other_university_id;
                     //echo "<br>Othe University name = ".$other_university;


                }
            }

//*****************Work Shop Id *******************

             $strWorkshopId = "select count(workshop_id) from workshop_date";
             $rsWorkshopId = mysql_query($strWorkshopId);

             if(mysql_num_rows($rsWorkshopId) > 0)
             {
                 $marrSelWorkshopId = mysql_fetch_array($rsWorkshopId);
                 $mintWorkshopCtr = $marrSelWorkshopId["count(workshop_id)"];

             } // if(mysql_num_rows($rsTeamGuideId) > 0 )

             if($mintWorkshopCtr == 0)
             {
                 $mintWorkshopId = 1;

             } // if($mintTeamCtr == 0)
             else
             {
                 $strSelMaxWorkshopId = "select max(workshop_id) from workshop_date";
                 $rsSelMaxWorkshopId = mysql_query($strSelMaxWorkshopId);
                 if(mysql_num_rows($rsSelMaxWorkshopId) > 0 )
                 {
                     $marrSelMaxWorkshopId = mysql_fetch_array($rsSelMaxWorkshopId);
                       $mintWorkshopId = $marrSelMaxWorkshopId["max(workshop_id)"] + 1;

                 } // if(mysql_num_rows($rsSelMaxTeamId) > 0 )

             }

             $work_shopid = $mintWorkshopId;



/********************* Other State *********************************************** */



            if($other_state != "")
            {
                //echo "<br>other_city = ".$other_city;

                $strSelState = "select state_nm from state where state_nm = '".$other_state."'";
                //print "<br>strSelCity = ".$strSelCity;
                $rsSelState = mysql_query($strSelState);

                $numState = mysql_num_rows($rsSelState);
                if($numState == 0)
                {
                    // get next id for city from city table

                     $strSelStateId = "select count(state_id) from state";
                     $rsStateId = mysql_query($strSelStateId);

                     if(mysql_num_rows($rsStateId) > 0 )
                     {
                         $marrSelStateId = mysql_fetch_array($rsStateId);
                         $mintStateCtr = $marrSelStateId["count(state_id)"];

                     } // if(mysql_num_rows($rsCityId) > 0 )

                     if($mintStateCtr == 0)
                     {
                         $mintStateId = 1;

                     } // if($mintCityCtr == 0)
                     else
                     {
                         $strSelMaxStateId = "select max(state_id) from state";
                         $rsSelMaxStateId = mysql_query($strSelMaxStateId);
                         if(mysql_num_rows($rsSelMaxStateId) > 0 )
                         {
                             $marrSelMaxStateId = mysql_fetch_array($rsSelMaxStateId);
                             $mintStateId = $marrSelMaxStateId["max(state_id)"] + 1;

                         } // if(mysql_num_rows($rsSelMaxCityId) > 0 )

                     }

                     $other_State_id = $mintStateId;

                    // echo "<br>Other City ID = ".$other_city_id;
                    // echo "<br>Othe City name = ".$other_city;


                }
            }

//*********************other state end *************************************************/


//*********************other district start********************************************* */



if($other_district != "")
            {
                //echo "<br>other_city = ".$other_city;

                $strSelDistrict = "select district_nm from district where district_nm = '".$other_district."'";
                //print "<br>strSelCity = ".$strSelCity;
                $rsSelDistrict = mysql_query($strSelDistrict);

                $numDistrict = mysql_num_rows($rsSelDistrict);
                if($numDistrict == 0)
                {
                    // get next id for city from city table

                     $strSelDistrictId = "select count(district_id) from district";
                     $rsDistrictId = mysql_query($strSelDistrictId);

                     if(mysql_num_rows($rsDistrictId) > 0 )
                     {
                         $marrSelDistrictId = mysql_fetch_array($rsDistrictId);
                         $mintDistrictCtr = $marrSelDistrictId["count(district_id)"];

                     } // if(mysql_num_rows($rsCityId) > 0 )

                     if($mintDistrictCtr == 0)
                     {
                         $mintDistrictId = 1;

                     } // if($mintCityCtr == 0)
                     else
                     {
                         $strSelMaxDistrictId = "select max(district_id) from district";
                         $rsSelMaxDistrictId = mysql_query($strSelMaxDistrictId);
                         if(mysql_num_rows($rsSelMaxDistrictId) > 0 )
                         {
                             $marrSelDistrictId = mysql_fetch_array($rsSelMaxDistrictId);
                             $mintDistrictId = $marrSelDistrictId["max(district_id)"] + 1;

                         } // if(mysql_num_rows($rsSelMaxCityId) > 0 )

                     }

                     $other_district_id = $mintDistrictId;

                    // echo "<br>Other City ID = ".$other_city_id;
                    // echo "<br>Othe City name = ".$other_city;


                }
            }





//*********************other state end *************************************************/

//************************************************** ************************************************** ************************************************** ***************************
//To verify username and password for team for subsequent access

//echo "<br>team_password = ".$team_password;
//$encrypt_password = crypt($team_password);
//echo "<br>encrypted password = ".$encrypt_password;

//echo "<br>username = ".$team_username;

/*$strVerifyTeamCredentials = "select team_username, team_password from team where team_username = '".$team_username."'";
//print "<br>strVerifyTeamCredentails = ".$strVerifyTeamCredentials;

$rsTeamCredentials = mysql_query($strVerifyTeamCredentials);

$numTeamCredentials = mysql_num_rows($rsTeamCredentials);
//print "<br>numTeamCredentials = ".$numTeamCredentials;

if($numTeamCredentials > 0)
{
    while($fetchCredentials = mysql_fetch_array($rsTeamCredentials))
    {
        $password = $fetchCredentials['team_password'];
        //echo "<br>password from db = ".$password;
        if(crypt($team_password,$password) == $password)
        {
            echo "<br>password verified";
        }
        else
        {
            echo "<br>incorrect password";
        }
    }
}
else
{
    echo "<br>username does not exist";
}
*/
/*if(crypt($team_username,$password) == $password)
{
    echo "<br>password verified";
}
else
{
    echo "<br>incorrect password";
}*/





//************************************************** ************************************************** ************************************************** ***************************
// store team details in table team


 $team_name;
 $team_username;
 $team_password;
 $total_team_members;
 $ibm_user_id;

//echo "<br>team_name = ".$team_name;
//echo "<br>team_username = ".$team_username;
//echo "<br>team_password = ".$team_password;
//echo "<br>total_team_members = ".$total_team_members;
$errorcount=0;
$errorno=0;
$errorcountap="false";
for($j=0;$j<count($team_mem_name);$j++)
            {
            if($team_mem_name[$j] != "")
                {
$strselTeamemail="select team_id,team_mem_name from team_member_details where team_mem_email='".$team_mem_email[$j]."'";
 $rsSelTeamemail=mysql_query($strselTeamemail);
if(mysql_num_rows($rsSelTeamemail)>0)
{
while($rs=mysql_fetch_array($rsSelTeamemail))
    {
$chk_approve="select team_approved from team where team_id='".$rs["team_id"]."'"; //and team_approved='R' and team_approved!='A' and team_approved!='P'";
$chk_memail=mysql_query($chk_approve);
if(mysql_num_rows($chk_memail)>0)
{
$rsapval=mysql_fetch_array($chk_memail);
if($rsapval["team_approved"]=='A' or $rsapval["team_approved"]=='P')
{
$errorno++;
$errorcountap="false";
}
else
{
$errorcountap="true";
}
}
if($errorcountap=="false" and $errorno!=0)
{
 $errorcount++;
}
    }// end while
}
//echo $errorno;
/*elseif(mysql_num_rows($rsSelTeamemail)>1)
{
$errorcount++;
}*/
$errorcountap="false";
//echo $errorcount;
//print "<br>strselTeamemail = ".$strselTeamemail;

                }
            }
//echo $errorcount;
 //$numMememail=mysql_num_rows($rsSelTeamemail);
//exit;
if($errorcount > 0)
{

    $link1="http://192.168.0.194/tgmc/registration.php"."?err=2&team_name=$team_name&lst Project=$lstProject&lstUniversity=$lstUniversity&o ther_university=$other_university&lstInstitute=$ls tInstitute&other_institute=$other_institute&princi ple_name=$principle_name&ibm_user_id=$ibm_user_id& institute_address1=$institute_address1&institute_a ddress2=$institute_address2&lstCity2=lstCity2&othe r_city=$other_city&lstState=$lstState&lstDistrict= $lstDistrict&other_district=$other_district&instit ute_pincode=$institute_pincode&institute_phone1=$i nstitute_phone1&institute_phone2=$institute_phone2 &institute_website=$institute_website&team_mem_nam e=$team_mem_name&completionYear=$completionYear&te am_mem_email=$team_mem_email&team_mem_phone=$team_ mem_phone&team_alt_phone=$team_alt_phone&guide_tit le=$guide_title&guide_email_address=$guide_email_a ddress&guide_name=$guide_name&guide_address=$guide _address&guide_phone1=$guide_phone1&guide_phone2=$ guide_phone2&lstCity2=$lstCity2×tamp=$timestamp× tamp1=$timestamp1";

    echo "<script language='javascript'>";
    echo "location.href='$link1'";
    echo "</script>";
/*
header("Location: registration.php?err=2&team_name=$team_name&lstPro ject=$lstProject&lstUniversity=$lstUniversity&othe r_university=$other_university&lstInstitute=$lstIn stitute&other_institute=$other_institute&principle _name=$principle_name&ibm_user_id=$ibm_user_id&ins titute_address1=$institute_address1&institute_addr ess2=$institute_address2&lstCity2=lstCity2&other_c ity=$other_city&lstState=$lstState&lstDistrict=$ls tDistrict&other_district=$other_district&institute _pincode=$institute_pincode&institute_phone1=$inst itute_phone1&institute_phone2=$institute_phone2&in stitute_website=$institute_website&team_mem_name=$ team_mem_name&completionYear=$completionYear&team_ mem_email=$team_mem_email&team_mem_phone=$team_mem _phone&team_alt_phone=$team_alt_phone&guide_title= $guide_title&guide_email_address=$guide_email_addr ess&guide_name=$guide_name&guide_address=$guide_ad dress&guide_phone1=$guide_phone1&guide_phone2=$gui de_phone2&lstCity2=$lstCity2×tamp=$timestamp×tam p1=$timestamp1");*/
exit;
}

/* check for the member e-mail id and faculty e-mail id */

    if($_POST['guide_email_address'] != "")
    {
        $errorcountap12="false";
         $strselfacultyemail="select team_id from team_faculty_details where team_faculty_email='".$_POST['guide_email_address']."'";

           $rsSelfacultymail=mysql_query($strselfacultyemail) ;
           //if(mysql_num_rows($rsSelfacultymail)>0)
            //{
            // $facultycount++;
            //}

            /*************************************/
if(mysql_num_rows($rsSelfacultymail)>0)
{
    $errorn1=0;
while($rs12=mysql_fetch_array($rsSelfacultymail))
{
$chk_approve12="select team_approved from team where team_id='".$rs12["team_id"]."'";// and team_approved='R' and team_approved!='A' and team_approved!='P'";
$chk_memail12=mysql_query($chk_approve12);
if(mysql_num_rows($chk_memail12)>0)
{
$rsap=mysql_fetch_array($chk_memail12);
if($rsap["team_approved"]=='A' or $rsap["team_approved"]=='P')
{
$errorn1++;
$errorcountap12="false";
}
else
{
$errorcountap12="true";
}
}
if($errorcountap12=="false" and $errorn1!=0)
{
$facultycount++;
}
} //end while loop
}
/*elseif(mysql_num_rows($rsSelfacultymail)>1)
{
$facultycount++;
}*/
$errorcountap12="false";
            /***************************************/

    }


//echo $errorcount;
 //$numMememail=mysql_num_rows($rsSelTeamemail);
//exit;
if($facultycount > 0)
{

$link1="registration.php"."?err=5&team_name=$team_ name&lstProject=$lstProject&lstUniversity=$lstUniv ersity&other_university=$other_university&lstInsti tute=$lstInstitute&other_institute=$other_institut e&principle_name=$principle_name&ibm_user_id=$ibm_ user_id&institute_address1=$institute_address1&ins titute_address2=$institute_address2&lstCity2=lstCi ty2&other_city=$other_city&lstState=$lstState&lstD istrict=$lstDistrict&other_district=$other_distric t&institute_pincode=$institute_pincode&institute_p hone1=$institute_phone1&institute_phone2=$institut e_phone2&institute_website=$institute_website&team _mem_name=$team_mem_name&completionYear=$completio nYear&team_mem_email=$team_mem_email&team_mem_phon e=$team_mem_phone&team_alt_phone=$team_alt_phone&g uide_title=$guide_title&guide_name=$guide_name&gui de_address=$guide_address&guide_phone1=$guide_phon e1&guide_phone2=$guide_phone2&lstCity2=$lstCity2× tamp=$timestamp×tamp1=$timestamp1";

echo "<script language='javascript'>";
echo "location.href='$link1'";
echo "</script>";
/*header("Location: registration.php?err=5&team_name=$team_name&lstPro ject=$lstProject&lstUniversity=$lstUniversity&othe r_university=$other_university&lstInstitute=$lstIn stitute&other_institute=$other_institute&principle _name=$principle_name&ibm_user_id=$ibm_user_id&ins titute_address1=$institute_address1&institute_addr ess2=$institute_address2&lstCity2=lstCity2&other_c ity=$other_city&lstState=$lstState&lstDistrict=$ls tDistrict&other_district=$other_district&institute _pincode=$institute_pincode&institute_phone1=$inst itute_phone1&institute_phone2=$institute_phone2&in stitute_website=$institute_website&team_mem_name=$ team_mem_name&completionYear=$completionYear&team_ mem_email=$team_mem_email&team_mem_phone=$team_mem _phone&team_alt_phone=$team_alt_phone&guide_title= $guide_title&guide_name=$guide_name&guide_address= $guide_address&guide_phone1=$guide_phone1&guide_ph one2=$guide_phone2&lstCity2=$lstCity2×tamp=$times tamp×tamp1=$timestamp1");*/
exit;
}

$strSelectTeamName = "select team_name from team where team_name = '".$team_name."'";
//print "<br>strSelectTeamName = ".$strSelectTeamName;

$rsTeamName = mysql_query($strSelectTeamName);

$numTeamName = mysql_num_rows($rsTeamName);

if($numTeamName > 0)
{


    $link2="http://192.168.0.194/tgmc/registration.php"."?err=1&team_name=$team_name&lst Project=$lstProject&lstUniversity=$lstUniversity&o ther_university=$other_university&lstInstitute=$ls tInstitute&other_institute=$other_institute&princi ple_name=$principle_name&ibm_user_id=$ibm_user_id& institute_address1=$institute_address1&institute_a ddress2=$institute_address2&lstCity2=lstCity2&othe r_city=$other_city&lstState=$lstState&lstDistrict= $lstDistrict&other_district=$other_district&instit ute_pincode=$institute_pincode&institute_phone1=$i nstitute_phone1&institute_phone2=$institute_phone2 &institute_website=$institute_website&team_mem_nam e=$team_mem_name&completionYear=$completionYear&te am_mem_email=$team_mem_email&team_mem_phone=$team_ mem_phone&team_alt_phone=$team_alt_phone&guide_tit le=$guide_title&guide_email_address=$guide_email_a ddress&guide_name=$guide_name&guide_address=$guide _address&guide_phone1=$guide_phone1&guide_phone2=$ guide_phone2&lstCity2=$lstCity2×tamp=$timestamp× tamp1=$timestamp1";

    echo "<script language='javascript'>";
    echo "location.href='$link2'";
    echo "</script>";
/*$link1="http://192.168.0.194/tgmc/registration.php"."?err=5&team_name=$team_name&lst Project=$lstProject&lstUniversity=$lstUniversity&o ther_university=$other_university&lstInstitute=$ls tInstitute&other_institute=$other_institute&princi ple_name=$principle_name&ibm_user_id=$ibm_user_id& institute_address1=$institute_address1&institute_a ddress2=$institute_address2&lstCity2=lstCity2&othe r_city=$other_city&lstState=$lstState&lstDistrict= $lstDistrict&other_district=$other_district&instit ute_pincode=$institute_pincode&institute_phone1=$i nstitute_phone1&institute_phone2=$institute_phone2 &institute_website=$institute_website&team_mem_nam e=$team_mem_name&completionYear=$completionYear&te am_mem_email=$team_mem_email&team_mem_phone=$team_ mem_phone&team_alt_phone=$team_alt_phone&guide_tit le=$guide_title&guide_name=$guide_name&guide_addre ss=$guide_address&guide_phone1=$guide_phone1&guide _phone2=$guide_phone2&lstCity2=$lstCity2×tamp=$ti mestamp×tamp1=$timestamp1";*/

    echo "<script language='javascript'>";
    echo "location.href='$link1'";
    echo "</script>";
    //print "<br>Team Name already exists!!!";
    /*header("Location: registration.php?err=1&team_name=$team_name&lstPro ject=$lstProject&lstUniversity=$lstUniversity&othe r_university=$other_university&lstInstitute=$lstIn stitute&other_institute=$other_institute&principle _name=$principle_name&ibm_user_id=$ibm_user_id&ins titute_address1=$institute_address1&institute_addr ess2=$institute_address2&lstCity2=lstCity2&other_c ity=$other_city&lstState=$lstState&lstDistrict=$ls tDistrict&other_district=$other_district&institute _pincode=$institute_pincode&institute_phone1=$inst itute_phone1&institute_phone2=$institute_phone2&in stitute_website=$institute_website&team_mem_name=$ team_mem_name&completionYear=$completionYear&team_ mem_email=$team_mem_email&team_mem_phone=$team_mem _phone&team_alt_phone=$team_alt_phone&guide_title= $guide_title&guide_email_address=$guide_email_addr ess&guide_name=$guide_name&guide_address=$guide_ad dress&guide_phone1=$guide_phone1&guide_phone2=$gui de_phone2&lstCity2=$lstCity2×tamp=$timestamp×tam p1=$timestamp1");*/
    exit;
}
else
{
        $strWorkshop = "select workshop_id from workshop";
        $rsWorkshop = mysql_query($strWorkshop);
        $arrWorkshop=mysql_fetch_array($rsWorkshop);

        $dtTodayDt = date("l, d F Y h:i:s a",time());
        $tmStamp = strtotime($dtTodayDt);
        $dtSystemDate=date("Y-m-d H:i:s",$tmStamp);



        // encrypt the password to store in table
        //$encrypt_password = crypt($team_password);
        //insert team details in the team table
        //echo "<br>team_id = ".$team_id;

    if($_POST['contestinfo1']!="")
    $coninfo.=" ".$_POST['contestinfo1'];
    if($_POST['contestinfo2']!="")
    $coninfo.=" ".$_POST['contestinfo2'];
    if($_POST['contestinfo3']!="")
    $coninfo.=" ".$_POST['contestinfo3'];
    if($_POST['contestinfo4']!="")
    $coninfo.=" ".$_POST['contestinfo4'];
    if($_POST['contestinfo5']!="")
    $coninfo.=" ".$_POST['contestinfo5'];
    if($_POST['contestinfo6']!="")
    $coninfo.=" ".$_POST['contestinfo6'];
    if($_POST['contestinfo7']!="")
    $coninfo.=" ".$_POST['contestinfo7'];




        $strInsertTeamDetails = "insert into team SET ";
        $strInsertTeamDetails .= " team
 
Old August 21st, 2006, 04:31 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Seems like one of the variables that you're putting in a URL has a
carriage return in it. This can be fixed by using urlencode() around
any variables you're putting into a redirection
URL. (http://us2.php.net/urlencode) In fact, you should be doing
this already -- it's safer and will prevent corruption of special
characters (and international characters) from page to page.

Jon Emerson
http://www.jonemerson.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugger warning thillai Visual Basic 2005 Basics 1 April 4th, 2008 08:50 AM
meaning of a warning mastrgamr C++ Programming 7 December 22nd, 2006 08:16 AM
Compile Warning... jch02140 C++ Programming 1 September 29th, 2006 07:48 AM
ASP.Net Single Single-on with Oracle Application S guhanath Oracle 0 October 6th, 2004 05:05 AM
[Question]Warning: Cannot modify header informatio unknownu Beginning PHP 1 August 19th, 2004 05:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.