Jump to content

peasepud

Members
  • Posts

    25
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

peasepud's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. evening folks, I have 6 seperate Ajax calls within a page, 5 are working fine but the latest just never responds. my code is: function amend_book(bookid) { alert(bookid); var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var result = xmlhttp.responseText; var resbits = result.split("|"); document.getElementById("seltog").value = resbits[0]; document.getElementById("bookdate").value = resbits[1]; document.getElementById("booktime").value = resbits[2]; } var newurl = "get_booking.php?bookid=" + bookid; xmlhttp.open("GET", newurl , true); xmlhttp.send(); } } Im running firebug and theres no errors appearing, I put the alert in at line 2 and it correctly outputs the bookid when the call is made so I know its being called. I've also tried alerting the newurl where it is but nothing appears when i do that, if I move the var newurl to the 2nd line and then alert it correctly shows the URL. Copying and pasting that into a browser gives me the expected results so I know the url is fine and the php works as expected. No matter what I do though, I cant seem to confirm that the xmlhttp.open is ever actually taking place. Like I say theres another 5 of these in the page and all are exact apart from the GET Url and what I do with the results. Anyone have any ideas or alternatively any thoughts on how I debug it better?
  2. OK so I may not explain this well, apologies in advance. The query however is not a coding one, Im happy to sort that out but more a pick of your brains on how you would go about doing this logically. Im working on a booking system for a group of photographers, each photographer works varying shifts (each day can be different) so I have a table of "availability" which contains the following: Photographer Id Date Start Time End Time straight forward, so Mary may have the following entry 56, 2015-10-28, 09:00, 16:00 showing shes working from 9 til 4 on the 28th Im outputting these on a bar style page for each day with the 24 hours at the top and I create a div from midnight until the start time (each hour is 45pixels wide + 1 pixel border) so it calculates the width as 9 x 46 and creates a simple grey div to denote time before work. Then theres a 2nd table of bookings which shows the jobs the clients are booked on, this contains Photographer_id Date Start Time Duration So after creating the 1st div, I pull all the bookings for that client in the day and create divs to show they're busy. Same logic, calculate the width of the div based on the length of the job (1 hour = 45pixels), calculate the time between the last job (or them starting work) and set the left margin to that amount. eg Mary has a 1 hour job at 10am would create a div of 46 px wide and set its left margin to 46px (10am - 9am = 1hour). I do this for all the jobs and then finish off with another grey div to show theyre not working using the same logic (24:00 - 16:00 = 8hours so set the width to be 8x46). So my basic logic is: For each record in availability table for requested date Create Pre start div Cycle through any bookings creating booking divs Create Post end div Loop That all works great however...................... they have a new contract that means they need to provide cover 24 hours a day so now a person could be working say 8pm until 4am and their availability table would show: 56, 2015-10-28, 20:00, 04:00 which wouldnt make sense so instead Im creating two records. 56, 2015-10-28, 20:00, 23:59 56, 2015-10-29, 00:00. 04:00 this however means that Mary can now have two records for the 29th, the one above and then the next shift: 56, 2015-10-29, 20:00, 23:59 Now no matter how many times Ive ran this through in my head I cant come up with how best to change the display page to incorporate this logic. The only thing I can see to do would be to remove the availability table all together and create records showing times they arent available ie for Marys 9 to 4 shift, I would add two records to the bookings table (with a new indicator to denote OFF) of 56, 2015-10-28, 00:00, 08:59 56, 2015-10-28, 16:00, 23:59 Is this the best way forward or is there some easier way you can see to incorporate multiple shifts in a day? Any help would be appreciated.
  3. Hi all, Ive checked through the posts and have seen a couple related but nothing matching mine so apologies if Ive missed an answer already. I want a body background that has images down the left and right hand sides, in the centre Im looking to put the actual content. Example below: The shaded content will be a fixed height and width for a 1024x768 screen so maybe 900x700 or so. My problem is that I cant repeat the background and want the vines down the sides to stay at the relevant edges therefore I thought I could just float left and right respectively (with the yellow background in the body to fill the gap). Where the problem comes is the height. I made the background images way longer than needed so if someone is using a large screen resolution then they will see the continuation however if I set the height to 100% I dont see them at all. So basically my question is, is it possible to create a three column BODY as such that will stretch to the width and height of the screen?
  4. Thanks for your help, it appears that the password I was using wasnt the same as the one held for the database, strange that seeing as how I havent changed it and the login details are the same ones I was using this morning!
  5. Im able to access it through the phpMyAdmin via my Cpanel so it appears to be running. Ive realised your reply could be read two different ways so just in case thats not what you meant, all of the websites are on the same server and all normally connect to localhost (Like I say in testing, each of these pages worked correctly + now I cant even login through the actual site that the database is held on).
  6. Hi, I have just completed work on a content management system for the websites I develop. This CM works off a database and the links pages on each of the 9 sites log into that database to establish which links to display. Each of the 9 website owners can also log into the CM system via my main website to change the content displayed. This has worked fine in testing and I have been able to log in freely whenever required, I also had temporary versions of the links pages on all 9 sites working fine. Today I released the content to the live sites and it seemed to be working ok this morning however I have now found that none of the relevant pages seem to be working and the following error message is displayed: "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'adultep_viewer'@'localhost' (using password: YES) in /home/websitename/public_html/phpfuncts_epdd.php on line 3 I cannot connect to the database because: Access denied for user 'adultep_viewer'@'localhost' (using password: YES)" Nothing has changed between the testing and live release with regards to database users or passwords. I have checked and the password is correct (I even created a new user and changed the details on one site to that users name and password but still received an error). Is it something to do with connections? there is nowhere in my code where I close the connection therefore Im wary that I may have overloaded the system with an excess of open connections across the 9 sites. If not, does anyone have any ideas of what could be wrong? ps I can access the database without problems by going through the phpMyadmin functions within my website account so Im confident the database itself is up and running. Any help would be gratefully received. Peter
  7. First you would need to check the filetype based on its suffix with something like: $suffix = substr($filename, strripos($filename, '.')); then just check that matches the types you want (xls or csv) before carrying out the upload function.
  8. Your SELECT statement should have the following: WHERE (date_field_name >= CURDATE() )
  9. hmmmmm first time Ive had this happen. I have a site, which is a basic one using php, within its server space Ive created a new site to show a client under the sub directories of /sites/development/clientname Ive then put a few files in there, the .html works fine yet the php file gives a 500 internal server error, the file in question is very basic and just has a couple of include statements in it so its not even like Im doing any GET or POST operations. Does anyone have any ideas?
  10. to run Ajax queries? I didnt think so yet I took the following Ajax code (http://www.linuxuser.at/wiki_old/index.php?title=Most_Simple_Ajax_Chat_Ever), followed all the instructions and uploaded to my server yet it doesnt work for me, it loads and allows you to enter the 2 bits of info but never updates the file. Ive checked the permissions and relative URLs and no problems, all are correct. So after 3 hours of trying everything I could think of, I hunted out another script to play with (http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=9) and again followed everything to the letter yet, again no joy, the database never gets updated. Ive tried echoing the code in both cases and it definitely goes to the script and gets to the relevant update part of the code but just doesnt work ??? ??? Im lost, Im not new to either Javascript or php but this has me mightily confused!!!
  11. I think yes, that maybe I havent made myself clear. This code is running on one domain on one server. Myself and the client are both accessing the same page and doing exactly the same thing yet for one of us it works while the other it doesnt. I agree all the things said previously such as the very much reduced code, the inclusion of $_GET and even the 301 redirect but they are all incidental to the actual question of how one occurrence of php/mySQL code can work for one user but not another.
  12. Is this not the problem? you are running something written in 2001 on php 5. I'd recommend posting the question here > http://forums.ipbhelpers.com/ as they will have more knowledge about these specific things (not that I dont have faith in those posting here). Good luck although I think what you really need to do is upgrade to the current version, I moved my board to version 2.2 and paid for it but it was worth every penny, the difference is immense.
  13. isnt there a setting for time limit a script can run? could it be thats too low for loading a 50Mb file in? check max_execution_time
  14. Ok I'll add that in but I didnt believe register_globals was a user specific variable, you set it on the server using php.ini and (I thought) that was it????? Surely if it was user specific then users could override the setting themselves making it highly unstable and unsecure?
  15. On the first one, you shouldnt do the login.php as an include, if you're referencing login.php as an action then it should just be a seperate file. Asyou have it written there, then the file should be in the same directory as index.php The second problem is caused (I think) by the fact you're using the include before the session_start() try swapping those two lines around, Im sure the session_start cannot come after you've written anything to the browser?
×
×
  • 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.