Your script should work fine, and to fix claims made in
this thread:
a) $HTTP_RAW_POST_DATA is NOT an array, it's a string.
b) It does not live in $_SERVER, or rely on register_globals.
Your code is wrong because you don't provide names for your
fields, so there is no POST data. Assign
Dan Anderson wrote:
Is there any reason you couldn't do something like:
?php
$buffer = implode(\n,file($somesite));
while (strstr($buffer,li);
{
$li_tag_start_position = strpos($buffer,li);
$li_tag_end_position = strpos($buffer,/li);
$data = substr($buffer,(4 + $li_tag_start_position),(4 +
If I am using this code:
mail([EMAIL PROTECTED], test, testbody);
and want to add a From: line, how do I do it?
Also, is this an excepted way of sending mail from a web page?
Thanks,
Amanda
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
DvDmanDT wrote:
I use to write my own search engines... That way they get customized
easier... You can write one that spiders like google... Hell, it even found
my private server... And there's not a single link ther afaik..
Now, is it for web or site search? If site, just get a MySQL table with
[snip]
If I am using this code:
mail([EMAIL PROTECTED], test, testbody);
and want to add a From: line, how do I do it?
Also, is this an excepted way of sending mail from a web page?
[/snip]
Read http://us4.php.net/manual/en/function.mail.php Example 2 (How's
that Chris?)
And yes, it is
John W. Holmes wrote:
DvDmanDT wrote:
I use to write my own search engines... That way they get customized
easier... You can write one that spiders like google... Hell, it even
found
my private server... And there's not a single link ther afaik..
Now, is it for web or site search? If site,
Amanda McComb [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
If I am using this code:
mail([EMAIL PROTECTED], test, testbody);
and want to add a From: line, how do I do it?
Also, is this an excepted way of sending mail from a web page?
Thanks,
Amanda
The mail() function has
Hello All,
My application has a search / query feature where in the user
selects the search criteria and is displayed a page containing the
reults. The user must also be allowed to edit these results and save
them later on. On the results page I use the following logic,
//
// START OF
I'm curious if someone could explain to me why this is occuring:
function blah() {
//global $GLOBALS;
echo 'Globals: pre'; print_r( $GLOBALS ); echo '/pre';
}
As it is shown above, with the 'global $GLOBALS' line commented
out, the print_r() works and shows all the currently defined variables
Please Cc: me directly, if possible. Thanks!
[This got long, but a search for Synopsis: (two of them) should give the
gist.]
Originally, the machine (Linux 2.4.19-16mdk) had Mandrake 8 RPM's of PHP
4.2.3 and Apache 1.2.26
I was able to install LIBFDFTK.SO 5.0 and the .h file, symlinked to
I can't speek about the first problem, but about the second one.
You are not setting the variable $blah as a global variable.
Try this instead
$GLOBALS['blah'] = 'bob';
and that should work.
You need to look into scope when refering to variables and functions.
Jim Lucas
- Original
I'm curious if someone could explain to me why this is occuring:
function blah() {
//global $GLOBALS;
echo 'Globals: pre'; print_r( $GLOBALS ); echo '/pre';
}
As it is shown above, with the 'global $GLOBALS' line commented
out, the print_r() works and shows all the currently
[snip]
$GLOBALS
[/snip]
From http://us2.php.net/language.variables.scope
The $GLOBALS array is an associative array with the name of the global
variable being the key and the contents of that variable being the value
of the array element. Notice how $GLOBALS exists in any scope, this is
because
Hi Chris,
Chris Boget wrote:
function blah() {
//global $GLOBALS;
echo 'Globals: pre'; print_r( $GLOBALS ); echo '/pre';
}
As it is shown above, with the 'global $GLOBALS' line commented
out, the print_r() works and shows all the currently defined variables
and their corresponding values.
Maybe it has to do with the fact that the $GLOBALS[] array has a copy of
itself inside the parent.
kinda weird but it looks like this
$GLOBALS['key1'] = 'value1';
$GLOBALS['key2'] = 'value2';
$GLOBALS['GLOBALS']['key1'] = 'value1';
$GLOBALS['GLOBALS']['key2'] = 'value2';
don't ask me why, but
just to let you know, the $GLOBALS[] superglobals was around long before
php 4.1.0
Jim Lucas
- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: Chris Boget [EMAIL PROTECTED]; PHP General
[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 12:18 PM
Subject: RE: [PHP] Globals
[snip]
just to let you know, the $GLOBALS[] superglobals was around long
before
php 4.1.0
// Superglobals are available in any scope and do
// not require 'global'. Superglobals are available
// as of PHP 4.1.0
[/snip]
This is the quote in the online manual
--
PHP General Mailing List
Greg Beaver wrote:
$GLOBALS does not contain a reference to itself
Yes it does. I just ran the following, and I got Greg is wrong.
?php
$foo = 'Greg is wrong.';
echo $GLOBALS['GLOBALS']['GLOBALS']['GLOBALS']['foo'];
?
--
The above message is encrypted with double rot13 encoding. Any
Hi, i did a standard preg [A-Za-z0-9]{1,65536}
What i am simply trying to do is to validate the a form that will insert
into my TEXT database field. So i just want to prevent a larger insert
then expected.
PHP trows me this error preg_match(): Compilation failed: number too
big in {} quantifier
Try this code:
?php
function blah() {
var_dump($GLOBALS['GLOBALS']);
}
blah();
?
It appears that in a function scope, it doesn't. This is definitely a
bug, I'll post it if it hasn't already been noticed.
Greg
Leif K-Brooks wrote:
Greg Beaver wrote:
$GLOBALS does not contain a reference to
Pushpinder Singh Garcha mailto:[EMAIL PROTECTED]
on Friday, August 01, 2003 11:11 AM said:
form name=form1 method=post
action=full_profile_1.php?val=$company
Use a hidden form element instead.
input type=hidden name=val value=$company/
Can some one tell me if the action parameter of the
actually, it does work and it does exist.
Try using print_r() or
print_r(array_keys($GLOBALS));
and you will see an entry for GLOBALS
mine is located at #13
Jim Lucas
- Original Message -
From: Greg Beaver [EMAIL PROTECTED]
To: Leif K-Brooks [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Hi Jim,
The code you posted is correct, I never contested that. Read carefully.
?php
function not_super()
{
var_dump(isset($GLOBALS['GLOBALS']));
$a = array_keys($GLOBALS);
var_dump(isset($a['GLOBALS']));
}
not_super();
?
run this code, don't read it, you will see output of
$HTTP_RAW_POST_DATA is an array...
with echo you'll only get array..
No, it's a string - just the raw bytes that were posted.
Is register globals ON or OFF? Either way, maybe try
$_SERVER['HTTP_RAW_POST_DATA']...
Also, ensure that always_populate_raw_post_data is on, too - see:
* Thus wrote Yann Larrivee ([EMAIL PROTECTED]):
Hi, i did a standard preg [A-Za-z0-9]{1,65536}
What i am simply trying to do is to validate the a form that will insert
into my TEXT database field. So i just want to prevent a larger insert
then expected.
PHP trows me this error
umm... That is what is going to happen when you follow your example.
I think you are mistaken in what you are expecting...
This line:
$a = array_keys($GLOBALS);
will give you an array of values that match the keys of the $GLOBALS array
it won't copy the arrays.
Try this.
PRE
?php
$a =
How do I prevent a long float number end up like this after/during a
calculation?
8.5E-05 //A number error occurs.
I even tried keeping the whole calculation in 1 line:
//Get the weight (in pounds) of a O-Ring.
$N = round((0.03613 * 1.85 * ((pow(pi(), 2) * pow(($iDia[$d] - $oDia[$d]),
2) *
Here's another way to do it:
?php
$url=$_SERVER[SCRIPT_URI];
$url_array=parse_url($url);
if($url_array[scheme]!=https)
{
header(Location: https://$url_array[host]$url_array[path];);
}
?
Luis
-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]
Sent: Friday,
Hello,
This is a reply to an e-mail that you wrote on Fri, 1 Aug 2003 at
20:35, lines prefixed by '' were originally written by you.
Hi, i did a standard preg [A-Za-z0-9]{1,65536}
What i am simply trying to do is to validate the a form that will
insert
into my TEXT database field. So i just
Jim,
My bad, I posted the wrong code. Try this instead to see the bug:
?php
function not_super()
{
var_dump(isset($GLOBALS['GLOBALS']));
return array_keys($GLOBALS);
}
//var_dump(not_super(), array_keys($GLOBALS));
not_super();
not_super();
?
run this code, don't read it, you will see
I don't follow what you are trying to say here?
it is returning true, just as it should.
show me the results that you get by running this code.
here is mine
bool(true)
bool(true)
What is wrong about this?
Read my notes below
?php
function not_super()
{
$v = isset($GLOBALS['GLOBALS']);
Thanks a lot.
hehe no thanks needed. Just remember to read up on the functions so
you'll know how they work. ;-)
-Dan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
What version of PHP are you running? I have PHP 4.3.2 on windows XP
here. I'm getting bool(false) bool(false) every time.
Greg
Jim Lucas wrote:
I don't follow what you are trying to say here?
it is returning true, just as it should.
show me the results that you get by running this code.
Keeping it on one line doesn't affect the calculations (as it
shouldn't). Try using either sprintf() or number_format() for this
purpose (the latter is generally preferred, but I don't know exactlt
what you're after).
Bogdan
Zavaboy wrote:
How do I prevent a long float number end up like
I am running PHP 4.2.2 on Debian linux with apache 1.3.26
Jim
- Original Message -
From: Greg Beaver
To: Jim Lucas
Cc: [EMAIL PROTECTED]
Sent: Friday, August 01, 2003 3:02 PM
Subject: Re: [PHP] Re: Globals
What version of PHP are you running? I have PHP 4.3.2 on
Check out:
http://www.htdig.org/
-Original Message-
From: imran [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 4:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Search Engine
Hi,
Does anyone know any free search engine for web application
imee
--
PHP General Mailing
Hello,
I'm getting a weird warning message from a php script that I'm working
on. Right now the script does not contain any include or require
statements and is basically a very simple straight forward script. But
when I try to execute via the browser I get the following error:
Warning:
Hello,
This is a reply to an e-mail that you wrote on Sat, 2 Aug 2003 at
00:10, lines prefixed by '' were originally written by you.
Hello,
I'm getting a weird warning message from a php script that I'm
working
on. Right now the script does not contain any include or require
statements
David,
This is what my php.ini file looks like and I don't seem to have any
.htaccess files. Could it be something in the httpd.conf file thats
pointing to an invalid file/directory?
; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =
Matt
Thanks! number_format() fixed it!
Bogdan Stancescu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Keeping it on one line doesn't affect the calculations (as it
shouldn't). Try using either sprintf() or number_format() for this
purpose (the latter is generally preferred, but I don't
In the following snippet, I'm trying to open and read a URL into the
variable $contents.
I'd like to use preg_replace() to return only part of that string beginning
with say - regional and ending with new - but I get the complete URL string
returned.
Thank you for any assistance.
Tony Ritter
yes it could be in the httpd.conf file.
look in your VirtualHost block and see if something there refers to a file
called loging.php
Jim Lucas
- Original Message -
From: Matt Giddings [EMAIL PROTECTED]
To: 'David Nicholson' [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, August 01,
Hello all,
How do I go about checking if a file is a zip file?
Wrapping the zipinfo utility in php did not help since it does not return an
exit code whether it succeeded or not.
Thanks,
IP
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Ivo Pletikosic mailto:[EMAIL PROTECTED]
on Friday, August 01, 2003 5:10 PM said:
Wrapping the zipinfo utility in php did not help since it does not
return an exit code whether it succeeded or not.
Well if zipinfo returns anything at all it's probably valid. If it
doesn't then it's probably
* Thus wrote Anthony Ritter ([EMAIL PROTECTED]):
In the following snippet, I'm trying to open and read a URL into the
variable $contents.
I'd like to use preg_replace() to return only part of that string beginning
with say - regional and ending with new - but I get the complete URL string
* Thus wrote Ivo Pletikosic ([EMAIL PROTECTED]):
Hello all,
How do I go about checking if a file is a zip file?
Wrapping the zipinfo utility in php did not help since it does not return an
exit code whether it succeeded or not.
I'm assuming the zipinfo your talking about is part of the
Hi,
I have installed the latest cygwin - php4.2 with apache, but looking at the
configuration file for
php.ini , I tried to change value , restart apache and it didn't work
then I went and totally rename the php.ini to aaa.bak and restart apache
which I expecting the
error reading og the php.ini
I've not been able to find anywhere a good use of the pfpro
functionality in PHP. No where do any of the scripts ensure that the
script goes through it's full execution.
One person's solution was just to exec the pfpro binary in the
background, passing it the necessary arguments. This seems
Curt Zirzow wrote in message:
This exact thing was talked about earlier today, with the subject
'Using eregi_replace()'.
Right.
However, I've tried using the following code in which the text from the URL
is printed out completely and then I change the variable from
* Thus wrote e ([EMAIL PROTECTED]):
I've not been able to find anywhere a good use of the pfpro
functionality in PHP. No where do any of the scripts ensure that the
script goes through it's full execution.
One person's solution was just to exec the pfpro binary in the
background,
Hello,
As a recent flurry of activity has commenced within Command Prompt we
have released upon this rather unround earth, plPHP. Yes it is trigger
safe, yes you can write UDF's in PostgreSQL with PHP now.
Find it here:
http://www.commandprompt.com/entry.lxp?lxpe=260
Have a glorius weekend.
This was last asked: in 2001
2. 2001-07-31 Embedding PHP into another application...
The solution suggested was to adopt a commericial package.
I have experimented with a javascript library, but I think the licensing
of php is more favourable; I am not lawyer though!
I have seen somewhere that
* Thus wrote Anthony Ritter ([EMAIL PROTECTED]):
Curt Zirzow wrote in message:
This exact thing was talked about earlier today, with the subject
'Using eregi_replace()'.
Right.
However, I've tried using the following code in which the text from the URL
is
* Thus wrote Joshua D. Drake ([EMAIL PROTECTED]):
Hello,
As a recent flurry of activity has commenced within Command Prompt we
have released upon this rather unround earth, plPHP. Yes it is trigger
safe, yes you can write UDF's in PostgreSQL with PHP now.
I have yet to know what it does,
On Saturday 02 August 2003 09:00, kalmen wrote:
I have installed the latest cygwin - php4.2 with apache, but looking at
the configuration file for
php.ini , I tried to change value , restart apache and it didn't work
then I went and totally rename the php.ini to aaa.bak and restart apache
Haven't found anything yet. The login.php file is the one I'm trying to
view when I get that error. I have a second file info.php that works
fine, but all it contains is ?php phpinfo(); ?. So I know
apache/php is working, I just don't know why it isn't working with my
login script.
Matt
Duh, I figured it out. I had the permissions screwed up on the file.
Thanks for your help and sorry for bothering everybody else with my
ignorance.
Matt
-Original Message-
From: Matt Giddings [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 11:25 PM
To: 'Jim Lucas'; 'David
Curt Zirzow writes:
I did some testing you can see the code and results here:
http://zirzow.dyndns.org/html/php/tests/preg/parse_doc.php
..
Thanks Curt.
I checked it out and I still pick up the following lines which I was looking
to delete on the pattern match.
They are:
101 - 158 of 158 matches
Mail list logo