Jump to content

Recommended Posts

Hi,

I came up this problem today:
I tried to pass a variable to a script creating a URL like:

article.php?id=25

Unfortunately it appears $id is quite empty. Is there some setting I need to alter?
It used to work in the past (php4 that is).
Also, I don't have great access to the settings so is there also a workaround besides changing the ini file?

Thank you in advance!
Link to comment
https://forums.phpfreaks.com/topic/23840-passing-vars-over-url/
Share on other sites

now the query string is parsed into "SUPERGLOBALS"

The ?GET query string can be accessed with the SuperGlobal $_GET (Array)

eg.

[code]<?php
$id = $_GET["id"];
echo $id;
?>[/code]

This was changed because from earlier versions of PHP for security and performance concerns. POST vars are now stored in $_POST :)
hth..

NOTE: you can also turn on the 'old skool' methods in php.ini
Link to comment
https://forums.phpfreaks.com/topic/23840-passing-vars-over-url/#findComment-108272
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.