Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. To keep things simple you could try changing this: $sSql = $vehicles->SQL(); To this: $sSql = ($_GET['type']) ? $vehicles->SQL() . " WHERE type = '" . mysql_real_escape_string($_GET['type']) . "'" : $vehicles->SQL(); (Not tested obviously!) There's a few ways you can do it though...
  2. Urf.. ugly. Here's the SQL though: // Table level SQL function SqlSelect() { // Select return "SELECT * FROM `vehicles`"; } You could check if the 'type=' var has been passed through the URL, if it has, amend the SQL with 'WHERE type = ...' Make sense?
  3. $rebuild = true; include($maps[$i]); Then check the value of $rebuild within the included file...
  4. You'll probs struggle to find it as your code appears OO. If you can, search the code base for the '$vehicles->SQL()' method (try searching for function SQL) - that will contain the SQL you need to alter.
  5. Beggin your pardon, but Google can read dynamic URLs.
  6. This is just basic SQL... SELECT * FROM something WHERE type = 'Car' You can pass a value through the URL like you said and collect it with $_GET: inventory.php?type=car $type = $_GET['type']; You just need to look through the code and find where the SQL is currently and edit that. Perhaps be best off reading a couple of tutorials first to be honest!
  7. Here's a site I created quite a while ago, I've posted before but just curious to find out what the general opnion is? It's under going some maintenance so now's a good time if anyone has any ideas to improve it a bit. http://minimerc.co.uk Thanks Adam
  8. I imagine you'd need to change the JavaScript, specifically this line, to the Australian co-ordinates: map.setCenter(new GLatLng(1.3714, 103.8861), 13);
  9. Could you give a realistic example of what the input would look like? I was thinking something along the lines of this may work... $str = "strtoupper('test string');"; $str = preg_replace('/([a-zA-Z_][\w]+\([^\)]+\);)/', "<?php $1 ?>", $str); eval($str); But that would require PHP functions without PHP tags around them, just in a string. (Not tested!)
  10. Ahh of course!
  11. Yeah - obviously you can't count on the user to enter the data correctly. If you look at his original regular expression it looks like he's tried to put in that flexibility but being unsuccessful.
  12. Again need to see the code. No reason why it would do that ordinarily.
  13. Have a bash at it and if you get stuck, get the help here...
  14. Well you now have an array containing all of the functions captured. What have you tried so far?
  15. Also if the browser does block the session cookie, normally it's passed through the URL instead.
  16. This works: $string = "(232) 555-5555"; if (preg_match('/^\(?\d{3}\)?[-\.\s]?\d{3}[-\.\s]?\d{4}$/', $string)) { echo "successful."; }else{ echo "not successful"; } From what I could gather of yours the brackets are optional and the two gaps could be either a space, hypon or dot? Examples: (111) 111 1111 (111)-1111111 (111)111.1111 111-111-1111 111.111.1111 111 111 1111
  17. if (!preg_match('/[\d]+/', $text)) { print 'No digits!'; }
  18. Sorry but.. http://lmgtfy.com/?q=php+cron+tutorial
  19. If this is supposed to display Australia on the map, then it's not working as you can only have 1 onload call... onload="showAddress('<?php echo $map_address; ?>')" Use instead: <body onload="initialize(); showAddress('<?php echo $map_address; ?>');" onunload="GUnload();">
  20. Links? Examples? I can only assume they're printing out the media player after the page has loaded, with JavaScript...
  21. Try this.. $str = "tester('test string')"; preg_match_all('/[a-zA-Z_][\w]+\([^\)]+\);/', $str, $matches); print_r($matches); You should be able to convert it to preg_replace if you need to, I just didn't understand what you were trying to do before...
  22. These are nothing to do with PHP, these are simply HTML comments. There may be times when PHP software outputs them, but they'll usually only serve as comments to make the source clearer. There is another use for them though, which does follow a similar syntax to the code you provided; IE conditionals. For example: <!--[if IE 5]>This is internet explorer 5<![endif]--> These tags allow you to create content just for [specific versions of] Internet Explorer. Most commonly used to include an extra stylesheet specific to IE's needs..
  23. http://www.google.com/coop/cse/
  24. Why not show us all the code? It could be something as simple as a missing: session_start();
  25. What exactly doesn't work with it? Do you get any errors?
×
×
  • 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.