Jump to content

gazever

Members
  • Posts

    133
  • Joined

  • Last visited

Everything posted by gazever

  1. if anyones interested here final working code, however IE8 doesnt show the alert message, anyone know why? <script type="text/javascript"> function submitform(){ var selectedvalue = document.getElementById("size") ; if(selectedvalue.value == "choose"){ alert("Please choose a size"); } else { document.addtocart.submit(); } } </script> <a href="javascript:submitform()" class="buy">Add to shopping bag</a>
  2. Hi Im really a PHP programmer and trying to cobble together some code for a very simple form validation, what i need to do is if a select value is at its default state of "Choose size" I need to make an alert saying choose size before sending the form. In IE it keeps saying this page contains errors "object doesnt support this method or property "but functions ok, however this is stopping me from adding another zooming in javascript for images. Could someone Please amend or let me know what im doing wrong. in the head <script type="text/javascript"> function submitform(){ var sizevar = document.getElementById("size"); if(!madeSelection(sizevar, "Please Choose a Size")){ } } function madeSelection(elem, helperMsg){ if(elem.value == "choose"){ alert(helperMsg); elem.focus(); return false; }else{ document.addtocart.submit(); } } </script> bit of a mismatch of code, dont know javascript and the link to submit the form <a href="javascript: submitform()" class="buy">Add to shopping bag</a> Thanks!
  3. OK, fixed it using bcsub (1481.00,1480.99,2) How weird.
  4. Hi foodigi, Thanks Did you resolve your issue by rounding?
  5. I'd start by using explode on the xml string on the <row>, then looping the array using str_replace on the </row>, then do the same for <name> and <city> making an php array to hold all the data, then loop through this array to put the data how you need it.
  6. Hi I'm getting an unexpeted result from the following, <?php echo 1481.00-1480.99; ?> output = 0.00999999999999 Does anyone understand why this is happening?
  7. Yes I have all errors on, what you pointed out was what I was missing, been coding normal PHP for a couple of years, now trying to include classes as part of my coding practices, more learning curves. Thanks for your help
  8. Hi what am I doing wrong here Just trying to learn and use classes class form{ var $variable1 = 'test string here'; function return_form(){ return $this->$variable1; } } $test = new form; $theform = $test->return_form(); echo $theform;
  9. Sussed it myself, was trying to use V2 code in my V3 api, this is the fix if anyones interested var myOptions = { zoom: 11, center: hollywoodstudios, mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel:false } just set scrollwheel to false
  10. Hi I'm trying to disable the mouse wheel scroll function on google maps, here is my code, cannot figure out where to put the following code into it disableScrollWheelZoom() <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> function initialize() { var house = new google.maps.LatLng('.$lat.','.$lon.'); var hollywoodstudios = new google.maps.LatLng(28.3576995,-81.5610138); var epcot = new google.maps.LatLng(28.3737300,-81.5492050); var universal = new google.maps.LatLng(28.4722601,-81.4690932); var seaworld = new google.maps.LatLng(28.4095199,-81.4622289 ); var magickingdom = new google.maps.LatLng(28.4197794,-81.5802069); var animalkingdom = new google.maps.LatLng(28.3575650,-81.5903850); var image = \'http://www.debbiesvillas.co.uk/images/villa_icon.gif\'; var myOptions = { zoom: 11, center: hollywoodstudios, mapTypeControl: true, disableScrollWheelZoom:true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); Thanks
  11. Hi I have a list of places of interest which I have their Lat & Lon for, I also have another list of villas of which I'd like to calculate the driving distances between the items. I can output a map with the directions from one point to another, but could I just output the distances between points as a list rather than the directions. Or can I capture the javascript variable and enter into a database to retrive with php to output a list of distances. What id like to achive is something like Distance to Disney: 2 miles Distance to Seaworld: 4 miles Distance to Kennedy Space Center: 15 miles.. etc. Or would I have to manually query every villa for every item and then enter it in a DB I only really know PHP, javascript is new to me hence the lack of knowledge. Google example http://code.google.com/apis/maps/documentation/examples/directions-simple.html HTML BELOW: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <title>Google Maps JavaScript API Example: Simple Directions</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script> <script type="text/javascript"> // Create a directions object and register a map and DIV to hold the // resulting computed directions var map; var directionsPanel; var directions; function initialize() { map = new GMap2(document.getElementById("map_canvas")); directionsPanel = document.getElementById("route"); directions = new GDirections(map, directionsPanel); directions.load("from: 28.1391880, -81.3604530 to: 28.415800, -81.455905"); } </script> </head> <body onload="initialize()"> <div id="map_canvas" style="width: 70%; height: 480px; float:left; border: 1px solid black;"></div> <div id="route" style="width: 25%; height:480px; float:right; border; 1px solid black;"></div> <br/> </body> </html> Hope this makes sense Many Thanks Gazever
  12. Would you be able to look at the following site and let me know what you think http://www.debbiesvillas.co.uk Being more of a developer than a designer and having spent so much time looking at it now not sure how it looks? Thanks
  13. I am building a databse of crossword words. I want to select where word = d?t? I am trying to use select where word like 'd%t%' however when running it I expect to get returned results of the word DATA but it seems to search where d & t are in that order returning for example ADIT, DART etc do I have to get all these results then match character for character through an array or can I do this in my mysql query Many Thanks Gazever
  14. That looks like all the info I need, thanks
  15. How long does it take for a session to timeout, if I have a user logged in on my site, how much time of inactivity will it take before the session is automatically destroyed and they become logged out, i do not use cookies, I have these values in my php info session.cache_expire 180 session.gc_maxlifetime 1440 session.gc_probability 1 from what I understand the session is destroyed after 180 minutes of inactivity, but the session has a 1% chance of being garbage collected after 1440 seconds of inactivity (is this destroyed?) so if I wanted all sessions destroyed after the 1440 seconds, should i set the probability to 100 or should i change the session.cache_expire 180 to something that would suit me better, i.e. the 1440 seconds, i.e. session.cache_expire 24, would this always delete the session after 24 minutes, or do both values have to correspond etc, any advice on this would be greatly appreciated, Thanks Gazever
  16. Yeah, But I guess not everyone of there users check input before doing stuff with it, so guess its a failsafe, I may see if I can get them to remove this restriction, was just so baffled by the behaviour, glad I now have an answer. Thanks Again
  17. spoke to hosting account, there reply Victor: Yes, that is due to security rules implemented on server. Here are the logs for the same. mod_security: Access denied with redirect to [/]. Pattern match "<(.|\\\\n)+>" at POST_PAYLOAD [id "XSS_Check"] [severity "EMERGENCY"] [hostname "www.debbiesvillas.co.uk "] [uri "/enquiry_sender.php"], thanks all for the input
  18. magic quotes are on, the following enquiry dsfsdf'dsfsdf outputs Array ( [enquiry] => dsfsdf\'dsfsdf ) Is this the issue do you think?
  19. code is now, <?php echo "<pre>"; echo "<hr />"; print_r($_POST); echo "</pre>"; die(); ?> Still same problem, it's as if its never even going to the enquiry_sender when there are tags input
  20. Yeah that is the problem, very weird behaviour, I have tested it without print_r($_post) thinking this may be the problem, but no, it still doesn't just stick to this page without that,
  21. I use firefox to test everything, did you try posting the following </> this here screws it up and send it to the index, other stuff seems to post fine
  22. What website are you hosting, is it a uk site, if so use a uk host, this is for a seo reason, i.e. sites held on us servers which are actually uk sites will be given less relevance from google.co.uk as google thinks it's a US site, I use eukhost they seem pretty good, I have quite a healthy amount of reseller space, for a relatively cheap amount of money.
×
×
  • 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.