A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Href link in edit box

  1. #1
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58

    Href link in edit box

    Hello 3dfa's,

    Since the last time Blanius helped me so much with a script i have another question. I like to have the possibility to edit links to other site's just like the rest of the text on the site. So when i am writing text in the edit box and past in a link like <a href="http://3dfa.com">3dfa</a> and then save the link it changes to <a href=\"http://3dfa.com\">3dfa</a> (see the zip file)

    It seems to have a problem with the quotes.
    Somebody out there who can give me a helping hand.

    thanks in advance
    Attached Files Attached Files

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    try using single quotes
    '

  3. #3
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58
    I tried that but, it with the same result. When i am using single or double quotes and try to save the text the \ appears before the quotes.

    Beats me

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I just tried using <a href="http://3dfa.com">3dfa</a> in an editbox that has HTML set to on and it works fine. Only issue is that it doesn't underline it as you would expect but you could just add <u> </u> if you want to that's what my guest book does

  5. #5
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58
    Blanius,
    The link works when i put it in a HTML box. But with the php script writing the input from the HTML box to a links.txt file on the server it fails.
    You can see what i mean at www.rmvos.nl/writetoserver.html
    There you see exactly what i mean when you write down a link.

    thanks for your answer.

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    LOL that looks familiar strip the / in php and you'll be fine.

  7. #7
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58
    Blanius,

    this is the php part. You made it yourself didn't you?
    But where do i have to strip the /

    <?php
    if ($_POST['cmd']=='w'){
    //to write a file
    $fp=fopen ($_POST[file],'w');//open file for writing
    fwrite($fp,"&var1=".$var1);//save what ever is in the string contents
    fclose ($fp);//close it
    }else{

    //open a file and assign it a 'handle' of fp
    $fp=fopen($file_name,'r') ;

    //Then read the file
    $contents = fread ($fp, filesize ($file_name));
    fclose ($fp);//done close the file
    }
    //either way I think it's ok to send the contents back to 3dfa
    //so send it
    echo "&var1=".$var1;//change this to the variable you use in 3dfa
    ?>

    Do you mean like:

    <?php
    if ($_POST['cmd']=='w'){
    $fp=fopen ($_POST[file],'w');
    fwrite($fp,"&var1=".$var1);
    fclose ($fp);
    }else{
    $fp=fopen($file_name,'r') ;
    $contents = fread ($fp, filesize ($file_name));
    fclose ($fp);
    }
    echo "&var1=".$var1;
    ?>
    Last edited by RobVos; 07-03-2005 at 04:03 PM.

  8. #8
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    hmm where is it adding the slashes? Must be in the 3dfa code. Try removing where it adds them in the first place. I don't think you need them here anyway. If you where using the html strings in PHP you would but shouldn't just to save to server. Otherwise I'll try to whip up code to remove the slash.

    Simple solution might be to just strip the slashes in the PHP before sending it to 3dfa. I probably add the slashes when saving the file it is needed.

    change the following line
    echo "&var1=".stripslashes($var1);
    Last edited by blanius; 07-04-2005 at 10:24 AM.

  9. #9
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58
    Blanius,

    when i read the txt file it goes from 3dfa and the line is as follows. (got it from you ;-))

    file="test.txt"
    loadVariables ("http://www.rmvos.nl/"+file,GET);

    I tried changing the line like you sayed but that didn't do the job. ;-(
    Is there a way to strip the slashes when reading the txt file.
    Do you know something else ?

    greetings Rob
    Last edited by RobVos; 07-04-2005 at 01:31 PM.

  10. #10
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Confused.

  11. #11
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590
    Edit: I removed this because I just realised it had already all been said. Apologies.
    Last edited by ForumNewbie; 07-05-2005 at 02:15 PM.
    Please note that my domain has changed to http://www.morganmultinational.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center