#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    6
    Rep Power
    0
    A funny problem, I am generating strings on one page and passing them via a form to a second page.

    In the process all the periods in the passed strings are converted to underscores

    i.e. "http://202.49.141.21/mydata/new_form/tryit.jpg"
    becomes
    "http://202_49_141_21/mydata/new_form/tryit_jpg"


    Has anyone noticed this behaviour, or know of why and how to overcome it.

    Thanks
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    I am generating strings on one page and passing them via a form to a second page.
    >>

    when you generate the string ..how it is coming ?...try to print it and see.

    ----------
    try the following..
    ----------

    In your first page...use urlencode() function to encode this value...

    <?
    $value="http://202.49.141.21/mydata/new_form/tryit.jpg";

    $value=urlencode($value);
    ?>

    In your second page...you can use urldecode() to decode the above value..



    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    6
    Rep Power
    0
    Thanks for the suggestion, but urlencode() and urldecode() did not help.

    Interesting that (even after decode) the results were still with _ substitution for . and also had all of the url characters encoded i.e. spaces became %20 etc.

    I must check that it is php not some funny effect in my browser. Printing the string to screen before the post shows it is in correct form.

    Thanks for the suggestion

    Regards-Gordon
  6. #4
  7. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Gordon,

    actually this is very interesting problem.

    Can you post that code here?..

    so we can test that script and tell you how it is giving result for us..




    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    hhhhmmmmm Strange one - You can sort of workaround it by using regex or str_replace() at the receiving end, PHP does a similar thing with co-ordinates from image maps but that is on purpose, this I am not sure about!

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. One confirmation email, two different forms
    By sisleysusie in forum PHP Development
    Replies: 3
    Last Post: January 26th, 2004, 10:26 PM
  2. WHM account creation error messages on RH
    By borisbaloney in forum Linux Help
    Replies: 0
    Last Post: December 16th, 2003, 06:54 PM
  3. Putting/submitting lots of forms on one page
    By rampguy in forum PHP Development
    Replies: 1
    Last Post: December 5th, 2003, 10:47 PM
  4. changing forms with no name
    By Thadanator in forum HTML Programming
    Replies: 1
    Last Post: August 26th, 2003, 02:05 AM
  5. Changing Values In Forms
    By 2ZOD.COM in forum HTML Programming
    Replies: 2
    Last Post: March 21st, 2003, 09:53 AM

IMN logo majestic logo threadwatch logo seochat tools logo