AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
Add to cart (U KORPU) and return to last visited page on one click
AyKay47 replied to jovigor's topic in PHP Coding Help
Add history.back() to the inclick event. -
Yuengling lager for me and I'm set. Nom nom nom.
-
We will help you to modify the code yourself. However we do not provide free code. Required gave you some pointers, start there.
-
you can use a rewrite for this, but this should not be happening. Do you have any rewrites in place right now that could be causing this behavior?
-
how much did the gents at humblebumble end up raising?
-
I'm not a fanatic, guru or freak but these books teach the basics, are still good and you can use all of their code today. while you can find a few good books, they are getting more and more rare. Most of them are either outdated in their practices (teaching deprecated methods), or as Ignace said, they teach bad practices in general (SQL injectable strings etc.). My final word here is that the online PHP manual is your best bet to learn up to date PHP functions and practices. They have several tutorials geared towards beginner and intermediate to advanced level coders, as well as the in depth documentation.
-
If you are intentionally giving out wrong answers, that makes you a troll, purposely trying to sabotage the community. That is grounds for warning and ban. then ban me.
-
Do you have any recommendations? The online manual? http://www.php.net/manual/en/ at this stage in PHP 5, the PHP manual is your best bet to get current documentation. All of the books that I have seen on the market are outdated.
-
You are right Adam, and I did this on purpose. Most of the time when I write a regex for someone on here, I will either leave something out or will have something slightly off to intrigue the OP to find the issue and fix it himself. Perhaps i should add that into my signature like ManiacDan.. I do appreciate you spotting it and linking the OP to an informative doc on the subject. Hopefully he/she will learn from it.
-
you can use the AddCharset directive to set the specified extension to use the specified charset. (e.g) AddCharset UTF-8 .php basically, this will cause all the files with the targeted extension to send a Content-Type: header with the charset as whatever you specify. Note that this will change all of the .php files in all of the subdirectories stemming from the current location. You can also target one file (e.g.) <files "example.php"> AddCharset UTF-8 .php </files>
-
it strengthens your eyeballs?
-
they were getting ready to arm wrestle when I exited..
-
I have overlooked the fact (not sure how) that rewrite rules ignore query strings unless specified in a condition, as requinix pointed out. Really, his code should work for you, you will want to add a 301 redirect for google indexing: RewriteEngine On RewriteCond %{REQUEST_URI} ^/09search_results\.php RewriteCond %{QUERY_STRING} ^search_KEYWORD=([a-z]+)&search_RANGE=([a-z]+)&o=([0-9]+)&search=[0-9]+$ [NC] RewriteRule ^/09search_results.php$ /%2/%1/%3 [R=301,NC, L]
-
same here, I thought it would show the screen. Now I sort of feel like a window stalker..
-
you are calling mysql_query() on a query resource. if (!mysql_query($result, $connection)) { die('Error: ' . mysql_error() . "<br />" . $sql); } It should read something like this: $sql = "UPDATE pages SET name = '$name', content = '$content' WHERE id = $id" $result = mysql_query($sql); if (!$result) { die('Error: ' . mysql_error() . "<br />" . $sql); }
-
there are a couple of ways that this can be done. My preferred method would be to take the full results set, and filter the values similar to the logic outline that you have laid out. Since the values are coming from a database as a few expected patterns, the regex can be a little looser. $str = $row['Part_No']; if(preg_match('~\b\d{4}-\d{3}\b~',$str)) { // execute code for block 1 } else if(preg_match("~\b\d{4}[A-Z](?:S|M|L|XL|XXL)\b~",$str)) { //execute code for block 2 } else if(preg_match("~\b\d{2}-\d{4}\b~"),$str) { //execute code for block 3 } or you can self join using the clause REGEXP I'm sure there a several other ways, but I am not a mysql expert.
-
from the specifics that you have given me, your pattern will look like this: $str = "3641-001 ( part & colour)"; $pattern = "~\b\d{4}-\d{3}\b~"; preg_match($pattern, $str, $ms); print_r($ms); results: 3641-001
-
can you give me an example of a full string that contains the text that you want to grab.
-
yes "livethedead" I agree with pika. While I do love regex, if there is a simple PHP functions solution to the problem, I would always go with that. Especially with large strings such as text files etc. They tend to be much more efficient than using a regular expression in most cases. It is only in special cases where the solution cannot be done with simple PHP functions or it would be way too much of an effort to do so where a regex should be used.
-
I agree with requinix here, since this is a rather easy regular expression, I would suggest you study a little further on the subject. If you simply cannot figure this out, I will gladly help.
-
Do you only care about the "3641-001" in "3641-001 ( part & colour)"? If so, are all of the part numbers followed by a space and then a parenthesis?
-
won't echo out text after space in textbox
AyKay47 replied to benchew0904's topic in PHP Coding Help
yep, i second that. OP what's happening is since you do not have quotes around the value attribute, the parser will include the text as the value until it encounters a space, which cuts the text. Text with spaces must be encased in quotes. -
won't echo out text after space in textbox
AyKay47 replied to benchew0904's topic in PHP Coding Help
can you post the relevant code.