Witam. Najpierw kody:
w mod_rewrite mam:
RewriteRule ^([a-zA-Z0-9]*)$ show.php?id=$1 [L]
i plik show w 2 wersjach:
$ref = $_SERVER['HTTP_REFERER'];
echo '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script type="text/javascript">
$(document).ready(function() {
setTimeout ( "doSomething3()", 1000 );
});
function doSomething3 ( )
{
$.ajax({
type: "GET",
url: "showadd.php",
data: "id='.$id.'&ref='.$ref.'",
});
}
</script>';
if($_GET['id']){
$url = $getUrl[0];
<frameset rows='*,1' border='0' frameborder='no' framespacing='0'>
<frame src='".$url."' marginheight='0' marginwidth='0' topmargin='0' leftmargin='0'>
<frame src='add.php' marginheight='0' marginwidth='0' border='0' topmargin='0' scroling='no' leftmargin='0'>
</frameset>
";
} else {
echo "<center>Error : invalid url</center>"; }
} else {
header("Location: index.php"); }
Przy takiej opcji gdy wpiszę adres strony jako
http://adresstrony.pl mimo że powinno mnie przekierować poprzez header("Location: index.php"); nie robi tego.
Pokombinowałem i zmieniłem kod na taki.
if($_GET['id']){
$url = $getUrl[0];
<frameset rows='*,1' border='0' frameborder='no' framespacing='0'>
<frame src='".$url."' marginheight='0' marginwidth='0' topmargin='0' leftmargin='0'>
<frame src='add.php' marginheight='0' marginwidth='0' border='0' topmargin='0' scroling='no' leftmargin='0'>
</frameset>
";
$ref = $_SERVER['HTTP_REFERER'];
echo '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script type="text/javascript">
$(document).ready(function() {
setTimeout ( "doSomething3()", 1000 );
});
function doSomething3 ( )
{
$.ajax({
type: "GET",
url: "showadd.php",
data: "id='.$id.'&ref='.$ref.'",
});
}
</script>';
} else {
echo "<center>Error : invalid url</center>"; }
} else {
header("Location: index.php"); }
Przy takim kodzie owszem przekierowanie na index.php przy wpisaniu adresu jako
http://adresstrony.pl działa ale za to nie działa tutaj teraz nie działa przesłanie GET z funkcji doSomething3 ...
Zapewne rozwiązanie jest banalne ale już nie mam pomysłu co jest nie tak.
hmm morze dziś się znajdzie ktoś kto pomorze

?
Ten post edytował bubusek 23.05.2011, 09:03:53