Jump to content

Drongo_III

Members
  • Posts

    579
  • Joined

  • Last visited

Everything posted by Drongo_III

  1. Ahh well i can't be of much help in that case sorry :/ I would have thought using ajax to prompt the ad server into refreshing your ads sounds reasonable - but that's assuming a server setup exists to allow you to do this.
  2. Well entirely your choice and you know your site better than i do. I would seriously consider not using ajax for this though if you have a standard website. As i dont fully understand your setup I can't see how you'd make this work with iframes. Unless you intend to iframe in content from companies who will themselves handle all the coding their end? How exactly do companies provide their ad code to you? Presumably companies provide you with some ad creative and a url?
  3. err not ajax...i meant jquery
  4. I'm not entirely sure what you're after here. But would it not make more sense pre-load in a random selection of ads on page load? I suggestion this for two reasons: 1) What is the average time a user spends on one of your pages? I bet it's not much over 2 mins so refreshing ads via ajax is a bit pointless. 2) Imagine an average person on your site. They visit, they might sit on a page and leave their browser open whilst doing something else (anywhere from a few minutes to a few hours). If that was happening for hundreds/thousands of users you'd end up making server requests via ajax every two minutes for each person - presenting users with ads when they aren't even there to see them. So you're tying up your server resources for absolutely no benefit. Personally i would preload in a range of ad urls to a javascript array and then use some other javascript/jquery to cycle them on a periodic basis. Drongo
  5. Can you post the php script that the ajax is targeting? At the moment everything you've posted is html and ajax...not php.
  6. Nop - jquery will reset the style and unhide it when the function is called. Jquery is like magic
  7. Just set the thank you div style to display:none;
  8. Or a maybe a better way might be to use a callback functino call from your AJAX to call a function that does the above.
  9. Hi Mate Probably easiest if done with jquery. Something like: <script> $(document).ready(function () { $("#FormSubmitButtonID").click(function(){ // Logic to determine the form is ok to submit. $('#YourFormID').hide(); $("#YourThankYouMessageDivID").show(2000); }); }); </script> Tapping that in off the top of my head, and i always typo javascript, but it is a simplistic example of what you want.
  10. Not sure you could use isset() because you're not refreshing the page and so not parsing anything. You're best option is probably to fire a javascript function (onsubmit) that will hide the form and display your message.
  11. Hi Guys I have a client who wants me to setup a web application to enable video conferencing for people logged into a special client area. Can anyone recommend the best direction to go with this? I've never setup anything to do with streaming live media before so I'm at a bit of a loss. Few google searches have turned up silverlight but can anyone suggest better options? i.e. flash? Or a java applet of some kind? Any advice in the right direction would be good! Drongo
  12. Hey mate This is a bit rough and ready but it will give you the general idea. You need regular expressions for this and i've explained how you test them below: <?php $subject = "abcdc ef"; $pattern = '/^[a-zA-Z\s]+$/'; // This tests the above pattern against the string provided - that would be the string from your form $test = preg_match($pattern, $subject); if($test == true){ echo "all ok"; } else { echo "bad string - please retry"; } // pre_replace will search your string for excess white space and remove it - but it will preserve single spaces $str = preg_replace('/\s\s+/', ' ', $subject); echo $str;
  13. Hmm i think the best solution to that will come out of you becoming much better acquainted with google maps api (which i'm not). But i would imagine your stock table (simplifying this of course) might have a related table for store locations (so every product is assigned to one or more stores). You might store the geolocations of those stores in the DB since they wont change. Then when someone browses for say 'pumpkins' on your site, your script looks up the item, and finds the stores in which that item is located. So you now know that pumpkins are stocked in store 1 and store 2 and you have the geolocations of those stores. You might then have a "user location " function and a "distance " function. The user location function would pinpoint the user's location. The distance function would 'range check' the user's location relative to the store locations you've stored. Then you might run another function to display this data on the map (through google maps api). As i said that's all very simplified and speculative as i'm not overly familiar with google maps api but i reckon that's doable.
  14. Ermm you tried just setting the link as "/blah.asp/"
  15. Very often when building your own cms people use things like this - http://www.tinymce.com/ to provide a wysyywig environment that updates the html code. You just need to code that into your site. But all of this is a big ask if you are very new to php so check out some open source cms packages. A very easy one i have used is concrete5 . Soooo easy to create a new theme and templates.
  16. Not overly familiar with Google maps API as haven't really used it much. But in theory it's perefectly possible to get their location (i.e. gelocation - http://code.google.com/apis/gears/api_geolocation.html )then have a script on your site that would calculate the closest shop (if product exists) using something like google maps distance matrix thingy - http://code.google.com/apis/maps/documentation/distancematrix/ . And if you've gone that far then displaying the shop location on a google map should be a piece of apple pie!
  17. err no, || is like OR
  18. text doesn't necessarily mean it's going to be considered text by php. You can specify the type as 'number' but this is a HTML 5 thing and won't have wide support. Your best options are to either use jquery/javascript to validate at the client side (though this would fail if they didn't have JS turned on) or post your data to a validation function and use something like: $yourinput = $_POST['yourinput']; filter_var($yourinput, FILTER_VALIDATE_FLOAT) ...with a conditional to check the input validates to a float - i believe it returns true if it's valid. If not then return the user to the form with the appropriate error.
  19. As the others have said, using the html entity will fix it in most cases and is probably the best way. I have had this issue a few times when copying text from word (even with the charset set as utf . I notice it happens on commas and apostrophes and sometimes the simplest fix is to delete the character and re-write it in your editor, which fixes the comma and apostrophe issue.
  20. Hi guys I hope someone can help me with an php mail issue as server setup is something i dont know very much about. I have a simple form on a client's website that sends its output via the php mail() function. The website's domain is hosted externally. They have pointed the A and @ records to my server and their MX records are set elsehwere and point to an external mail server. The issue is the form outputs works perfectly on my own email addresses but not on the client's email. At first i assumed my messages were getting spammed on the client's side but it has been confirmed that this is not the case. When i check the zone file on my server it has a default mx record setup as "theirsite.com.". And when i check the 'email delivery route' in cpanel it tells me it's directing locally to theirsite.com. I assume this is incorrect and it should actually be pointing externally. Am i right in thinking i need to setup the zone file to point at their external mail servers and this will correct the issue with delivering off the mail() function? Any advice is very gratefully received! Drongo
  21. If you didnt want to send the user to another page you could set the form's action to '#' which would keep them on the page. Then you could have some logic in your page to check if the form was submitted and if it was it could run whatever login function you have to verify the user. Then if they are logged in you could have some further logic to include admin elements on the current page. Something along those lines. Or you could use ajax to post to the login function and then refresh the page - but you would need to use header again for that But as suggested i would stick with using headers because this is just unecessarily complicating things
  22. i dont quite see how the value of $received is being assigned? You are adding it's value to$data and then echoing out $received - but why would that display your new value? try this to test it foreach($row['received'] as &$data) { $data += $received; echo $data; echo "<br/>"; } print_r($row['received']); Also you need to pass data by reference or it wont change outside of the loop.
  23. If you need any more help just yell!
  24. This is really more client side to be honest. You just need some jquery and some logic within your jquery. specifically you'll use the .change() function to register when a new selection has been made (i.e. from your drop down) and this would fire off the code for the new piece of the form you want to display. This should point you in the right direction - http://api.jquery.com/change/ You could of course load the form elements using ajax but i cant exactly see why it would be worth sapping server resources for soemthing that can be done client side
  25. The effect of white space is so infinitesimal that you really need never worry about it! it's better to produce readable code than bunch everything up to save a few thousandths of a millisecond... My two pennies...
×
×
  • 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.