php-general Digest 18 Mar 2008 10:02:13 -0000 Issue 5354
Topics (messages 271695 through 271701):
Re: help on using 'request_uri' to make a front-end site
271695 by: Shawn McKenzie
271699 by: Donn Ingle
271701 by: Richard Heyes
Re: Help for openssl_pkcs7_verify function
271696 by: Stut
Re: Detecting \u0000 in a string...
271697 by: Casey
Re: problem with this regex to remove img tag...
271698 by: Jonathan Crawford
preg-replace-callback problem
271700 by: Khaled Mamdouh
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 ---
Donn Ingle wrote:
> Shawn McKenzie wrote:
>> Use /index.php instead of index.php maybe...
> I assume you meant in the <a> tag. I tried that and the URL (when you
> mouse-over the link) becomes [http://localhost/index.php] which is not
> anywhere near where the files live.
>
> I must say I am rather confused by this situation, but I can fix it by
> always using absolute urls - which is a bit of a pain.
>
> \d
>
Does seem strange. Try:
<head>
<base href="http://localhost/~donn/blah/index.php" />
</head>
Then just use /home, /use1 etc... Might work.
-Shawn
--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:
> Does seem strange. Try:
> <head>
> <base href="http://localhost/~donn/blah/index.php" />
> </head>
> Then just use /home, /use1 etc... Might work.
Right, I'll give it a go. It's not much different from wiring-in a php var
naming the base with {$base}/use1 being the form.
The thing that would help here is if I could get a reliable way to extract
the working 'path' (from an http:// pov) from the $_SERVER array somehow.
Each of them gives a result tantalizingly close to the base, but they get
it wrong in various ways.
Well, thanks for your help.
\d
--- End Message ---
--- Begin Message ---
The thing that would help here is if I could get a reliable way to extract
the working 'path' (from an http:// pov) from the $_SERVER array somehow.
Each of them gives a result tantalizingly close to the base, but they get
it wrong in various ways.
You can use $_SERVER['PHP_SELF'] which will give you the path to the
script or $_SERVER['REQUEST_URI'] (you will probably have to remove the
query string with this), along with either dirname().
--
Richard Heyes
Employ me:
http://www.phpguru.org/cv
--- End Message ---
--- Begin Message ---
On 17 Mar 2008, at 21:34, Carlo Carbone wrote:
I need help for this function to verify a p7m file . The funcion
return
always error value ( -1 ) this is the sintax that I use to verify
the sign
on the file
openssl_pkcs7_verify("prova.p7m", PKCS7_BINARY ,"prova.pdf",
array("c:\cert.pem") );
I 'm a winXP user and the path of PHP is place in the system path as
mentioned in the setup note
why it don't work ? where is the problem ? somebody could help me ?
Just guessing since I'm not familiar with the function, but on a basic
PHP syntax level you need to escape the \...
openssl_pkcs7_verify("prova.p7m", PKCS7_BINARY ,"prova.pdf",
array("c:\\cert.pem") );
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Mon, Mar 17, 2008 at 3:56 AM, Mikey <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I was wondering if anyone here had experienced a simliar problem to mine.
>
> I am updating an Oracle XMLType column with XML built using DOM that is
> populated with values from an Excel spreadsheet saved out as a CSV.
>
> My problem is that for certain (apparently) random rows the xml updated
> will fail with the error:
>
> Warning: oci_execute(): OCIStmtExecute: ORA-31011: XML parsing failed
> ORA-19202: Error occurred in XML processing
> LPX-00217: invalid character 0 (\u0000)
> Error at line 1
> ORA-06512: at "SYS.XMLTYPE", line 5
> ORA-06512: at line 1
> in /path/ob/fu/scated/archive.inc on line 1374
>
> I have googled around and a Java fix for the problem seemed to revolve
> around a null char being left on the end of the XML string, so I tried
> stripping the last char from the string but this did not help. I then
> used an ordUTF8 function I found in the manual notes to see if I could
> find the null in the string - again, no luck.
>
> So my question is whether or not anyone here has a reliable way of
> detcting and removing \u0000 chars from strings?
>
> regards,
>
> Mikey
>
> --
How about:
$str = str_replace("\0", '', $str);
-Casey
--- End Message ---
--- Begin Message ---
Ryan A: i have been messing around with PHP for years but rarely even dipped my
toes into the REGEX part as I think it would be easier for me to learn greek :)
Now that thats over... can anybody recommend a good starting point to learn
regex in baby steps?
Cheers!
R
----------------------
προσπαθήστε εδώ να μάθει τα ελληνικά, σημαίνω regex
http://www.regular-expressions.info/php.html
Jonathan Crawford
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
In url
http://www.php.net/manual/en/function.preg-replace-callback.php
I read this example:
<?php$input = "plain [indent] deep [indent] deeper [/indent] deep [/indent]
plain";function parseTagsRecursive($input){ $regex =
'#\[indent]((?:[^[]|\[(?!/?indent])|(?R))+)\[/indent]#'; if
(is_array($input)) { $input = '<div style="margin-left:
10px">'.$input[1].'</div>'; } return preg_replace_callback($regex,
'parseTagsRecursive', $input);}$output = parseTagsRecursive($input);echo
$output;?>
example does not work if there are more deep statement in var I mean if
$input = "plain [indent] deep [indent] deeper [/indent] deep [/indent] plain
plain [indent] deep [indent] deeper [/indent] deep [/indent] plain
";
it does not work corectly how can I solve this problem
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
--- End Message ---