Re: [PHP] Pure PHP Templating Class/AJAX Problem

2008-10-13 Thread Yeti
Well after looking at the template thing you posted with your link it
seems to me like PHP is used to create working XML. So i wonder why
you are using AJAX here.
Now could it be that you use appendChild() ? That function would
simply add the XML again.

It's not easy to tell if you are not showing the JavaScript code ..
Still it simply depends on how you are importing the node you get from
XMLHttpRequest() or responseXML

Btw. importNode() is not working on all Browsers ..
Below is a code snipped I use for my AJAX class in JavaScript to copy
a node of one XML document (like from responseXML) into another. It
works in IE6+ and all W3C compliant browsers.
To make this work you will still have to make some ajustments.

xml_obj.prototype.xml_import_node = function(node, to_node,
all_children) { // cross browser importNode, NOTE: if toNode not
specified it will be set to current root_element
// appends node as a child to to_node
// if all_children is true then all child nodes will be imported too
/* NOTE TYPES:
ELEMENT_NODE = 1;
ATTRIBUTE_NODE = 2;
TEXT_NODE = 3;
CDATA_SECTION_NODE = 4;
ENTITY_REFERENCE_NODE = 5;
ENTITY_NODE = 6;
PROCESSING_INSTRUCTION_NODE = 7;
COMMENT_NODE = 8;
DOCUMENT_NODE = 9;
DOCUMENT_TYPE_NODE = 10;
DOCUMENT_FRAGMENT_NODE = 11;
NOTATION_NODE = 12;
*/
if (!node) return false;
if (!this.DOC) this.DOC = document;
if (!to_node.nodeType) {
if (!this.XML) return false;
try {
to_node = this.XML.documentElement;
this.DOC = this.XML;
} catch(e) {
return false;
}
}
try {
if (!node.nodeType) return false;
switch (node.nodeType) {
case 1: // new element
var new_node = 
this.DOC.createElement(node.nodeName);
if (node.attributes && 
(node.attributes.length > 0)) { // if it
has attributes
for (var count = 0; (count < 
node.attributes.length); count++) {

this.xml_import_node(node.attributes[count], new_node);
}
}
if (all_children && (node.childNodes && 
(node.childNodes.length >
0))) { // if child nodes
var dump = null;
for (var count = 0; (count < 
node.childNodes.length); count++) {

this.xml_import_node(node.childNodes[count], new_node, true);
}
}
to_node.appendChild(new_node);
return new_node;
break;
case 2: // new attribute
var name = node.nodeName;
switch (node.nodeName.toLowerCase()) {
case 'onload':
case 'onunload':
case 'onblur':
case 'onclick':
case 'ondblclick':
case 'onfocus':
case 'onkeydown':
case 'onkeypress':
case 'onkeyup':
case 'onmousedown':
case 'onmousemove':
case 'onmouseout':
case 'onmouseover':
case 'onmouseup':
var eval_code = 
'to_node.'+node.nodeName.toLowerCase();
eval_code += ' = 
function() { '+node.nodeValue+' };';
eval(eval_code);
break;
case 'style':
to_node.style.cssText = 
node.nodeValue; // IE FIX
// no break
case 'class':
   

[PHP] Re: Csv issue

2008-10-13 Thread Shawn McKenzie
[EMAIL PROTECTED] wrote:
> I am using a form to select a csv file and then import it into mysql and 
> maybe im just drawling a blank here. But why is it blowing up.
> This thing loads like 14 million records into the database and I am clue less 
> how it can do that with a 2 record csv file.
> 
> 
> Upload:
> 
> 
> 
> $row = 1;
> $filename = $_POST['filename'];
> $handle = fopen("$filename", "r");
> while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
> {
> $num = count($data);
> echo " $num fields in line $row: \n";
> $row++;
> }
> fclose($handle);
> print "Import done";
> 
> This will produce millions of lines until i go in and stop the process on the 
> server. I know its stupid but im drawling a blank as to why its doing this. 
> The csv file has 2 lines in period. 
>  0 fields in line 1: 
>  0 fields in line 2: 
> ect for millions of records.
Try:

print_r(file($_POST['filename']));

And see if you get what you expect.  You might also want to have
error_reporting at its highest and display_errors also.

-Shawn

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Csv issue

2008-10-13 Thread Ashley Sheridan
On Mon, 2008-10-13 at 15:02 -0700, bruce wrote:
> hi...
> 
> as a test... using the cli php... try to write a short app to read a file 
> that simulates your input csv file, and then writes it out as well...
> 
> once you do this, you'll know you have the logic to read/write/manipulate the 
> csv file.
> 
> after you can do this, go ahead and then create/work with a app to read a csv 
> file from the user/input/form data from a test website.
> 
> finally, after you're sure of your ability to manipulate the csv file 
> (read/write) than create the mysql process to insert the data..
> 
> you'll get it in no time...
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2008 2:56 PM
> To: php-general@lists.php.net
> Subject: [PHP] Csv issue
> 
> 
> I am using a form to select a csv file and then import it into mysql and 
> maybe im just drawling a blank here. But why is it blowing up.
> This thing loads like 14 million records into the database and I am clue less 
> how it can do that with a 2 record csv file.
> 
> 
> Upload:
> 
> 
> 
> $row = 1;
> $filename = $_POST['filename'];
> $handle = fopen("$filename", "r");
> while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
> {
> $num = count($data);
> echo " $num fields in line $row: \n";
> $row++;
> }
> fclose($handle);
> print "Import done";
> 
> This will produce millions of lines until i go in and stop the process on the 
> server. I know its stupid but im drawling a blank as to why its doing this. 
> The csv file has 2 lines in period. 
>  0 fields in line 1: 
>  0 fields in line 2: 
> ect for millions of records.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
I had this happen when trying to read in a binary file as a CSV. Are you
sure that the file is a CSV, and if so, is it delimited in the way you
expect? 


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Csv issue

2008-10-13 Thread bruce
hi...

as a test... using the cli php... try to write a short app to read a file that 
simulates your input csv file, and then writes it out as well...

once you do this, you'll know you have the logic to read/write/manipulate the 
csv file.

after you can do this, go ahead and then create/work with a app to read a csv 
file from the user/input/form data from a test website.

finally, after you're sure of your ability to manipulate the csv file 
(read/write) than create the mysql process to insert the data..

you'll get it in no time...



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, October 13, 2008 2:56 PM
To: php-general@lists.php.net
Subject: [PHP] Csv issue


I am using a form to select a csv file and then import it into mysql and maybe 
im just drawling a blank here. But why is it blowing up.
This thing loads like 14 million records into the database and I am clue less 
how it can do that with a 2 record csv file.


Upload:



$row = 1;
$filename = $_POST['filename'];
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$num = count($data);
echo " $num fields in line $row: \n";
$row++;
}
fclose($handle);
print "Import done";

This will produce millions of lines until i go in and stop the process on the 
server. I know its stupid but im drawling a blank as to why its doing this. The 
csv file has 2 lines in period. 
 0 fields in line 1: 
 0 fields in line 2: 
ect for millions of records.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Csv issue

2008-10-13 Thread admin
I am using a form to select a csv file and then import it into mysql and maybe 
im just drawling a blank here. But why is it blowing up.
This thing loads like 14 million records into the database and I am clue less 
how it can do that with a 2 record csv file.


Upload:



$row = 1;
$filename = $_POST['filename'];
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$num = count($data);
echo " $num fields in line $row: \n";
$row++;
}
fclose($handle);
print "Import done";

This will produce millions of lines until i go in and stop the process on the 
server. I know its stupid but im drawling a blank as to why its doing this. The 
csv file has 2 lines in period. 
 0 fields in line 1: 
 0 fields in line 2: 
ect for millions of records.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to know what current system is?

2008-10-13 Thread Tom Shaw

You can try, $_SERVER['SERVER_SOFTWARE']

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jiang Miao
Sent: Monday, October 13, 2008 3:44 PM
To: php-general@lists.php.net
Subject: [PHP] How to know what current system is?

Is there any function do that?
when php in Linux it returns linux
in windows it returns windows

I found phpinfo(INFO_GENERAL); output the string System => Linux ubuntu 
2.6.24-19-server. but I have no idea to get that info.

Thanks
Jiang Miao


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How to know what current system is?

2008-10-13 Thread Shawn McKenzie
Jiang Miao wrote:
> Is there any function do that?
> when php in Linux it returns linux
> in windows it returns windows
> 
> I found phpinfo(INFO_GENERAL); output the string System => Linux ubuntu
> 2.6.24-19-server. but I have no idea to get that info.
> 
> Thanks
> Jiang Miao
> 

PHP_OS constant.

-Shawn

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Pure PHP Templating Class/AJAX Problem

2008-10-13 Thread Tom Shaw
I use a pure templating class similar to something that I found here
http://www.talkphp.com/advanced-php-programming/2568-pure-php-template-class
.html.  My question is how do you handle AJAX requests from XMLHttpRequest
(); My class pumps out the entire page over again after the AJAX request is
made. In other words the page is displaying twice. 

 

Thanks

 

 

Tom Shaw

[EMAIL PROTECTED]

 

"Common sense is the knack of seeing things as they are, and doing things as
they ought to be done." 

Harriet

Elizabeth Beecher Stowe

 



[PHP] How to know what current system is?

2008-10-13 Thread Jiang Miao

Is there any function do that?
when php in Linux it returns linux
in windows it returns windows

I found phpinfo(INFO_GENERAL); output the string System => Linux ubuntu 
2.6.24-19-server. but I have no idea to get that info.


Thanks
Jiang Miao


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to this group....a continuation

2008-10-13 Thread Jochem Maas
Gary schreef:
> I posted that I was new to php and had a nice warm responce, however I am 
> now getting these responses in my email box.  Is this something that I am 
> doing? I read and contribute to other news groups on a daily basis and this 
> is a first Can I change this?

this list is as idiosyncratic as the language it covers :-)

I don't know anything about newsgroups - I partake via email, you can
set up filters to remove 'double replies' or just live with it ... it's
one of this lists weirdnesses that the reply addr is that of the poster
and not the list (which leads to 'reply to all' being the convention)

you could keep asking everyone not to reply to you but it gives them
extra work and it's not something you can rely on.

... oh and we're all a bunch of pirates, except for Tedd ... he's a
retired pirate.

> Thanks
> 
> Gary
> 
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Little regex help please...

2008-10-13 Thread Ryan S
Thanks guys, I appreciate the help.

Cheers!
R



  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Little regex help please...

2008-10-13 Thread Boyd, Todd M.
> -Original Message-
> From: Jim Lucas [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2008 12:13 PM
> To: Ryan S
> Cc: Eric Butera; Boyd, Todd M.; php php
> Subject: Re: [PHP] Little regex help please...
> 
> Too quick on the reply
> 
> forgot not to escape the forward slash on the closing title tag
> 
> preg_match('#([^<]*)#iU',$data,$match);

That'll do, Jim. :)

I also thought it worth mentioning that by telling a catch-all character
sequence (.*) not to be "greedy", another viable solution would be this:

preg_match('#(.*?)#iU', $data, $match);

The ? will stop it when it reaches  through back-tracking.
Probably less-efficient in more complex regex patterns, but I find it
can help make the patterns more readable at-a-glance in regex-heavy code
blocks.

Sorry.. a bit OT.. and the OP has already been answered. Meh.


Todd Boyd
Web Programmer




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to this group....a continuation

2008-10-13 Thread Stut

On 13 Oct 2008, at 18:12, Gary wrote:
I'm sure I will be able to filter, its just that I belong to a  
number of

other NGs and this is the first time I have seen this...


Didn't read the advice about top-posting did ya?

Anyhoo, this is primarily a mailing list with a newsgroup gateway.  
You're receiving replies in your mailbox because most contributors are  
subscribed by email and hitting "Reply to All" is the standard way to  
respond. An alternative to filtering would be to subscribe to the  
mailing list rather than the newsgroup but whatever floats ya boat.


-Stut

--
http://stut.net/


"Wolf" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

 Gary <[EMAIL PROTECTED]> wrote:
I posted that I was new to php and had a nice warm responce,  
however I am
now getting these responses in my email box.  Is this something  
that I am
doing? I read and contribute to other news groups on a daily basis  
and

this
is a first Can I change this?


Nope, you post and pretty much people will respond to the list and
sometimes include the other posters to that message.

If you are just going to read this group through the web or another
interface, set up your email to filter the messages.

HTH,
Wolf




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Little regex help please...

2008-10-13 Thread Leon du Plessis

-Original Message-
From: Ryan S [mailto:[EMAIL PROTECTED] 
Sent: 13 October 2008 07:09 PM
To: Eric Butera; Boyd, Todd M.
Cc: php php
Subject: Re: [PHP] Little regex help please...

Hey Todd, Eric,

Thanks for replying.

> I don't believe you need both the / and the # for delimiters in your
> RegEx. Try using just # (since / is actually going to be in the text
> you're searching for) like this:
>
>   $data =
> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
>  preg_match('#([^<]*)#iU', $data, $match);
>  $title = $match[1];
>  echo $title;
> ?>
>
>

> You can also escape the / like \/.


Ok, I changed it to:
http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
preg_match('/#([^<]*)<\/title>#iU',$data,$match);
$title=$match[1]; 
echo $title;
?>
And this is the error i am getting:

Warning:  preg_match() [function.preg-match]: No ending delimiter '/' found
in C:\wamp\www\ezee\tests\get_remote_title.php on line 3


>> Sorry forgot to include the list in my post to you

Here is another solution if you don't want to play around too much with
regex:

http://www.youtube.com/watch?v=oQ2dKXGAjNg";);

$strt = strpos($data,"")+7;
$end = strpos($data,"");
$len = $end - $strt;

$title= substr($data,$strt,$len);

echo $title
?>

Produces:
"YouTube - REALLY funny ad"

As mentioned, you can probably "neaten" this up a bitregex may be too
complex for the simple requirement needed ?

But for fun, it will be nice to see get if preg_match can do it at some
stage :-)

Regards,

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Little regex help please...

2008-10-13 Thread Eric Butera
On Mon, Oct 13, 2008 at 1:04 PM, Boyd, Todd M. <[EMAIL PROTECTED]> wrote:
>> -Original Message-
>> From: Eric Butera [mailto:[EMAIL PROTECTED]
>> Sent: Monday, October 13, 2008 12:00 PM
>> To: Boyd, Todd M.
>> Cc: Ryan S; php php
>> Subject: Re: [PHP] Little regex help please...
>>
>> On Mon, Oct 13, 2008 at 12:52 PM, Boyd, Todd M. <[EMAIL PROTECTED]>
>> wrote:
>> > I don't believe you need both the / and the # for delimiters in your
>> > RegEx. Try using just # (since / is actually going to be in the text
>> > you're searching for) like this:
>> >
>> > > >  $data =
>> > file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
>> >  preg_match('#([^<]*)#iU', $data, $match);
>> >  $title = $match[1];
>> >  echo $title;
>> > ?>
>>
>> You can also escape the / like \/.
>
> Very true... but I think everything gets a bit convoluted when you escape 
> your forward-slashes instead of just choosing a more convenient 
> delimiter--especially when URLs are involved. I've seen a few regex that look 
> ridiculous for that very reason: 
> /http:\/\/www\.asdf\.com\/blah\/foobar\.php/i ... looks like a zig-zaggy 
> mess. :)
>
> My 2c,
>
>
> Todd Boyd
> Web Programmer
>
>
>
>

Well that is a bit extreme, but I understand your point.  If it were 1
character I'd still stick with /'s and escape one though.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to this group....a continuation

2008-10-13 Thread Gary
I'm sure I will be able to filter, its just that I belong to a number of 
other NGs and this is the first time I have seen this...

Thanks

gary


"Wolf" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>  Gary <[EMAIL PROTECTED]> wrote:
>> I posted that I was new to php and had a nice warm responce, however I am
>> now getting these responses in my email box.  Is this something that I am
>> doing? I read and contribute to other news groups on a daily basis and 
>> this
>> is a first Can I change this?
>
> Nope, you post and pretty much people will respond to the list and 
> sometimes include the other posters to that message.
>
> If you are just going to read this group through the web or another 
> interface, set up your email to filter the messages.
>
> HTH,
> Wolf 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Little regex help please...

2008-10-13 Thread Jim Lucas
Ryan S wrote:
> Hey Todd, Eric,
> 
> Thanks for replying.
> 
>> I don't believe you need both the / and the # for delimiters in your
>> RegEx. Try using just # (since / is actually going to be in the text
>> you're searching for) like this:
>>
>> >  $data =
>> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
>>  preg_match('#([^<]*)#iU', $data, $match);
>>  $title = $match[1];
>>  echo $title;
>> ?>
>>
>>
> 
>> You can also escape the / like \/.
> 
> 
> Ok, I changed it to:
>  $data = file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
> preg_match('/#([^<]*)<\/title>#iU',$data,$match);
> $title=$match[1]; 
> echo $title;
> ?>
> And this is the error i am getting:
> 
> Warning:  preg_match() [function.preg-match]: No ending delimiter '/' found 
> in C:\wamp\www\ezee\tests\get_remote_title.php on line 3
> 
> 
> 
>   
> 

Too quick on the reply

forgot not to escape the forward slash on the closing title tag

preg_match('#([^<]*)#iU',$data,$match);

-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Little regex help please...

2008-10-13 Thread Jim Lucas
Ryan S wrote:
> Hey Todd, Eric,
> 
> Thanks for replying.
> 
>> I don't believe you need both the / and the # for delimiters in your
>> RegEx. Try using just # (since / is actually going to be in the text
>> you're searching for) like this:
>>
>> >  $data =
>> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
>>  preg_match('#([^<]*)#iU', $data, $match);
>>  $title = $match[1];
>>  echo $title;
>> ?>
>>
>>
> 
>> You can also escape the / like \/.
> 
> 
> Ok, I changed it to:
>  $data = file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
> preg_match('/#([^<]*)<\/title>#iU',$data,$match);
> $title=$match[1]; 
> echo $title;
> ?>
> And this is the error i am getting:
> 
> Warning:  preg_match() [function.preg-match]: No ending delimiter '/' found 
> in C:\wamp\www\ezee\tests\get_remote_title.php on line 3
> 
> 
> 
>   
> 

Take off the first /

preg_match('#([^<]*)<\/title>#iU',$data,$match);
-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to this group....a continuation

2008-10-13 Thread Gary
You must be a ptd customer...actually I am in SEPA, but howdy neighbor all 
the same.

Gary

""Daniel Brown"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Mon, Oct 13, 2008 at 12:57 PM, Gary <[EMAIL PROTECTED]> wrote:
>> I posted that I was new to php and had a nice warm responce, however I am
>> now getting these responses in my email box.  Is this something that I am
>> doing? I read and contribute to other news groups on a daily basis and 
>> this
>> is a first Can I change this?
>
>That's because of the Reply-All nature of the list.  If you
> subscribe to the list as opposed to a newsgroup, you should only get a
> single copy of the response, but using a real email address on a
> newsgroup means that you'll still get copies in addition to the posts
> to the newsgroup.
>
>By the way, you're probably the first person aside from myself
> here from NEPA.
>
> -- 
> 
> More full-root dedicated server packages:
> Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
> Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
> Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
> Dedicated servers, VPS, and hosting from $2.50/mo. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Little regex help please...

2008-10-13 Thread Ryan S
Hey Todd, Eric,

Thanks for replying.

> I don't believe you need both the / and the # for delimiters in your
> RegEx. Try using just # (since / is actually going to be in the text
> you're searching for) like this:
>
>   $data =
> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
>  preg_match('#([^<]*)#iU', $data, $match);
>  $title = $match[1];
>  echo $title;
> ?>
>
>

> You can also escape the / like \/.


Ok, I changed it to:
http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
preg_match('/#([^<]*)<\/title>#iU',$data,$match);
$title=$match[1]; 
echo $title;
?>
And this is the error i am getting:

Warning:  preg_match() [function.preg-match]: No ending delimiter '/' found in 
C:\wamp\www\ezee\tests\get_remote_title.php on line 3



  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Little regex help please...

2008-10-13 Thread Boyd, Todd M.
> -Original Message-
> From: Eric Butera [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2008 12:00 PM
> To: Boyd, Todd M.
> Cc: Ryan S; php php
> Subject: Re: [PHP] Little regex help please...
> 
> On Mon, Oct 13, 2008 at 12:52 PM, Boyd, Todd M. <[EMAIL PROTECTED]>
> wrote:
> > I don't believe you need both the / and the # for delimiters in your
> > RegEx. Try using just # (since / is actually going to be in the text
> > you're searching for) like this:
> >
> >  >  $data =
> > file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
> >  preg_match('#([^<]*)#iU', $data, $match);
> >  $title = $match[1];
> >  echo $title;
> > ?>
> 
> You can also escape the / like \/.

Very true... but I think everything gets a bit convoluted when you escape your 
forward-slashes instead of just choosing a more convenient 
delimiter--especially when URLs are involved. I've seen a few regex that look 
ridiculous for that very reason: /http:\/\/www\.asdf\.com\/blah\/foobar\.php/i 
... looks like a zig-zaggy mess. :)

My 2c,


Todd Boyd
Web Programmer





Re: [PHP] New to this group....a continuation

2008-10-13 Thread Daniel Brown
On Mon, Oct 13, 2008 at 12:57 PM, Gary <[EMAIL PROTECTED]> wrote:
> I posted that I was new to php and had a nice warm responce, however I am
> now getting these responses in my email box.  Is this something that I am
> doing? I read and contribute to other news groups on a daily basis and this
> is a first Can I change this?

That's because of the Reply-All nature of the list.  If you
subscribe to the list as opposed to a newsgroup, you should only get a
single copy of the response, but using a real email address on a
newsgroup means that you'll still get copies in addition to the posts
to the newsgroup.

By the way, you're probably the first person aside from myself
here from NEPA.

-- 

More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to this group....a continuation

2008-10-13 Thread Wolf
 Gary <[EMAIL PROTECTED]> wrote: 
> I posted that I was new to php and had a nice warm responce, however I am 
> now getting these responses in my email box.  Is this something that I am 
> doing? I read and contribute to other news groups on a daily basis and this 
> is a first Can I change this?

Nope, you post and pretty much people will respond to the list and sometimes 
include the other posters to that message.

If you are just going to read this group through the web or another interface, 
set up your email to filter the messages.

HTH,
Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New to this group....a continuation

2008-10-13 Thread Boyd, Todd M.
> -Original Message-
> From: Gary [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2008 11:58 AM
> To: php-general@lists.php.net
> Subject: [PHP] New to this groupa continuation
> 
> I posted that I was new to php and had a nice warm responce, however I
> am
> now getting these responses in my email box.  Is this something that I
> am
> doing? I read and contribute to other news groups on a daily basis and
> this
> is a first Can I change this?

It is the convention of this list that the original author be CC'd (or
the list CC'd, however you choose to look at it) upon reply, since it is
not required that one subscribe to the list in order to post to it. Just
ask in your posts that you not receive any personal replies, and I'm
sure everyone will be more than happy to oblige.


Todd Boyd
Web Programmer




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Top/bottom posting holy war *cringe* (was: New to PHP)

2008-10-13 Thread Boyd, Todd M.
> -Original Message-
> From: TG [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2008 11:44 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Top/bottom posting holy war *cringe* (was: New to
> PHP)
> 
> I concede only that the PHP list has a requested style (bottom
> posting).  I
> disagree on it's usefulness OVER top posting.
> 
> I'm perfectly able to read top or bottom posted messages with nearly
> equal
> fluidity.  I find top posting to be more fluid and useful.  I've never
> quite sure why this becomes a holy war.  Why can't some people do it
> one
> way and others do it the other way?  It's nice when everyone does it
> the
> same way, but with the indenting/prefixing lines of replies, it's easy
> enough to see what the last message was that the current top or bottom
> posted reply goes to.
> 
> Because this is such a hot button issue, I cringed when I saw it
> brought up
> as a response to a new member saying "Hi" and looking for PHP coding
> recommendations because it always leads to these discussions.  No good
> can
> come of even discussing it or bringing it up except to show people who
> aren't aware, that there IS a choice in the matter.

So.. you concede to ignore the requested style, then?

As for near-equal fluidity.. I don't believe you. Plainly and simply, I
do not believe your claim. That is, of course, unless you've been
reading bottom-to-top since you were a child in some bizarre psychology
experiment placed on your shoulders by your parents...

It boils down to this: if you've been participating in the discussion
adamantly, then yes--top posting probably won't throw you off. However,
for people who are jumping in the middle (perhaps they saw a keyword
related to something they are working on, or they just joined the list,
etc.) it can become quite confusing. This is a mailing list. On top of
that (no pun intended), it is a public mailing list. As such, there will
be many individuals reading conversations without having been around for
the start of them.

More confusing still is the "some do it this way, some do it that way"
proposal you have issued. When messages are replied to using both
conventions, the flow of the conversation looks like a seismic gauge
during an earthquake.


Todd Boyd
Web Programmer

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Little regex help please...

2008-10-13 Thread Eric Butera
On Mon, Oct 13, 2008 at 12:52 PM, Boyd, Todd M. <[EMAIL PROTECTED]> wrote:
>> -Original Message-
>> From: Ryan S [mailto:[EMAIL PROTECTED]
>> Sent: Monday, October 13, 2008 11:33 AM
>> To: php php
>> Subject: [PHP] Little regex help please...
>>
>> Hello!
>>
>> Here's a regex that I got off the web that I am trying to modify for
> my
>> needs, I suck at regex so desperately need some help.
>>
>> Basically, am trying to get a remote webpage and get the value between
>> the  tags, note that it should get the values regardless if
>>  is upper or lower case (case insensitive)
>>
>> > $data =
>> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
>> preg_match('/#([^<]*)#/iU',$data,$match);
>> $title=$match[1];
>> echo $title;
>> ?>
>>
>> This is the error that i am getting when running the above:
>>
>> Warning: preg_match() [function.preg-match]: Unknown modifier 't' in
>> C:\wamp\www\ezee\tests\get
>> _remote_title.php on line 3
>
> Ryan,
>
> I don't believe you need both the / and the # for delimiters in your
> RegEx. Try using just # (since / is actually going to be in the text
> you're searching for) like this:
>
>   $data =
> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
>  preg_match('#([^<]*)#iU', $data, $match);
>  $title = $match[1];
>  echo $title;
> ?>
>
> HTH,
>
>
> Todd Boyd
> Web Programmer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

You can also escape the / like \/.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] New to this group....a continuation

2008-10-13 Thread Gary
I posted that I was new to php and had a nice warm responce, however I am 
now getting these responses in my email box.  Is this something that I am 
doing? I read and contribute to other news groups on a daily basis and this 
is a first Can I change this?

Thanks

Gary




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Top/bottom posting holy war *cringe* (was: New to PHP)

2008-10-13 Thread Davi Vidal
On Monday 13 October 2008 13:44:27 TG wrote:
> I concede only that the PHP list has a requested style (bottom posting).  I
> disagree on it's usefulness OVER top posting.
>

So, this is the only list that you read.

-- 
Davi Vidal
--
E-mail: davividal at siscompar dot com dot br
MSN   : davividal at msn dot com
GTalk : davividal at gmail dot com
Skype : davividal
YIM   : davi_vidal
ICQ   : 138815296


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Little regex help please...

2008-10-13 Thread Boyd, Todd M.
> -Original Message-
> From: Ryan S [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2008 11:33 AM
> To: php php
> Subject: [PHP] Little regex help please...
> 
> Hello!
> 
> Here's a regex that I got off the web that I am trying to modify for
my
> needs, I suck at regex so desperately need some help.
> 
> Basically, am trying to get a remote webpage and get the value between
> the  tags, note that it should get the values regardless if
>  is upper or lower case (case insensitive)
> 
>  $data =
> file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
> preg_match('/#([^<]*)#/iU',$data,$match);
> $title=$match[1];
> echo $title;
> ?>
> 
> This is the error that i am getting when running the above:
> 
> Warning: preg_match() [function.preg-match]: Unknown modifier 't' in
> C:\wamp\www\ezee\tests\get
> _remote_title.php on line 3

Ryan,

I don't believe you need both the / and the # for delimiters in your
RegEx. Try using just # (since / is actually going to be in the text
you're searching for) like this:

http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
 preg_match('#([^<]*)#iU', $data, $match);
 $title = $match[1];
 echo $title;
?>

HTH,


Todd Boyd
Web Programmer

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Top/bottom posting holy war *cringe* (was: New to PHP)

2008-10-13 Thread TG
I concede only that the PHP list has a requested style (bottom posting).  I 
disagree on it's usefulness OVER top posting.

I'm perfectly able to read top or bottom posted messages with nearly equal 
fluidity.  I find top posting to be more fluid and useful.  I've never 
quite sure why this becomes a holy war.  Why can't some people do it one 
way and others do it the other way?  It's nice when everyone does it the 
same way, but with the indenting/prefixing lines of replies, it's easy 
enough to see what the last message was that the current top or bottom 
posted reply goes to.

Because this is such a hot button issue, I cringed when I saw it brought up 
as a response to a new member saying "Hi" and looking for PHP coding 
recommendations because it always leads to these discussions.  No good can 
come of even discussing it or bringing it up except to show people who 
aren't aware, that there IS a choice in the matter.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread TG
The problem with pointing out the pros and cons is that it will lead to 
another holy war. :)

- Original Message -
From: Micah Gersten <[EMAIL PROTECTED]>
To: PHP General 
Date: Mon, 13 Oct 2008 10:48:34 -0500
Subject: Re: [PHP] New to PHP

> The problem with bottom posting is that if you follow the conversation,
> you have to scroll to find the new content.  I guess if you trim and
> bottom post it's not so bad.
> 
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
> 
> 
> 
> Wolf wrote:
> > By Bottom Posting (common when on a mailing list or NG) it gives greater 
context as you read through the previous posts and by the time of getting 
to where the new response is, it is in sync.  No skipping back and forth to 
read to get the context.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Little regex help please...

2008-10-13 Thread Ryan S
Hello!

Here's a regex that I got off the web that I am trying to modify for my needs, 
I suck at regex so desperately need some help.

Basically, am trying to get a remote webpage and get the value between the 
 tags, note that it should get the values regardless if  is upper 
or lower case (case insensitive)

http://www.youtube.com/watch?v=oQ2dKXGAjNg";);
preg_match('/#([^<]*)#/iU',$data,$match);
$title=$match[1]; 
echo $title;
?>

This is the error that i am getting when running the above:

Warning: preg_match() [function.preg-match]: Unknown modifier 't' in 
C:\wamp\www\ezee\tests\get
_remote_title.php on line 3

TIA,
Ryan




 --
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New to PHP

2008-10-13 Thread Boyd, Todd M.
> -Original Message-
> From: Micah Gersten [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2008 10:49 AM
> To: PHP General
> Subject: Re: [PHP] New to PHP
> 
> The problem with bottom posting is that if you follow the conversation,
> you have to scroll to find the new content.  I guess if you trim and
> bottom post it's not so bad.
> 
> Wolf wrote:
> > By Bottom Posting (common when on a mailing list or NG) it gives
> greater context as you read through the previous posts and by the time
> of getting to where the new response is, it is in sync.  No skipping
> back and forth to read to get the context.

The list, however, disagrees with you:

3. Do not top post. Place your answer underneath anyone you wish to quote and 
remove any previous comment that is not relevant to your post.

That is taken from http://us3.php.net/reST/php-src/README.MAILINGLIST_RULES . 
Sure, it's labeled as "more of a guideline"... but it is irrefutable proof that 
yes, the mailing list rules DO discuss top posting--and they frown on it.

As for having to scroll to read the new content--first of all, you sound very 
lazy. Second of all, it shouldn't be that big of a deal if people are properly 
trimming their messages.

I might also note:

7. Please configure your email client to use a real name and keep message 
signatures to a maximum of 2 lines if at all necessary.

*cough* ;)


Todd Boyd
Web Programmer


Re: [PHP] New to PHP

2008-10-13 Thread Wolf
 Daniel Brown <[EMAIL PROTECTED]> wrote: 
> On Mon, Oct 13, 2008 at 11:45 AM, TG <[EMAIL PROTECTED]> wrote:
> > I don't want to get into a bottom vs top posting debate.  Just know that 
> > some
> > of us prefer top posting.   There's no right/wrong answer to this.
> 
> There is no debate.  There is a right and wrong answer.  Sometimes
> people just need a refresher.
> 
> http://www.php.net/reST/php-src/README.MAILINGLIST_RULES
> 
> QUOTE:
> 3. Do not top post. Place your answer underneath anyone you wish to
> quote and remove any previous comment that is not relevant to your
> post.
> 
> This is also addressed in the "Netiquette" RFC (1855).

See, and when you reply, make sure to cut the 10 lines of dan's sig file off.  

Well said Dan!  :) 

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Daniel Brown
On Mon, Oct 13, 2008 at 11:45 AM, TG <[EMAIL PROTECTED]> wrote:
> I don't want to get into a bottom vs top posting debate.  Just know that some
> of us prefer top posting.   There's no right/wrong answer to this.

There is no debate.  There is a right and wrong answer.  Sometimes
people just need a refresher.

http://www.php.net/reST/php-src/README.MAILINGLIST_RULES

QUOTE:
3. Do not top post. Place your answer underneath anyone you wish to
quote and remove any previous comment that is not relevant to your
post.

This is also addressed in the "Netiquette" RFC (1855).

-- 

More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Stut

On 13 Oct 2008, at 16:48, Micah Gersten wrote:

Wolf wrote:
By Bottom Posting (common when on a mailing list or NG) it gives  
greater context as you read through the previous posts and by the  
time of getting to where the new response is, it is in sync.  No  
skipping back and forth to read to get the context.


The problem with bottom posting is that if you follow the  
conversation,

you have to scroll to find the new content.  I guess if you trim and
bottom post it's not so bad.


The major benefit of bottom posting is providing easy-to-read context  
to each message. This is important for those of us on many lists, for  
times when you missed an earlier part of a conversation or when people  
are reading your messages in archives.


At the end of the day it's beneficial to the community at large if  
each individual message can stand on its own. Judicious trimming and  
bottom-posting ensures this and makes list archives more valuable as a  
reference for Googlers.


Of course that's just my opinion and I know many people disagree but  
on this issue discussion is generally pointless since it's a religious  
bike shed.


Praise FSM!

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New to PHP

2008-10-13 Thread Jay Blanchard
[snip]
I don't want to get into a bottom vs top posting debate.  Just know that
some of us prefer top posting.   There's no right/wrong answer to this.
[/snip]

Consider how this would read if I posted above your entry.

But I have trimmed quite nicely thank you! :)

 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New to PHP

2008-10-13 Thread Juan Jose Rosales Rodriguez
Ok thank you,  i try learn yor post, and make meny aport, for the list, 
apologize me  for my english, i am new  in this theme but in php i have 
experience. 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New to PHP

2008-10-13 Thread Juan Jose Rosales Rodriguez
 
 
Hola.
 
"No son los años los que te enseñan sobre la vida, sino como vives en la vida 
los años"
 Universidad de las Ciencias Informáticas
   Juan José Rosales Rodriguez 
 Tel: 02366792 (Gr) - 078358458 (UCI) 



De: Micah Gersten [mailto:[EMAIL PROTECTED]
Enviado el: lun 13.10.2008 11:48
Para: PHP General
Asunto: Re: [PHP] New to PHP



The problem with bottom posting is that if you follow the conversation,
you have to scroll to find the new content.  I guess if you trim and
bottom post it's not so bad.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com  



Wolf wrote:
> By Bottom Posting (common when on a mailing list or NG) it gives greater 
> context as you read through the previous posts and by the time of getting to 
> where the new response is, it is in sync.  No skipping back and forth to read 
> to get the context.
>
>  

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Wolf

 Micah Gersten <[EMAIL PROTECTED]> wrote: 
> The problem with bottom posting is that if you follow the conversation,
> you have to scroll to find the new content.  I guess if you trim and
> bottom post it's not so bad.
> 
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
> 
> 
> 
> Wolf wrote:
> > By Bottom Posting (common when on a mailing list or NG) it gives greater 
> > context as you read through the previous posts and by the time of getting 
> > to where the new response is, it is in sync.  No skipping back and forth to 
> > read to get the context.
> >
> 

Until very recently, everyone was up to speed and trimmed/bottom posted.  It 
does make for better contextual understanding.  Otherwise you have to scroll to 
the bottom and read UP to make sense of the whole of a Post.

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Micah Gersten
The problem with bottom posting is that if you follow the conversation,
you have to scroll to find the new content.  I guess if you trim and
bottom post it's not so bad.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Wolf wrote:
> By Bottom Posting (common when on a mailing list or NG) it gives greater 
> context as you read through the previous posts and by the time of getting to 
> where the new response is, it is in sync.  No skipping back and forth to read 
> to get the context.
>
>   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread TG
I don't want to get into a bottom vs top posting debate.  Just know that some 
of us prefer top posting.   There's no right/wrong answer to this.

Trimming is always good, though.

I second the recommendations for this mailing list as a good source (as well 
as reading what's posted and seeing if you know or can find out the answer) 
as well as php.net.  The online documentation has tons of great code 
examples.

The best way to learn is really by doing.  Think of a project or exercise 
you'd like to try and see if you can do it in PHP.

One of the best things you can learn as you go, is when it's appropriate to 
use PHP and when it isn't.  Sometimes you can solve your problems with 
simple HTML.  PHP can be useful in many situations, though.  Simple 
situations to some very complex ones.

Also, if you come from a programming background, chances are PHP will 
accomodate whatever programming style you're used to but also remember that 
there are so many pre-made functions in PHP to do so many things, you may 
end up discovering that a function you thought you had to write could be 
done with a simple PHP command.

I worked with a guy once who came from a C programming background.  He wrote 
many functions that he didn't need to because he assumed PHP was as sparse 
as a "real programming language".  

At any rate, you'll learn tons as you go along and probably look back at your 
early efforts and say "What was I thinking?".  Don't worry about it, comes 
with the territory.

-TG

- Original Message -
From: Wolf <[EMAIL PROTECTED]>
To: Gary <[EMAIL PROTECTED]>
Cc: php-general@lists.php.net
Date: Mon, 13 Oct 2008 11:18:08 -0400
Subject: Re: [PHP] New to PHP

> 
>  Gary <[EMAIL PROTECTED]> wrote: 
> > Well...thank you all for the warm and friendly welcome, I will probably 
try 
> > to steer one of my projects to php (or at least a portion of) in a short 
> > while.
> > 
> 
> 
> Gary, one thing to keep in mind is to BOTTOM POST and TRIM your posts.
> 
> By Bottom Posting (common when on a mailing list or NG) it gives greater 
context as you read through the previous posts and by the time of getting 
to where the new response is, it is in sync.  No skipping back and forth to 
read to get the context.
> 
> Trimming is appropriate when addressing a specific entry or when cutting 
off Dan's 12 line signature block to reply to a message.  ;)
> 
> And yeah, you'll find a number of us aren't as serious as others may like.  
:)
> 
> Welcome to the list.  I also keep www.php.net handy and a general rule of 
thumb when using Firefox if you have the google search plug-in running is 
to use "php: " where  is what you are looking to do.  
By prefacing the search with php: google tends to give greater responses 
since it looks for PHP first and then the question.
> 
> HTH.
> Wolf


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Wolf

 Gary <[EMAIL PROTECTED]> wrote: 
> Well...thank you all for the warm and friendly welcome, I will probably try 
> to steer one of my projects to php (or at least a portion of) in a short 
> while.
> 


Gary, one thing to keep in mind is to BOTTOM POST and TRIM your posts.

By Bottom Posting (common when on a mailing list or NG) it gives greater 
context as you read through the previous posts and by the time of getting to 
where the new response is, it is in sync.  No skipping back and forth to read 
to get the context.

Trimming is appropriate when addressing a specific entry or when cutting off 
Dan's 12 line signature block to reply to a message.  ;)

And yeah, you'll find a number of us aren't as serious as others may like.  :)

Welcome to the list.  I also keep www.php.net handy and a general rule of thumb 
when using Firefox if you have the google search plug-in running is to use 
"php: " where  is what you are looking to do.  By prefacing 
the search with php: google tends to give greater responses since it looks for 
PHP first and then the question.

HTH.
Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Gary
Well...thank you all for the warm and friendly welcome, I will probably try 
to steer one of my projects to php (or at least a portion of) in a short 
while.

One of the things a client wants is a "landing page", so I am assuming that 
php might come in handy for that...

Thank you all and once I get in deeper I'm sure I will have a lot of 
quesitons.

Thanks again

Gary
""Daniel Brown"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>Welcome to the list, Gary.
>
> On Mon, Oct 13, 2008 at 10:01 AM, Gary <[EMAIL PROTECTED]> wrote:
>> Sorry if this is a dup, but I posted and it seemed to get lost
>
>Both came through.  Sometimes it just takes a minute or two, and
> you shouldn't get a copy of your own message.
>
>> I am just learning php, and I like to use newsgroups to suppliment the
>> learning process.
>>
>> Can anyone reccomend a good source for information to a newbie and is 
>> this a
>> good forum for my level? or is there another one you might suggest?
>
>Here and http://www.phpbuilder.com/ are the two resources I
> recommend most frequently.
>
> -- 
> 
> More full-root dedicated server packages:
> Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
> Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
> Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
> Dedicated servers, VPS, and hosting from $2.50/mo. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New to PHP

2008-10-13 Thread Juan Jose Rosales Rodriguez
He i not speak very good englis, pliss can you tel me abaout list in spanich?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Daniel Brown
Welcome to the list, Gary.

On Mon, Oct 13, 2008 at 10:01 AM, Gary <[EMAIL PROTECTED]> wrote:
> Sorry if this is a dup, but I posted and it seemed to get lost

Both came through.  Sometimes it just takes a minute or two, and
you shouldn't get a copy of your own message.

> I am just learning php, and I like to use newsgroups to suppliment the
> learning process.
>
> Can anyone reccomend a good source for information to a newbie and is this a
> good forum for my level? or is there another one you might suggest?

Here and http://www.phpbuilder.com/ are the two resources I
recommend most frequently.

-- 

More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP

2008-10-13 Thread Jason Pruim


On Oct 13, 2008, at 10:01 AM, Gary wrote:


Sorry if this is a dup, but I posted and it seemed to get lost

I am just learning php, and I like to use newsgroups to suppliment the
learning process.

Can anyone reccomend a good source for information to a newbie and  
is this a
good forum for my level? or is there another one you might  
suggest?



hi Gary,

This is a great place to cut your teeth on php... I was in your boat  
about a year ago, and came to this list and have learned a ton from  
people here... And hopefully I've helped a few people as well.


One thing that I could suggest if you don't have a project you are  
working on currently, every time someone posts a question to the list,  
try and create a solution for it. It not only gets you into the code  
in significant ways that you are more likely to remember, it gives you  
one heck of a code library pretty quickly.


If you have questions, please feel free to post them, but please make  
sure to include the code, php version, and the actual error you are  
seeing. That way we can help you step through it.


Thanks Gary!


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] New to PHP

2008-10-13 Thread Gary
Sorry if this is a dup, but I posted and it seemed to get lost

I am just learning php, and I like to use newsgroups to suppliment the 
learning process.

Can anyone reccomend a good source for information to a newbie and is this a 
good forum for my level? or is there another one you might suggest?

Thanks

Gary 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] New to PHP

