radar Posted May 15, 2007 Share Posted May 15, 2007 Okay so it has been about 6+ months since i've even looked at a piece of PHP code. I am again working on my site for helping people in graphics and programming alike. However I need some help myself... Let me see if I can try and explain what I want as much as I can. I am working on my Administration Panel right now, and within my administration panel I have a few pages that I will want to do this on... Lets start with the first one, and lets make the first page be the About Us page... So, About Us is just that, about the site and how it came to be, just a 1 cell table in the database.... When you click on the link in the navigation the text that actually displays in the database shows up as it displays on the actual website... Now that is easy, but here is the tricky part that I can't figure out, though im sure it has something to do with JavaScript and DIV tags (i just dont know how to write it)... At the bottom of the "About Us" text there will be a button that if clicked -- the sample text will be hidden, and the full form to edit the text will be revealed... Then when you hit the Save button in the bottom of that, it will save the information to the database, hide the form and reveal the sample text once again... Any clue how to do this? because I have no clue what so ever... Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/ Share on other sites More sharing options...
genericnumber1 Posted May 15, 2007 Share Posted May 15, 2007 that's pretty much done in all javascript with optional ajax for saving without the full submit process... unless of course you want some page refreshing going on. Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/#findComment-253294 Share on other sites More sharing options...
jitesh Posted May 15, 2007 Share Posted May 15, 2007 <tr id="texttr"> ......... ........ Displayed Text ......... ........ </tr> <tr id="formtr" style="display:none"> ............ ........... Form to Edit ........ ......... </tr> <tr> <a href="#" onclick="javascript:hideshow('form')">Show form</a> </tr> <tr> <a href="#" onclick="javascript:hideshow('text')">Show Text</a> </tr> <script language="javascript"> function hideshow(fel){ if(fel == 'form'){ document.getElementById('formtr').style.display = ""; document.getElementById('texttr').style.display = "none"; }else if(fel == 'text'){ document.getElementById('formtr').style.display = "none"; document.getElementById('texttr').style.display = ""; } } </script> Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/#findComment-253297 Share on other sites More sharing options...
radar Posted May 15, 2007 Author Share Posted May 15, 2007 Well seeing as though I don't know ajax and im pretty sure that the server i'll be running this site on doesn't have the ajax capabilities, i'm pretty sure there would be at least one page refresh at the end of the submit process which would in turn get rid of the form... i'm just not sure about the javascript or div statements -- i had something similar for my FAQ's but i've seemed to have lost that piece of code.... Thank you much for that code sample jitesh -- i will give it a try and see if I can get it to work... Again I appreciate the help. Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/#findComment-253298 Share on other sites More sharing options...
genericnumber1 Posted May 15, 2007 Share Posted May 15, 2007 ajax isn't a language, it's just a mixture of javascript and PHP. So if you can do PHP, ajax is completely possible - and quite easy with all the javascript libraries out there. Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/#findComment-253302 Share on other sites More sharing options...
radar Posted May 15, 2007 Author Share Posted May 15, 2007 Ahh well see that I had no clue about... If the code sample that jitesh doesn't happen to work for me, perhaps I Will look into doing some things with ajax -- and if you could possibly point me into a direction on where I could find some information about AJAX, that would be helpful. Again Thank you all for your help I appreciate it much. Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/#findComment-253315 Share on other sites More sharing options...
radar Posted May 17, 2007 Author Share Posted May 17, 2007 Genericnumber1 -- the AJAX suggestion was awesome, i started reading on ajax and everything and I wrote some code to edit in place, and it's freaking awesome! i love it, thank you for your suggestion, and thank you everyone for the help on this... This here is DEFINATELY solved. Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/#findComment-255075 Share on other sites More sharing options...
neel_basu Posted May 18, 2007 Share Posted May 18, 2007 ajax isn't language, it's just a mixture of javascript and PHP. So if you can do PHP, ajax is completely possible - and quite easy with all the javascript libraries out there. NO That concept is wrong ajax isn't Javascript its Like Javascript.And its compleately Client side thing Ajax Cant do anything in server side. So there is No matter of PHP in AJAX you can run any language in server side. Quote Link to comment https://forums.phpfreaks.com/topic/51431-solved-some-help-needed/#findComment-256125 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.