1

i need to add any function for my result id in EOF but i see this line in page and not work my function. how to fix this?!

{design_num('61')}

my PHP:

$stmt->bind_result($Id,$first_name, $last_name);

$content = <<< EOF
  <tr>
  <td style="text-align:center;">{design_num($Id)}</td> 
  <td style="text-align:right;"><a href="#">{$first_name}</td>
  <td style="text-align:right;">{$last_name}</td>
  </tr>                                                     
EOF;
2
  • 1
    You do not close your a element. Moreover, please use htmlspecialchars when outputting $first_name and $last_name to avoid XSS. Commented Apr 1, 2013 at 11:58
  • 1
    As Michael suggests, those EOF markers are being used as what is called HEREDOC markers. Just so you know for future googling. Commented Apr 1, 2013 at 12:18

1 Answer 1

1

It's feasible, but you need a powerful magic to accomplish this task

$design_num = design_num($Id);
$content = <<< EOF
  <tr>
  <td style="text-align:center;">$design_num</td> 
  <td style="text-align:right;"><a href="#">$first_name</td>
  <td style="text-align:right;">$last_name</td>
  </tr>                                                     
EOF;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.