Jump to content

calling php file


fareedreg

Recommended Posts

I m calling one index.php file from this html.. but now i want to know that how can i call multiple file from according to menu.. I mean to say that .suppose user select 'addnewcustomer' so instead of index.php , i can call addnewcustomer.php ...  IS IT POSSIBLE? code below

 

(call.php)

<html>

<head>

<title> Library Managment System </title>

<link rel="stylesheet" type="text/css" href="style.css"/>

</head>

 

<body>

<?php

include ("head.html");

?>

 

 

<!-- Table for Main Body -->

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td valign="top" align="left" width="130">

<?php

include ("menu.html");

?>

</td>

 

 

 

<td width="1" bgcolor="lightskyblue" valign="top">  </td>

<td valign="top">

 

 

 

<?php

include ("index.php");

?>

<br> <br>

 

Link to comment
https://forums.phpfreaks.com/topic/189128-calling-php-file/
Share on other sites

using a href links:

<a href="addnewcustomer.php">Add New Customer</a>

 

using GET values:

<a href="call.php?loadPage=addnewcustomer.php">Add New Customer</a>

<html>
<head>
<title> Library Managment System </title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>

<body>
<?php
include ("head.html");
?>


<!-- Table for Main Body -->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td valign="top" align="left" width="130">
<?php
if (isset($_GET['loadFile']) && file_exists($_GET['loadFile']))
{
   include ($_GET['loadFile']);
}
else
   include('index.php'); // load index page on failure to load desired page if it doesn't exist.
?>
</td>



<td width="1" bgcolor="lightskyblue" valign="top">  </td>
<td valign="top">



<?php
include ("index.php");
?>
<br> <br> 

 

See: http://au.php.net/manual/en/reserved.variables.get.php - $_GET

http://au.php.net/manual/en/function.file-exists.php - file_exists()

http://au.php.net/manual/en/function.isset.php - isset()

Link to comment
https://forums.phpfreaks.com/topic/189128-calling-php-file/#findComment-998533
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.