2008-10-13 Thread Gary
I am just starting to learn php, and typically I use newsgroups to 
suppliment the learning process.

Does anyone have any sources that you would reccommend to me and is this the 
best NG for me to monitor?...or is there another you might suggest?

Thanks

Gary 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Remove index.php from url

2008-10-13 Thread Boyd, Todd M.
> -Original Message-
> From: Ashley Sheridan [mailto:[EMAIL PROTECTED]
> Sent: Saturday, October 11, 2008 11:44 AM
> To: Shawn McKenzie
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Re: Remove index.php from url
> 
> On Sat, 2008-10-11 at 11:02 -0500, Shawn McKenzie wrote:
> > Shawn McKenzie wrote:
> > > OOzy Pal wrote:
> > >> Hello,
> > >>
> > >> I expect that this question been beaten to death. I googled for
> many hours
> > >> and all what I found is related to one CMS or another. I want to
> do is to
> > >> make a very very very simple index.php that when is it called it
> > >> automatically detect the page and load it. For example, when I
> call
> > >>
> > >> www.xyz.com/index.php/company, it calls for company.html. I have
> made that
> > >> index.php. Now I need to remove this index.php from the url.
> > >>
> > >> Can you help?
> > >>
> > > mod_rewite if you use Apache.  In the simplest form (not tested):
> > >
> > > .htaccess
> > >
> > > RewriteRule ^index\.php\/(.*)$ $1 [L,NC,NS]
> > >
> > > HTH
> > > -Shawn
> > Scrub that.  The rule is backwards.  But mod_rewrite is the answer.
> >
> > -Shawn
> >
> Incidentally, does anyone know how this would be achieved on IIS?
We've
> got a site at work that's running off a CMS I knocked up, but they'd
> prefer the URLs to look proper, without the query string.

http://www.codeplex.com/IIRF - Ionic ISAPI Rewrite Filter

It's free under the Ms-PL (Microsoft Permissive License), and uses
Regular Expressions. Took me a while of rooting through crappy URL
filters that charge $500+ just for RegEx functionality to find this gem.
I've tested it in a few different situations here at work, and it does
the job.

HTH,


Todd Boyd
Web Programmer

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and SQL Server

2008-10-13 Thread Andrew Ballard
On Tue, Sep 23, 2008 at 10:17 AM, Jason <[EMAIL PROTECTED]> wrote:
> At 15:05 23/09/2008, you wrote:
>
> [snip]
>
>> So, I'm left wondering what that leaves. Is there anything currently
>> available that could be considered stable for a production
>> environment, supports parameterized queries and is not slated to be
>> mothballed in the near future?
>
> Have you considered the MS "official" php extension available from
> http://www.microsoft.com/sql/technologies/php/default.mspx ?
>
> We've played with it here and it seems quite good. It requires SQL 2005 or
> above, so it may not be good for you. YMMV.
>
> I have to admit we've yet to seriously load-test it, but at least we finally
> have Unicode support from PHP to MSSQL. :)
>
> HTH
> J

