xcoderx Posted June 10, 2009 Share Posted June 10, 2009 Ok friends how would one do this, display category on left handside menu and when u click results show in right hand or say center of the website? Quote Link to comment Share on other sites More sharing options...
haku Posted June 10, 2009 Share Posted June 10, 2009 Ajax Quote Link to comment Share on other sites More sharing options...
ankur0101 Posted June 10, 2009 Share Posted June 10, 2009 Use Ajax with dreamweaver video tutorials . Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 No i want to do it with php and html, do i have to use frame or something? Im confused kindly someone help me figure it out. Quote Link to comment Share on other sites More sharing options...
trq Posted June 10, 2009 Share Posted June 10, 2009 If you want to do it with php alone you will need to make a new request to the server. Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 Could you show me an example brother? Quote Link to comment Share on other sites More sharing options...
trq Posted June 10, 2009 Share Posted June 10, 2009 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. Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 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> ? Quote Link to comment Share on other sites More sharing options...
trq Posted June 10, 2009 Share Posted June 10, 2009 If that's what your link will look like you'll be looking for $_GET['name'] instead of $_POST['foo'] as in my example. Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 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 Quote Link to comment Share on other sites More sharing options...
trq Posted June 10, 2009 Share Posted June 10, 2009 Why don't you try some code and show us when your stuck? I've really no idea what your talking about. Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 Lol u r right bro sory for the pain im very bad in explaining ok il make something and get back. Thanks alot for al the help tho. Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 Ok im back lol ok here an example what i want to do http://netwatcher.net/main.htm look at this site the menu is in left and than its has option to click like links etc and when u click results show in right hand side thats what im planing to do but unable to figure it out. Quote Link to comment Share on other sites More sharing options...
trq Posted June 10, 2009 Share Posted June 10, 2009 Seriously, that page isn't even using php. This is basic web design stuff. Simply make links to the pages you create. Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 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 Quote Link to comment Share on other sites More sharing options...
alang Posted June 10, 2009 Share Posted June 10, 2009 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"; ?> Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 The links as i explained wil be in difrent dirs A B C are the dir name and inside these dir would be the page.php so wil it work? Could u give a gôod example to do it? Thanks alot Quote Link to comment Share on other sites More sharing options...
alang Posted June 10, 2009 Share Posted June 10, 2009 So just change it to  <?php if ($link=="page1") { include 'A/page1.php'; } elseif ($link=="page2"){ include 'B/page2.php'; } ?>  Or am I missing something? Quote Link to comment Share on other sites More sharing options...
xcoderx Posted June 10, 2009 Author Share Posted June 10, 2009 Walla awesome this was exactly what i wanted thanks alot alang. Btw ur name is same with a long lost friend of mine, r u also asian? Quote Link to comment Share on other sites More sharing options...
alang Posted June 10, 2009 Share Posted June 10, 2009 great, glad to help. No my name is Alan and I'm in Ireland. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.