Inserare text colorat in php
Scris: 21-Iul-2006, 14:35:19
vreau sa adaug un text colorat in urmatoarea pagina php
de exemplu dupa aceasta linie
cum pot sa fac...care e codul? thanx
Cod: Selectaţi tot
<php>sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error getting data', '', __LINE__, __FILE__, $sql);
}
$rowset = $db->sql_fetchrowset($result);
if (count($rowset) == 0)
{
//user hasn't already submitted, go ahead
$sql = "INSERT INTO " . COMPETITION_SUBMISSIONS_TABLE . " (username, user_id, answer) VALUES ('$submit_username', '$submit_user_id', '$submit_answer')";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in entering your answer', '', __LINE__, __FILE__, $sql);
}
message_die(GENERAL_MESSAGE, 'Answer Entered Successfully');
}
else
{
//user already submitted
message_die(GENERAL_ERROR, 'You have already submitted an entry');
}
break;
default:
$sql = "SELECT * FROM " . COMPETITION_CONFIG_TABLE . " WHERE config_name = 'question'";
if (!($result= $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain option information!", "", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$question = $row['config_value'];
$template->assign_vars(array(
'L_QUESTION' => $question,
'L_INSTRUCTIONS' => $lang['competition_instructions'])
);
$get_username = $userdata['username'];
$get_user_id = $userdata['user_id'];
$sql = "SELECT * FROM " . COMPETITION_OPTIONS_TABLE . " ORDER BY option_name";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in getting options', '', __LINE__, __FILE__, $sql);
}
// Put options into dropdown boxes
$optionbox .= '<select><option>' . $lang['select_option'] . '</option>';
while ( $row = $db->sql_fetchrow($result) )
{
$optionname = $row['option_name'];
$optionid = $row['option_id'];
$optionbox .= '<option>' . $optionname . '</option>';
}
$optionbox .= '</select>';
$template->assign_vars(array(
'GET_USERNAME' => $get_username,
'GET_USER_ID' => $get_user_id,
'OPTIONBOX' => $optionbox,
'L_CLICK_ME' => $lang['competition_click_me'],
'S_SUBMIT_ACTION' => append_sid('competition.'.$phpEx.'?mode=send'))
);
$template->set_filenames(array(
'body' => 'competition_body.tpl')
);
include($phpbb_root_path .'includes/page_header.'. $phpEx);
$template->pparse('body');
include($phpbb_root_path .'includes/page_tail.'. $phpEx);
}
?>
Cod: Selectaţi tot
$page_title = 'Concurs cu intrebari';