I know it's been a while since I started this thread, but I wanted to
say thanks for the suggestion and post an update for the archives. I
downloaded the Sqlsrv library from Microsoft. It required us to
install the SQL Native Client (ODBC driver for SQL 2005), but it
connects just fine to our SQL 2K database. We put it into production
on this site a couple weeks ago when the site was crashing routinely
using both PDO_MSSQL and PDO_ODBC due to a (possibly misconfigured?)
spider that was hitting (I should say hammering) our site.  Since
switching, the site has not crashed once. The Microsoft extension also
implements connection pooling internally which is cool.


Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RewriteRule

2008-10-13 Thread Yeti
You are absoloodle right about that. Although I'm not sure about their
greediness, which might be different.
I prefer the '{0,}' in my rewrite rules because I usually define the
max-length to prevent code injection.

eg.

# to make sure only the first 8 chars get passed on to PHP
RewriteRule ^blog/([^/]{0,8} index.php?a=$1 [NC,QSA,L]

So that's why they ended up in my reply.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RewriteRule

2008-10-13 Thread Per Jessen
Yeti wrote:

>> What's the point of using '{0,}' instead '*' ?
> 
> Well the thing is that with the {0,} more REQUEST_URIs are valid:
> eg.
> /blog
> /blog/
> /blog/17
> /blog/17/
> /blog/17/0
> /blog/17/0/

Yeti, 

I must be slow today - I still can't see the difference between 

'{0,}'  (= 0 or more instances of the previous) 

and

'*' (= 0, 1 or more instances of the previous)



/Per Jessen, Zürich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RewriteRule

2008-10-13 Thread Yeti
>Jessen wrote:
>RewriteRule ^blog/([^/]+)/([^/]+)/ blog.php?getparam1=$1&getparam2=$2 
>[NC,QSA,L]

Of course, your truely does what the OP asked for + it cuts of all
strings after the last /

/A yeti

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RewriteRule

2008-10-13 Thread Yeti
> What's the point of using '{0,}' instead '*' ?

Well the thing is that with the {0,} more REQUEST_URIs are valid:
eg.
/blog
/blog/
/blog/17
/blog/17/
/blog/17/0
/blog/17/0/

AND additional characters get ignored (like when it is necessary to
reload content with javascript, due to caching issues)

/blog/17/0/ignored_string

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Alternative to HTTP_REFERER?

2008-10-13 Thread Eric Butera
On Mon, Oct 13, 2008 at 3:09 AM, Per Jessen <[EMAIL PROTECTED]> wrote:
> Ashley Sheridan wrote:
>
>> You should look at developing the app so that it doesn't rely on
>> referrer information, as this is unpredictable as you've seen.
>
> Yep, that's what I did too.  Can't remember exactly what I did, but I
> suspect it involved setting info in the session,
>
>> Not just with IE as well, because some proxy servers have been known
>> to strip out this information, and individual users can turn this off
>> if they know how.
>
> That is/was not a concern in my case.
>
>> What are you doing with it? Maybe there's another solution to the
>> problem.
>
> My problem was that I needed to use the HTTP_REFERER as the URL in a 303
> redirect after a POST.  From page 1 (list of items), the user would
> click on an item and the new url would be set through javascript.  On
> page 2 (item detail), the user would then POST some action, after which
> he should be returned to the original list at the same place.  (The
> list is a window of e.g. 500 items from a list of several thousands).
>
> Anyway, I don't know what the OPs was trying do with HTTP_REFERER.
>
>
> /Per Jessen, Zürich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I don't bother with the referer at all.  Whenever I've needed this
information I either:

1) store it in the session
2) store it in the url as a ?continue=url

