/    Sign up×
Community /Pin to ProfileBookmark

ECHO Nightmire

hi guys what i thought was a simple echo turns out to be unworkable, as it keeps saying an error.
below is the working form:

[code=php]
<form method=”post”>
Bank level: <?php echo $user[‘bank’]; ?> <br />
Next level: <input type=”submit” value=”<?php echo number_format($need_money) ?> money” name=”upgradebank”>
</form>[/code]

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@jasonahouleMar 28.2008 — What is the error? Also, you are missing a semi-colon after the number_format() call.
Copy linkTweet thisAlerts:
@bokehMar 28.2008 — you are missing a semi-colon[/QUOTE]You only need a delimiter when there is something to delimit.
Copy linkTweet thisAlerts:
@mitchellauthorMar 28.2008 — this is the echo code that doesnt work:

[code=php]
echo ("<form method=/"post/">
Bank level: $user['bank'] <br />
Next level: <input type=/"submit/" value=/" number_format($need_money) money/" name=/"upgradebank/">
</form>");[/code]



i dont understand whats wrong
Copy linkTweet thisAlerts:
@zombieJonesMar 28.2008 — You have your Escape slashes the wrong way..

should be fixed:

echo ("<form method="post">

Bank level: $user['bank'] <br />

Next level: <input type="submit" value=" number_format($need_money) money" name="upgradebank">

</form>");
Copy linkTweet thisAlerts:
@ZnupiMar 28.2008 — You escape special characters like ", ', etc using a [b]back[/b]slash ([b][/b]), [u][b]not[/b][/u] a [b]forward[/b] slash ([b]/[/b]).
Copy linkTweet thisAlerts:
@mitchellauthorMar 29.2008 — thanks allot mate i really appeciate it, knew there was nothing major wrong, a silly mistake. thanks again
Copy linkTweet thisAlerts:
@jasonahouleMar 29.2008 — You only need a delimiter when there is something to delimit.[/QUOTE]
You can get away with not using quotes for you html attributes. Does that mean that you should?
Copy linkTweet thisAlerts:
@YelgnidrocMar 29.2008 — I think bokeh mean that the LAST statement within php tag does not need a semi colon as nothing follows it therefore it's not a delimiter.
Copy linkTweet thisAlerts:
@bokehMar 29.2008 — You can get away with not using quotes for you html attributes. Does that mean that you should?[/QUOTE]It's not a case of getting away with something; the delimiter's purpose is to separate two statements, i.e. come between them, not to end a statement, but if you do add an unnecessary one (or more) the compiler will ignore it.
×

Success!

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