You are here: Re: Simple question « PHP Programming Language « IT news, forums, messages
Re: Simple question

Posted by Rik on 07/16/06 20:52

Sheldon Glickler wrote:
> Here is the problem I have. I have added a management interface in
> php for a website that was all html and flash. Whereas before items
> were hard-coded, now they are pulled up from a database. I can
> change the links from html to php almost everywhere. One of them is
> located within a flash file, however. The source for it was lost
> because of a computer crash (yes, she didn't back it up -- arghh).

I keep my hands of Flash, but maybe some people could help you retrieve it,
so it can be altered?

> So, here is what I want to do but don't know how. I want to replace
> the existing referenced html page with code that will redirect the
> user (without notification) to the new php page. I tried a test
> called test1.html that simply had a header statement within <?php ?>
> to go to another page, but that didn't work.

Why not?
This should work, if the user allows redirects (and almost all users do):
<?php header('Location : http://www.example.com'; exit; ?>

Keep in mind you shouldn't have any output before the header statement.

> How do I code the html page to automatically go to another page?

It's possible in HTML, see
http://webdesign.about.com/od/metataglibraries/a/aa080300a.htm. It's Bad
Practice though...

If you can't do it in PHP for some reason, you could also do it in Apache
using mod_rewrite.

On a side note, the HTTP header 301 (permanently moved), was invented for
this kind of stuff.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация