www.webdeveloper.com
Results 1 to 4 of 4

Thread: Passing variable containing '•' via $_GET

  1. #1
    Join Date
    Jun 2012
    Posts
    3

    Passing variable containing '•' via $_GET

    I'm trying to pass a variable that contains a 'bullet' from one php file to another. It appears to work fine in Firefox and Explorer, but is not interpreted correctly by Chrome or Safari.

    Here's the code in the file defining the variable $title.

    Code:
    <a href="../product/product.php?title=Window Reflection &bull; 1985&dir-name=madrona&image=madrona1" >Go To Store</a>
    Here's the code in the file "getting" the variable.

    Code:
    <h2><?php echo $_GET["title"] ?></h2>
    I've messed around with htmlspecialchars() htmlentities(), but have not found a resolution that works in all browsers!?!

    Any pointers are appreciated.

    Thanks!!!

  2. #2
    Join Date
    May 2012
    Posts
    59
    The & means something in URL's... you need to use rawurlencode() eg:

    dsadsdas.com?title=<?php print urlencode("Window Reflection &bull; 1985"); ?>&blabla=bladeda

    Kind regards,
    Scott

  3. #3
    Join Date
    Jun 2012
    Posts
    3
    Thank You!!!!

    That solved my problem.

  4. #4
    Join Date
    Jun 2012
    Posts
    3

    resolved Resolved

    Thanks!

Thread Information

Users Browsing this Thread

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

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



Recent Articles