Lately I've been having to build a lot of different ways of getting to
the same edit form.  So to get the user back to where they came from
this previous url is quite important.  Also it's imperative to
validate that the $_GET['url'] is a url that your system can handle
though.

http://www.owasp.org/index.php/Open_redirect


[PHP] Re: [Semi-OT] Tonns of jobs available

2008-10-13 Thread Michelle Konzack
Am 2008-10-10 11:13:11, schrieb tedd:
> I just landed a client who had a very bad experience with rentacoder. 
> So, it appears that the 2nd-world nation programming experience is 
> providing some kick-back work for honest programmers. At least I 
> receive more business from people who have had problems with "cheap" 
> programming than those high-profile sites who sell "cheap" 
> programming serves.

This happen to me too.  And I am not alone, since there are some  coders
which have unbelivable evaluations...

...and of course, they have there price.  I even know Indian and Russian
coders "expensive" like me, but we have  our  customers  and  they  come
always back if something is needed...

A while back I had a stupud problem in C coding... I wasted 2 Weeks on a
solution then I have offered the job on GetACoder  for  50 US$...  Goten
a 23y old guy from Pakistan and the job was done in 30 Minutes...

Not realy funny for me.  

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Setcookie()

2008-10-13 Thread Ben Stones
Hi,

My problem was a headers already sent error, which I fixed by redirecting
the form POST to a seperate file instead of the same login.php. Thanks for
all your help!

