SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: ampersand (&)

  1. #1
    SitePoint Addict joyce's Avatar
    Join Date
    Aug 2001
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ampersand (&)

    i want to pass '&' and a character in a string. how can i do that?

    for eg:
    $subcat = me & u
    it will only pass the me but will tend to ignore words after &.( & u)

    this is the way i pass the $subcat.

    echo "<tr><td colspan=3 align=right><font face=verdana size=1><a href =\" http://www.certifyexpress.com/review..._main.php?gid=$id&cat=$cat&title=$title&subcat='$subcat'&image=$image1&desc=$desc\">Write a review</a></font>";

  2. #2
    SitePoint Addict lveale's Avatar
    Join Date
    Jun 2001
    Location
    Dublin
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when you're passing anything via the querystring, use the php function urlencode to wrap the querystring first:

    e.g
    PHP Code:
    $link "main.php?$pageid=" .urlencode($pid
    http://www.php.net/manual/en/function.urlencode.php
    Last edited by lveale; Sep 25, 2001 at 00:02.


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
  •