TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Showing results 1 to 25 of 67
Search took 0.13 seconds.
Search: Posts Made By: xenon
Forum: Absolute Beginners 05-13-2009, 05:38 PM
Replies: 2
Views: 729
Posted By xenon
You've got it somewhat right, but not fully....

You've got it somewhat right, but not fully. $this only refers to the current instance of an object created from a class. So, given the following simple class:

class SimpleClass
{
public $var1 =...
Forum: General 05-12-2009, 04:45 PM
Replies: 4
Views: 976
Posted By xenon
That is already built into the MySQL server...

That is already built into the MySQL server itself, you don't have to implement it in PHP. You just need to set it up properly.

Here's a start:...
Forum: General 05-08-2009, 05:43 PM
Replies: 2
Views: 477
Posted By xenon
You would use serialization...

You would use serialization (http://www.php.net/manual/en/function.serialize.php).
Forum: General 04-09-2009, 08:13 PM
Replies: 2
Views: 444
Posted By xenon
print_r(recur_dir('Art')['level' =...

print_r(recur_dir('Art')['level' = 1]['name']);That would not work in PHP (at least not yet). What you really want to do is:

$dirs_list = recur_dir('Art');

print_r($dirs_list[1]['name']);
Forum: Absolute Beginners 03-27-2009, 06:17 PM
Replies: 4
Views: 2,526
Posted By xenon
ob_start(); extract($templateVars,...

ob_start();
extract($templateVars, EXTR_PREFIX_SAME, 'some_prefix_');
include 'template_file.html';
$__parsed = ob_get_contents();
ob_end_clean();

echo $__parsed;

I forcedly used include there...
Forum: Absolute Beginners 03-25-2009, 04:33 PM
Replies: 4
Views: 2,526
Posted By xenon
You would use include or require to read the file.

You would use include or require to read the file.
Forum: Advanced PHP Programming 03-23-2009, 05:12 PM
Replies: 14
Views: 932
Posted By xenon
Well, selecting all columns, as well as selecting...

Well, selecting all columns, as well as selecting just one column for counting will always be extremely slow because the MySQL engine should go through each and every one of the rows in that table...
Forum: Absolute Beginners 03-21-2009, 07:13 AM
Replies: 10
Views: 737
Posted By xenon
Try this way: if(preg_match('/^(?:' ....

Try this way:

if(preg_match('/^(?:' . str_replace('.', '\.', implode('|', $bad_ip_address)) . ')/', $buffer) > 0) echo $buffer;

$bad_ip_address is an array, so in your statement, it wouldn't work,...
Forum: Absolute Beginners 03-19-2009, 11:12 AM
Replies: 10
Views: 893
Posted By xenon
Sounds like file_put_contents...

Sounds like file_put_contents (http://www.php.net/manual/en/function.file-put-contents.php) could help you.

file_put_contents('filename.txt', 'file contents...');

Why create your own function when...
Forum: General 01-21-2009, 08:53 AM
Replies: 5
Views: 565
Posted By xenon
Well, the playlist of the music player (or a...

Well, the playlist of the music player (or a single song at a time) is loaded by passing the URL to the song to the player, using PHP or a similar server-side technology. If that's the case, then you...
Forum: Absolute Beginners 11-29-2008, 09:28 AM
Replies: 9
Views: 887
Posted By xenon
I think you've gone far enough. I've detailed...

I think you've gone far enough. I've detailed below how PHP does the calculations:

echo "Testing " . 1 + 2 . "34";

step1: echo "Testing1" + 2 . "34";
step2: echo 0 + 2 . "34";
step3: echo 2 ....
Forum: Absolute Beginners 11-28-2008, 12:10 AM
Replies: 27
Views: 2,465
Posted By xenon
Drop the "var" keyword. It's deprecated as of PHP...

Drop the "var" keyword. It's deprecated as of PHP 5.0.0.

Now, about the problem with the table creation. Tables are assigned to databases. Therefore, you need to actually select a database before...
Forum: Libraries & Extensions 10-14-2008, 08:54 AM
Replies: 27
Views: 4,983
Posted By xenon
It kicks ass. Also has integrated...

It kicks ass. Also has integrated internationalization, besides forcing you to write valid XHTML and it's way faster than Smarty.
Forum: Advanced PHP Programming 10-10-2008, 10:45 AM
Replies: 10
Views: 701
Posted By xenon
Well, first of all, $1, $2, ..., $n are...

Well, first of all, $1, $2, ..., $n are references to the previously captured groups (stuff between paranthesis, in the order they were created). Second of all, in regex, ^ delimits the beginning of...
Forum: Absolute Beginners 09-14-2008, 10:31 PM
Replies: 5
Views: 1,108
Posted By xenon
echo date('m/d/Y', $iNext); Check out the date...

echo date('m/d/Y', $iNext);

Check out the date function (http://www.php.net/date) on php.net.
Forum: MySQL & Databases 09-13-2008, 03:08 PM
Replies: 7
Views: 953
Posted By xenon
you probably mean... SELECT ... FROM tbl WHERE...

you probably mean...

SELECT ... FROM tbl WHERE field_name IN('value1', 'value 2'[, ...])
Forum: Absolute Beginners 09-12-2008, 06:49 PM
Replies: 7
Views: 1,849
Posted By xenon
Ok then, just convert the int to a string before...

Ok then, just convert the int to a string before passing it to strlen. Aka:

echo strlen((string) 293898239382);
Forum: MySQL & Databases 09-10-2008, 07:49 PM
Replies: 2
Views: 746
Posted By xenon
That's extremely bad for the server that...

That's extremely bad for the server that processes the requests. A single MySQL table can work easily with as many as 1 billion rows. And that is alot of info. This way, it only has to deal with one...
Forum: Absolute Beginners 09-06-2008, 04:57 PM
Replies: 7
Views: 1,849
Posted By xenon
You can use strlen. The only difference is speed...

You can use strlen.

The only difference is speed there. (string) is an explicit cast (aka a language construct), whereas strval is a function, and therefore, is more memory consuming.
Forum: General 08-20-2008, 05:43 PM
Replies: 6
Views: 1,049
Posted By xenon
I think he wants to select only the distinct...

I think he wants to select only the distinct words. In which case, this query would work perfectly:

SELECT DISTINCT(word) FROM table_name GROUP BY word

...assuming that you have each word on its...
Forum: General 08-19-2008, 09:42 PM
Replies: 6
Views: 656
Posted By xenon
Here's a little start: <table border="0"...

Here's a little start:

<table border="0" cellpadding="0" cellspacing="0" style="width:100%;">
<?php $bg = '#fff'; $x = 0; ?>
<?php while($x <= 10): ?>
<?php...
Forum: General 08-15-2008, 08:07 PM
Replies: 5
Views: 1,021
Posted By xenon
...or, with ini_set: ini_set('setting_name',...

...or, with ini_set:

ini_set('setting_name', 'value');
Forum: General 07-02-2008, 07:19 PM
Replies: 9
Views: 2,235
Posted By xenon
As Village Idiot already asked, why would you...

As Village Idiot already asked, why would you want to do that? It's an extremely big security hole. And the solution to your 'problem' is: you don't do that anymore.
Forum: General 06-29-2008, 10:30 PM
Replies: 4
Views: 966
Posted By xenon
Yes, you did miss your semicolon :-P However,...

Yes, you did miss your semicolon :-P However, this thing you're doing it's not called 'error muting', it's called error suppression. What's really happening is this: the error is still thrown in the...
Forum: General 06-27-2008, 07:05 PM
Replies: 5
Views: 638
Posted By xenon
You are wrong about #2.

You are wrong about #2.
Showing results 1 to 25 of 67

 

All times are GMT. The time now is 10:08 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design