473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Simple question

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).

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.

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

Shelly
Jul 16 '06 #1
5 1324
Rik
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/metata.../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
Jul 16 '06 #2

"Rik" <lu************@hotmail.comwrote in message
news:a4***************************@news1.tudelft.n l...
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?
She bought something that can retrieve to code from the .swf, but is having
problems.
>
>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; ?>
This is exactly what I did, but calling it test1.htnl simply did not do
anything. Remember that the intention is to replace a page that is
currently pointed to as something.html with this redirecting file which will
be called something.php and will be the modified original something.html so
that it includes the new php stuff. Apparantly for the header statement to
work it has to be in a .php file. Inside a .html file simply did not work.
>
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/metata.../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


Jul 16 '06 #3
"Rik" <lu************@hotmail.comwrote in message
news:a4***************************@news1.tudelft.n l...
It's possible in HTML, see
http://webdesign.about.com/od/metata.../aa080300a.htm. It's Bad
Practice though...
This worked perfectly. Thanks. BTW, why is it bad practice?

Shelly
Jul 16 '06 #4
Shelly, for your use this will be just fine. A better approach would be
to configure your web server to 'forward' requests for problem.html to
whatyouwant.php.

In apache, you can specify a directive in .htaccess that will send the
browser a '301' moved status code with the new url.

Cheers,
Yong
Sheldon Glickler wrote:
"Rik" <lu************@hotmail.comwrote in message
news:a4***************************@news1.tudelft.n l...
It's possible in HTML, see
http://webdesign.about.com/od/metata.../aa080300a.htm. It's Bad
Practice though...

This worked perfectly. Thanks. BTW, why is it bad practice?

Shelly
Jul 16 '06 #5
Rik
Sheldon Glickler wrote:
"Rik" <lu************@hotmail.comwrote in message
news:a4***************************@news1.tudelft.n l...
>It's possible in HTML, see
http://webdesign.about.com/od/metata.../aa080300a.htm. It's
Bad Practice though...

This worked perfectly. Thanks. BTW, why is it bad practice?

Google it.
Some reading material:
http://www.mcanerin.com/EN/articles/...-scripting.asp

If you have apache, I'd seriously suggest mod_rewrite, and creating a
..htacess file:

----.htaccess---------
RewriteEngine On
RewriteRule ^something\.html$ something.php [R=301]
----------------------

Grtz,
--
Rik Wasmus
Jul 16 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
1
by: Proteus | last post by:
Any help appreciated on a small perl project I need to write for educator/teaching purposes. I have not programmed perl for some time, need to get up to speed, maybe some kind souls hrere will help...
2
by: Raskolnikow | last post by:
Hi! I have a very simple problem with itoa() or the localtime(...). Sorry, if it is too simple, I don't have a proper example. Please have a look at the comments. struct tm *systime; time_t...
3
by: Peter | last post by:
Hello Thanks for reviewing my question. I would like to know how can I programmatically select a node Thanks in Advanc Peter
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
4
by: dba_222 | last post by:
Dear Experts, Ok, I hate to ask such a seemingly dumb question, but I've already spent far too much time on this. More that I would care to admit. In Sql server, how do I simply change a...
14
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
10
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.