$_GET[] after a #fragment ?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
paintitblack
New php-forum User
New php-forum User
Posts: 8
Joined: Mon Feb 17, 2014 8:53 pm

Re: $_GET[] after a #fragment ?

Post by paintitblack » Tue Feb 18, 2014 11:32 pm

In its simplest form, this is what you need:

Code: Select all

$q = $HTTP_GET_VARS['q'] ;

paintitblack
New php-forum User
New php-forum User
Posts: 8
Joined: Mon Feb 17, 2014 8:53 pm

Re: $_GET[] after a #fragment ?

Post by paintitblack » Wed Feb 19, 2014 10:25 pm

I've just tested this on one of my shared hosting account (Linux), and it works fine:

Code: Select all

<?php
$param = $_GET['t'];
echo "The parameter value is: " . $param;
?>
I'm running this PHP code as follows:

Code: Select all

http://mydomain.com/phpcode.php?t=test

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: $_GET[] after a #fragment ?

Post by seandisanti » Thu Feb 27, 2014 10:11 am

The suggested solution is the correct one; but make sure you replace 'q' with the variable name being passed in your form. Also make sure that your form is sending data via 'get' and not 'post'. To make use of the suggestion I mean. Post is actually the better choice as it keeps your url a little cleaner, etc

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests