Results 1 to 11 of 11

Thread: Problem passing html thru url

  1. #1
    Join Date
    Nov 2009

    Question Problem passing html thru url

    Hi people, i got a sort of big problem, wich i actually think will be solved with just a little line of code either in html, javascript or php.

    But i have no idea at all what i can do to solve it by my self.

    So here it goes,

    On my index.php i got four textareas, two is regular, the other two has WYSIWYG editors attached to it.

    The two regular contains only:
    My Name etc and Some other text the user wants to write.

    The two with WYSIWYG editors attached are used to post images, and the form data as in the image is visually shown as a image, but behind the scenes in the WYSIWYG editor its like this:
    <img src="" height="" width="" alt="" />

    As in regular html code.

    I _need_ to pass this once before saveing, and i must pass the html thru get function, or my whole script fails.

    But when i pass it, it goes into urlencode i think, and it adds a little "%22" somewhere in my code that makes it look like this:

    HTML Code:
    And that makes it not working.
    When i change the url to this:

    HTML Code:
    Then it works, so what i did was to remove the %22 after the image url.

    Is there a way to remove the %22 automaticly for each submit of the get form, or is there another way to pass html thru get?

    I'm up for using either PHP, HTML or JAVSCRIPT to solve this one.

    Hope someone knows a slolution else then changeing form to post, as post will not make it work with the rest of my script.


  2. #2
    Join Date
    Nov 2003
    Worthington, OH, USA
    The &#37;22 is a double quote ("), but if you can't find where you are inserting it you should be able to get rid of it using the string.replace() function in javascript. Before the urlencode assuming str contains the text string you are getting ready to send the code would look something like:
    54 68 65 42 65 61 72 4D 61 79

  3. #3
    Join Date
    Jan 2009
    If you are possibly sending large amounts of data it would be much easier to use POST. Then you won't have to worry about url_encode or url_decode on the server-side at all.

  4. #4
    Join Date
    Jun 2008
    I use this:
    PHP Code:
    $who str_replace('/\%20/'' '$who);  //This strips out the %20 you asked for
    $who ereg_replace("[-]"" "$who);    //This removes any dashes
    $who urldecode($who);                     //This will remove any + signs 

  5. #5
    Join Date
    Jun 2008
    on another note, to replace any of those things to re-insert in your search string... you can do this:

    PHP Code:
    $search ereg_replace("[-]"" "$search);  // This will remove dashes
    $search urlencode($search);                   // This will encode the URL (replace spaces with + signs 

  6. #6
    Join Date
    Nov 2009

    Lightbulb Thanks people

    Hi, thanks all for setting some ideas into my head..

    I added this to my code

    PHP Code:
    $content_name    $_GET['content0'];
    $content_dag    str_replace("/\%22/"" "$_GET['content1']);
    $content_dag    urldecode($content_dag);
    $content_dag    str_replace("&lt;""<"$content_dag);
    $content_dag     str_replace("&gt;"">"$content_dag);
    $content_natt    "";
    $content_kladd    $_GET['content3'];
    $postable        "true";

    And now my problem is getting closer to be solved
    HTML Code:
    <img src="%5C%22images_dir/lady/image_url.jpg%5C%22" width="154" height="140">
    thats what i have now, so the html is sent
    sucessfully, but im still not removing %22 and %5C showed up there to.

    What can i do now ?

    and thanks again


  7. #7
    Join Date
    Nov 2009

    Lightbulb Tried this one too

    I tried useing substr to remove some of the code, and a wird thing happend :s

    PHP Code:
    //Added this to code:
    $content_dag    substr($content_dag4, -4); 
    HTML before:
    HTML Code:
    <img src="%5C%22images_dir/lady/image_url.jpg%5C%22" width="154" height="140">
    HTML after:
    HTML Code:
     src=\"produkter_org/man/produkter_man_level1.jpg\" width=\"150\" height=\"14
    So as you see, this function wirdly removed the characters i wanted to remove, and it removed %5C%22, but it added slashes..

    And ofcourse i cant show the image when <img and \"> is missing..

    So cant use this in any tricky way can i?

    Or wait, got a little idea while i wrote this, maybe i chould set <img and \">
    as a default inside the elseif somewhere, then the only thing i need to do is echo/print the content of content_dag inside the <img and \> etc?

    Or will this not work?
    Might test it before someone replies but happy if someone helps


  8. #8
    Join Date
    Nov 2009
    When adding <img and > in the echo/print
    url turned out like this again:

    HTML Code:
    <img src="&#37;5C%22produkter_org/man/produkter_man_level1.jpg%5C%22" width="150" height="140">
    So that dident work so well at all
    Then im stuck again, so anyone out there with an idea?


  9. #9
    Join Date
    Sep 2008
    I must be missing something in this thread.... where are these characters coming from to start with??? I didn't see that addressed in the posts (or I missed it somehow).
    I would eliminate the "problem at it's source instead of trying to fix it after the fact... just a thought.
    ...but stupidity is terminal.

  10. #10
    Join Date
    Nov 2009
    I cant post my whole code here, as its not small or understandable at all, but ill give you the important things:

    HTML Code:
    <form name="my_form" method="get" action="">
        <textarea name="content1" id="content1">
        	This is the textarea with a name 
        <textarea name="content2" id="content2">
        	This is the textarea with a WYSIWYG editor attached. and it contains a image, with html code no [img] or anything
        <textarea name="content3" id="content3">
        	This is also a textarea like the other one content2
    	<textarea name="content4" id="content4">
        	This is just like content1 only with a bit more text
    So the thing is that i have to update the content of either content2 or content3 without tuching the rest on a refresh.
    I solved that by echoing the content after i sent it to URL, but that gave me the issue i need help with, like sending html thru url and decodeing it
    to be "showable".

    need some more description?


  11. #11
    Join Date
    Sep 2008
    Are you using a standard pre-written WYSIWYG editor? which one?
    or one that you put together?
    The editor is adding the characters - why? We can only find out seeing that part of the editor... if it is one that everybody has access to it's easy enough to check. If it's not the editor, then it's in the file that you are using to process the output of the editor....
    ...but stupidity is terminal.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13490 seconds
  • Memory Usage 2,975KB
  • Queries Executed 15 (?)
More Information
Template Usage (35):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (7)bbcode_html
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (11)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (11)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (73):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates