Connecting Tech Pros Worldwide Help | Site Map

l/f problem?

Richard Ragon
Guest
 
Posts: n/a
#1: Nov 9 '05
I'm a flash applications developer. I'm working with a PHP developer
who is working on a back end database. His PHP program writes a small
blob with a sting of comma delineated variables. It looks like this..

'Air Conditioning,Included,Included,Power
Steering,Included,Included,Power Windows,Included,Included,Power Door
Locks,Included,Included,Tilt Wheel,Included,Included'

I suspect there's a problem on how his PHP writes this string, because
my program (flash windows based) is having a problem trying to read the
strings last variable "Included".

I used SQLYOG, a Windows based SQL editor to take a look at the string
in the blob, and I can see an unidentifiable character at the end of the
string.. windows can't see it, but it looks like a | at the end of the
string in the blob db.

Is this a line return? How do we get rid of this l/f or return from
showing up via windows?

What needs to be in the PHP code in order NOT to put a l/f or return here??

Thanks
-Richard

Andy Hassall
Guest
 
Posts: n/a
#2: Nov 10 '05

re: l/f problem?


On Wed, 09 Nov 2005 22:45:54 GMT, Richard Ragon <bsema04@hananho.com> wrote:
[color=blue]
>What needs to be in the PHP code in order NOT to put a l/f or return here??[/color]

What's at the end of the line in the code that DOES write it?
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Frank [GOD]
Guest
 
Posts: n/a
#3: Nov 10 '05

re: l/f problem?


have your PHP guy add an extra comma on the end of the string. That will
remove your l/f and solve your problems!!

Frank


Richard Ragon wrote:[color=blue]
> I'm a flash applications developer. I'm working with a PHP developer
> who is working on a back end database. His PHP program writes a small
> blob with a sting of comma delineated variables. It looks like this..
>
> 'Air Conditioning,Included,Included,Power
> Steering,Included,Included,Power Windows,Included,Included,Power Door
> Locks,Included,Included,Tilt Wheel,Included,Included'
>
> I suspect there's a problem on how his PHP writes this string, because
> my program (flash windows based) is having a problem trying to read the
> strings last variable "Included".
>
> I used SQLYOG, a Windows based SQL editor to take a look at the string
> in the blob, and I can see an unidentifiable character at the end of the
> string.. windows can't see it, but it looks like a | at the end of the
> string in the blob db.
>
> Is this a line return? How do we get rid of this l/f or return from
> showing up via windows?
>
> What needs to be in the PHP code in order NOT to put a l/f or return here??
>
> Thanks
> -Richard
>[/color]
Meião
Guest
 
Posts: n/a
#4: Nov 10 '05

re: l/f problem?


Windows and Linux have diferent caracters for Line Feeds and Returns.
Does your coworker use linux? Maybe that's it.

You can also try to trim the string.

André

Richard Ragon
Guest
 
Posts: n/a
#5: Nov 10 '05

re: l/f problem?


Andy Hassall wrote:[color=blue]
> On Wed, 09 Nov 2005 22:45:54 GMT, Richard Ragon <bsema04@hananho.com> wrote:
>
>[color=green]
>>What needs to be in the PHP code in order NOT to put a l/f or return here??[/color]
>
>
> What's at the end of the line in the code that DOES write it?[/color]

Don't know! Windows sees it as a small thin black box.. Looks like a
character that windows can't understand.

# == character that windows can't read

This is what my string looks like to windows

Variable1,Variable2,Variable3#

-Richard
Richard Ragon
Guest
 
Posts: n/a
#6: Nov 10 '05

re: l/f problem?


Frank [GOD] wrote:
[color=blue]
> have your PHP guy add an extra comma on the end of the string. That will
> remove your l/f and solve your problems!!
>
> Frank[/color]

Doesn't work.. This is what happens..

# == character windows can't read.

So, this is what my variable ends up looking like..

variable1,variable2,variable3,variable4,variable5# ,

odd huh?
Thanks
-Richard
Richard Ragon
Guest
 
Posts: n/a
#7: Nov 10 '05

re: l/f problem?


Meião wrote:
[color=blue]
> Windows and Linux have diferent caracters for Line Feeds and Returns.
> Does your coworker use linux? Maybe that's it.[/color]

No, but the PHP server is linux. The string is NOT placed by hand.
[color=blue]
> You can also try to trim the string.[/color]

What's a trim? Is it some kind of function?
[color=blue]
>
> André[/color]

-Richard


Andy Hassall
Guest
 
Posts: n/a
#8: Nov 10 '05

re: l/f problem?


On Thu, 10 Nov 2005 18:13:43 GMT, Richard Ragon <bsema04@hananho.com> wrote:
[color=blue]
>Andy Hassall wrote:[color=green]
>> On Wed, 09 Nov 2005 22:45:54 GMT, Richard Ragon <bsema04@hananho.com> wrote:
>>[color=darkred]
>>>What needs to be in the PHP code in order NOT to put a l/f or return here??[/color]
>>
>> What's at the end of the line in the code that DOES write it?[/color]
>
>Don't know! Windows sees it as a small thin black box.. Looks like a
>character that windows can't understand.[/color]

No, I mean in the _PHP source code_.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jeff North
Guest
 
Posts: n/a
#9: Nov 10 '05

re: l/f problem?


On Wed, 09 Nov 2005 22:45:54 GMT, in comp.lang.php Richard Ragon
<bsema04@hananho.com> wrote:
[color=blue]
>| I'm a flash applications developer. I'm working with a PHP developer
>| who is working on a back end database. His PHP program writes a small
>| blob with a sting of comma delineated variables. It looks like this..
>|
>| 'Air Conditioning,Included,Included,Power
>| Steering,Included,Included,Power Windows,Included,Included,Power Door
>| Locks,Included,Included,Tilt Wheel,Included,Included'
>|
>| I suspect there's a problem on how his PHP writes this string, because
>| my program (flash windows based) is having a problem trying to read the
>| strings last variable "Included".
>|
>| I used SQLYOG, a Windows based SQL editor to take a look at the string
>| in the blob, and I can see an unidentifiable character at the end of the
>| string.. windows can't see it, but it looks like a | at the end of the
>| string in the blob db.[/color]

All this means is that the font you are currently using can not
display the character.
[color=blue]
>| Is this a line return? How do we get rid of this l/f or return from
>| showing up via windows?
>|
>| What needs to be in the PHP code in order NOT to put a l/f or return here??[/color]

What version of Flash are you using?

Use the following to obtain the code you are looking for (AS2.0 code):
---------------------------------------------------
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean):Void {
if (success) {
trace(this);
} else {
trace("Error");
}
}
my_lv.load("lv.txt");
-----------------------------------------------------
change the "lv.txt" to that of your filename.
The output window will show the URL encoded string that is read. If
the last character is a linefeed then you'll see %0D as the last
character of the output.

From there you could expand your if( success ) function to:

if( success ) {
my_lv = my_lv.substring(0,my_lv.length-1);
//--- do more processing
}
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Closed Thread