php-general Digest 14 Aug 2008 11:33:31 -0000 Issue 5623

Topics (messages 278055 through 278067):

Re: regex
        278055 by: Philip Thompson
        278056 by: Micah Gersten
        278057 by: Shawn McKenzie
        278058 by: Boyd, Todd M.
        278059 by: Philip Thompson
        278060 by: Philip Thompson

Re: A dumb question regarding sending email
        278061 by: Ross McKay

On one of my computers, php can't see an external javascript I included
        278062 by: googling1000
        278063 by: Per Jessen
        278064 by: googling1000
        278065 by: Per Jessen
        278066 by: Carlos Medina

php-gd problems on Ubuntu 8.04
        278067 by: Chantal Rosmuller

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Figured it out. Just needed to stretch my brain a lil.

On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:

<?php
function blegh ($subject) {
 // I know this pattern doesn't exactly work
 $pattern = '/(.*).php\?action=([^&].*)/';

$pattern = '/(.*).php\?action=([^&]+)+/';


 preg_match ($pattern, $subject, $matches);
 return $matches;
}

blegh ('somePage.php?action=doSomething&id=');
?>

Ok, the important parts that I need to obtain from this are:

somePage
doSomething

How can you modify the pattern above to grab the action appropriately? Sorry, my regex is a lil rusty!

Thanks in advance,
~Phil

Cheers,
~Philip

--- End Message ---
--- Begin Message ---
Take a look at this function, it'll make things  a little easier:
http://us3.php.net/manual/en/function.parse-str.php

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



Philip Thompson wrote:
> Figured it out. Just needed to stretch my brain a lil.
>
> On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:
>
>> <?php
>> function blegh ($subject) {
>>  // I know this pattern doesn't exactly work
>>  $pattern = '/(.*).php\?action=([^&].*)/';
>
> $pattern = '/(.*).php\?action=([^&]+)+/';
>
>
>>  preg_match ($pattern, $subject, $matches);
>>  return $matches;
>> }
>>
>> blegh ('somePage.php?action=doSomething&id=');
>> ?>
>>
>> Ok, the important parts that I need to obtain from this are:
>>
>> somePage
>> doSomething
>>
>> How can you modify the pattern above to grab the action
>> appropriately? Sorry, my regex is a lil rusty!
>>
>> Thanks in advance,
>> ~Phil
>
> Cheers,
> ~Philip
>

--- End Message ---
--- Begin Message ---
Philip Thompson wrote:
Figured it out. Just needed to stretch my brain a lil.

On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:

<?php
function blegh ($subject) {
 // I know this pattern doesn't exactly work
 $pattern = '/(.*).php\?action=([^&].*)/';

$pattern = '/(.*).php\?action=([^&]+)+/';


 preg_match ($pattern, $subject, $matches);
 return $matches;
}

blegh ('somePage.php?action=doSomething&id=');
?>

Ok, the important parts that I need to obtain from this are:

somePage
doSomething

How can you modify the pattern above to grab the action appropriately? Sorry, my regex is a lil rusty!

Thanks in advance,
~Phil

Cheers,
~Philip

That regex might not always work for you, (&amp;) comes to mind. You might want to look at parse_str() which you can use after parse_url() if needed.

