hi, i'm working with php short hand for the first time and i'm trying to edit this code:

<?=($c->is_admin == 'Yes')?'<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>'
:
'
            <p>
                This is not the page you were looking for.
            </p>
'

?> 

i want to do something like this :

<?=($c->is_admin == 'Yes')?'<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>'
$con = @mysql_connect(my login stuff);
mysql_select_db(more stuff); // database
if (!$con)
  {
  echo'connection error';
  die('Could not connect: ' . mysql_error());
  }
:
'
            <p>
                This is not the page you were looking for.
            </p>
'

?> 

any ideas why it wont work?

Try this:

<?php

$ok = '<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>'; # this is mix of input and a tags, it's not correct
$error = '<p>This is not the page you were looking for.</p>';
$con = @mysql_connect(my login stuff);
$connection_err = false;
mysql_select_db(more stuff);
if(!$con) { $error .= "\nConnection error". mysql_error(); $connection_err = true; }

echo ($c->is_admin != 'Yes' || $connection_err === true) ? $error:$ok;
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.