Professional Web Applications Themes

Easy PHP question - PHP Development

Im trying to send a variable via GET to a php script like so: <a href="process.php?id=test & test">Link</a> Leaving spaces is no problem, but the & symbol (ampersand) cannot be displayed to the screen. I want it to show "test & test". Instead it displays just "test" without the rest following it. Can anyone tell me how to display the whole variable passed to process.php? TIA Rob...

Sponsored Links
  1. #1

    Default Easy PHP question

    Im trying to send a variable via GET to a php script like so:

    <a href="process.php?id=test & test">Link</a>

    Leaving spaces is no problem, but the & symbol (ampersand) cannot be
    displayed to the screen. I want it to show "test & test". Instead it
    displays just "test" without the rest following it.

    Can anyone tell me how to display the whole variable passed to
    process.php?

    TIA
    Rob
    Sponsored Links
    Robert Guest

  2. #2

    Default Re: Easy PHP question

    On 12 Sep 2003 17:01:24 -0700, [email]gojukasi.rr.com[/email] (Robert) wrote:
    >Im trying to send a variable via GET to a php script like so:
    >
    ><a href="process.php?id=test & test">Link</a>
    >
    >Leaving spaces is no problem, but the & symbol (ampersand) cannot be
    >displayed to the screen. I want it to show "test & test". Instead it
    >displays just "test" without the rest following it.
    In a URL, & is one of the separator characters (; being the other); so you
    have urlencode it for it to be part of a value within a URL.

    <a href="process.php?id=<?php echo urlencode('test & test')?>">Link</a>

    It'll come out as:

    <a href="process.php?id=test+%26+test">Link</a>
    >Can anyone tell me how to display the whole variable passed to
    >process.php?
    And then & is special in HTML. You must encode it as &amp; in any output.

    echo htmlspecialchars($_GET['id']);

    --
    Andy Hassall (andyandyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
    Space: disk usage ysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
    Andy Hassall Guest

  3. #3

    Default easy php question

    Hi,all

    I just install easyphp and manage to get apache and mysql services running
    fine, and I get my local web display 'apache connected page' at first run
    which the url is http://localhost

    The doentroot is 'c:/easyphp/www'. I use Xp pro and set port:80,
    server:localhost, login:root, password:blank
    I check the dependancy of dll and found msjava.dll missing, I correct it by
    downloading and save into c:\windows.

    Then I follow to create a test.php and I found that all php files I type,
    (eg: http://localhost/test.php) does not show and given message 'page not
    found' .

    What is the program use to open php file type ? IE ?
    What visual tool can I use to create MySQL db file ?
    When I use MySQL Administrator I can't connect to the MySQL server ?
    What could be wrong or missing ?

    Regards
    Hoe


    tnhoe Guest

  4. #4

    Default Re: easy php question

    Hoe,
    Please check the content of your error_log file.

    bluetent Guest

Similar Threads

  1. Easy Question
    By Chris Morris in forum PHP Development
    Replies: 20
    Last Post: March 4th, 03:06 PM
  2. VERY easy question (I think!)...
    By DIY_Lobotomy in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: November 10th, 09:38 PM
  3. very easy question here, plz help me!!!
    By deb_23 in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 13th, 03:23 AM
  4. Easy question = easy answer?
    By Jyry webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 4
    Last Post: September 29th, 03:29 PM
  5. Easy Question/Easy Answer
    By ChuckyJ webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 12th, 01:50 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139