2008/10/13 Stut <[EMAIL PROTECTED]>

> On 12 Oct 2008, at 23:51, Micah Gersten wrote:
>
>> The question is, why aren't you using a session variable instead of
>> cookies?  That's one of the greatest features of PHP.
>>
>
> If you're able to use cookies instead of sessions, and the size of the data
> you're storing is fairly small, it's always better to use cookies. Sessions
> complicate scalability.
>
> Ben: The *only* restriction around use of setcookie is that there cannot be
> any *output* before it. You can have as much code as you want as long as it
> doesn't output anything. If your script outputs content before your business
> logic is done then (IMHO) it's wrong and needs to be rewritten anyway,
> regardless of the need to set a cookie.
>
> -Stut
>
> --
> http://stut.net/
>
>  Ben Stones wrote:
>>
>>> What I mean is I cannot use setcookie, I need to check if user
>>> credentials
>>> are correct first (which is BEFORE setcookie) and if so, set a cookie. I
>>> can't do that unless setcookie is first, but I need to check if the user
>>> credentials is correct. Furthermore I cannot use setcookie in the header
>>> as
>>> I want to display a message saying that they have successfully logged in
>>> in
>>> the correct area of my template.
>>>
>>> 2008/10/11 Per Jessen <[EMAIL PROTECTED]>
>>>
>>>
>>>  Ben Stones wrote:


  I'm using cookies for my website script and upon users logging in a
