0

Basically what I'm doing is an if.then.else and depending on a value in the DB it's supposed to load one page or another. Right now I have it kluged together with a submit button but I'd like it to load automatically.

This PHP script sits alone with no HTML output, it just searches the database for an item. If that item is found I want it to go to my page, otherwise I want it to go to a default page on another server.

All that aside, whether it's HTML, PHP, or Javascript I just need a command that allows me to force the browser to load a new page. I know it's easy I just can't seem to find what I'm looking for. I've found things that were close, but not right.

3
Contributors
4
Replies
7
Views
7 Years
Discussion Span
Last Post by dietdew12z
0
<?php
header('Location: http://www.yoursite.com/new_page.html');
?>

That *is* MARVELOUS! Thank you, it worked like a charm. After two days of beating my head against this problem it was such a beautiful sight to see it seamlessly load the correct page.

Thanks again!

David

0

That *is* MARVELOUS! Thank you, it worked like a charm. After two days of beating my head against this problem it was such a beautiful sight to see it seamlessly load the correct page.

Thanks again!

David

It worked great until I started putting code into it. :)

I chanced across this method
<?php
echo "<script>location.replace(\"http://192.168.1.56/welcome.htm\");</script>";
?>
using javascript. I think it'll work better. We'll have to see.

David

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.