Jump to content

RichardRotterdam

Members
  • Posts

    1,509
  • Joined

  • Last visited

Everything posted by RichardRotterdam

  1. hmmm lets see that sounds like top friends on myspace it's pretty much a combo of javascript and a serverside language or in otherwords Ajax. You need javascript to drag and drop and php to save the location to the server
  2. i never write php without functions
  3. to understand how to use it you must first know what it is read this info that might help you to get you on your way http://www.w3schools.com/Ajax/Default.Asp http://en.wikipedia.org/wiki/AJAX
  4. the page you are requesting should only give the info you want on your main page so all the html stuff you remove your ajax page should be just text for example <?php foreach($namearray as $name ){ echo($name); } ?> actually you probably want to get an array which is more complicated but first make this work from there on you can progress
  5. Hi, Currently I am looking for a hotel reservation system which is programmed in php. is there anyone who can point me out to a descent existing os php reservation system. Usually I would prefer to build one from scratch since I dont like existing os systems since a lot of them are pretty messy like having globals and tables as layout. if anyone knows a good one can you plz post some links. ty
  6. jquery is a javascript framework that makes the ajax call a lot easier then the regular ajax. look at the following line in your js code url: 'Iindex.php?action=register', this will call your file Iindex.php and will return a value in text format
  7. if its ajax then you have to have that check on a seperate page and call it using a ajax call
  8. why not just have one request send and return json so you dont need 2 requests as for using the onload on the body. you dont have to. you can use this anywhere in your page so the function loads when the page is loaded <script> document.load=function(){ //your function to load } </script>
  9. I dont think feed is the correct term. All you need is to use php to create an xml. The file extention would still be php only it would have xml data in it so flex can read the file. i dunno what that last forloop does but replace this <? for($x=0; $x < $totimg; $x++) { $size = getimagesize($imgdir.'/'.$a_img[$x]); // do whatever $halfwidth = ceil($size[0]/2); $halfheight = ceil($size[1]/2); echo "$a_img[$x] <br />"; } ?> with <gallery> <?php foreach($a_img as $imageUrl){ ?> <image> <url><?php echo($imageUrl) ?></url> </image> <?php } ?> </gallery> well something like that it really depends on how you want your xml to look its best to use a static xml first.
  10. i think what you are looking for is called a tooltip try looking up some scripts for that
  11. ok youre right it it is a set of objects
  12. sure it can be done without mootools or the json.js include if you want to build youre own json decode function
  13. this is what i get when i combine the function on the decoded json to jsarray # May 2008: * New: o Total: 163 o Customer_List: + 94262 + 94612 + 95002 + 95382 have you included the mootools script? <script> scr="mootools.js"</script> that should solve your problem or use this to decode your json http://www.devpro.it/JSON/files/JSON-js.html
  14. wait do you mean you have no serverside language what so ever? in that case you cant have any cms running on the server so your pretty much stuck. as for ajax. ajax is nothing more then combining a serverside language(such as php) with javascript to update a page without refreshing
  15. not with javascript you have to use php to write to a text file since javascript is clientside(runs in the browser) and doesnt have access to your server btw i think sqlite could be an answer for not having a db or xml you can use either xml or sqlite as a flat database. sqlite is a file you can store on the server
  16. because your json is not an array yet its a string
  17. like i said in the second part of the reply you need to decode the json array to a usable javascript array. because the json is in a string format. lets say your jsonstring looks like you posted <script> var jsonData="{"May 2008":{"New":{"Total":"163","Customer_List":["94262","94612","95002","95382","93912","94292","94662" etc...."; </script> <script> or probably like you are doing var jsonData='<?php echo(json_encode($phpArray));?>'; </script> now you need to decode it to a usable array like so <script> //decode data var jsArray = Json.evaluate(jsonData); </script> now you have a usable javascript array you can loop through
  18. do you know this php function json_encode($phpArray); it creates a array in string format now you need to decode to a usable javascript array this is how it works with the mootools frame work its probably very similar in prototype var jsArray = Json.evaluate(jsonData); http://docs.mootools.net/Remote/Json.js I recommend using a javascript framework (such as prototype,mootools,jQuery or Dojo)since it usually has json functionality
  19. if its the same data but it should be displayed in a different manner i would use json instead. Using two different calls does work but it makes the server work harder then really required. the difference between Json and ajax is. that ajax gives you a plain text or html while json can send structured php arrays as javascript arrays. just in case you want to do it the clean way try looking it up for future purposes
  20. it is easy you just didnt follow all steps you didnt put in the script part that looks like this <script> NewCal([textbox id],[date format],[show time in calendar?],[time mode (12,24)?]) </script>
  21. All that is is hiding a div element when a button is clicked and showing another it shouldnt be too hard to build.
  22. do you mean the elements need to be updated with different data? because your php doesnt know what to update and it wont know that either. the php file is just told what kinda of data to fetch from the database and what the output should be. not where it should be that is the javascript part
  23. here is basicly what the ajax request does everthing inside the following tag <div id='ajaxDiv1'> </div> gets replaced by what gets retrieved that is what the document.getElementById() function does so in order to update something just add a id attrubute to it like so <div id="secondElementToBeUpdated"></div> then you could change the function like so <script> ajaxRequest.onreadystatechange = function() { if(ajaxRequest.readyState == 4) { var ajaxDisplay = document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = ajaxRequest.responseText; /////////////////////////////////////////////////// //OK here goes the second update var secondElementToBeUpdated = document.getElementById('secondElementToBeUpdated); secondElementToBeUpdated.innerHTML = ajaxRequest.responseText; /////////////////////////////////////////////////// } } var shipinfo = document.getElementById('shipinfo').value; var queryString = "?si=" + shipinfo + "&seller=$value&subtotal={$subtotal[$key]}&itemcount={$itemcount[$key]}&tax={$taxtotal[$key]}&sellername=$sellername"; ajaxRequest.open("GET", "cs.php" + queryString, true); ajaxRequest.send(null); } </script>
  24. for javascript to update an element you need plain html this is php post the browser source instead because javascript cant read php since it is clientside
×
×
  • 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.