Re: print problem
| From: | Philip Olson | Date: | Wed, 15 Nov 2000 17:29:30 +0000 |
| Subject: | Re: print problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25474@lists.php.net to get a copy of this message | ||
Hey,
A bunch of loons replied to your question so I will add another :-)
First, your syntax is SO wrong that it's almost as if you are joking so
perhaps you should reread that book and if it instructs the aforementioned
code then immediatly burn it.
Now, firstly this is what you wanted to do. First we'll define the
variable and then print it :
<?php
$My_Board = 'My board is made of wood';
print "$My_Board";
?>
If you'd like to read up on syntax (you should!) then go here :
http://www.php.net/manual/language.basic-syntax.php
In fact, you should go through the manual. Anyway, you will see many ways
to print variables exist such as :
<?php
print $My_Board;
print ("$My_Board");
print "$My_Board";
?>
Oh and there is echo() function too :-) Anyway, you need to learn some
basics my friend, so check out :
Basics :
http://devshed.com/Server_Side/PHP/PHP101_1/
(part 1 of 5 part series - very basic)
Use Strings :
http://www.zend.com/zend/tut/using-strings.php
(using strings is so important this is where many fail)
Don't mind peoples comments, it's just that your code was or is horrible
and not even close to being correct...but you will learn to dominate PHP
soon enough :-)
Regards,
Philip
--
be outside the box.
On Wed, 15 Nov 2000, Joe Newbie wrote:
>
> Hi, I'm reading the book "Teach Yourself PHP in 15 Minutes" and can't
> figure out why this doesn't work:
>
> >?
>
> print ""; $My_Board
>
> </php>
>
>
> Could someone please re-write my code so the message board works and
the cookie is set. Should I have included() or required() the Style
Sheet(which is faster)? And please tell my why this way is better than the ASP way?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>