This should work:
^\\ # Don't match if a backslash precedes
\[ # Open bracket
([^\]]+?) # Text, including whitespace
\] # Close bracket
By the way, using a tool called The Regex Coach I solved your problem in
about 10 seconds. For those having regex problems you might
1) Does this mean that I cannot use the $_SESSION[] variable to enter
information into the session?
Sure you can. When you use a custom session handler then setting /
getting the $_SESSION[] variables will use sess_write and sess_read in
order to write/read that information. I think the only
Sherri wrote:
Woah!
Signed up litterally 1 minute ago and I'm already getting spam. From
Advance Credit Suisse Bank
Great. Thanks php.net.
Guess you can't even trust the well known sites not to slam you with spam.
The problem is this list has no active moderator (at least none that
makes
I'm surprised that no one else already replied to this?!?! Anyhow, my
answers are below.
Phil Dowson wrote:
Hi,
I am having a couple of difficulties with a script to parse XML. This may
well be because my 16 month kid was up all night, but I'm banging my head
against a wall right now.
OT: And
John Kaspar wrote:
Try taking the square root of the variable
$sqrt = sqrt($var);
then compare the number of decimal places.
if (strlen(strstr($sqrt,.)) = strlen(strstr($var,.))) {
// perfect
}
Just guessing of course.
I'd do something similar, but a little different:
$sqrt = sqrt($var);
if
Stephen Craton wrote:
I'm in a bit of a pickle. I need to find out if a variable is a perfect
square or not, and this needs to test for decimal numbers as well, such as
2.25. The thing is, the only function I've found in PHP is
gmp_perfect_square() which isn't supported on my web server, and I
We'll probably need source code to help you out with this.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Is there any way to get JUST the user-defined variables in PHP? Problem with
get_defined_vars() is that it contains everything, including server and
environment vars, and there's no easy way to keep just the user-defined vars
part of the array created by get_defined_vars.
Monty
Why not just unset
Out of curiosity, how were you planning on passing session id's?
Through POST variables?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
?php
$starting_vars = get_defined_vars();
//bunch of PHP code...
$current_vars = get_defined_vars();
$user_defined_vars = array_diff($current_vars,$starting_vars);
...
---John Holmes...
Oh I like that... wish I would have suggested that one!
--
PHP General Mailing List (http://www.php.net/)
Motorpsychkill wrote:
Hi all,
Some of my webpages are no longer working with the IE browser after MS
implemented some security patches which disable sending authentication info
through the URL:
http://user:[EMAIL PROTECTED]
This no longer works with IE, but is fine with most other browsers.
Justin Patrin wrote:
Richard Harb wrote:
Uh, I was wrong...
Foreach evaluates only once at initialisation... You can even unset
the array once into the loop and it still works perfectly well (not
that I recommend this as good practice or whatever, just did some
checking to be sure :)
Richard
That
John Doe wrote:
hello, does any know how to conver microsoft word document to pdf via on the
server using php language?? i try to implementing the feature that allow
user to upload microsoft word document to the web server, after the upload,
it automatic covert to pdf file ??? any one done that
germán m. rivera wrote:
Hi all!
Let's say I have a PHP script that needs the user to input some data
during its execution. At the point the data is needed the browser could
be redirected to a new page with a form where the user could enter the
data. But thus is necessary to save the script
Mike R wrote:
Is there a version of Apache 2+ that now works with PHP? Last I checked,
the were incompatible, but recently someone I ran into claimed that the bugs
have been for such a setup.
:)
Thanks,
-MIke
I've been using PHP + Apache 2 for a long time now.
http://www.php.net/install.apache2
A bit like this
$num_args = func_num_args();
$arg_list = func_get_args();
$vars = 'function_to_call(';
for ($i = 0; $i $num_args; $i++) {
$vars .= ($i 0)? ',':'';
$varname = 'variable'.$i;
$$varname = $arg_list[$i];
$vars .= \$$varname;
}
$vars .= ');';
//that leaves you with a string
So my question is how to verify PHP has been installed with ldap support?
Thanks in advance for any help,
Bing
?php phpinfo() ?
or, more specifically:
?php
$loaded = extension_loaded('ldap');
echo 'The ldap extension is ' . $loaded ? 'loaded' : 'not loaded';
?
--
PHP General Mailing List
In light of this statement and further testing in PHP4, I'm not sure if
an object was being instantiated or not. It certainly didn't pipe up
with an error.
Unfortunately, no (http://www.php.net/call_user_func):
Object methods may also be invoked statically using this function by
passing
Aric Caley wrote:
I want to create a function similar to the MySqli extensions'
mysqli_stmt_bind_param() function. I assume that this function takes
its arguments passed by reference. Now, I know how to do variable
length argument lists in a function with func_get_arg(s) but how do I
tell
I'm getting off the computer, so I figured I'd go ahead and just send
this to you. As my subject suggests, this class shows all of the
Reflections_* classes at work. One warning though: describe.php cannot
describe the Reflections API itself, this causes the server to crash.
Enjoy.
Jason
Orangehairedboy wrote:
I would like to use eval() to evaluate another PHP file and store the output
of that file in a string.
Personally, I try to avoid using eval(). It can be very useful, but
there are also potential security issues depending on your setup. Based
on what you said in another
Richard A. Devenezia wrote:
Suppose I don't have access to a database server.
I have any indexed array of like keyed arrays, essentially mimicing a
database table.
Are there any libraries or functions that I can use to 'query' the array in
a SQL like manner ?
e.g.
$data = array
What kinds of phrases are you looking for? If you want to know whether
an *exact* phrase is going to appear in a block of text, just use
strstr() or strpos(), they tend to be faster than regexes anyway.
http://www.php.net/strpos
function valid_phrase ($phrase, $search = 'text to search for')
[EMAIL PROTECTED] wrote:
Hi there, needing some more advise, is this function correct ?
function create_object($class_name,$dir = null, $serialize = null)
{
$dir ? $dir = $dir./ : $dir = ;
require_once(.CLASS_PATH.$dir.$class_name..php);
Dubreuilmedia wrote:
Hi
I was wondering about includes and classes. I have a class in which
depending on a member variable, i should load
the proper include, which is really the proper config file for that moment.
How does a member variable control this? E.g. you set the member
variable in the
Yes thats fine, there is a DB and auth and template class i instance
globally, these are across pages aswell should i do the same ?? I dont wont
to go overboard and slow the system down, I'd really want to make it
scalable. These dont store any data as such though like the rest. The
others i
So far I've made multiple statements pulling out all the data and using PHP
to formulate the information. But I know there is a better way using mysql.
Only thing is I haven't got the faintest idea how to do it in one query and
keep overheads low. I start to get lost when I'm doing select
Huha wrote:
hi everyone,
i have to write work abaut formal gramatic in language php.
As i understand it is the way as compiler works.
e.g. if i write function, then php compiler looks for funcion name,
then for ( and so on..
Find out more about tokens/tokenizing and lexical scanner.
Andre wrote:
I want to be able to process a PHP script and then if successful redirect to
another page. Is there a good way to do this with PHP or do I need to stick
to Javascript?
You should check out the header() function.
http://www.php.net/header
There are some common pitfalls with this, most
Phplist wrote:
php-general
I've a PHP-MySQL site now.
I've a empty database named 'dsx'.
I'd like to creat a table named 'test' and insert some data in order
to test the database can use now.
Can any one give me some code about
Lasse Motroen wrote:
Help again please.
Im trying to connect to MySQL server, using the PHP function:
mysql_connect('localhost', 'someuser', 'somePword');
I run it, and what I get is:
*Fatal error*: Call to undefined function: mysql_connect()
It sounds like you don't have support for the MySQL
Andy B wrote:
if i install php5 will it affect any of the php4.3.3 code that i have
running at all...?? i want to install 5 and see what they have new going on
and stuff but i dont want to crash my 4.3.3 running code any
and where would i be able to read a list of stuff that is new in 5??
You
David T-G wrote:
Hi again, all --
...and then David T-G said...
%
...
% Any recommendations?
I was amazed to receive from this
- an entirely-in-German post apparently wishing me a happy Easter
- a note from Credit Suisse letting me know they'd process my request
- a promise from Astral
Yep, I'd agree with the above comments. If you're interested in one
solution, check out HAWHAW, it has a proxy server for detecting/serving
web pages via regular browsers and mobile devices. I haven't tried it
in a long time though, so it might need updating but can still show you
an example
Ash.. wrote:
Hello,
Thanks John (Holmes) for the clue on form-param-reading. Simple one, but
shows I got a lot of basics to learn yet.
Here I have another doubt I cant resist asking help for.
What are the various ways of forwarding to another page. I tried header()..
based on an example I found
the browser always shows like this: brbFatal error/b: Call to
undefined function: domxml_open_mem() in
bc:\apache\htdocs\svg_dom_xml_php_bsp.php/b on line b76/bbr. What is wrong here?
In php 4 the dom xml extension is NOT loaded by default. So you can't
just call these functions until you
It's not the same thing. When an variable references an object then you
can change either the original object or the new variable and you will
be changing the *same* object, not a new one. Maybe this example helps?
?php
class test {
function test($val) {
global
My question is actually regarding the line $myref = $this;. The
author states that this is a reference to the class/object itself. Isn't
this like saying outside the class $myref = new test;? What would be
the point of referring to itself inside the class in this manner?
Thanks for your
page 1
__
// include class definition file
include_once order_classes.php;
// start session
session_start();
// create instance of class Order
$order = New Order();
// assign class instance to $SESSION[]
$_SESSION['order'] = $order;
page 2
__
// include class definition file
include_once
Boot wrote:
Thanks to those who helped with my last post on session vars.
My question now is why does my server seem to randomly choose whether or not
to show the session ID appended to the browser URL? Sometimes it is there,
sometimes not. All pages session_start();.
Thanks!
Check your
You probably need to check out OPOS, but I haven't looked at it in a
while and can't really tell you what to do.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Randall Perry wrote:
on 4/2/04 8:24 PM, Jason Barnett at [EMAIL PROTECTED] wrote:
Are you passing the session id between the pages? E.g. are you setting
session cookies, or passing the session id as part of the url?
Doesn't php default to using cookies? I'm not doing anything other than
using
Robby Russell wrote:
I am trying to debug some xml issues with a SOAP/Client-based script.
$sc = new SOAP_Client(...);
is there a way to display the XML it attempts to send the server when I
perform a
$sc-call(...)
*back to his google searches*
Just as a note, you might try posting
Merlin wrote:
Hi there,
I am trying to find values inside an array. This array always starts
with 0.
Do you mean the keys? Or the values? Unnamed keys _should_ start with 0.
unfortunatelly array_search start searching with the array element 1.
So the first element is always overlooked.
How
Curlybraces Technologies Ltd wrote:
by using php technology, is there any possibility to stop/start perl
script in a remote machine ?
thanx in advance
curlys
You probably want to check out XML-RPC. You'd create server/client
scripts that pass xml messages back and forth. As long as your
/person
person
fullnameJason Barnett/fullname
/person
/root
Do you see the problem? By assigning the character data to the element
tag each time, you would end up with $fullname = Jason Barnett. Would
you want this to be an array instead to grab all fullname tags?
Any help would
Kenn Murrah wrote:
Jason:
Yes, I am aware of the problem. However, for the very simple XML files
that I'm being asked to process, it's not an issue -- each file has, for
example, one and only one occurrence of fullname So, while I
realize that any solution I achieve for this project
Hmmm, that looks interesting.
On another note, I've made a simple parse based on PEAR's XML_Parser
that parses an entire XML tree into associative arrays. Feel free to use
it.
http://www.reversefold.com/~papercrane/XML_Parser_Assoc/Assoc.phps
I haven't used that class before, or else I
Nabil wrote:
Hi all,
I have problem storing the submitted data in the database in the right
encoding.
I need to use UTF-8
I need to save the Arabic text in UTF-8 encoding.
I have a problem with UTF-8 and windows-1256 conversion.
I wish I can understand those things, coz encoding thing will take
Henry Grech-Cini wrote:
Hi All,
I am trying to check if a website is up (reachable) and I have used the
standard code below:
Unfortunately this works for most sites but Microsoft doesn't work most of
the time even thought the site is definiately up! (Occassionally it does say
it is reachable but
Edward, I couldn't see either of your SQL statements. However, PHP's
internal functions currently supports UTF-8, not UTF-16, so not all
characters are supported. Can you post some code?
[EMAIL PROTECTED] wrote:
Dear You,
How to control php convert inserted data or query to / from MS-SQL (
James Nunnerley wrote:
Is there a function within PHP that picks up the screen/display size?
I know of the one in JavaScript, however I want to pick it up in PHP
Thanks
Nunners
I assume you mean the size of a web browser's screen? I don't know of
anything PHP that does that offhand.
Ryan Munevar wrote:
Hello,
Does anyone know how to actually print PHP code in Color to actual
paper from Dreamweaver MX? We like to paste the code up to the wall
here to get a bigger look at it. I know you can do it in BBedit, but MX
is what we like.
Just curios. Thanks!
Red Wingate wrote:
Hi David,
same thing i reported to the PHP-DEV List some time ago ( before RC1
was released ). The problem is the Win32/Apache2 Combination you
are using.
I am using the same setup as well, if any of you find a solution to this
I would appreciate hearing about it. I've
I just sent this to one person and realized that others might find this
useful. This code will ONLY work for PHP 5, comments are in the code.
?php
/**
* This is a class that can be used to describe classes, objects, methods,
* functions, parameters, properties, and even extensions.
*
Darnit... I forgot I changed the error handler in my own scripts. Use
this instead, sorry for posting bad code the first time around:
?php
/**
* This is a class that can be used to describe classes, objects, methods,
* functions, parameters, properties, and even extensions.
* Example usage:
Prabu Subroto wrote:
Dear my friends...
I want to make an alert which can display a value from the database.
I am meaning :
how can I pass a value of a variable from PHP into JavaScript alert ( alert($Firstname,
$LastName and $Address);
Is it possible?
Sure. Probably the easiest way I can think
Prabu Subroto wrote:
Akh... thank you my friend It's solved.
May I ask another question?
Can I call a function of PHP code from HTML tag just the same as I call a function of
JavaScript from HTML tag?
I meant, Like this a Onclick='warning()'CustID/a;
Well, what do you mean exactly? If
First of all, if you have the option to upgrade you might want to check
out PHP5. SimpleXML really makes it easy to parse xml files. If PHP4
is your platform of choice, check out PEAR's XML_Parser package.
The entities can't be handle with xml_set_default_handler because some
entities are
Brent Clark wrote:
Hi all
Ive been try for sometime now, and too tried googling for an answer, to grab the
STDOUT of a command.
In this case the binary command is readbar
The general output of readbar executed on its own is as so:
Code 39-10005802
IATA 2 of 5-2
IATA 2 of 5-8
1
I am using php in combination with ant to create a small automated build
process. Will php run sequentially? What I mean is I have a series of
modules or tasks:
Example:
//check out files
include(modules/checkout.php)
//zip up the files
include (modules/zip.php)
etc
Will php wait to execute the
Mike R wrote:
I am getting this error:
Fatal error: Failed opening required
'/home/sites/site111/web/news/settings/newsletter.settings.inc.php'
(include_path='') in
/home/sites/site111/web/news/forms/sign_in_out_form.inc.php on line 7
From this piece of code:
require
Yes, Linux. I checked the permission - set the whole directory to 777, no
change in the problem.
Is there anything in the compiling of php or ini settings that would affect
include or require statements?
:)
Thanks,
-Mike
OK, try setting the error_reporting = E_ALL, and just try to execute
Richard Davey wrote:
Hello Justin,
Tuesday, March 30, 2004, 6:27:20 PM, you wrote:
JP I also have no idea what Agent 2 is
It's a Windows based news-reader (the free version is called
FreeAgent) - think tin with knobs on.
Oh and to the OP: Agent 2 is OUT and available, has been for a short
Fatal error: Failed opening required
'/home/sites/site111/web/news/settings/newsletter.settings.inc.php'
(include_path='') in
/home/sites/site111/web/news/forms/sign_in_out_form.inc.php on line 7
From this piece of code:
require
(/home/sites/site111/web/news/settings/newsletter.settings.inc.php);
Motorpsychkill wrote:
I'm trying to re-create the following multi-dimentional array from a
database query, where the indices 5, 7 and 21 are order_id and my table is
food_orders(order_id, food, cooked):
?php
$food_array = array(
5=array('steak','rare'),
Adam Williams wrote:
Hi, what is the syntax for using ocilogon() to connect to a remote server?
The remote server's name is zed.mdah.state.ms.us (ip is 10.8.5.4) and the
database is zed.aleph0. Locally on zed I can do
ociogon(user,pw,zed.alpeh0) and connect fine, but on a remote server
I
David Scott wrote:
I'm using a for() loop to generate random die rolls. I'd like the
numbers to be formatted in a grid.
In a grid... like an HTML table? You could something like:
$row = 20;
$col = 5;
echo 'table';
for ($i = 1; $i $row; $i++) {
echo 'tr';
for ($j = 1; $j $col; $j++) {
Bruno Santos wrote:
Hello all.
Im developing a page, and need to create a thumb of some images.
i've compiled PHP 4.3.5 with the built-in support of GD, even having
installed the GD library.
the problem is that i call the imagecreatefromjpeg function, and PHP
returns a fatal error
when in
From http://www.php.net/manual/en/function.imagecreatefromjpeg.php
To all those having trouble with a message to the effect of:br
CreateImageFromJpeg() not supported in this PHP buildbr
Start by adding --with-jpeg-dir to your ./configure options as I left
this out (not knowing I needed it) and I
Anthony Ritter wrote:
Greets,
I've been able to open a remote URL, read it and then lop off everything
except the last line and break it into an array with its' tabs - /t .
The data will then be inserted into a table.
However, the following URL shows reservoir storage and is a .doc file. I am
Actually, why don't you just use plain text like this. Sheesh,
sometimes I forget the easy answer :)
STORAGE The actual combined contents for the New York City Reservoirs
in the Delaware River Basin
for December 1, 2003-March 29, 2004.
Date Pepacton Cannon. Never. Actual Drought
Since those figures change _daily_ on their site, I was hoping for a way to
open the file, read it, adjust the format by lopping off the last line into
an array and writing those values into a table - _without manually copying
and pasting the data each day into a .txt file_.
Whoops, it's getting
I also see lots of people talking about speed. In my mind, having extra
convenience and error handling is far worth the extra load / run time.
Apart from that, there's also this coding rule which I agree with almost
always. Developer time is far more valuable that runtime. If you spend
lots
I'm using PHP version 4.2.2 on a Linux system running Apache. I am
trying to allow my users to upload a file, however I continue to receive a
Permission denied error when using move_uploaded_file() or copy(). The
file appears to be sent to the temporary directory successfully, but can not
be
I'm new to php and web development in general. I've toyed with ASP a little
and enjoyed using include statements to include my navigation and heading
pages. Does PHP provide a similar statement, or is there something else I
can do to achieve this effect?
--
PHP General Mailing List
601 - 676 of 676 matches
Mail list logo