-Shawn

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Shawn McKenzie [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 13, 2008 3:31 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: regex
> 
> Philip Thompson wrote:
> > Figured it out. Just needed to stretch my brain a lil.
> >
> > On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:
> >
> >> <?php
> >> function blegh ($subject) {
> >>  // I know this pattern doesn't exactly work
> >>  $pattern = '/(.*).php\?action=([^&].*)/';
> >
> > $pattern = '/(.*).php\?action=([^&]+)+/';
> >
> >
> >>  preg_match ($pattern, $subject, $matches);
> >>  return $matches;
> >> }
> >>
> >> blegh ('somePage.php?action=doSomething&id=');
> >> ?>
> >>
> >> Ok, the important parts that I need to obtain from this are:
> >>
> >> somePage
> >> doSomething
> >>
> >> How can you modify the pattern above to grab the action
> appropriately?
> >> Sorry, my regex is a lil rusty!
> >>
> >> Thanks in advance,
> >> ~Phil
> >
> > Cheers,
> > ~Philip
> 
> That regex might not always work for you, (&amp;) comes to mind.  You
> might want to look at parse_str() which you can use after parse_url()
> if
> needed.

I think /(.*)\.php\?action=([^&]+(?(&)[^&+]+))/ might be a step in the
right direction for RegExing the additional URL query string parameters.
I haven't tested it... but either way, I thought it was worth mentioning
that the ".php" part should be "\.php" (or "[.]php"), otherwise it will
match "any character followed by php."


Todd Boyd
Web Programmer



--- End Message ---
--- Begin Message ---
On Aug 13, 2008, at 3:31 PM, Shawn McKenzie wrote:

Philip Thompson wrote:
Figured it out. Just needed to stretch my brain a lil.
On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:
<?php
function blegh ($subject) {
// I know this pattern doesn't exactly work
$pattern = '/(.*).php\?action=([^&].*)/';
$pattern = '/(.*).php\?action=([^&]+)+/';
preg_match ($pattern, $subject, $matches);
return $matches;
}

blegh ('somePage.php?action=doSomething&id=');
?>

Ok, the important parts that I need to obtain from this are:

somePage
doSomething

How can you modify the pattern above to grab the action appropriately? Sorry, my regex is a lil rusty!

Thanks in advance,
~Phil
Cheers,
~Philip

That regex might not always work for you, (&amp;) comes to mind. You might want to look at parse_str() which you can use after parse_url() if needed.

-Shawn

That's a good thought. However, I am specifically sending a URL that has not yet been urlencoded, so I know that &amp; won't be occurring.

Thanks,
~Philip


--- End Message ---
--- Begin Message ---
On Aug 13, 2008, at 4:06 PM, Boyd, Todd M. wrote:

-----Original Message-----
From: Shawn McKenzie [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 13, 2008 3:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: regex

Philip Thompson wrote:
Figured it out. Just needed to stretch my brain a lil.

On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:

<?php
function blegh ($subject) {
// I know this pattern doesn't exactly work
$pattern = '/(.*).php\?action=([^&].*)/';

$pattern = '/(.*).php\?action=([^&]+)+/';


preg_match ($pattern, $subject, $matches);
return $matches;
}

blegh ('somePage.php?action=doSomething&id=');
?>

Ok, the important parts that I need to obtain from this are:

somePage
doSomething

How can you modify the pattern above to grab the action
appropriately?
Sorry, my regex is a lil rusty!

Thanks in advance,
~Phil

Cheers,
~Philip

That regex might not always work for you, (&amp;) comes to mind.  You
might want to look at parse_str() which you can use after parse_url()
if
needed.

I think /(.*)\.php\?action=([^&]+(?(&)[^&+]+))/ might be a step in the
right direction for RegExing the additional URL query string parameters. I haven't tested it... but either way, I thought it was worth mentioning that the ".php" part should be "\.php" (or "[.]php"), otherwise it will
match "any character followed by php."


Todd Boyd
Web Programmer

Good call! I so passed over that one. ;)

Thanks,
~Philip


--- End Message ---
--- Begin Message ---
On Wed, 13 Aug 2008 15:46:47 +0000 (UTC), Jonesy wrote:

>I'd've thought with Aussie, Southern Cross-oriented globes, it would be 
>to the _right_ of Kalifornia and _up_ a bit.

Yes, but I was translating from Strine to Wronglish for the North
Americans ;)
-- 
Ross McKay, Toronto, NSW Australia
"I come from a land down under,
 where beer does flow and men chunder" - Men At Work

--- End Message ---
--- Begin Message ---
I have apache and php on Windows.
I have 3 computers. A php file is calling an external .js file.
Two of my computers have no problem calling a .js file, there's only one
machine that doesn't execute functions inside of the .js file.

