Jump to content


Photo

Concatenating a String with HTML Content


  • Please log in to reply
2 replies to this topic

#1 ptwizzy

ptwizzy
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 April 2006 - 04:18 PM

I have a registration page on the project I'm working on. There is length validation involved so I am using a stand-alone validation page which recieves data posted from collection page, validates it, if there are any errors I want to create an error_log, or string with each error triggered. I want to create a string and concatenate a line of HTML to this string each time.

$error_log = $error_log .= "\"" <p class="\"error\"">You must enter a password.</p> "\"";

Can anyone offer any advice?

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 18 April 2006 - 04:28 PM

You almost have it:
<?php
$error_log .= '<p class="error">You must enter a password.</p>';
?>

Ken

#3 ptwizzy

ptwizzy
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 April 2006 - 11:25 PM

Thank you for your help, Ken.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users