Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Ampersand problem, data from php

Posted on 2005-04-04
11
Medium Priority
?
1,419 Views
Last Modified: 2012-06-27
I have a flash textfield thats rendered as HTML and i access a mysql database through a php file to get some content. That all works good but I have an & in my content and the flash content in the text box ends at the &

here's some of my php code

print("&accommodations=$accommodations");

i tried this before the print but it will just print out B%26B

$accommodations = str_replace("&", "%26", $accommodations);
and
urlencode($accommodations);

but nothing works

any help would be great. thanks.
0
Comment
Question by:jmingo
  • 5
  • 4
10 Comments
 
LVL 18

Expert Comment

by:Billystyx
ID: 13700671
what is the problem?
You have an & and its part of the text and meant to be there, or you have a & and you don't want it?
Billystyx
0
 
LVL 3

Expert Comment

by:mixart
ID: 13702945
Have you tried something like...

echo "textvar=".urlencode(utf8_encode("lots of special chars: &äöü..."));
0
 

Author Comment

by:jmingo
ID: 13706069
if i do the urlencode thing, it shows up in my flash textbox as this B%26B's for example, and the text color is black, is white without the urlencode code in there.

any other ideas?

thanks for your help.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jmingo
ID: 13706079
also, this is the code i put in

print "&accommodations=".urlencode(utf8_encode("$accommodations"));

0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13706279
what is $accomodations? Can you give me an example of the text values that are in there?

Billystyx
0
 

Author Comment

by:jmingo
ID: 13706320
geez, i'm very sorry guys.... i found the problem. it was an ID-10-T problem.

i was converting the & into %26 and for some reason after that converting %'s into %25's

sorry... thanks for your help and responses.
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13706373
That was in the string value of $accomodations I suppose?

Billystyx
0
 
LVL 18

Accepted Solution

by:
Billystyx earned 100 total points
ID: 13741039
That's OK, but I was wondering if my question prompted the solution being found. Could jmingo let us know that?

Billystyx
0
 

Author Comment

by:jmingo
ID: 13752340
well i guess it helped me in the sense that it made me look at the code a bit more.
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13752510
That's cool. Just wondering... :)
Good luck with it
Billystyx
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses
Course of the Month12 days, 12 hours left to enroll

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question