
Jason
Staff
/ Moderator

Nov 17, 2011, 10:40 AM
Post #11 of 14
(2756 views)
Shortcut
|
|
Re: [gkornbluth] Echo variable inside of textbox
[In reply to]
|
Can't Post
|
|
Hi Jerry, I took a look at your code. It seems that var6, 7, and 8 are all dependent on each other. If there is no special location name, there probably won't be an address. In that case, we can replace 6, 7, and 8 with a single placeholder and combine those 2 fields into a single string. So the text box would look like this:
You're all signed up for <b>"*var1*"</b> on <b>*var3*, from *var4*</b> *var6* We suggest that you arrive at least 15 minutes early so that you can get to know some of the other attendees. As a reminder, here's a copy of the description of this event. "*var5*" We look forward to seeing you there. and the PHP would look like this:
<?php $event_start_date = date("l, M jS, Y", strtotime($learning_centerRecord['event_start_date'])) ; $special_location = ""; if (@$learning_centerRecord['special_event_location_name']) { $special_location = "<b>Special Location: ".$learning_centerRecord['special_event_location_name']."</b>\n".$learning_centerRecord['special_event_location_address']; } $placeHolders = array("*var1*", "*var2*", "*var3*", "*var4*", "*var5*", "*var6*", "*var7*", "*var8*" ); $replaceWith = array($learning_centerRecord['event_title'], $learning_centerRecord['event_fee'], $event_start_date, $learning_centerRecord['event_times'], $learning_centerRecord['event_description'], $special_location); echo str_replace($placeHolders, $replaceWith, $common_informationRecord['learning_center_thank_you_1']); ?> Hope this helps --------------------------------------------------- Jason Sauchuk - Programmer interactivetools.com Hire me! Save time by getting our experts to help with your project. http://www.interactivetools.com/consulting/
(This post was edited by Jason on Nov 17, 2011, 11:17 PM)
|