/    Sign up×
Community /Pin to ProfileBookmark

Parse error: parse error, unexpected ‘,’

Hi.

I’m getting the following error:

[b]
Parse error: parse error, unexpected ‘,’ in /home2/racingri/public_html/game/register.php on line 33[/b]

I searched, but don’t even have a ‘,’ in the code. So I’m not sure what happened. ?

Here is the code:

[code=php]<?php

// Include init file
include ‘init.php’;

if (!isset($_POST[‘submit’]))
{
// Show the form
include ‘register_form.inc.php’;
exit;
}
else
{
// Check if any of the fields are missing
if (empty($_POST[‘username’]) || empty($_POST[‘password’]) || empty($_POST[‘confirmpass’]) || empty($_POST[‘firstname’]) || empty($_POST[‘lastname’]) || empty($_POST[‘address’]) || empty($_POST[‘city’]) || empty($_POST[‘state’]) || empty($_POST[‘country’]))
{
// Reshow the form with an error
$reg_error = ‘One or more fields missing’;
include ‘register_form.inc.php’;
exit;
}

// Check if the passwords match
if ($_POST[‘password’] != $_POST[‘confirmpass’])
{
// Reshow the form with an error
$reg_error = ‘Your passwords do not match’;
include ‘register_form.inc.php’;
exit;
}

// Everything is ok, register
user_register ($_POST[‘username’], $_POST[‘password’] ($_POST[‘firstname’], ($_POST[‘lastname’], ($_POST[‘address’], ($_POST[‘city’], ($_POST[‘state’], ($_POST[‘country’]);

echo ‘Thank you for registering on our site, <a href=”index.php”>click here</a> to go back.’;

}

?>
[/code]

Any help will greatly be appreciated. Thanks! ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Bootsman123Jul 12.2005 — [code=php]
user_register ($_POST['username'], $_POST['password'] ($_POST['firstname'], ($_POST['lastname'], ($_POST['address'], ($_POST['city'], ($_POST['state'], ($_POST['country']);
[/code]


Should be:
[code=php]
user_register ($_POST['username'], $_POST['password'], $_POST['firstname'], $_POST['lastname'], $_POST['address'], $_POST['city'], $_POST['state'], $_POST['country']);
[/code]
Copy linkTweet thisAlerts:
@legendxJul 12.2005 — line 33 is a mess

user_register ($_POST['username'], $_POST['password'] ($_POST['firstname'], ($_POST['lastname'], ($_POST['address'], ($_POST['city'], ($_POST['state'], ($_POST['country']);


you have $_POST['password'] ($_POST['firstname'], which arnt seperated by a ',' and an opening ( but no closing ), in many places on line 33. Try this

user_register ($_POST['username'], $_POST['password'], $_POST['firstname'], $_POST['lastname'], $_POST['address'], $_POST['city'], $_POST['state'], $_POST['country']);
×

Success!

Help @Lao spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...