> cookie is set. Problem for me is that the cookie doesn't work due to
> headers already sent. Is there anyway of fixing this because, there is
> no possible way of adding setcookie() to the top of the PHP file when
> the cookie is holding the username from the POSTed form.
>
>  This must be a self imposed restriction on your side, coz' otherwise I
 see no problem.


 /Per Jessen, Zürich


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




>>>
>>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>


Re: [PHP] Setcookie()

2008-10-13 Thread Stut

On 12 Oct 2008, at 23:51, Micah Gersten wrote:

The question is, why aren't you using a session variable instead of
cookies?  That's one of the greatest features of PHP.


If you're able to use cookies instead of sessions, and the size of the  
data you're storing is fairly small, it's always better to use  
cookies. Sessions complicate scalability.


Ben: The *only* restriction around use of setcookie is that there  
cannot be any *output* before it. You can have as much code as you  
want as long as it doesn't output anything. If your script outputs  
content before your business logic is done then (IMHO) it's wrong and  
needs to be rewritten anyway, regardless of the need to set a cookie.


-Stut

--
http://stut.net/


Ben Stones wrote:
What I mean is I cannot use setcookie, I need to check if user  
credentials
are correct first (which is BEFORE setcookie) and if so, set a  
cookie. I
can't do that unless setcookie is first, but I need to check if the  
user
credentials is correct. Furthermore I cannot use setcookie in the  
header as
I want to display a message saying that they have successfully  
logged in in