My .php file has the following line in the beginning of the file:
<script src="myfunctions.js"></script>


My .js file consists of a number of functions written in javascript

I don't know why functions inside .js file doesn't get executed.

I tried copy/paste all the functions inside the .js file to my .php file and
it works.
I don't understand how my machine can't read an external .js file

I'm frustrated. Help will be appreciated!
-- 
View this message in context: 
http://www.nabble.com/On-one-of-my-computers%2C-php-can%27t-see-an-external-javascript-I-included-tp18975937p18975937.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
googling1000 wrote:

> 
> I have apache and php on Windows.
> I have 3 computers. A php file is calling an external .js file.
> Two of my computers have no problem calling a .js file, there's only
> one machine that doesn't execute functions inside of the .js file.
> 
> My .php file has the following line in the beginning of the file:
> <script src="myfunctions.js"></script>
> 
> My .js file consists of a number of functions written in javascript
> 
> I don't know why functions inside .js file doesn't get executed.
> 
> I tried copy/paste all the functions inside the .js file to my .php
> file and it works.

Check your apache log files to make sure your javascript source file is
being loaded. 


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
Hi,

Thanks already for replying.
How do you check for that???
And, what do you have to do to force Apache to load it???



Per Jessen wrote:
> 
> googling1000 wrote:
> 
>> 
>> I have apache and php on Windows.
>> I have 3 computers. A php file is calling an external .js file.
>> Two of my computers have no problem calling a .js file, there's only
>> one machine that doesn't execute functions inside of the .js file.
>> 
>> My .php file has the following line in the beginning of the file:
>> <script src="myfunctions.js"></script>
>> 
>> My .js file consists of a number of functions written in javascript
>> 
>> I don't know why functions inside .js file doesn't get executed.
>> 
>> I tried copy/paste all the functions inside the .js file to my .php
>> file and it works.
> 
> Check your apache log files to make sure your javascript source file is
> being loaded. 
> 
> 
> /Per Jessen, Zürich
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/On-one-of-my-computers%2C-php-can%27t-see-an-external-javascript-I-included-tp18975937p18976152.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
googling1000 wrote:

> 
> Hi,
> 
> Thanks already for replying.
> How do you check for that???
> And, what do you have to do to force Apache to load it???
> 

You're on Windows, right?  Sorry, I don't know anything about Windows.


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
googling1000 schrieb:
I have apache and php on Windows.
I have 3 computers. A php file is calling an external .js file.
Two of my computers have no problem calling a .js file, there's only one
machine that doesn't execute functions inside of the .js file.

My .php file has the following line in the beginning of the file:
<script src="myfunctions.js"></script>


My .js file consists of a number of functions written in javascript

I don't know why functions inside .js file doesn't get executed.

I tried copy/paste all the functions inside the .js file to my .php file and
it works.
I don't understand how my machine can't read an external .js file

I'm frustrated. Help will be appreciated!
Hi,
to check where your log are look at the Apache directory. If you are using a bundle or apache with installer you will find your directory apache/logs there where apache was installed ( The Windows way is easy - for all then doesnt know about windows );-)


Best regards

Carlos

--- End Message ---
--- Begin Message ---

Hi list, 

I have a PHP problem on Ubuntu 8.04, the php-gd package for ubuntu
doesn't use the gd bundles library for security reasons if I understood
this correctly. I solved it by downloading a php-gd fedora rpm and
converting it to .deb with alien. it works for the apache websites but
not for the commandline. I get the follwoing error:


 php /path/to/process.php variable1 variable2

Warning: Wrong parameter count for strpos() in /path/to/config.php on
line 30
JpGraph Error This PHP installation is not configured with the GD
library. Please recompile PHP with GD support to run JpGraph. (Neither
function imagetypes() nor imagecreatefromstring() does exist)ro

does anyone know how to fix this?

regards Chantal


--- End Message ---

Reply via email to