/    Sign up×
Community /Pin to ProfileBookmark

Why doesnt this code update the db?? <option>

I get to the webhoster’s ERROR 404 page..

[code=php]

if(isset($_POST[‘submit’]))
{
include_once ‘dbcon.php’;

$abc= mysqli_real_escape_string($_POST[‘abc’]);

mysqli_query($con, “UPDATE users SET abc=’$abc’ WHERE username='”.$_SESSION[‘user’].”‘ “);

}

[/code]

[code=html]
<form action=”” method=”post”> //action is in same file
<select name=”abc”>

<option value=”a” <?php if ($value == “a”) {echo ” selected”;} ?> >a</option>
<option value=”b” <?php if ($value== “b”) {echo ” selected”;} ?> >b</option>
<option value=”c” <?php if ($value== “c”) {echo ” selected”;} ?> >c</option>
<option value=”d” <?php if ($value== “d”) {echo ” selected”;} ?> >d</option>

</select>

<button type=”submit” name=”submit” > ok</button>
</form>
[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@jedaisoulJul 25.2015 — Hi and welcome to the site.
Copy linkTweet thisAlerts:
@NogDogJul 26.2015 — No idea why you'd get a 404 -- anything in either the php or httpd error logs?
Copy linkTweet thisAlerts:
@jag1authorJul 26.2015 — Ahhh seems like i do typos every 3/10 times xD

Got it to work
×

Success!

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