LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-13-2005, 01:10 AM   #1
prabhatsoni
Member
 
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Rep: Reputation: 30
php function to open an html page


Hello everybody,

I have this php code in a script which has a switch statement:

Code:
<?php
 include "/usr/local/include/php/fns.php";
?>
<html>
<head><title>Bla blah Blah</title></head>
<body bgcolor="pink">
<?php
 switch($_POST['act_choice'])
   {
     case "pgpr":
        pgpr_form1();
	break;
     case "alpha":
        alpha_form1();
	break;
     case "vpt":
	vpt_form1();
        break;
   }
?>
</body>
</html>
Is there a php function which can directly open a given html page. In above case, I want that in case "ppr" a form (say ppr_form.html) should open, similarly for case "alpha" a form - alpha_form.html, should be opened. I believe there is some php function which should do it.

Can anyone guide a greenhorn like me?


Thanks in advance.


Prabhat Soni

Last edited by prabhatsoni; 06-13-2005 at 01:19 AM.
 
Old 06-13-2005, 06:05 AM   #2
Boby
Member
 
Registered: Feb 2004
Posts: 781

Rep: Reputation: Disabled
Hi!

You can use:
PHP Code:
case "pgpr":
   if(
file_exists("ppr_form.html"))
      include 
'ppr_form.html';
   break; 
This will include the content of "ppr_form.html" at that place in your main page.

Or redirect to a new page, this will show only "ppr_form.html" as new page without including it in your main page:
PHP Code:
case "pgpr":
   
header("Refresh: 0;url=ppr_form.html");
   break; 
Cheers, Boby!
 
Old 06-13-2005, 11:32 PM   #3
prabhatsoni
Member
 
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Original Poster
Rep: Reputation: 30
Thanks Boby,
You have been of immense help.



Prabhat Soni
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
html page maker prabhakar_kushwaha Linux - Software 3 10-14-2005 09:17 PM
PHP: html Form Select function problem camlinux Programming 2 05-15-2005 08:23 PM
Passing one php function result as a parameter to another php function davee Programming 13 09-12-2004 12:08 PM
HTML page break? patpawlowski Programming 4 02-12-2004 10:30 AM
Creating a simple html page from php? lucastic Linux - General 4 11-05-2003 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration