# Frameset for php

**URL:** <https://forum.kirupa.com/t/frameset-for-php/265735>\
**Category:** programming\
**Created:** [July 11, 2008, 7:11pm UTC](https://forum.kirupa.com/t/frameset-for-php/265735 "2008-07-11T19:11:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Utech22](https://avatars.discourse-cdn.com/v4/letter/u/f17d59/32.png) [@Utech22](https://forum.kirupa.com/u/Utech22)\
**Post date:** [July 11, 2008, 7:11pm UTC](https://forum.kirupa.com/t/frameset-for-php/265735/1 "2008-07-11T19:11:30Z")

</div>

I created a table instead of using frames.  
What I want to achieve is to have the menu links load in the table center row  
as if I was using frames, I want all the page links to load in the homepage table center row;  
I was trying this:

```php

link1="page1.php";
link2="page2.php";
link3="page3.php";
if (link1) {
include_once("page1.php");}
else if (link2) {
include_once("page2.php");}
else {
include_once("page3.php");}

```

My logics for the was if link1 is clicked page1.php would be displayed in the center table row, else if link2 is clicked page2.php would be displayed in the center table row, else  
link3 is clicked page3.php would be displayed in the center table row;

I need the correct coding as this is not working.

---

<div class="post-metadata">

**Author:** ![jwilliam](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jwilliam](https://forum.kirupa.com/u/jwilliam)\
**Post date:** [July 11, 2008, 7:44pm UTC](https://forum.kirupa.com/t/frameset-for-php/265735/2 "2008-07-11T19:44:52Z")

</div>

A valid PHP variable must beging with ‘$’ . I don’t see anything else that’s obviously wrong, though I have one suggestion. Instead of include\_once, use require\_once. This will stop execution of the script if it is unable to include one of your PHP files, which is almost always the desirable response.

---

<div class="post-metadata">

**Author:** ![Utech22](https://avatars.discourse-cdn.com/v4/letter/u/f17d59/32.png) [@Utech22](https://forum.kirupa.com/u/Utech22)\
**Post date:** [July 12, 2008, 2:16pm UTC](https://forum.kirupa.com/t/frameset-for-php/265735/3 "2008-07-12T14:16:27Z")

</div>

Ok, yes ‘$’ for variable declaration, I was on vacation, so I have not written any program in a while.  
Respect. I’ll try to solve the issue, if not I’ll seek help.  
Thanks

---

<div class="post-metadata">

**Author:** ![Utech22](https://avatars.discourse-cdn.com/v4/letter/u/f17d59/32.png) [@Utech22](https://forum.kirupa.com/u/Utech22)\
**Post date:** [July 12, 2008, 3:05pm UTC](https://forum.kirupa.com/t/frameset-for-php/265735/4 "2008-07-12T15:05:04Z")

</div>

I want the links to be displayed in the center when the users click it.

```php

//check to see which link is clicked and displays it in the table center row 
if ($link1) {
page1Function();
}
else if ($link2) {
page2Function();
}
else {
page3Function();
}

```

This is how this section of it should looks, below:

![](http://img386.imageshack.us/img386/2764/phplinkskf9.jpg)

---

<div class="post-metadata">

**Author:** ![Utech22](https://avatars.discourse-cdn.com/v4/letter/u/f17d59/32.png) [@Utech22](https://forum.kirupa.com/u/Utech22)\
**Post date:** [July 15, 2008, 11:53pm UTC](https://forum.kirupa.com/t/frameset-for-php/265735/5 "2008-07-15T23:53:21Z")

</div>

How can I establish this.?  
If a use clicks 'link1’in the first column, its content displays in the second column.  
and the same process for the other links.
