views:

211

answers:

2

I am using php, js, flash and mysql on 1 website.

I want to do a URL masking using frameset(or maybe iframe). Scenario:

An user click on a link, which direct him/her to my page with this url:

www.domain.com/index.php?var1=string1&var2=string2

How to mask the url so that visitor can only see www.domain.com/index.php, but actually there are some variables over there. I need the variables, but i dont want the visitors to see. How to do URL masking on this? (I dont expect to get any code, I just want to know the logic of the url masking method)

PS. I probably would not use mod_rewrite, because I dont know how to use/write the code. So please, answer with iframe/frameset methods :)

A: 

EDIT: I think I misunderstood your question, so here is another attempt:

In www.yourdomain.com/index.php:

<?php

session_start();

if (isset($_REQUEST['flashvar']) && ! isset($_SESSION['flashvar'])) {

    // Store any parameters received
    $_SESSION['flashvar'] = $_REQUEST['flashvar'];

    // Redirecting without query parameters
    header('Location: /index.php');
    exit;
}
?>
<HTML>
<HEAD></HEAD>
<BODY>
<?php
  echo '<embed src="player.swf?flashvar=',
       urlencode($_SESSION['flashvar']), '"/>';
?>
</BODY>
</HTML>

This example will start a session and redirect the user to itself without needing to store any parameters in the query string. Naturally, it will only work if the user has cookies enabled.

Inshallah
A: 

Can you submit that parameters as POST data?

For example:

<form name="form1" action="index.php" method="POST">
    <input type="hidden" name="var1" value="value1" />
    <input type="hidden" name="var2" value="value2" />
</form>

<a href="#" onclick="document.form1.submit()">Click me</a>

When user clicks on the link, the form will be submitted to index.php with POST parameters var1 and var2. User will never see this parameters in their URL (still possible to see with various tools though).

Max