SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Exclamation PHP URL output problem - please help!!!

    I am using a wysiwyg editor in an administration panel for the administrator to insert text, images and other elements. The editor I am using is "TheManInBlue" which can be found at http://www.themaninblue.com

    I have used this editor many times before, and I never had this problem. What happens is that on output of the specific entry from the database, all images aren't showing correctly.

    Let's say that the image URL is the following :

    Code:
    http://www.domain.com/images/image.gif
    It shows up as :

    Code:
    http://www.domain.com/images/http://www.domain.com/images/image.gif
    In other words...the main directory is repeated for some reason.

    Could anyone please help me or give me some advice? It will be greatly appreciated.

    A very important point is that the URL is correct in the database itself, so obviously something goes wrong on output.

    Thank You very much.

    I hope to get a response soon.

    Best,
    Contrid

  2. #2
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Paste your code that outputs it. There may be something there that is causing this problem.
    PHP | MySQL | (X)HTML | CSS

  3. #3
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brent5392
    Paste your code that outputs it. There may be something there that is causing this problem.
    Thanks for your response.

    PHP Code:
    //description1
    $desc1 $res['description1'];
    $message1 addslashes(preg_replace("/\r|\n/"''$desc1));
    $strip1 stripslashes($message1);
    $final1 stripslashes($strip1);
    $desc1 "$final1"
    That's about it. The file runs a query and extracts the value from the database.

    For some odd reason it repeats the directory url before the image name.

    I will kiss your *** if you could help me. lol

    Thanks.

  4. #4
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The entry in the database which gets extracted as shown in my previous post, looks like this :

    <p><span class=&quot;textblack&quot;><p><span class=&quot;textblack&quot;><p><span class=&quot;textblack&quot;><p><span class=&quot;textblack&quot;><p><span class=&quot;textblack&quot;><span class=&quot;textblack&quot;><span class=&quot;textblack&quot;><span class=&quot;textblack&quot;><span class=&quot;textblack&quot;><p>This is the description for product 03</p></span></span></span></span></span></span></span><p><img alt=&quot;asdf&quot; src=&quot;http://www.contrid.com/demo/products...logo.png&quot; /></p></span></span></p>
    Thanks.

  5. #5
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I have some more information.

    I see that my previous script has a different format in the database. I use this other script as a reference, since it works perfectly good.

    In this script, the quotation marks are '&quot' in the database and the other script (which works) has normal quotation marks where this one has '&quot'.

    Hope this helps.

    lol...I don't really know that much about this stuff yet. But I am willing to learn.

    Thanks for any help

  6. #6
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, quite confusing. Its great that you willing to learn. Also you have found a good way to get your post count up, ). Now, onto the main problem. I have never used themaninblue so i dont really know much about it.

    Im pretty tired, been a long day for me, so im still not quite sure what the problem is. I read over the database post above about what was in the database. Thats fine so it is something to do with the final output, the php.

    That php code you posted, what exactly does it have to do with your problem? What is the variable $res['description1']?

    ~Brent~
    PHP | MySQL | (X)HTML | CSS

  7. #7
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brent5392
    Ok, quite confusing. Its great that you willing to learn. Also you have found a good way to get your post count up, ). Now, onto the main problem. I have never used themaninblue so i dont really know much about it.

    Im pretty tired, been a long day for me, so im still not quite sure what the problem is. I read over the database post above about what was in the database. Thats fine so it is something to do with the final output, the php.

    That php code you posted, what exactly does it have to do with your problem? What is the variable $res['description1']?

    ~Brent~
    Thanks for your help.

    I have managed to sort the problem out, but I haven't had the chance to post an update here.

    Well...technically the issue was with the database. The code in the database wasn't right for output...atleast not in the format that I specifically needed it.

    So I had to make some adjustments to addslashes and stipslashes to get the values stored correctly in the database.

    $res was just a variable containing the 'mysql_fetch_array'

    Thanks again. I am just sooooo happy that I got it sorted out. I have already notified my client of his script completion...and now it's time to get paid.

  8. #8
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, makes sense now. Paid... wonderful... im still waiting for a reply on some help (i think), i cant remember... or am i ment to be working on it right now... hmmm... maybe ill just go to bed
    PHP | MySQL | (X)HTML | CSS

  9. #9
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brent5392
    Cool, makes sense now. Paid... wonderful... im still waiting for a reply on some help (i think), i cant remember... or am i ment to be working on it right now... hmmm... maybe ill just go to bed
    Yeah...
    In the mean time I will think of ways to get my post count up.

    So...
    What do you think of the unique avatar? Pretty cool, right?

  10. #10
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Hmmm... found out i wasnt waiting for a reply... looks like its back to work. So far you have got 6 of 10 posts on this thread...

    Your avatar...

    PHP Code:
    <?php
    $sarcasm 
    "Your avatar is real exciting.";
    echo 
    $sarcasm;
    ?>
    PHP | MySQL | (X)HTML | CSS

  11. #11
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php

    $i 
    0;
    $the_bomb "brent is sooooo coooool";

    while (
    $i == 0)
    {
    echo 
    "$the_bomb";
    };

    ?>

  12. #12
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Our ammusement is quite sad...
    PHP | MySQL | (X)HTML | CSS


Bookmarks

Posting Permissions

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