herghost Posted February 25, 2009 Share Posted February 25, 2009 Hi all, I am trying to acheive something in php, that I have tried searching this forum but nut quite sure what to search for! Basically I have an index.php, and using .css this is displayed as a left sidebar and a main content. Basically what I want to do is; when a link is clicked in the left side bar, the main content should show the result. Ie, if the user has added his email address to his profile then when he clicks on say 'email address' on the left, the main contact page will show his email address without loading another page like indexuseremailaddress.php to display it. Would I have to do something like split the sidebar into another php page called something like left.php and call the main content main.php and have them both display from index.php? Wouldnt this leave me with the same problem of having more than one main content page for each detail? I hope this is clear enough! Thanks Link to comment https://forums.phpfreaks.com/topic/146862-solved-php-simple-display-question/ Share on other sites More sharing options...
limitphp Posted February 25, 2009 Share Posted February 25, 2009 Hi all, I am trying to acheive something in php, that I have tried searching this forum but nut quite sure what to search for! Basically I have an index.php, and using .css this is displayed as a left sidebar and a main content. Basically what I want to do is; when a link is clicked in the left side bar, the main content should show the result. Ie, if the user has added his email address to his profile then when he clicks on say 'email address' on the left, the main contact page will show his email address without loading another page like indexuseremailaddress.php to display it. Would I have to do something like split the sidebar into another php page called something like left.php and call the main content main.php and have them both display from index.php? Wouldnt this leave me with the same problem of having more than one main content page for each detail? I hope this is clear enough! Thanks I think what you're describing will require ajax. Read their tutorial example.... its easy to get started with this: http://www.phpfreaks.com/forums/index.php/topic,115581.0.html Basically, what you'll be doing is when they click a link, the link will point to a javascript function that will make a call to a new page and display the contents of that new page in a div. You'll have the main content in a div or something with an id of say "ajaxBox". And the javascript function will replace everything in that div with whatever you need. Link to comment https://forums.phpfreaks.com/topic/146862-solved-php-simple-display-question/#findComment-771006 Share on other sites More sharing options...
herghost Posted February 25, 2009 Author Share Posted February 25, 2009 Thanks for the quick reply bugger another language I shall look into it and see if I can do all I want to do in it. Link to comment https://forums.phpfreaks.com/topic/146862-solved-php-simple-display-question/#findComment-771013 Share on other sites More sharing options...
limitphp Posted February 25, 2009 Share Posted February 25, 2009 Thanks for the quick reply bugger another language I shall look into it and see if I can do all I want to do in it. No, no no....thats what i thought too when the good people here told me I need to use ajax for what I wanted.... its nothing new... its javascript and php working together..... for some reason they call this process ajax... actually, what it really is is just a new function in javascript.... this XMLHttpRequest it allows javascript to call a page (even a php page) in the background without refreshing the current page (I might be off here, but I think thats what it is).... and then most people use that with an ability that javascript has had for a good while.... the innerHTML the ability to replace anything on the screen with new stuff. Link to comment https://forums.phpfreaks.com/topic/146862-solved-php-simple-display-question/#findComment-771018 Share on other sites More sharing options...
herghost Posted February 26, 2009 Author Share Posted February 26, 2009 Thanks, I got it working Link to comment https://forums.phpfreaks.com/topic/146862-solved-php-simple-display-question/#findComment-772116 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.