Originally posted by ge0rge
Srv = www.manuva.co.uk
Usr=root
Pass=password
Db=manuva
<script language="JavaScript1.1">
window.location=("<?php $GET['srv'] ?>";/Displaying.php?srv="<?php $GET['srv'] ?>";&usr="<?php $GET['usr'] ?>";pass="<?php $GET['pass'] ?>";&db="<?php $_GET['db'] ?>"š
</script>
Should look like when exe
<script language="JavaScript1.1">
window.location=(www.manuva.co.uk/displaying.php?srv=www.manuva.co.uk&usr=root&pass=password&db=manuva)
</script>
Let's do it step by step...
First... he is how to make a redierction with JS...
<script language="JavaScript1.1">
location.href = "address";
// or
self.location.href = "address"; // will change the location ONLY in the current frame (if frames are present)
// or
top.location.href = "address"; //(will remove frames and load the page)
// and so on...
</script>
Second (let's use self.location.href)...
You want something like :
<script language="JavaScript1.1">
self.location.href = "http://www.manuva.co.uk/displaying.php?srv=www.manuva.co.uk&usr=root&pass=password&db=manuva";
</script>
(Please note that I removes the ( ), that I added "http://" and that I added quotes (they are ESSENTIAL)
Third... let's replace the different elements with PHP...
-> Let's change "www.manuva.co.uk" with PHP... (please note that you must NOT put quotes before and after the PHP code... if you do, you will have JS error)
<script language="JavaScript1.1">
self.location.href = "http://[COLOR=red]<? echo $_GET["srv"]; ?>[/COLOR]/displaying.php?srv=[COLOR=red]<? echo $_GET["srv"]; ?>[/COLOR]&usr=root&pass=password&db=manuva";
</script>
-> Let's change "root" with PHP...
<script language="JavaScript1.1">
self.location.href = "http://<? echo $_GET["srv"]; ?>/displaying.php?srv=<? echo $_GET["srv"]; ?>&usr=[COLOR=red]<? echo $_GET["usr"]; ?>[/COLOR]&pass=password&db=manuva";
</script>
-> Let's change "password" with PHP...
<script language="JavaScript1.1">
self.location.href = "http://<? echo $_GET["srv"]; ?>/displaying.php?srv=<? echo $_GET["srv"]; ?>&usr=<? echo $_GET["usr"]; ?>&pass=[COLOR=red]<? echo $_GET["pass"]; ?>[/COLOR]&db=manuva";
</script>
-> Finally, let's change "manuva" with PHP...
<script language="JavaScript1.1">
self.location.href = "http://<? echo $_GET["srv"]; ?>/displaying.php?srv=<? echo $_GET["srv"]; ?>&usr=<? echo $_GET["usr"]; ?>&pass=<? echo $_GET["pass"]; ?>&db=[COLOR=red]<? echo $_GET["db"]; ?>[/COLOR]";
</script>
Why it didn't work ?
- You had problems with quotes.
- You didn't print the PHP variables...
<? $_GET["variable"]; ?> will not print anything... where is "echo" ? "print" ?
A little tip... instead of <? echo $something; ?> you can simply write <?= $something; ?> (read about it because some conditions must be respected)
- You semi-colon ( ; ) was outside the PHP code, so you should have gotten a PHP error...
Your code...
<script language="JavaScript1.1">
window.location=("page.php<?php $_GET['srv'] ?>";/Displaying.php?srv="<?php $_GET['srv'] ?>";&usr="<?php $_GET['usr'] ?>";pass="<?php $_GET['pass'] ?>";&db="<?php $_GET['db'] ?>";&ip="<?php $_GET['ip'] ?>";&port="<?php $_GET['port'] ?>";&nick="<?php $_GET['nick'] ?>"
</script>
...would have produced something like this :
<script language="JavaScript1.1">
window.location=("page.php";/Displaying.php?srv="";&usr="";pass="";&db="";&ip="";&port="";&nick=""
</script>
Doesn't really make sense... ! Never put quotes in a URI...
I mean...
http://www.server.com/dir/file.extension?variable1="value1"&variable2="value2"&variable3="value3"
IS WRONG !
http://www.server.com/dir/file.extension?variable1=value1&variable2=value2&variable3=value3
IS GOOD !
Did this [long] message help ?