for Users - by Users
You are not logged in.
I am trying to use php to load a new webpage automatically
In simple terms I have index files containing a details about web page and use a 'For' loop to load up that info into a table which displays to give the user choices to click on.
If there is only 1 page detailed the table becomes irrelevant so I just I want to go straight to that page without the user having to click on it. No need to show a listing page for 1 item.
e.g
read index file
process first dataset
if only 1 dataset in file then got to page detailed in dataset
else
continue with processing datasets and display details
The logic of it I can handle, its the added function to go automaiticaly to another page (replacinbg existing one) that I can't find.
Obviously it can be done with a Metatag redirect in the header but I need to do it in the body of the page, with PHP
I'm sure It's straight forward and I'm missing something.
Any ideas anybody?
Offline
have a look at:
http://php.net/manual/en/function.header.php
Offline
Thanks elfin,
not sure if this will work though.
So far it hasn't. However I'm in in Spain at the moment - trying to test it on my little web book and writing code from memory, (in a bar).
I'll try a bit more thoroughly when I get home
Offline
Problem solved.
Just in case anybody is the slightest bit interested - which is probably unlikely however:
I was told meta tags do not need to go in the header - news to me.
Therefore a simple PHP solution switch to a new page is
echo "<meta http-equiv='refresh' content='0;url=/TargetPage.php'>; ?>
The 0 is a delay of 0 seconds
Works perfectly
Offline