...

View Full Version : Resolved placing php before a java redirect



darksecu
05-31-2012, 10:28 AM
<script>
<!--

/*
Count down then redirect script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

//change below target URL to your own
var targetURL="*****.php?get=****8&&getid='.$id.'"
//change the second to start counting down from
var countdownfrom='.$clicktime.'


var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//-->
</script>';

Before
window.location=targetURL
return I Want to place $_SESSION['namestatus'] == 'name';
how can i do it .. please help me ..

devnull69
05-31-2012, 08:39 PM
The question is: Why would you want to do that?

It seems like you want to set a PHP SESSION variable "shortly before" you leave the current page. This is not possible. All the PHP code has long been executed before any Javascript code will start to execute.

So if you want to set this SESSION variable at exactly this moment, you'd have to do it either in the page you redirect to or via an Ajax request ... and then only redirect after the Ajax request has finished.

darksecu
06-02-2012, 05:12 AM
never tried ajax, can you give me some codes which shows countdown and after countdown is to 0 it set $_SESSION and redirect to link we set there...

or

when countdown ends it shows users captcha , when users type correct words it set $_SESSION and redirect...

darksecu
06-02-2012, 06:27 AM
Placed a count down auto submit form with some hidden get values, using those get values as security token on next page :) ...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum