Forum: PHP Nov 13th, 2009 |
| Replies: 6 Views: 408 |
Forum: PHP Oct 27th, 2009 |
| Replies: 6 Views: 320 Use either GET or POST. Don't use REQUEST as it has security flaws. |
Forum: PHP Oct 24th, 2009 |
| Replies: 4 Views: 606 You can't pass url parameters to a php script through cron.
If you need to store something to be used in a cronjob later, your best bet would be either to use a database or a text file. |
Forum: PHP Oct 24th, 2009 |
| Replies: 1 Views: 471 An associative array is one with named keys.
Ex.
array(
'name' => 'Name here',
'other' => 'Other data here'
);
In a mysql result, they are the column names. |
Forum: PHP Oct 23rd, 2009 |
| Replies: 4 Views: 275 You need to understand that a salted hash is irreversible (without the original text and salt). Thats the point of it.
You either need to generate them a new password and send it to them or give... |
Forum: PHP Oct 17th, 2009 |
| Replies: 4 Views: 319 I don't add stuff like that. I keep it simple.
The random token helps out with automated requests so I don't worry about a brute force attack. If someone wants to try and login a hundred times, I... |
Forum: PHP Oct 17th, 2009 |
| Replies: 4 Views: 319 Using $_SESSION['admin'] would be fine. Its pretty difficult to hijack a session anyway. You have taken the right security measures to prevent that from happening so there isn't much to worry about.... |
Forum: PHP Oct 17th, 2009 |
| Replies: 6 Views: 768 You could extend it, but every time you called a class a new connection to the database would be made (which isn't good).
I would use the singleton method. |
Forum: PHP Oct 17th, 2009 |
| Replies: 6 Views: 768 You have a few options.
You can send an instance to each class.
Ex.
$db = new db;
$admin = new admin( $db,$id ); //send the db object to the class
Or use the singleton method. Look this... |
Forum: PHP Oct 12th, 2009 |
| Replies: 4 Views: 287 http://php.net/manual/en/function.session-save-path.php
You need specify a new path using an absolute path. It needs to be done on every page before session_start(). It would be pointless to store... |
Forum: PHP Oct 7th, 2009 |
| Replies: 3 Views: 214 Put code at the top of page to check and see if the user is still logged in. If not, then you redirect to login page.
Its that simple. |
Forum: PHP Oct 7th, 2009 |
| Replies: 4 Views: 293 |
Forum: PHP Oct 3rd, 2009 |
| Replies: 1 Views: 318 I use list and explode.
list( ,,$value ) = explode( ',','one,two,three,four' );
echo $value; //returns three |
Forum: PHP Oct 1st, 2009 |
| Replies: 4 Views: 685 Once its deleted it won't be used again (unless you truncate the table). MySQL will not reassign the ids, as it would defeat the purpose of using them. Once you set an id, it should never change. |
Forum: PHP Sep 30th, 2009 |
| Replies: 9 Views: 428 |
Forum: PHP Sep 21st, 2009 |
| Replies: 10 Views: 422 You need a database class that handles all basic functions. Don't make it specific towards anything.
After you have that then you create other classes (ect. article class) that will handle... |
Forum: PHP Sep 20th, 2009 |
| Replies: 7 Views: 994 I really hate trying to rewrite urls. I found using a basic rewrite and having php parse the url is much easier.
I use a url class that parse the url. This makes it so you can change the rewrite... |
Forum: PHP Sep 20th, 2009 |
| Replies: 10 Views: 422 Any reason why you are wanting to set it up that way? |
Forum: PHP Sep 20th, 2009 |
| Replies: 10 Views: 422 Within the class you use const var = 5;.
To access it, you need to use class_name::const_name or use self in php5. self::const_name (only works inside the class the constant is defined in) |
Forum: PHP Sep 20th, 2009 |
| Replies: 10 Views: 422 You access class variables with $this->var_name
This is whats causing the error:
public function connect($host = $HOST, $user = $USER = "root", $passwd = $PASS, $db = $DATABASE ){
should be:... |
Forum: PHP Sep 14th, 2009 |
| Replies: 2 Views: 510 This:
$total = count($children);
should be:
$total = count($children) - 1; |
Forum: PHP Sep 12th, 2009 |
| Replies: 4 Views: 287 http://www.w3schools.com/PHP/php_operators.asp |
Forum: PHP Sep 12th, 2009 |
| Replies: 4 Views: 287 You are just setting the value to a variable.
You should do something like this:
foreach( $_GET as $key => $val ) {
$_GET[$key] = htmlentities( $val );
} |
Forum: PHP Sep 10th, 2009 |
| Replies: 16 Views: 786 On this line:
$backupFileName = "Desktop/toy-`date +%d-%m-%Y-%H:%M:%S`.sql";
You probably are going to need the absolute path to where the file needs to be stored. |
Forum: PHP Sep 10th, 2009 |
| Replies: 13 Views: 1,866 The ability to use the protocol is free, the ability to use the cellphone companies towers to send your messages is not. |
Forum: PHP Sep 10th, 2009 |
| Replies: 13 Views: 1,866 You really think cellphone companies are going to let you send free messages through their equipment. Not going to happen.
SMS providers buy a bulk of messages from those companies at a... |
Forum: PHP Sep 9th, 2009 |
| Replies: 13 Views: 1,866 Here is something simple, but still would cost money. This type of service will never be free.
http://invalid.name/wiki/index.php/Setting_up_an_SMS_Gateway |
Forum: PHP Sep 9th, 2009 |
| Replies: 3 Views: 268 This really has nothing to do with OOP particularly, mostly it has to do with your setup.
The way I would do it to minimize queries would be to select all data with users that have that guild id.... |
Forum: PHP Sep 3rd, 2009 |
| Replies: 10 Views: 477 It looks like he is returning more than one row from that query, so yes that is correct. |
Forum: PHP Sep 3rd, 2009 |
| Replies: 10 Views: 477 This line:
$fiction_articles = mysql_fetch_assoc($mysql_result1);
is your problem.
mysql_fetch_assoc() only returns 1 row. |
Forum: PHP Sep 2nd, 2009 |
| Replies: 6 Views: 364 What I just wrote changes SKILL and then writes it back into its original form. Did you try the code? |
Forum: PHP Sep 1st, 2009 |
| Replies: 6 Views: 364 You can do:
$array = array_filter( explode( '\_1',$charstring ) );
$data = array();
foreach( $array as $part ) {
list( $key,$val ) = explode( '=',$part );
$data[$key] = $val;
}
//edit... |
Forum: PHP Aug 26th, 2009 |
| Replies: 3 Views: 183 Look up cron jobs. They are what you are looking for. |
Forum: PHP Aug 22nd, 2009 |
| Replies: 10 Views: 624 Actually mysql_affected_rows takes the connection to the database itself, not the result of a query. |
Forum: PHP Aug 22nd, 2009 |
| Replies: 10 Views: 624 You are running mysql_fetch_array only once, which means the code will only be run for one row. Is this what you are wanting?
I see that you have queries that update multiple rows based on the... |
Forum: PHP Aug 22nd, 2009 |
| Replies: 6 Views: 530 You still have to compile them. I thought you didn't want to have to configure and install php with new extension (which is a pain in the ass).
Just extract the files from the tar file and then... |
Forum: PHP Aug 22nd, 2009 |
| Replies: 6 Views: 530 The easiest way I know is to install the files into the directory where extensions are suppose to be and add the extension to the php.ini file. Worked for my install on a Kubuntu box. |
Forum: PHP Aug 21st, 2009 |
| Replies: 7 Views: 600 <?=...?> is short-hand syntax for echoing data to a page. I personally don't use it, but its pretty common. |
Forum: PHP Aug 20th, 2009 |
| Replies: 5 Views: 222 Look at this again:
content="' .$meta_keywords' . ">
You should see the error. |
Forum: PHP Aug 19th, 2009 |
| Replies: 3 Views: 332 You didn't escape the " characters.
Example:
$property_link = "<a href="listingstest.php?category=property">Property</a>";
should be
$property_link = "<a... |