Jump to content

[SOLVED] How to do it?


xcoderx

Recommended Posts

Its a simple idea.

 

<table>
  <tr>
    <td>
      <form>
        <select name="foo">
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">4</option>
        </select>
        <input type="submit" name="submit">
      </form>
    </td>
    <?php
      if (isset($_POST['submit'])) {
        echo "<td>You selected {$POST['foo']}</td>";
      }
      ?>
  </tr>
</table>

 

Excuse the table.

Link to comment
Share on other sites

Thanks bro, ok so i place the dropdown in the left hand where the menu is and that php code in center of the page where i want the content to show rite? Can i use link instead of dropdown? But how wil i name a link? My categories would be in link so would i add lik <a herf="index.php?name="foo"/>1</a> ?

Link to comment
Share on other sites

No that was something i was asuming. Ok il explain where i said menu il add links to folders like

 

A

B

C

 

say i click on A and inside folder A there would be a page.php and i want to show whatever is writen in page.php in right side something like this after u click on A

 

A.    |      page.php results here

Link to comment
Share on other sites

Exactly bro that is basic but it was something i showed for example, i want to do that with php say like i $_request that link in the right hand within index.php of my site when click on menu category without having to go to some other page.php. Like i explained. Anyways i gues its not  posible to do it. Thanks for ur help

Link to comment
Share on other sites

If there are only going to be a few you could set each link to call index.php?link=page1, index.php?link=page2 and so on and then...

 

<?php
$link = $_GET['link'];
?>

 

To get the link and set a variable.

 

Then where you want the content to display use if and elseif statements to include whatever page corresponds to that link...

 

<?php
if ($link=="page1")
{
include 'page1.php';
}
elseif ($link=="page2"){
include 'page2.php';
}
else
  echo "Invalid link";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.