Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 25th, 2003, 05:29 AM
Gappa Gappa is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 27 Gappa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 30 sec
Reputation Power: 0
Simple PHP load?

Hey all I simply want to load my php file intp a text box (in flash MX) (not like view it as code, but like as the html result)

just having trouble doing it? I dont need to play with the varibles or anything...I just wanna display it as its basically just site news.


Here is the script i wanna load
PHP Code:
<html>
<
head>
<
titleRantage.tk :: News ::</title>
</
head>
<
body>

<
table border=0 width=100%>
<?
php
$db 
mysql_connect("localhost""Gappa"""); 
mysql_select_db("Gappa",$db); 
 

$query "SELECT topic_title, topic_id, 
      FROM_UNIXTIME(topic_time,'%W the %D %M @ %r') AS Topic_Date, 
      post_text, username 
FROM phpbb_topics 
RIGHT JOIN phpbb_posts_text ON topic_first_post_id=post_id 
JOIN phpbb_users 
WHERE user_id=topic_poster AND forum_id=6 
ORDER BY topic_time DESC"
;


$result mysql_query($query$db) or die ($query .': '.mysql_error()); 

$BBcode_search = array('[ b ]''[ /b ]''[ i ]''[ /i ]''[pre]''[/pre]''[shout]''[/shout]''[br]'); 
$BBcode_replace = array('<b>''</b>''<i>''</i>''<pre>''</pre>''<span class="shout">''</span>''<br> <br>'); 

while(
$row mysql_fetch_assoc($result)) {


echo 
"<b><FONT FACE=Arial SIZE=-1 COLOR=#FF9900>"
echo 
"$row[topic_title]:</FONT></b><br/>"
echo 
"<FONT FACE=Arail SIZE=-2 COLOR=#999999>posted by: <b>$row[username]</b>"
echo 
" on: "
echo 
"$row[Topic_Date]</FONT><br/><hr><br/>"
echo 
"<FONT FACE=Arail SIZE=-1 COLOR=#FFFFFF> $row[post_text]</FONT>"
echo 
"<br/><br/>";  
echo 
"<FONT FACE=Arial SIZE=-2>"
echo 
"<a href=\"http://www.hostultra.com/~Gappa/phpBB2/viewtopic.php?t=$row[topic_id]\"><b><FONT COLOR=#FF9900>Read comments</FONT></b></a></FONT>";
echo 
"<br/><br/><br/>";  

?> 
</table>
</body>
</html> 


It has some horizontal lines in there at the moment, might need to take em out (dont know if flash can read them)...

Any way, how do i go about loading this...?

Reply With Quote
  #2  
Old July 2nd, 2003, 05:16 AM
jamieB jamieB is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2002
Posts: 592 jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 1 h 56 m 16 sec
Reputation Power: 17
if you can rely on your html being well-formed xml (all tags closed, case sensitive etc), use xml.load from your flash movie......otherwise, use a loadvars object, but loadvars will only accept name=value pairs so do something like:

PHP Code:
echo "&codenews=";
echo 
"<b><FONT FACE=Arial SIZE=-1 COLOR=#FF9900>"

echo 
"$row[topic_title]:</FONT></b><br/>"

echo 
"<FONT FACE=Arail SIZE=-2 COLOR=#999999>posted by: <b>$row[username]</b>"

echo 
" on: "

echo 
"$row[Topic_Date]</FONT><br/><hr><br/>"

echo 
"<FONT FACE=Arail SIZE=-1 COLOR=#FFFFFF> $row[post_text]</FONT>"

echo 
"<br/><br/>";  

echo 
"<FONT FACE=Arial SIZE=-2>"

echo 
"<a href=\"http://www.hostultra.com/~Gappa/phpBB2/viewtopic.php?t=$row[topic_id]\"><b><FONT COLOR=#FF9900>Read comments</FONT></b></a></FONT>";

echo 
"<br/><br/><br/>"
echo 
"&"


and escape any ampersands in there. Then in flash you can call that with:

Code:
my_lv = new LoadVars();
my_lv.onLoad = handleLoad;
my_lv.load("sitenews.php");
function handleLoad(success) {
if(sucess) {
news_txt.htmlText = this.siteNews;
} else {
news_txt.htmlText = "<b>No news is good news</b>";
}
}


and make a dynamic textfield called news_txt on the main timeline and set it to display html in the properties panel. xml would be the nicer way to do it if you are sure it's well-formed.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Simple PHP load?


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 2 hosted by Hostway