/    Sign up×
Community /Pin to ProfileBookmark

Notice: Undefined index:

Got this error when trying to run one of my scripts anyone any ideas?

Notice: Undefined index: Update in c:websitequality_managementbackup_logbackup_edit.php on line 104

Thanks

Bazjones

[code=php]<form action=”<? echo($PHP_SELF); ?>” method=POST>
<table width=”129%” border=”0″>
<tr width=”100%”>
<?
$system = array(“Steelmaking Management”,
“Vessels”,
“Desulph”,
“Secondary Steelmaking”,
“BOS Engineering”,
“Quick Tap Phos”,
“Steeler”,
“X-Windows Load Host”,
“BOS Ladle Metallurgy”,
“Steelmaking File Server”);

# probably “nicer” to get above list of names from a database table?
echo <<<EOD
<td><strong>System:</strong></td>
<td><select name=”system” id=”system”>
EOD;
# add each eng as an option:
foreach($system as $value)
{
$selected = “”;
if($value == $get_info[“system”])
{
# mark this one as the selected entry:
$selected = ” selected”;
}
echo “<option$selected>$value</option>n”;
}
echo <<<EOD
</select></td>
EOD;
?>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=”9″>&nbsp;</td>
</tr>
<tr>
<td><strong>Comment:</strong></td>
<td colspan=”9″><textarea class=”textarea” name=”comment” rows=15 cols=120><? echo($get_info[“comment”]); ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=”9″>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=”9″>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=”6″><input name=”Update” type=SUBMIT class=”button” id=”Update2″ value=”Update”>
<input name=”Cancel” type=”button” id=”Cancel” onClick=”MM_goToURL(‘parent’,’/quality_management/backup_log/backup_report.php’);return document.MM_returnValue” value=”Cancel”></td>
<td width=”315″ colspan=”2″><div align=”right”> </div></td>
</tr>
</table>
<br>
</form>

<?
if($_POST[‘Update’])
{
$query = “UPDATE `backup` SET `System` = ‘”. $_POST[“system”] .”‘, `Comment` = ‘”.nl2br($_POST[“comment”]).”‘ WHERE `BackupID` = ‘$backupid'”;
$result = mysql_query($query);
if(!@header(“Location: backup_report.php”)){
echo(“<META HTTP-EQUIV=Refresh CONTENT=”1; URL=backup_report.php”>”);
echo(“<script>
window.top.location.href = ‘backup_report.php’;
</script>”);
echo(“You should now be redirected to the home page, click <a
href=’backup_report.php’>here</a> if you are not redirected.”);
};

}
?>[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMar 02.2006 — Could you indicate to us which line is number 104?
Copy linkTweet thisAlerts:
@SpectreReturnsMar 03.2006 — [code=php]if($_POST['Update'])[/code] It's that. You need to make sure POST has been submit before you make the form, and then put that as an else, so that you don't get errors like this:
[code=php]if (!isset($_POST['submit'])) {
...
} else {
...
}[/code]
×

Success!

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