the correct area of my template.

2008/10/11 Per Jessen <[EMAIL PROTECTED]>



Ben Stones wrote:



I'm using cookies for my website script and upon users logging in a
cookie is set. Problem for me is that the cookie doesn't work due  
to
headers already sent. Is there anyway of fixing this because,  
there is
no possible way of adding setcookie() to the top of the PHP file  
when

the cookie is holding the username from the POSTed form.

This must be a self imposed restriction on your side, coz'  
otherwise I

see no problem.


/Per Jessen, Zürich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: HTML5 canvas tag

2008-10-13 Thread Richard Heyes
Hi,

> I'm not very familiar with the whole thing yet

I think that's a common position.

> but after looking at
> your site I find it quite interesting.
> So is it possible to render 3d vector based objects in the canvas and
> if so an entire 3d based website?

Well before you start calling the methods which actually do something,
you need to get a "context" and specify '2d' (the only one that's
supported right now), so the door has been left open for a '3d'
context. And if it doesn't materialise, then no biggie.

> Are there any 3d libraries yet like OpenGL for applications?

Don't think so. Though there is a 3d Doom-esque game which you'll find
if you look around.

> It would be quite handy to describe 3d/2d objects or styles with a
> language like CSS. Do you think that will be possible in the near
> future?

Probably not. But the drawing API is very easy to use with methods
like lineTo() and arc() etc. The drawing is all done using Javascript
so if you're familiar with that, then you're in.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HTML5 canvas tag

