/    Sign up×
Community /Pin to ProfileBookmark

Need Some Help (U can Get Some Idea Too)

CAn you Help me up with this one? my add button is nothin ok . i mean my add button can;t submit

here is my codeL:

<?
session_start();
include(“../inc/config.php”);
$resultQuery=mysql_query(“SELECT * FROM tblchildren”);

$sql=mysql_query(“SELECT * FROM tblemployee WHERE strEmployeeTIN=’$tinID'”);
$sqlRow=mysql_fetch_array($sql);
?>
<?
include (“../inc/config.php”);
$sqlRet=mysql_query(“SELECT *
FROM tblemployee where strEmployeeTIN=’$tinID'”);
$sqlRetFetch=mysql_fetch_array($sqlRet);
?>
<?
$Edit=$_POST[‘Edit’];

if($Edit){
include(“../inc/config.php”);
$query=”update tblchildren set strNameOfChildren=’$txtNameofChildren’, strPlaceOfBirth=’$txtPlaceofBirth’, dtmDateOfBirth=’$txtDateofBirth’ where id=’$txtuid'”;
mysql_query($query) or die(mysql_error());
echo ‘<script>alert(“Children Information Successfully Updated”)</script>’;
echo ‘<meta http-equiv=”refresh” content=”0;url=childreninfo2.php”>’;
}
?>
<?
$Add=$_POST[‘Add’];
if($Add){
include(“../inc/config.php”);
$qry=mysql_query(“SELECT * FROM tblchildren WHERE strNameOfChildren=’$txtNameofChildren’ AND strPlaceOfBirth=’$txtPlaceofBirth’ AND dtmDateOfBirth=’$txtDateofBirth'”) or die(mysql_error());
$qryRow=mysql_num_rows($qry);
if ($qryRow==1) {
echo $qryRow;
echo ‘<script>alert(“Already exists!”)</script>’;
echo ‘<script>history.back()</script>’;
} else {
$query=”INSERT INTO tblchildren(strNameOfChildren,strPlaceOfBirth,dtmDateOfBirth) VALUES(‘$txtNameofChildren’,’$txtPlaceofBirth’,’$txtDateofBirth’)”;
mysql_query($query) or die(mysql_error());
echo ‘<script>alert(“Children Information Successfully Added”)</script>’;
echo ‘<meta http-equiv=”refresh” content=”0;url=childreninfo2.php”>’;

}

}
?>
<?php
$Delete=$_POST[‘Delete’];
if($Delete){
include(“../inc/config.php”);
$query=”delete from tblchildren where strEmployeeTIN=’$txtstrEmployeeTIN'”;
mysql_query($query)or die(mysql_error());
echo ‘<script>alert(“Children Information Successfully Deleted”)</script>’;
echo ‘<meta http-equiv=”refresh” content=”0;url=childreninfo2.php”>’;
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />
<title>Personal Information Sheet</title>
<meta name=”keywords” content=”” />
<meta name=”description” content=”” />
<link href=”../style.css” rel=”stylesheet” type=”text/css” media=”screen” />
<script language=”javascript” type=”text/javascript” src=”../inc/datetimepicker.js”></script>
<script type=”text/javascript”>
// Popup window code
function newPopup(url) {
popupWindow = window.open(
url,’popUpWindow’,’resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no’)
}
</script>
</head>
<body>
<div align=”center” class=”post”><img src=”../images/logo.png”></div><br>
<!– start sidebar –>
<div id=”sidebar”>
<div id=”logo”>

</div>
<div id=”widgets”>
<div id=”widgets-top”></div>
<ul>
<li>
<h2 style=”color:#FFF;text-decoration:overline;font-size:16px”>Main Menu</h2>
<br />
<? include (“../inc/editmenu.php”); ?>
<h2>&nbsp;</h2></li>
</ul>
</div>
</div>
<!– end sidebar –>
<!– start page –>
<div id=”page”>
<div id=”search”>
<form name=”form1″>
<fieldset>
<div style=”margin-left:220px;”><marquee><font color=”#FF0000″ size=”2″><b><blink>NEWS!</blink>&nbsp;&nbsp;&nbsp;</b></font><a href=”http://www.denr.gov.ph” target=”_blank” style=”text-decoration: none”><font color=”#FFFFFF”>www.denr.gov.ph</font></a></marquee></div>
</fieldset>
</form>
</div>
<!– start content –>
<div id=”content”>
<h1 class=”pagetitle”>Edit/Update</h1>
<div class=”post”>
<div class=”ct”>
<div class=”l”>
<div class=”r”></div>
Data Info of: <?php echo strtoupper($sqlRetFetch[‘strLastName’]); ?>, <?php echo strtoupper($sqlRetFetch[‘strFirstName’]); ?> <?php echo strtoupper($sqlRetFetch[‘strMiddleName’]); ?> <br>Employee TIN:<? echo $sqlRetFetch[‘strEmployeeTIN’];?><br>

<? echo $msg; ?></h2>
</div></div>
<div class=”entry”>
<fieldset>
<legend style=”font-weight:bolder; color:#FFFFFF”>Add New Children Information
</legend>
<form name=”frmReg” method=”post” action='<? $PHP_SELF; ?>’>
<table width=”100%” align=”center”>
<tr>
<td align=”right”><div align=”justify”><strong>NAMe of children</strong></div></td>
<td><div align=”justify”>
<input type=”text” name=”txtNameofChildren”>
</div></td>
</tr>

<tr>
<td width=”101″ align=”right”><div align=”justify”><strong> birthplace</strong></div></td>
<td width=”168″><div align=”justify”>
<input type=”text” name=”txtPlaceofBirth”>
</div></td>
</tr>
<tr>
<td align=”right”><div align=”justify”><strong>date of birth</strong></div></td>
<td><div align=”justify”>
<input name=”txtDateofBirth” type=”text” maxlength=”10″>
<font style=”font-size:9px; text-transform:lowercase; font-style:italic; color:#0000FF”>&nbsp;(yyyy/mm/dd)</font></div></td>
</tr>
<tr>
<td colspan=”2″ align=”center”><div align=”justify”>
<input type=”submit” name=”Add” value=”Add”>
</div></td>
</tr>
</table>
</form>
</fieldset>
<br><? echo $message; ?><br>
<? $admin=$_
COOKIE[“strUsername”]; ?>
<fieldset><legend style=”font-weight:bolder; color:#FFFFFF”>Edit/Delete Administrator Account</legend>

<table width=”100%” align=”center”>
<tr>
<td><div align=”center”><strong>name of children</strong></div></td>
<td><div align=”center”><strong>birthplace</strong></div></td>
<td><div align=”center”><strong>date of birth</strong></div></td>
<td><div align=”center”></div></td>
<td><div align=”center”></div></td>
</tr>
<?
include (“../inc/config.php”);
$sqlAdmin=mysql_query(“SELECT * FROM tblchildren”);

while ($sqlAdminRow=mysql_fetch_array($sqlAdmin)) {
?>
<form name=”frmEdit” method=”post” action='<? $PHP_SELF; ?>’>
<tr>
<input type=”hidden” name=”txtstrEmployeeTIN” value=”<? echo $sqlAdminRow[‘strEmployeeTIN’]; ?>”>
<td><div align=”center”>
<input type=”text” name=”txtNameofChildren” value=”<? echo $sqlAdminRow[‘strNameOfChildren’]; ?>”>
</div></td>
<td><div align=”center”>
<input type=”text” name=”txtPlaceofBirth” value=”<? echo $sqlAdminRow[‘strPlaceOfBirth’]; ?>”>
</div></td>
<td><div align=”center”>
<input type=”text” name=”txtDateofBirth” value=”<? echo $sqlAdminRow[‘dtmDateOfBirth’]; ?>”>
</div></td> <td><div align=”center”>
<input type=”submit” name=”Edit” value=”Edit”>
</div></td>
<td><div align=”center”>
<input type=”submit” name=”Delete” value=”Delete”>
</div></td>
</tr>
</form>
<? } ?>
</table>
</fieldset>

</div>
<div class=”cb”>
<div class=”l”>
<div class=”r”></div>
</div>
</div>
</div>
<div class=”post”>
</div>
</div>
<!– end content –>

</div>
<!– end page –>
<div id=”footer”>
<p>Copyright &copy; 2010 All Rights Reserved.<br />
Design by <a href=”http:///”>M.I.S.D.</a> Web Developer Team</p>
</div>
<div align=”right”>
<?
echo “(Host) IP Address: <strong>$server</strong> – “;
echo “(Remote) IP Address: <strong>$domain</strong> – “;
echo “(Local-Machine) IP Address: <strong>$domain1</strong>”;
?>
</div>
</body>

</html>
———————————–

Can anyone help me up with this one??? tnx and tnx??:p

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 10.2010 — Please use [noparse][code=php]...[/code][/noparse] tags around your code if you want us to take the time to read it.

[url=http://www.webdeveloper.com/forum/misc.php?do=bbcode]forum BBCode tags[/url]
Copy linkTweet thisAlerts:
@OctoberWindFeb 10.2010 — Didn't even look at any of the PHP, but the form action is [code=php]<form name="frmReg" method="post" action='<? $PHP_SELF; ?>'>[/code] and it should be like this:

[code=php] <form name="frmReg" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">[/code]

Same goes for the other form on the page.
Copy linkTweet thisAlerts:
@dhie20authorFeb 11.2010 — I Got error w/c is unknown column can anyone redebug this tnx and trnx

<?

session_start();

include("../inc/config.php");

$resultQuery=mysql_query("SELECT * FROM tbleligibilites");

$sql=mysql_query("SELECT * FROM tblemployee WHERE strEmployeeTIN='$tinID'");

$sqlRow=mysql_fetch_array($sql);

?>

<?

include ("../inc/config.php");

$sqlRet=mysql_query("SELECT *
FROM tblemployee where strEmployeeTIN='$tinID'");

$sqlRetFetch=mysql_fetch_array($sqlRet);

?>

<?

$Edit=$_POST['Edit'];

if($Edit){

include("../inc/config.php");

$query="UPDATE tbleligibilites SET strTitleOfExamination='$txtTitleOfExamination', dtmDateOfExam='$txtDateOfExam', strPlaceOfExamination='$txtPlaceOfExamination', strRating='$txtRating', dtmLicenseRelease='$txtLicenseRelease', strLicense='$txtLicense' WHERE id='$txtuid'";

mysql_query($query) or die(mysql_error());

echo '<script>alert("Civil Service Eligibility Successfully Updated")</script>';

echo '<meta http-equiv="refresh" content="0;url=editcivilservice.php?tinID='.$tinID.'">';

}

?>

<?

$Add=$_POST['Add'];

if($Add){

include("../inc/config.php");

$qry=mysql_query("SELECT * FROM tbleligibilites WHERE strTitleOfExamination='$txtTitleOfExamination' AND dtmDateOfExam='$txtDateOfExam' AND strPlaceOfExamination='$txtPlaceOfExamination' AND strRating='$txtRating' AND dtmLicenseRelease='$txtLicenseRelease' AND strLicense='$txtLicense'") or die(mysql_error());

$qryRow=mysql_num_rows($qry);

if ($qryRow==1) {

echo $qryRow;

echo '<script>alert("Already exists!")</script>';

echo '<script>history.back()</script>';

} else {

$query="INSERT INTO tblformaleducation(strEmployeeTIN,strTitleOfExamination,dtmDateOfExam,strPlaceOfExamination,strRating,dtmLicenseRelease,strLicense) VALUES ('$tinID','$txtTitleOfExamination','$txtDateOfExam','$txtPlaceOfExamination','$txtRating','$txtLicenseRelease','$txtLicense')";

mysql_query($query) or die(mysql_error());

echo '<script>alert("Civil Service Eligibility Successfully Added")</script>';

echo '<meta http-equiv="refresh" content="0;url=editcivilservice.php?tinID='.$tinID.'">';

}

}

?>

<?php

$Delete=$_POST['Delete'];

if($Delete){

include("../inc/config.php");

$query="DELETE FROM tbleligibilites WHERE strEmployeeTIN='$txtEmployeeTIN' AND id='$txtid'";

mysql_query($query)or die(mysql_error());

echo '<script>alert("Civil Service Eligibility Successfully Deleted")</script>';

echo '<meta http-equiv="refresh" content="0;url=editcivilservice.php?tinID='.$tinID.'">';

}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>Personal Information Sheet</title>

<meta name="keywords" content="" />

<meta name="description" content="" />

<link href="../style.css" rel="stylesheet" type="text/css" media="screen" />

<script language="javascript" type="text/javascript" src="../inc/datetimepicker.js"></script>

</head>

<body>

<div align="center" class="post"><img src="../images/logo.png"></div><br>

<!-- start sidebar -->

<div id="sidebar">

<div id="logo">

</div>

<div id="widgets">

<div id="widgets-top"></div>

<ul>

<li>

<h2 style="color:#FFF;text-decorationverline;font-size:16px">Main Menu</h2>

<br />

<? include ("../inc/editmenu.php"); ?>

<h2>&nbsp;</h2></li>

</ul>

</div>

</div>

<!-- end sidebar -->

<!-- start page -->

<div id="page">

<div id="search">

<form name="form1">

<fieldset>

<div style="margin-left:220px;"><marquee><font color="#FF0000" size="2"><b><blink>NEWS!</blink>&nbsp;&nbsp;&nbsp;</b></font><a href="http://www.denr.gov.ph" target="_blank" style="text-decoration: none"><font color="#FFFFFF">www.denr.gov.ph</font></a></marquee></div>

</fieldset>

</form>

</div>

<!-- start content -->

<div id="content">

<h1 class="pagetitle">Edit/Update</h1>

<div class="post">

<div class="ct">

<div class="l">

<div class="r"></div>

<h2>&nbsp;Data Info of:&nbsp;&nbsp;

<strong style="color:#0000CC"><?php echo strtoupper($sqlRetFetch['strLastName']); ?>, <?php echo strtoupper($sqlRetFetch['strFirstName']); ?> <?php echo strtoupper($sqlRetFetch['strMiddleName']); ?></strong></h2>

<br><h2>&nbsp;Employee TIN:&nbsp;&nbsp;<strong style="color:#0000CC"><? $tinID=$sqlRetFetch['strEmployeeTIN']; echo $tinID;?></strong></h2><br>

<center><? echo $msg; ?></center>

</div></div>

<div class="entry">

<fieldset>

<legend style="font-weight:bolder; color:#FFFFFF">Add New Eduactional Background</legend>

<form name="frmAdd" method="post" action='<? $PHP_SELF; ?>'>

<table width="100%" align="center">

<tr>

<td width="309" align="right"><strong>career service/ ra 1080(board/bar) under special laws/ces /csee:</strong></td>

<td><strong>

<input type="text" name="TitleOfExamination" />

</strong></td>

</tr>

<tr>

<td align="right"><strong>rating:</strong></td>

<td width="349"><strong>

<input type="text" name="txtRating">

&nbsp;</strong></td>

</tr>

<tr>

<td height="44" align="right"><strong>date of examination:</strong></td>

<td><strong>

<input type="text" name="txtDateOfExam" />

</strong></td>

</tr>

<tr>

<td align="right"><strong>place of examination</strong></td>

<td><input type="text" name="txtPlaceOfExamination"/>

</span></strong></td>

</tr>

<tr>

<td rowspan="2" align="right"><strong>License (if applicable)</strong></td>

<td><div align="left"><strong>number:

<input type="text" name="txtLicense" />

</strong></div></td>

</tr>

<tr>

<td><div align="left"><strong>date of release:

<input type="text" name="txtLicenseRelease" />

</strong></div></td>

</tr>

<tr>

<td colspan="2" align="right"><strong>

<input type="submit" name="Add" value="Add">

</strong></td>

</tr>

</table>

</form>

</fieldset>

<br><? echo $message; ?><br>

<fieldset>

<legend style="font-weight:bolder; color:#FFFFFF">Edit/Delete Educational Background</legend>

<table width="100%" align="center">

<tr>

<td><div align="center"><strong>

Career service / ra 1080(board/bar) under special laws/ces/csee</strong></div></td>

<td><div align="center"><strong>rating</strong></div></td>

<td><div align="center"><strong>date of examination<font style="font-size:9px; text-transform:lowercase; font-style:italic; color:#0000FF"></font></strong></div></td>

<td><div align="center">

<strong>place of examination</strong></div></td>

<td>&nbsp;</td>

<td colspan="2"><div align="center"><strong>License</strong></div> <div align="center"><strong>(if applicable)</strong></div></td>

<td><div align="center"></div></td>

<td><div align="center"></div></td>

</tr>

<?

include ("../inc/config.php");

$sqlAdmin=mysql_query("SELECT * FROM tbleligibilites WHERE strEmployeeTIN='$tinID'");

while ($sqlAdminRow=mysql_fetch_array($sqlAdmin)) {

?>

<form name="frmEdit" method="post" action='<? $PHP_SELF; ?>'>

<tr>

<input type="hidden" name="txtstrEmployeeTIN" value="<? echo $sqlAdminRow['strEmployeeTIN']; ?>">

<input type="hidden" name="txtid" value="<? echo $sqlAdminRow['id']; ?>">

<td><div align="center">

<input type="text" name="txtTitleOfExamination" value="<? echo $sqlAdminRow['strTitleOfExamination']; ?>">

</div></td>

<td><div align="center">

<input type="text" name="txtRating" value="<? echo $sqlAdminRow['strRating']; ?>" />

</div></td>

<td><div align="center">

<input type="text" name="txtDateOfExam" value="<? echo $sqlAdminRow['dtmDateOfExam']; ?>" />

</div></td>

<td><div align="center">

<input type="text" name="txtPlaceOfExamination" value="<? echo $sqlAdminRow['strPlaceOfExamination']; ?>"/>

</div></td>

<td><div align="center"></div></td>

<td><div align="center">

<input type="text" name="txtLicense" value="<? echo $sqlAdminRow['strLicense']; ?>" />

</div></td>

<td><div align="center">

<input type="text" name="txtLicenseRelease" value="<? echo $sqlAdminRow['dtmLicenseRelease']; ?>">

</div></td> <td><div align="center">

<input type="image" src="../images/edit.png" name="Edit" value="Edit" title="Edit">

</div></td>

<td><div align="center">

<input type="image" src="../images/drop.png" name="Delete" value="Delete" title="Delete">

</div></td>

</tr>

</form>

<? } ?>

</table>

</fieldset>

</div>

<div class="cb">

<div class="l">

<div class="r"></div>

</div>

</div>

</div>

<div class="post">

</div>

</div>

<!-- end content -->

</div>

<!-- end page -->

<div id="footer">

<p>Copyright &copy; 2010 All Rights Reserved.<br />

Design by <a href="http:///">M.I.S.D.</a> Web Developer Team</p>

</div>

<div align="right">

<?

echo "(Host) IP Address: <strong>$server</strong> - ";

echo "(Remote) IP Address: <strong>$domain</strong> - ";

echo "(Local-Machine) IP Address: <strong>$domain1</strong>";

?>

</div>

</body>

</html>


------------------------------------------
×

Success!

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