Mohamedal_hakim at hotmail dot com
03-Sep-2003 05:34
you can write it like this too..
if (($_POST['id']) ||
($_POST['save_new_data'])) {
elseif ($_POST['id']) {
$link =
$_POST['link'];
$windowtype = $_POST['windowtype'];
$linktext
= $_POST['linktext'];
$display = $_POST['display'];
$windowtype = 'target="'.$_POST['windowtype'].'"';
$sql =
"UPDATE _cms_links SET link = '$link', windowtype
=
'$windowtype', linktext = '$linktext', display = '$display'
WHERE
id = $id";
$result = mysql_query($sql);
}
elseif
($_POST['save_new_data']) {
$sql = "INSERT INTO _cms_links
(link, windowtype, linktext,
display) VALUES
('$link',
'$windowtype', '$linktext', '$display')";
$result =
mysql_query($sql);
}
}
mfg.
cp1967 at techie dot com
01-Apr-2003 07:04
This function works well if you want to identify something to do for a
couple of conditions, and the remainder, you want to do nothing
with.
Ex.
if($a == a){
print
"yes";
}elseif($a == b){
print
"no";
}else{
// if $a != a AND $a != b
print "who
cares";
}