2008-10-13 Thread Per Jessen
Ashley Sheridan wrote:

> Hmm, it doesn't mention which versions of the browsers it lists are
> capable of displaying the canvas tag. I'm still using Firefox 2 on
> this computer, and all I got was 5 horizontal bands of grey and blue.

Same here. 


/Per Jessen, Zürich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: HTML5 canvas tag

2008-10-13 Thread Richard Heyes
> Probably not Firefox 1.5.  I have FF 1.5 without _any_ add-ons here and
> all I got were the same "5 horizontal bands of grey and blue."

So it does support it, bit not very well... :-)

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HTML5 canvas tag

2008-10-13 Thread Richard Heyes
>Check your addons and such, Ashley.  Gecko itself (the HTML
> rendering engine used in Firefox) has supported  since 1.8 I
> believe, which equated to Firefox 1.5.

Older versions may well have issues though. An example of
inconsistencies would that FF3 doesn't seem to have a problem with
negative sizes for rectangles, whereas Chrome did. This one's easy to
fix though.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: HTML5 canvas tag

2008-10-13 Thread Richard Heyes
> very fine work mr heyes, I've been most impressed by you're RGraph - a great
> use for the canvas!

Thank you!

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Alternative to HTTP_REFERER?

2008-10-13 Thread Per Jessen
Ashley Sheridan wrote:

> You should look at developing the app so that it doesn't rely on
> referrer information, as this is unpredictable as you've seen. 

Yep, that's what I did too.  Can't remember exactly what I did, but I
suspect it involved setting info in the session,

> Not just with IE as well, because some proxy servers have been known
> to strip out this information, and individual users can turn this off
> if they know how.

That is/was not a concern in my case. 

> What are you doing with it? Maybe there's another solution to the
> problem.

My problem was that I needed to use the HTTP_REFERER as the URL in a 303
redirect after a POST.  From page 1 (list of items), the user would
click on an item and the new url would be set through javascript.  On
page 2 (item detail), the user would then POST some action, after which
he should be returned to the original list at the same place.  (The
list is a window of e.g. 500 items from a list of several thousands). 

Anyway, I don't know what the OPs was trying do with HTTP_REFERER. 


/Per Jessen, Zürich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php