Search Results

Showing results 1 to 40 of 323
Search took 0.03 seconds.
Search: Posts Made By: kkeith29
Forum: PHP 22 Days Ago
Replies: 6
Views: 350
Posted By kkeith29
Look up func_get_args().
Forum: PHP Oct 27th, 2009
Replies: 6
Views: 285
Posted By kkeith29
Use either GET or POST. Don't use REQUEST as it has security flaws.
Forum: PHP Oct 24th, 2009
Replies: 4
Views: 497
Posted By kkeith29
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: 384
Posted By kkeith29
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: 230
Posted By kkeith29
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: 279
Posted By kkeith29
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: 279
Posted By kkeith29
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: 619
Posted By kkeith29
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: 619
Posted By kkeith29
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: 272
Posted By kkeith29
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: 210
Posted By kkeith29
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: 260
Posted By kkeith29
or use substr_count()
Forum: PHP Oct 3rd, 2009
Replies: 1
Views: 294
Posted By kkeith29
I use list and explode.

list( ,,$value ) = explode( ',','one,two,three,four' );
echo $value; //returns three
Forum: PHP Oct 1st, 2009
Replies: 4
Views: 603
Posted By kkeith29
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: 363
Posted By kkeith29
urlencode()

Look it up.
Forum: PHP Sep 21st, 2009
Replies: 10
Views: 394
Posted By kkeith29
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
Solved: .htaccess URI
Views: 808
Posted By kkeith29
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: 394
Posted By kkeith29
Any reason why you are wanting to set it up that way?
Forum: PHP Sep 20th, 2009
Replies: 10
Views: 394
Posted By kkeith29
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: 394
Posted By kkeith29
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: 493
Posted By kkeith29
This:

$total = count($children);

should be:

$total = count($children) - 1;
Forum: PHP Sep 12th, 2009
Replies: 4
Views: 281
Posted By kkeith29
http://www.w3schools.com/PHP/php_operators.asp
Forum: PHP Sep 12th, 2009
Replies: 4
Views: 281
Posted By kkeith29
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: 750
Posted By kkeith29
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,623
Posted By kkeith29
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,623
Posted By kkeith29
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,623
Posted By kkeith29
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
Solved: PHP OOP & MySQL
Views: 265
Posted By kkeith29
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: 441
Posted By kkeith29
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: 441
Posted By kkeith29
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: 355
Posted By kkeith29
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: 355
Posted By kkeith29
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
Solved: automated jobs
Views: 176
Posted By kkeith29
Look up cron jobs. They are what you are looking for.
Forum: PHP Aug 22nd, 2009
Replies: 10
Solved: Code Errors
Views: 609
Posted By kkeith29
Actually mysql_affected_rows takes the connection to the database itself, not the result of a query.
Forum: PHP Aug 22nd, 2009
Replies: 10
Solved: Code Errors
Views: 609
Posted By kkeith29
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: 503
Posted By kkeith29
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: 503
Posted By kkeith29
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
Solved: EasyPHP issue
Views: 531
Posted By kkeith29
<?=...?> 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: 205
Posted By kkeith29
Look at this again:

content="' .$meta_keywords' . ">

You should see the error.
Forum: PHP Aug 19th, 2009
Replies: 3
Views: 321
Posted By kkeith29
You didn't escape the " characters.

Example:

$property_link = "<a href="listingstest.php?category=property">Property</a>";

should be

$property_link = "<a...
Showing results 1 to 40 of 323

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC