Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Parse error: parse error
Old 08-16-2010, 10:18 AM Parse error: parse error
Junior Talker

Posts: 2
Name: Daniel
Trades: 0
Hi All, I am new to this forum, so I would like to say g'day to every one here.

I am big noob when is comes to php and mysql sorry in advance for asking this question and future dumb questions.

I have an assignment that basically wants users to log in and upload script tutorial files. Once the tutorials are uploaded other users can then rate and comment regarding the tutorial posted. (don't really know how I am meant to go about doing it )

okay, for some reason i just cant get the log in page to work. I keep getting the following error message:
Parse error: parse error in C:\wamp\www\phpac\register.php on line 47

the code looks like this:

PHP Code:
<?php
echo "<h1>Register</h1>";

$submit $_POST['submit'];

//form data
$fullname strip_tags ($_POST['fullname']);
$username strip_tags ($_POST['username']);
$password =strip_tags ($_POST['password']);
$repeatpassword strip_tags ($_POST['repeatpassword']);
$date date("Y-m-d");

if (
$submit)
{

//check for existance
if ($fullname&&$username&&$password&&$repeatpassword)
{
    
//encrypt password
    
$password md5($password);
    
$repeatpassword md5($repeatpassword);
    
    if (
$password==$repeatpassword)
    {
        
    
//check char length of username and fullname
    
if (strlen($username)>25||srtlen($fullname)>25)
    {
        echo 
"Length of username and fullname is too long!";
    }
    else
    {
        
//check password length
        
if (strlen($password)>25||strlen($password)<6)
    {
        echo 
"Password must be between 6 and 25 characters";
    }
    else
    {
        
//register the user
        
echo "Success!!";
        
    }
    
    
//check to see if passwords match    
    
}
    else
    {
        echo 
"Your passwords do not macth";
    }
    
}
else
    echo 
"Please fill in <strong>all</strong> fields!";


}

?>


<html>
<p>
<form action="register.php" method="POST">
    <table>
            <tr>
                <td>
                Your full name:
                </td>      
                <td>
                <input type="text" name="fullname">
                </td>      
            </tr>
            <tr>
                <td>
                Choose a username:
                </td>      
                <td>
                <input type="text" name="username">
                </td>      
            </tr>
            <tr>
                <td>
                Choose a password:
                </td>      
                <td>
                <input type="password" name="password">
                </td>      
            </tr>
            <tr>
                <td>
                Repeat your password:
                </td>      
                <td>
                <input type="password" name="repeatpassword">
                </td>      
            </tr>
    </table>
    <p>
    <input type="submit" name="submit" value="Register">

</form>

</html>
Any ideas or assistance will be much appreciated
zacthecat is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-16-2010, 12:02 PM Re: Parse error: parse error
Extreme Talker

Posts: 149
Trades: 0
check your if / else {}.
__________________
Free
Please login or register to view this content. Registration is FREE

Visit our
Please login or register to view this content. Registration is FREE
and
Please login or register to view this content. Registration is FREE
mimamo is offline
Reply With Quote
View Public Profile
 
Old 08-16-2010, 03:21 PM Re: Parse error: parse error
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You're missing a closing bracket. It becomes clear where its missing from when you tab your code:
PHP Code:
if ($submit


//check for existance 
if ($fullname&&$username&&$password&&$repeatpassword

    
//encrypt password 
    
$password md5($password); 
    
$repeatpassword md5($repeatpassword); 
     
    if (
$password==$repeatpassword
    { 
             
        
//check char length of username and fullname 
        
if (strlen($username)>25||srtlen($fullname)>25
        { 
            echo 
"Length of username and fullname is too long!"
        } 
        else 
        { 
            
//check password length 
            
if (strlen($password)>25||strlen($password)<6
            { 
                echo 
"Password must be between 6 and 25 characters"
            } 
            else 
            { 
                
//register the user 
                
echo "Success!!"
                     
            } 
         
        
//check to see if passwords match     
        

    else 
    { 
        echo 
"Your passwords do not macth"
    } 
     

else 
    echo 
"Please fill in <strong>all</strong> fields!"



__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to Parse error: parse error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 2.78165 seconds with 12 queries