This topic is locked

view as custom on edit page / display code snippet on edit page

6/20/2014 6:25:33 PM
PHPRunner General questions
D
dspolans author

the following code works perfectly when i place it in the "view as custom" for the field for the VIEW page. However, i want the same thing to display on the edit page as read only.

I tried adding a code snippet, but it doesn't show up after i build. do i need to add an echo somewhere in my code? what's the best way to get this to simply display on the edit page with all my other fields?
-----
$rs = CustomQuery("SELECT concat(zip, phonenumber) as zipphone FROM do_not_call WHERE concat(zip, phonenumber) = '".$data['phone1']."'");

$record = db_fetch_array($rs);
if (!$record["zipphone"])

{

$value = "<font color=black>".$data['phone1']."</font>";

}

else

{

$value = "DNC" . "<font color=red>".$data['phone1']."</font>";

}