Jump to content

Passing Vars over URL


deaf_jupiter

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.