General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 3rd, 2003, 10:36 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 7
Outputting Large blocks of html

PHP Code:
print <<<END
    <tr>
    <td>$answers
['pa_name']</td>
    <td align='center'>$votes</td>
    <td><!-- Display Percentage --></td>
    </tr>
    END; 


the error,
Parse error: parse error, unexpected $end in file.php on line 79

Line 79 is the End of File,... </html>

Any Idea's?

I am not familiar with the print <<<END stuff,...don't know if I am doing it right or not.
__________________
-- Jason

Reply With Quote
  #2  
Old February 4th, 2003, 10:37 AM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
PHP Code:
 print*"<<<END

****<tr>

****<td>$answers['pa_name']</td>

****<td*align='center'>$votes</td>

****<td><!--*Display*Percentage*--></td>

****</tr>

****END"


Reply With Quote
  #3  
Old February 4th, 2003, 10:43 AM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 7
hmm,....why does that not work like this?

http://www.devarticles.com/art/1/397/2

PHP Code:
<?php 

$turkeys 
“variables”

print <<<
END 
  It is nice to know that “you” can 
print any amount of text on 
  
<font color=”red”>multiple</fontlines with <b>any</b
  
character and still include $turkeys
END

?>

Reply With Quote
  #4  
Old February 4th, 2003, 01:22 PM
corker corker is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 18 corker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
One of the rules with the print <<<END method is that there is absolutely NO extra whitespace on the terminating line. That's usually the problem I run into when using this method.

See http://www.php.net/manual/en/function.print.php

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Outputting Large blocks of html


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT