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? Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/ Share on other sites More sharing options...
haku Posted June 10, 2009 Share Posted June 10, 2009 Ajax Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852893 Share on other sites More sharing options...
ankur0101 Posted June 10, 2009 Share Posted June 10, 2009 Use Ajax with dreamweaver video tutorials . Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852911 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852947 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852950 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? Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852953 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852956 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> ? Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852960 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852962 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 Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852965 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852966 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852969 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852980 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852984 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 Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-852990 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"; ?> Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-853024 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 Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-853040 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? Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-853067 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? Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-853069 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. Link to comment https://forums.phpfreaks.com/topic/161629-solved-how-to-do-it/#findComment-853092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.