Hello.

I created a simple registeration code for my form but I seem to get this error.

Parse error: syntax error, unexpected T_IF on line 130.

I tried to change everything, double check it. But still I get the same error.

 if ($_POST['loginbtn']){
            $user = $_POST['user'];
            $password = $_POST['password'];
    }
    else
        echo $form;

On line 130:

if ($_POST['loginbtn']){

That's it. I still can't find the error.

Thanks.

Member Avatar for Zagga

Hi MrXortex,

Can you post the few lines before line 130?

                    <?php

                    $form = "<form action='login.php' method='post'>
                        <table>
                        <tr>
                            <td><label for='username'><strong>Username&nbsp;</strong></br><input type='text' name='user' id='username' value='' size='30' placeholder='Enter Username' /></label></td>
                        </tr>
                        <tr>
                        <td><label>&nbsp;</label></td>
                        </tr>
                        <tr>
                            <td><label for='password'><strong>Password&nbsp;</strong></br><input type='password' name='password' id='password' size='30' placeholder='Enter Password'/></label></td>
                        </tr>
                        <tr>
                        </tr>
                        <tr>
                        <td><label>&nbsp;</label></td>
                        </tr>
                        <tr>
                        <tr>
                    <td><input type='submit' class='submit' name='loginbtn' value='&nbsp; Login &nbsp;' />&nbsp; or &nbsp; <input type='submit' class='submit' name='loginbtn' value='Register Now' /></strong></td>
                    </tr>
                    </table>
                    </div>
                </form>"



if ($_POST['loginbtn']){
            $user = $_POST['user'];
            $password = $_POST['password'];
    }
    else
        echo $form;

Thanks a lot. Works like a charm now. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.