PHP Classes

Reading data in address bar

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Reading data in address bar  
Subject:Reading data in address bar
Summary:Read address bar and check in database, short address
Messages:2
Author:Sven Josefsson
Date:2009-02-27 10:24:40
Update:2009-02-27 14:41:11
 

  1. Reading data in address bar   Reply   Report abuse  
Picture of Sven Josefsson Sven Josefsson - 2009-02-27 14:24:32
Hi
Can anyone help me with a problem?
If it is possible to do like this?
I need help with a solution where I can send someone to
<test>.domain.com.

(Or, if not possible - http://domain.com/<test>)
where <test> is a value defined in a mysql database.
For example, if I write: http://test.mydomain.com
then it check if "test" exist in the database.
If exist, redirect to mydomain.com/defined_page and session=ok.
If not, redirect to mydomain.com/not_defined_page and session=not_ok

The checking in database, or setting of session are no problem.
Just the reading.

----in use, but I need an easier/shorter address-----
address = http://mydomain.com/page.php&value=<test>

require "functions.php";
if ( isset($_GET['value'])){
$get_test_ok = checkHtest($_GET['value']);
if($get_test_ok){
$exist = "1";
$_SESSION['sess_exist'] = $exist;
$_SESSION['sess_test'] = $_GET['value'];
$testId = gettestId($_SESSION['sess_test']);}
----This was not so hard to create, but..-----

Is this possible to use http://<test>.mydomain.com?
or http://mydomain.com/<test>?
What must be done on my webserver?

Hope someone can help me

Best regards
Sven Josefsson

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.