/    Sign up×
Community /Pin to ProfileBookmark

What is this “<span class=” for ?
What does it mean span and what class got to do with anything ?

[code]
<form method=”post” action=”<?php echo htmlspecialchars($_SERVER[“PHP_SELF”]);?>”>

Name: <input type=”text” name=”name”>
<span class=”error”>* <?php echo $nameErr;?></span>
<br><br>
E-mail:
<input type=”text” name=”email”>
<span class=”error”>* <?php echo $emailErr;?></span>
<br><br>
Website:
<input type=”text” name=”website”>
<span class=”error”><?php echo $websiteErr;?></span>
<br><br>
Comment: <textarea name=”comment” rows=”5″ cols=”40″></textarea>
<br><br>
Gender:
<input type=”radio” name=”gender” value=”female”>Female
<input type=”radio” name=”gender” value=”male”>Male
<input type=”radio” name=”gender” value=”other”>Other
<span class=”error”>* <?php echo $genderErr;?></span>
<br><br>
<input type=”submit” name=”submit” value=”Submit”>

</form>
[/code]

Unlike the tutorial, I didn’t use the “<span class =” to make space to echo error on the input field like w3schools tutorial did.
I echoed the input error like following without using this “<span class=” thing.

[code]
<label for=”email_domain”>@ <b>*</b></label>
<input type=”domain” name=”email_domain” id=”email_domain” value=”<?php if(ISSET($_SESSION[’email_domain’])) { echo $_SESSION[’email_domain’]; } ?>” required> <?php if(ISSET($_SESSION[’email_2b_error’])) { if($_SESSION[’email_2b_error’] != ”) { echo $_SESSION[’email_2b_error’]; }} ?>
[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@developer_webauthorFeb 26.2021 — Do any of you use "<span class=" ?

Where you use been using it on ?
Copy linkTweet thisAlerts:
@NogDogFeb 26.2021 — It's basic HTML. It has nothing to do with PHP (other than it's HTML being output from a PHP script in this case).

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span

Also in #PHP

Differentiating SQL UNION Sub result setsexec() not workingPage title from include php file??
×

Success!

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