Jump to content

How to redirect a php page


jack
 Share

Recommended Posts

Hi All,i have a html page where normal all the html tags are there and i got a php page where i have written a function tp to redirect another .Javascript page.Its jsut a function to redirect a javascript file nothing more than that.The code is<?phpheader("Location: http://www.hhhhhhh.js/");?>Now my question is how can i call this function in .html file.]pls help me.Thanks in advanceJack.

Link to comment
Share on other sites

the header has to be a seperate file, you can't just save it in with an entire page and expect php to just take out the header. I hope this helps, try saving the desired header as header.html. When you do that, put this one line where you would like the header(at the top of the page most likely):<?php require("header.html");?>and there you go! Simple as that. Please tell me if this has helped you.

Link to comment
Share on other sites

the header has to be a seperate file, you can't just save it in with an entire page and expect php to just take out the header. I hope this helps, try saving the desired header as header.html. When you do that, put this one line where you would like the header(at the top of the page most likely):<?php require("header.html");?>and there you go! Simple as that. Please tell me if this has helped you.

Its some thing like this.2 files are there1)a.html - this file dont have any scripts its a pure html file.I want to call b.php file here.HOW DO I CALL b.php here?2)b.php- here i have a function written to redirect broswer to another site.Name of page is b.phpName of Function is repageMy question here is how do i call repage from a.html?Is it possible to call function written in a php page to be called in HTML page?If possible can anyopne help me?Its quiet urgentThanks in advanceJack.
Link to comment
Share on other sites

Guest FooCumber

Basically you can't use any php in *.html files. To use PHP code of any sort you must be using a php extension. So, simply by changing a.html to a.php and making sure to use the include or require function to include the file with the function. After doing so call the function whatever(arguements); and you should be good.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...