byUsers Forums

for Users - by Users

You are not logged in.

Announcement

Please see the byUsers policy on cookies.

If you see a post that is objectionable, or appears to be spam, please use the "Report" button at the bottom of the post to let us know.

Thank-you.

#1 19-04-2011 18:02:18

jerryh
Elite Member
From: Medway, Kent
Registered: 30-03-2001
Posts: 1231
Karma: 36
Website

load web page using PHP

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?


Oh No not again!!

Offline

#2 21-04-2011 13:01:42

elfin
Administrator
From: Liverpool, UK
Registered: 17-08-2002
Posts: 3061
Karma: 70
Website

Re: load web page using PHP


My mind is on a permanent tangent

Offline

#3 26-04-2011 15:36:52

jerryh
Elite Member
From: Medway, Kent
Registered: 30-03-2001
Posts: 1231
Karma: 36
Website

Re: load web page using PHP

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


Oh No not again!!

Offline

#4 28-04-2011 03:39:19

jerryh
Elite Member
From: Medway, Kent
Registered: 30-03-2001
Posts: 1231
Karma: 36
Website

Re: load web page using PHP

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

Code:

 echo "<meta http-equiv='refresh' content='0;url=/TargetPage.php'>;  ?>

The 0 is a delay of 0 seconds

Works perfectly


Oh No not again!!

Offline

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson