/    Sign up×
Community /Pin to ProfileBookmark

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home2/fashong/public_html/signup.php on line 47

[code=php]
<?php
$title = “Signup”;
include(“top.php”);
$IP = $_SERVER[‘REMOTE_ADDR’];
?>

<div id=”content”>
<span>Signup</span>

<p>
<form method=”POST” action=”signup.php?action=signup”>
Username:<br> <input type=”text” name=”username” size=”20″ maxlength=”15″><br>
Password:<br> <input type=”password” name=”password” size=”20″ maxlength=”15″><br>
Verify Password:<br> <input type=”password” name=”verpassword” size=”20″ maxlength=”15″><br>
Email:<br> <input type=”text” name=”email” size=”20″ maxlength=”25″><br><br>

Note: Your ip will be logged so please do not make multiple accounts<br><br>
<input type=”submit” name=”turkey” value=”submit”></form>

<?php

IF (isset($_POST[‘turkey’])){

$ipcheck = mysql_query(“select * from users where IP=’$IP'”);
IF (@mysql_num_rows($ipcheck) > 0) {
$ipused = “yes”;
}else{
$ipused = “no”;
}

IF ($_POST[‘password’] == $_POST[‘verpassword’]) {
$passwordmatch = “true”;
}else{
$passwordmatch = “false”;
}

IF ($ipused == “no” && $passwordmatch == “true”){

mysql_query(“INSERT INTO users (id, username, email, password, status, ipaddress, age) VALUES (”, ‘$_POST[‘username’]’, ‘$_POST[’email’]’, ‘$_POST[‘password’]’, ‘Member’, ‘$IP’, ”)”);
echo “Thanks for signing up!”;
}else{
echo “You etheir have an account already, or your passwords do not match!”;
}
}
?>

</div>

<?php
include(“bottom.php”);
?>

[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ScleppelOct 01.2005 — [code=php]
mysql_query("INSERT INTO users (id, username, email, password, status, ipaddress, age) VALUES ('', '{$_POST['username']}', '{$_POST['email']}', '{$_POST['password']}', 'Member', '$IP', '')");

//instead of

mysql_query("INSERT INTO users (id, username, email, password, status, ipaddress, age) VALUES ('', '$_POST['username']', '$_POST['email']', '$_POST['password']', 'Member', '$IP', '')");
[/code]


it gets confused about arrays, so you have to add {} around them.
Copy linkTweet thisAlerts:
@XxXxRobxXxXauthorOct 01.2005 — Thank you very much!
×

Success!

Help @XxXxRobxXxX 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 6.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...