Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP Question

Options
  • 12-06-2002 11:36am
    #1
    Registered Users Posts: 14,761 ✭✭✭✭


    I am a ASP programmer and need to use a php code to request something off the querystring. I know no PHP what so ever but need to use it as the server does not to my knowledge run ASP.

    The PHP code im looking for, in ASP is: <%=Request.QueryString("image")%>

    According to DreamweaverXP its: <?php echo HTTP_GET_VARS[image]; ?>.

    What is the PHP code to get image from the QueryString?


Comments

  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Hi Winters,

    According to DreamweaverXP its: <?php echo HTTP_GET_VARS[image]; ?>.

    It should be $HTTP_GET_VARS. In later versions of PHP, where register_globals is turned off, you can use the pseudo-global $_GET array: $_GET. (You don't really need the qoutes around the element, but it's good coding practise.)

    HTH,
    adam


  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    doesnt' php automatically parse the query string anyway and turn them into variables?

    although its not the most secure way of doing it just accessing $image should work..

    unless i'm missing something :)


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    doesnt' php automatically parse the query string anyway and turn them into variables?

    It does indeed, but newer versions have this behaviour (register_globals) turned off by default.

    although its not the most secure way of doing it just accessing $image should work..

    It should, but it's better to avoid it. Course, it's just a matter of code cleanliness, but where would we be without standards? :)

    adam


  • Registered Users Posts: 14,761 ✭✭✭✭Winters


    Thanks. Could never get it to work. Im guessing the problem is with IIS :rolleyes: . ASP is a lot easier :D


Advertisement