Log in

View Full Version : Help with some code plz =D [+Rep]



Jahova
15-02-2007, 05:10 PM
Hi, I want to know what should I add to the code below to make the specified go into a new window, not the same one.
+ rep for awnsers
- T.



setcookie("in", 1, time()+3600);
// Start hidden page
header("Location: http://www.cowly.co.uk/staff/logged.htm");
}
}


Edited by Lµke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks :).

F32
15-02-2007, 05:11 PM
-ignore.

PHP.

Jahova
15-02-2007, 05:20 PM
This is php...?
- T.

ZAG
15-02-2007, 05:22 PM
PHP cannot control the client, it is server-side, so it cannot choose whether it loads in a new page etc.

Use Javascript to load the page instead.

Heres a simple code


<script type="text/javascript">
function LoadPage(URL){
window.open(URL);
}
</script>


And heres an example of using it

<a href="javascript:LoadPage('http://google.co.uk')">LOL</a>

Jahova
15-02-2007, 05:28 PM
Oh yeah forgot, its for a login system :l
Plz =D

ZAG
15-02-2007, 05:32 PM
Then you could use something like this



<?php
setcookie("in", 1, time()+3600);
// Start hidden page
?>
<script type="text/javascript">
window.open('http://www.cowly.co.uk/staff/logged.htm');
</script>
<?php
}
}
?>

Jahova
15-02-2007, 05:44 PM
Thanks +rep.
I am not using it but it would have worked.
I am making a whole new system using a tutorial and building on it =D
- T.

ZAG
15-02-2007, 05:48 PM
OK, thanks :)

Want to hide these adverts? Register an account for free!