/    Sign up×
Community /Pin to ProfileBookmark

help – error message

i am getting this

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ‘]’ on line 23

here is some of php:

if(isset($_POST[s1]))
{
$MyExp = mktime(0,0,0,date(m) + 1, date(d), date(Y));

$q1 = “insert into agents set
username = ‘$_POST[NewUsername]’,
AccountType = ‘$_POST[AccountType]’,
type=’$_POST[type]’,
password = ‘$_POST[p1]’,
FirstName = ‘$_POST[FirstName]’,
LastName = ‘$_POST[LastName]’,
resume = ‘$_POST[resume]’,
phone = ‘$_POST[phone]’,
cellular = ‘$_POST[cellular]’,
pager = ‘$_POST[pager]’,
ResumeImages = ‘$ImageStr’,
email = ‘$_POST[email]’,

RegDate = ‘$t’,
ExpDate = ‘$MyExp’,
AccountStatus = ‘active’,
offers = ‘0’ “;

mysql_query($q1);

please help – i am going crazy here

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@PineSolPirateSep 22.2006 — First of all, use code tags, they make life easier to read. I think your query is a little buggy, don't you want something like this?
[code=php]if(isset($_POST[s1]))
{
$MyExp = mktime(0,0,0,date(m) + 1, date(d), date(Y));

$q1 = "
INSERT INTO agents
(username, AccountType, type, password, FirstName, LastName, resume, phone, cellular, pager, ResumeImages, email, RegDate, ExpDate, AccountStatus, offers)
VALUES
('$_POST[NewUsername]', '$_POST[AccountType]', '$_POST[type]', '$_POST[p1]', '$_POST[FirstName]', '$_POST[LastName]', '$_POST[resume]', '$_POST[phone]', '$_POST[cellular]', '$_POST[pager]', '$ImageStr', '$_POST[email]', '$t', '$MyExp', 'active', '0')
";
mysql_query($q1);[/code]

Also, which line is line 23 here?
Copy linkTweet thisAlerts:
@lauraleiauthorSep 22.2006 — great - thanks, that works - what i was trying to do when i got this mess was put another input field - something where they have to give a referral email address - can you help with this too ----- thank you so much
Copy linkTweet thisAlerts:
@PineSolPirateSep 22.2006 — sure thing, just add it into the database, then into the form [code=html]<input type="text" name="referralEmail" />[/code] and then into the query $q1 = "
INSERT INTO agents
(username, AccountType, type, password, FirstName,
LastName, resume, phone, cellular, pager, ResumeImages,
email, RegDate, ExpDate, AccountStatus,
offers, [b]referralEmail[/b])
VALUES
('$_POST[NewUsername]', '$_POST[AccountType]', '$_POST[type]',
'$_POST[p1]', '$_POST[FirstName]', '$_POST[LastName]',
'$_POST[resume]', '$_POST[phone]', '$_POST[cellular]',
'$_POST[pager]', '$ImageStr', '$_POST[email]', '$t', '$MyExp',
'active', '0',[b]'$_POST[referralEmail]'[/b])
";
Copy linkTweet thisAlerts:
@PineSolPirateSep 22.2006 — You also might want to clean up those inputs. If your PHP install doesn't have magic quotes on, then a malicious user could mess up your table, maybe even drop it with all it's data.
×

Success!

Help @lauralei 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,
)...