-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Viewing only certain type of Inventory from inventory.php
Adam replied to gamerzfuse's topic in Third Party Scripts
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... -
Viewing only certain type of Inventory from inventory.php
Adam replied to gamerzfuse's topic in Third Party Scripts
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? -
Require()ing or include()ing files with a query string
Adam replied to opalelement's topic in PHP Coding Help
$rebuild = true; include($maps[$i]); Then check the value of $rebuild within the included file... -
Viewing only certain type of Inventory from inventory.php
Adam replied to gamerzfuse's topic in Third Party Scripts
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. -
Beggin your pardon, but Google can read dynamic URLs.
-
Viewing only certain type of Inventory from inventory.php
Adam replied to gamerzfuse's topic in Third Party Scripts
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! -
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
-
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);
-
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!)
-
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.
-
Again need to see the code. No reason why it would do that ordinarily.
-
Have a bash at it and if you get stuck, get the help here...
-
Well you now have an array containing all of the functions captured. What have you tried so far?
-
Also if the browser does block the session cookie, normally it's passed through the URL instead.
-
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
-
if (!preg_match('/[\d]+/', $text)) { print 'No digits!'; }
-
Sorry but.. http://lmgtfy.com/?q=php+cron+tutorial
-
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();">
-
Links? Examples? I can only assume they're printing out the media player after the page has loaded, with JavaScript...
-
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...
-
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..
-
http://www.google.com/coop/cse/
-
Why not show us all the code? It could be something as simple as a missing: session_start();
-
What exactly doesn't work with it? Do you get any errors?