SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jun 2013
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy what is $end error ? nt able to fix it

    ( ! ) Parse error: syntax error, unexpected $end in C:\wamp\www\advance php\login\submit.php on line 45


    PHP Code:
    <?php
    require_once 'connect.php';
    var_dump($_POST);//use to see the all the possilbe value in the form of array with thier length..
    if(isset($_POST['clientname']))
    {
    $clientname             =$_POST['clientname']        ;
    $client_l_name          =$_POST['client_lname']        ;
    $client_pass             =$_POST['client_pass']        ;
    $client_con_pass        =$_POST['client_re_pass']    ;
    $client_client_phone    =$_POST['client_phone']        ;
    $client_mail            =$_POST['clientmail']        ;
    $client_date            =$_POST['user_date']        ;
    $client_month            =$_POST['month']            ;
    $client_year            =$_POST['year']                ;
    $client_gen                =$_POST['u_gen']            ;
    $client_sallary            =$_POST['sallary']            ;
    $client_pan                =$_POST['pancard']            ;
    }
    //setcookie('username',$client,time()+120);
    //echo $_COOKIE['username'];
    //-------------------------------------------------------------
    //!validations starts here---------------
    // if($clientname=="")
    // {
    //     $err.="username can't be empty";
    // }
    // if($client_l_name=="")
    // {
    //     $err.="please fill last name";
    // }
    // if ($client_pass=="") 
    // {
    //     $err.="please choose any password";
    // }
    // if ($client_con_pass=="")
    // {
    //     $err.="please confrim password";
    //     elseif ($client_pass!=$client_con_pass) 
    //     {
    //         $pass_err="password is nt same";
    //     }
    // }
    ?>
    <!-- <html>
    <head>
        <title>submit page</title>
    </head>
    <body>
    <h1>Thank's Mr.<?php //echo $_COOKIE['username']; ?> For the intrest we will get back to u soon</h1>
    </body>
    </html> -->
    <?php
    require_once 'connect.php';
    var_dump($_POST);//use to see the all the possilbe value in the form of array with thier length..
    if(isset($_POST['clientname']))
    {
    $clientname             =$_POST['clientname']        ;
    $client_l_name          =$_POST['client_lname']        ;
    $client_pass             =$_POST['client_pass']        ;
    $client_con_pass        =$_POST['client_re_pass']    ;
    $client_client_phone    =$_POST['client_phone']        ;
    $client_mail            =$_POST['clientmail']        ;
    $client_date            =$_POST['user_date']        ;
    $client_month            =$_POST['month']            ;
    $client_year            =$_POST['year']                ;
    $client_gen                =$_POST['u_gen']            ;
    $client_sallary            =$_POST['sallary']            ;
    $client_pan                =$_POST['pancard']            ;
    }
    //setcookie('username',$client,time()+120);
    //echo $_COOKIE['username'];
    //-------------------------------------------------------------
    //!validations starts here---------------
    // if($clientname=="")
    // {
    //     $err.="username can't be empty";
    // }
    // if($client_l_name=="")
    // {
    //     $err.="please fill last name";
    // }
    // if ($client_pass=="") 
    // {
    //     $err.="please choose any password";
    // }
    // if ($client_con_pass=="")
    // {
    //     $err.="please confrim password";
    //     elseif ($client_pass!=$client_con_pass) 
    //     {
    //         $pass_err="password is nt same";
    //     }
    // }
    ?>
    <!-- <html>
    [COLOR="#FF0000"]<head>[/COLOR] Erro
        <title>submit page</title>
    </head>
    <body>
    <h1>Thank's Mr.<?php //echo $_COOKIE['username']; ?> For the intrest we will get back to u soon</h1>
    </body>
    </html> -->
    Last edited by cpradio; Jun 20, 2013 at 08:03. Reason: Added php tags

  2. #2
    SitePoint Guru bronze trophy
    Join Date
    Feb 2013
    Posts
    667
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    If you are going to comment out pieces of code, be sure you don't comment out the end php tag.
    PHP Code:
    <?php
    require_once 'connect.php';
    var_dump($_POST);//use to see the all the possilbe value in the form of array with thier length..
    if(isset($_POST['clientname']))
    {
    $clientname =$_POST['clientname'] ;
    $client_l_name =$_POST['client_lname'] ;
    $client_pass =$_POST['client_pass'] ;
    $client_con_pass =$_POST['client_re_pass'] ;
    $client_client_phone =$_POST['client_phone'] ;
    $client_mail =$_POST['clientmail'] ;
    $client_date =$_POST['user_date'] ;
    $client_month =$_POST['month'] ;
    $client_year =$_POST['year'] ;
    $client_gen =$_POST['u_gen'] ;
    $client_sallary =$_POST['sallary'] ;
    $client_pan =$_POST['pancard'] ;
    }
    //setcookie('username',$client,time()+120);
    //echo $_COOKIE['username'];
    //-------------------------------------------------------------
    //!validations starts here---------------
    // if($clientname=="")
    // {
    // $err.="username can't be empty";
    // }
    // if($client_l_name=="")
    // {
    // $err.="please fill last name";
    // }
    // if ($client_pass=="")
    // {
    // $err.="please choose any password";
    // }
    // if ($client_con_pass=="")
    // {
    // $err.="please confrim password";
    // elseif ($client_pass!=$client_con_pass)
    // {
    // $pass_err="password is nt same";
    // }
    // }
    ?>
    <!-- <html>
    <head>
    <title>submit page</title>
    </head>
    <body>
    <h1>Thank's Mr.
    <?php 
    //echo $_COOKIE['username']; 
    ?> For the intrest we will get back to u soon</h1>
    </body>
    </html> -->
    <?php
    require_once 'connect.php';
    var_dump($_POST);//use to see the all the possilbe value in the form of array with thier length..
    if(isset($_POST['clientname']))
    {
    $clientname =$_POST['clientname'] ;
    $client_l_name =$_POST['client_lname'] ;
    $client_pass =$_POST['client_pass'] ;
    $client_con_pass =$_POST['client_re_pass'] ;
    $client_client_phone =$_POST['client_phone'] ;
    $client_mail =$_POST['clientmail'] ;
    $client_date =$_POST['user_date'] ;
    $client_month =$_POST['month'] ;
    $client_year =$_POST['year'] ;
    $client_gen =$_POST['u_gen'] ;
    $client_sallary =$_POST['sallary'] ;
    $client_pan =$_POST['pancard'] ;
    }
    //setcookie('username',$client,time()+120);
    //echo $_COOKIE['username'];
    //-------------------------------------------------------------
    //!validations starts here---------------
    // if($clientname=="")
    // {
    // $err.="username can't be empty";
    // }
    // if($client_l_name=="")
    // {
    // $err.="please fill last name";
    // }
    // if ($client_pass=="")
    // {
    // $err.="please choose any password";
    // }
    // if ($client_con_pass=="")
    // {
    // $err.="please confrim password";
    // elseif ($client_pass!=$client_con_pass)
    // {
    // $pass_err="password is nt same";
    // }
    // }
    ?>
    <!-- <html>
    <head> Erro
    <title>submit page</title>
    </head>
    <body>
    <h1>Thank's Mr.
    <?php 
    //echo $_COOKIE['username']; 
    ?> For the intrest we will get back to u soon</h1>
    </body>
    </html> -->

  3. #3
    SitePoint Member
    Join Date
    Jun 2013
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok sir thanku

  4. #4
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    69 Post(s)
    Tagged
    0 Thread(s)
    Generally speaking, Unexpected $end means you've forgotten to close a statement block (anything in {}, or (), etc), causing the script to reach the end of file before finding the closing symbol.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  5. #5
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,326
    Mentioned
    191 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by StarLion View Post
    Generally speaking, Unexpected $end means you've forgotten to close a statement block (anything in {}, or (), etc), causing the script to reach the end of file before finding the closing symbol.
    Precisely. And PHP provides you the line number. Simple jump to that line (or count from the top of the file) and locate the offending code.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  6. #6
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drummin View Post
    If you are going to comment out pieces of code, be sure you don't comment out the end php tag.
    Wrong. The unexpected end parse error is thrown due to an unclosed control statement - if, for, foreach, switch, while, and so on. Failing to have a closing ?> will not cause a parse error. Indeed, it is recommended that you do NOT use a closing ?> mark to prevent unwanted whitespace following it from being echoed out by the browser and causing headaches with the header() statement (the "warning: headers already sent" problem).


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
  •