/    Sign up×
Community /Pin to ProfileBookmark

Do not showing any syntex error

My code do not showing any error message, but data is not submitted to the data base

here is my code, Please help me..

“`php
<?php
include_once ‘database1.php’;
error_reporting(0);
if(isset($_POST[‘submit’]))
{
$result = executeQuery(“select max(f_id) as std from order”);
$r = mysql_fetch_array($result);
if(is_null($r[‘std’]))
{
$newstd = 1;
}
else
{
$newstd = $r[‘std’] +1;
}

if (empty($_REQUEST[‘name’]) || empty($_REQUEST[‘address’]) || empty($_REQUEST[‘mobile’]))
{
$_GLOBAL[‘message’] = ” Some field are empty .”;
}
else
{
$query=”INSERT INTO order (f_id, name, address, mobile)

VALUES($newstd,
‘” . htmlspecialchars($_REQUEST[‘name’], ENT_QUOTES) . “‘,
‘ ” . htmlspecialchars($_REQUEST[‘address’],ENT_QUOTES) .”‘,
‘ ” . htmlspecialchars($_REQUEST[‘mobile’], ENT_QUOTES) .”‘
)”;
mysql_query($con, $query);
// mysql_query($query, $con);

if(!@executeQuery($query))
{
$_GLOBAL[‘message’]= mysqli_error();
}
else
{
$_success=true;
$_GLOBAL[‘message’]= “Data is submitted.”;
}
}
}
?>
<html>
<body>
<p>
Please give your details
</p>
<form action=”form1.php” target=”_blank” method=”post”>
Enter your name : <br>
<input type=”text” name=”name”><br>
Enter your address : <br>
<input type=”text” name=”address”><br>
Enter your mobile no : <br>
<input type=”text” name=”mobile”>
<input type=”submit” name=”submit” value=”submit”>
<input type=”reset” name=”reset”>
</form>
</body>
</html>
“`

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 22.2018 — Where do you do anything with $_success and/or $_GLOBAL['message'] to see if the query failed and if so, why?
Copy linkTweet thisAlerts:
@ginerjmApr 22.2018 — Also - when you do this:

error_reporting(0);

you are turning error reporting OFF, not on.

See my signature.
Copy linkTweet thisAlerts:
@rootApr 23.2018 — they're mysqlI_ functions, not mysql_

You appear to have a number of problems with your development, another that springs to mind, no sanitation in to a safe array...
×

Success!

Help @rob12 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 4.30,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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