Forum: MySQL 6 Hours Ago |
| Replies: 10 Views: 249 Hey.
If you have a table with a VARCHAR field, you can often improve search performance on it by changing the field to the CHAR type. It has a static length, which allows MySQL to calculate a... |
Forum: MySQL 7 Hours Ago |
| Replies: 4 Views: 133 UTF-8 (utf8_general_ci) should work fine for that. Even for the Chinese characters.
I've created blog software in the past, using UTF-8, that I used to post content in multiple languages,... |
Forum: PHP 7 Hours Ago |
| Replies: 2 Views: 68 Hey.
Try something like:
<?php
$dbLink = new mysqli('host', 'user', 'pwd', 'db');
$result = $dbLink->query("... Put your query here ...");
if($result)
{ |
Forum: PHP 7 Hours Ago |
| Replies: 1 Views: 54 Hey.
HTML:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf8">
</head>
<body /> |
Forum: PHP 1 Day Ago |
| Replies: 18 Views: 4,448 But neither of our codes need the hash functions themselves to use a lot of memory. They both use arrays and strings we created to fill the memory.
I mean, using my last code, setting the... |
Forum: PHP 1 Day Ago |
| Replies: 1 Views: 109 Hey.
The htmlspecialchar (http://php.net/htmlspecialchar) function is meant to be used when printing unsafe data to a HTML page.
It doesn't protect you if you use the data for other things,... |
Forum: PHP 1 Day Ago |
| Replies: 9 Views: 176 Consider this code.
It has a form where a user enters the start and end date, and the PHP code compiles a XML file with all the data from a table that were created in that time-frame.
I created... |
Forum: PHP 1 Day Ago |
| Replies: 9 Views: 176 Also, forgot to mention.
If you would rather send the file to the user, to allow him to download it, you can do this instead of the file_put_contents.
header('content-type: text/xml');... |
Forum: PHP 1 Day Ago |
| Replies: 9 Views: 176 Ok, I see.
You can have PHP create whatever output you want out of that.
For example, to create a XML file and save it on the server, you can do:
// <snipped the DB code>
$output = '<?xml... |
Forum: PHP 1 Day Ago |
| Replies: 9 Views: 176 Hey.
What data are you looking to export?
Fetching data from a form and writing it to a file is fairly simple. We just have no idea what sort of data you are using, and without knowing that we... |
Forum: PHP 1 Day Ago |
| Replies: 24 Views: 1,229 Hey.
I'm not sure exactly what you are asking for.
What is the problem? Could you explain it a bit better?
And perhaps show us the code that is causing it? |
Forum: PHP 1 Day Ago |
| Replies: 3 Views: 96 Hey.
If you are having problems with functions, look them up in the manual (http://php.net/imagewbmp).
The third parameter of the imagewbmp (http://php.net/imagewbmp) function is not the same... |
Forum: PHP 1 Day Ago |
| Replies: 1 Views: 79 Hey.
Are you looking for a way to upload your PHP scripts on to the server, or are you looking for a way for you PHP scripts to receive file uploads from your users?
If it is the former, you... |
Forum: PHP 1 Day Ago |
| Replies: 1 Views: 77 Hey.
You only have very limited control over stuff like this, which is how it should be. Your code should not be able to mess up user-chosen browser settings, like the ability to see the menu bar.... |
Forum: PHP 1 Day Ago |
| Replies: 18 Views: 4,448 Thanks.
I did use an array at first, adding each hash as an element and them imploding it before creating the final hash. (Like you do in your code.)
However, after testing that I found that... |
Forum: PHP 2 Days Ago |
| Replies: 18 Views: 4,448 Thanks for that.
I see what you mean now, about the memory.
Interesting article to. I had never really considered using bcrypt before, although after doing some testing, and considering your... |
Forum: PHP 3 Days Ago |
| Replies: 18 Views: 4,448 @digital-ether
I agree with you 100%, although 100.000 iterations seem a bit excessive to me. (But that's just me :-P)
However, I got to ask why you specifically mention high memory usage? |
Forum: PHP 3 Days Ago |
| Replies: 6 Views: 153 That article is more than 6 years old :)
The 4GB limit it talks about applies only to MyISAM tables, and only on 32bit systems with ancient MySQL setups.
This limit does not apply to the standard... |
Forum: PHP 3 Days Ago |
| Replies: 6 Views: 153 Hey.
I wrote an article a while ago that explains how to do this in detail.
Check it out (http://bytes.com/topic/php/insights/740327-uploading-files-into-mysql-database-using-php).
Why do... |
Forum: PHP 3 Days Ago |
| Replies: 10 Views: 215 Sure. Try this one (http://www.regular-expressions.info/tutorial.html). It's what I used when I was first starting out with regular expressions.
And you can check out the details on how PHP uses... |
Forum: PHP 3 Days Ago |
| Replies: 6 Views: 141 Ahh ok, sorry. I see now where your coming from on that one.
Although I think you may have confused posts. I only see it in the OPs post. (Maybe I'm missing something. Caffeine hasn't quite kicked... |
Forum: PHP 3 Days Ago |
| Replies: 7 Views: 153 The $_POST array represents the data sent via a HTML <form>, using the POST method. So the data in $_POST['ta'] is just the data in whatever form element was named "ta".
The if statement checks to... |
Forum: PHP 3 Days Ago |
| Replies: 6 Views: 141 Hey.
I just wanted to point out a few minor things in network18's code:
Short tags are baaad! ;-)
Where does the $uploadArray variable for the foreach loop come from? Wouldn't it be better... |
Forum: PHP 3 Days Ago |
| Replies: 18 Views: 4,448 Hey.
Be careful if you do this in a SQL query tho. Some MySQL servers use plain-text query logs, so while your passwords might be encrypted in the database itself, they would be stored in their... |
Forum: PHP 3 Days Ago |
| Replies: 2 Views: 178 Hey.
When you create an array of <input> elements, you can specify the ID that is supposed to be used for that specific element.
For example:
<?php
echo "<form action='process.php'... |
Forum: PHP 3 Days Ago |
| Replies: 7 Views: 153 Ahh ok.
Is the MySQL table created to use UTF-8?
If you are not sure, try using the SHOW CREATE TABLE command. It should provide a DEFAULT CHARSET clause or two.
And how do you insert the data... |
Forum: PHP 3 Days Ago |
| Replies: 7 Views: 153 Well, I don't know what they are on about there, but I have never come across a situation where I explicitly needed to specify a charset when sending a query, and I use UTF-8 exclusively in my PHP... |
Forum: PHP 3 Days Ago |
| Replies: 7 Views: 153 Hey.
Do you set the charset for the resulting page?
By default, most browsers use the ISO charset, so if you plan on printing Unicode characters into it, you must specify that in the request.... |
Forum: PHP 3 Days Ago |
| Replies: 4 Views: 116 As an afterthought...
The mail function does allow for multiple recipients for one call.
If you pass something like User1 <user1@example.com>, User2 <user2@example.com> as the first parameter,... |
Forum: PHP 3 Days Ago |
| Replies: 4 Views: 116 Hey.
You should check out PHPMailer (http://phpmailer.worxware.com/) or Swift Mailer (http://swiftmailer.org/).
Both are much easier to deal with than the PHP mail function, and both allow for... |
Forum: PHP 3 Days Ago |
| Replies: 10 Views: 215 Yes, sorry about that second post. When I posted my first post it got posted twice because of a bug in the forum. (I assume)
It has been removed now.
But OK, as form validation is a rather... |
Forum: PHP 4 Days Ago |
| Replies: 10 Views: 215 Hey.
The isset (http://php.net/isset) and empty (http://php.net/empty) functions are also handy when validating form data. (or any data, for that matter) |
Forum: PHP 4 Days Ago |
| Replies: 6 Views: 164 Hey.
What do you mean by "a message system"?
Like a blog, or like a messenger?
If it's a blog, there are probably hundreds of codes available online for you to choose from. Wordpress... |
Forum: PHP 4 Days Ago |
| Replies: 8 Views: 174 Yea, whatever you do, you will need a list of correctly spelled words to test against. PHP has no way to determine what is and is not incorrectly spelled unless it has something to compare it to.
... |
Forum: PHP 4 Days Ago |
| Replies: 13 Views: 252 Duplicate... The forum software is on the fritz xD |
Forum: PHP 4 Days Ago |
| Replies: 13 Views: 252 PHP uses cookies by default. If you don't know whether or not u use cookies to transfer the session ID, you almost definitely do.
Doesn't really matter in this context tho. The other option; using... |
Forum: PHP 4 Days Ago |
| Replies: 13 Views: 252 Yes, it is a security measure, limiting the window for a session hijacking (http://en.wikipedia.org/wiki/Session_hijacking).
There are ways for malicious persons to obtain your session cookie,... |
Forum: PHP 4 Days Ago |
| Replies: 13 Views: 252 Sure, but any method that would allow for that would require control over key areas of the server, which you are unlikely to have on a free, shared server.
If you did have the access, you could... |
Forum: PHP 5 Days Ago |
| Replies: 13 Views: 252 Ahh ok, so you don't control the server yourself. That complicates these sort of things.
An easy way around this is to just manually destroy the session in your scripts by keeping track of when... |
Forum: PHP 5 Days Ago |
| Replies: 13 Views: 252 It should be very close to the top.
See the attached image. It shows where it is on my PC. |