Jump to content


Photo

Can you take in HTML mark up as a value?


  • Please log in to reply
4 replies to this topic

#1 g-sal

g-sal
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 August 2005 - 08:24 PM

Hi,

I've created this object where a programmer can set all these values and the object can print out a div box with all the values formatted. In this div box I'd like to have this free text area that could potentially include images and tables and all sorts of HTML markup.

Here's an example of how the code would look like:

<?php
$event = new Event();
$event->title = "My title";
$event->description = "<p>My description</p>";
$event->display();
?>

Since I'm using Dreamweaver, I'd like the description to be defined outside the php tags so I can make full use of Dreamweavers GUI. The thing is, I don't know if PHP has a syntax that will enable me to do something like this:

<?php
$event = new Event();
$event->title = "My title";
$event->description = {
?>
<img src="..." /><p>description</p>
<?php }
$event->display();
//etc...
?>

Does anyone know is something similar is possible?

Thanks!

#2 Mattyspatty

Mattyspatty
  • Members
  • PipPipPip
  • Advanced Member
  • 76 posts
  • LocationEngland :D

Posted 21 August 2005 - 08:36 PM

Hi,

I've created this object where a programmer can set all these values and the object can print out a div box with all the values formatted.  In this div box I'd like to have this free text area that could potentially include images and tables and all sorts of HTML markup.

Here's an example of how the code would look like:

<?php
$event = new Event();
$event->title = "My title";
$event->description = "<p>My description</p>";
$event->display();
?>

Since I'm using Dreamweaver, I'd like the description to be defined outside the php tags so I can make full use of Dreamweavers GUI.  The thing is, I don't know if PHP has a syntax that will enable me to do something like this:

<?php
$event = new Event();
$event->title = "My title";
$event->description = {
?>
<img src="..." /><p>description</p>
<?php }
$event->display();
  //etc... 
?>

Does anyone know is something similar is possible?

Thanks!

View Post



what you are saying should work if im not mistaken, i use similar methods but not with ->, give it a go
ok, so my PHP is a bit rusty... my replies are 90% ok.
the other 10% either have syntax errors or are the "hard solution"
http://www.php.net  http://www.google.com - Are your friends!

I have a C++ problem with 'keybd_event' in certain applications. if you can help me PM me! :P
Needs motivation to create another quick cash website. I need a new TV

#3 g-sal

g-sal
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 22 August 2005 - 07:51 PM

Doing:

$event->description = { ?> ....... <? }

doesn't work.



#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 August 2005 - 02:01 PM

and will never work. you cant half assign a value to a variable, jump out of php to do something else then come back to php and expect it to be waiting. besides, what are the curly braces there for? your syntax is whack.

#5 g-sal

g-sal
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 01 September 2005 - 12:08 AM

and will never work. you cant half assign a value to a variable, jump out of php to do something else then come back to php and expect it to be waiting. besides, what are the curly braces there for? your syntax is whack.

View Post


Ok that's what I wanted to know, whether something similar is possible, not whether my syntax is right because i know it's wrong.

When it comes to functions or conditional statements you can jump into HTML. For example:

<? if ($var = $something) ?>
<p>Do this</p>
<? } else { ?>
<p>Do something else</p>
<? } ?>

I wanna know if I can store that html in a variable. I like to develop my HTML in Dreamweaver, have Dreamweaver preview the HTML in it's internal browser. That's why I want to know if this is possible.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users