Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / May 2007



Tip: Looking for answers? Try searching our database.

MySQL data into dynamic text field without escape sequence!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joshley2 - 23 May 2007 19:59 GMT
Hi guys,

I got a music portfolio web site running PHP, MySQL and Flash.  There's a page
showing all the artists my client worked for and when you click on a song
title, this title is passed as a variable to a PHP page then to a Flash page.  
The Flash page contains an actionscript music player which then looks for the
right audio file in the database and plays the song.  Everything works great
except for the dynamic text field which displays the song title.  If the song
title contains an apostrophe or a single quote, the Flash dynamic text field
then shows the apostrophe preceded by a \.

Here's an http://www.pierrepineault.com/quote_problem/quote_bug.jpg :

For example, the song Breaking up somebody's home (by Nanette Workman) is
written as is into the MySQL database.  The display into the HTML page is fine
( no \),  The problem is with the Flash dynamic text field.

The problem I think, is that PHP variables are sent to the Flash player and
one of these variables contains a string with single quotes in it (the actual
song title).  Here's the partial code that points the problem :

[code]
<?php
    while($arrAudio = mysql_fetch_assoc($resultAudio))
    {
        $aTitle = $arrAudio["Title"];
        $aFile = $arrAudio["File"];
        $counter = $counter + 1;
    ?>
    Track <?=$counter?> / [I]Plage <?=$counter?>[/I] : <a
href="<?=$_SERVER['PHP_SELF'].'?audioname='.$aTitle.'&audiofile='.$aFile.'&image
file='.$flashImage?>" target="_blank"><?= $aTitle ?></a><br />
    <?php
[/code]

Where  $aTitle  is the song title containing a single quote.    How can I tell
Flash to NOT escape the single quote ?

The actual site is here : http://www.pierrepineault.com/contentFrame.php

Many thanks in advance.

Joshley2
joshley2 - 24 May 2007 21:50 GMT
Hi,

I finally found the solution. Inside the file that's going to be read by
Flash, just wrap the variable with a stripslashes() function.

[CODE]

$audioname = stripslashes($audioname);

[/CODE]

Joshley
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.