-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
In the eyes of a search engine, "www.sportskevesti.co" and "sportskevesti.co" are not the same. You need to decided whether you want to include "www." or not, then force that decision by redirecting users when they try and access the wrong one. You can do this at the Apache level, either in a ".htaccess" file within your web root or within the main Apache config file. Add this rewrite rule to remove www: RewriteCond %{HTTP_HOST} ^www.sportskevesti.co$ [NC] RewriteRule ^/(.*) http://sportskevesti.co/$1 [L, R=permanent] Add this one to add it: RewriteCond %{HTTP_HOST} !^www.sportskevesti.co$ [NC] RewriteRule ^/(.*) http://www.sportskevesti.co/$1 [L, R=permanent]
-
You can't put PHP within a JavaScript function like that. PHP is processed by the web server when you first request a page. The response - the result of the PHP - is the HTML/CSS/JS that's handed back to the client (browser), but doesn't contain any PHP or knowledge of the server. The JavaScript is then executed much later by the browser itself on certain client events, such as onclick of an input. I would go with the cookie idea to retain the user's language, as JS and PHP both have access. Before using the value of the cookie though, I would first check if a GET parameter was sent to overwrite it. If there's no GET parameter or cookie, then I would assume a default.
-
Rollover buttons conflicting with auto scroll gallery
Adam replied to Johnnyboy69's topic in Javascript Help
You're binding two pieces of code to the document's onload event: The event can only be bound to one, so every time you bind it you're overwriting the previous handler. Move the MM_preloadImages() call into the anonymous function. -
Is this the location of the current Window? If so you can use the window.location.search property to get exactly what you're after. If you just have a URL string in a variable, I would just use string functions for this: var url = 'http://example.com/?foo=bar&baz=qux#hash'; if (url.indexOf('?') != -1) { var query = url.substr(url.indexOf('?') + 1); if (url.lastIndexOf('#') != -1) { query = query.replace(query.substr(query.lastIndexOf('#')), ''); } } There's possibly a function or object that exists that I've overlooked that can do this already.
-
Just to add, there's also md5_file which you'll probably find useful.
-
What do you see if you go to "http://localhost" or more importantly "http://localhost/projectMyWebsite/MyPageIndex.html" in your browser?
-
$this->get("C:/xampp/htdocs/projectMyWebsite/MyPageIndex.html"); Hmm.. I don't think so. Though how are you trying to run this exactly mx760?
-
What leads you to security and php.ini? Are you receiving any errors?
-
I'm guessing you mean without using the hash technique? This can only be done in newer browsers supporting HTML5 - have a read.
-
Problems downloading files over about 30Mb via PHP
Adam replied to Gideon-IT's topic in PHP Coding Help
Yup, or using set_time_limit. Forgot to add, because you're on a Windows server this is the case. On Linux the max execution time doesn't include stream operations, which you had increased the time-out of. I suspect you wouldn't be getting this problem on Linux. -
Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]
Adam replied to cypher86's topic in PHP Coding Help
Well as AyKay47 pointed out, you were missing a semi-colon off the end of your array_unshift() call, which means the code you posted would never work. Can you post the exact code you're running when you're receiving the error? -
Problems downloading files over about 30Mb via PHP
Adam replied to Gideon-IT's topic in PHP Coding Help
How long does it take for execution to stop? You're increasing the time out of the stream, but not the PHP execution itself. You'll possibly need to just increase the max execution time. -
Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]
Adam replied to cypher86's topic in PHP Coding Help
Did you try adding some debugging between the array_unshift() and call_user_func_array() calls? -
PHP's garbage collection is a little arbitrary even if you unset variables, and connections are closed automatically at the end of the request. While it is good to remove what you don't need, I would concentrate more on improving the efficiency in other ways, like your actual queries for example.
-
There's not a lot to say really. It's roughly a common set-up for small websites that don't stretch much beyond centralising the header/footer content. You could pass in a dynamic <title> and various tweaks like that, but that's about as far as it will take you. That's not a bad thing though, if that's all you need it for.
-
That will work while $filenamepath is a file within the same directory or in a path that already exists. The problem before was that your path didn't exist, which you would need to use mkdir to create first. Also as a heads up "/IITA/fingerscrossed.xml" - if you're working on a Windows machine this will never exist. The file path is not based on the HTTP path, it's based on the internal file path.
-
path="/bookstore/book/price/text()" This line is XPath.. Think of it like a SQL query to select certain data matching a pattern. You just need to run a check on the attribute: path="/bookstore/book[@category='COOKING']/price/text()"
-
That will be sufficient for a small website, yes.
-
Is there an equivalent to Java cast to byte in PHP?
Adam replied to Andy-H's topic in PHP Coding Help
There is no byte data type in PHP, you just need to use string: echo (string) 0xff; -
You could specify a rewrite rule to forward requests to the domain "www.shopsite1.com" if that isn't the host they're requesting. That will result in Google or other search engines being forwarded to the right domain and you not getting knocked down for duplicate content. You'll need to add an entry to your Apache config: RewriteCond %{HTTP_HOST} !^www.shopsite1.com$ [NC] RewriteRule ^/(.*) www.shopsite1.com/$1 [L,R=permanent] Of course this would only work for that one site though, so you'll probably want to think about a more dynamic way of doing it.
-
Told you that yesterday.
-
Don't rely on cookies to protect your files. Users could easily delete them or browse in an incognito type of mode to get around your security. Instead you should force all video/image requests through a separate script. In that you can perform all your user verification and tracking, and then send the response back as the requested content.
-
How do i recive an sms every time i recieve an email
Adam replied to afam4eva's topic in PHP Coding Help
This may help: http://en.wikipedia.org/wiki/List_of_SMS_gateways -
"example.com/user1" instead of "example.com/index.php?id=1"
Adam replied to hassank1's topic in Apache HTTP Server
Yup, it's called the Apache "mod_rewrite" module. It allows you to specify regular expression based patterns that the server will check for on requests. I dare say if you search for "mod rewrite cheat sheet" or something, you'll find what you're after. -
Then I apologise for my remarks, geckoo