php-general Digest 2 Jun 2006 13:49:09 - Issue 4162
Topics (messages 237233 through 237264):
$BG%?1$7$F$^$9(B
237233 by: yume
Re: Help with enter key in Forms
237234 by: George Babichev
237235 by: Chris
237236 by: Chuck Anderson
237237 by: George
Hi all,
Working on a PHP script at the moment where I want to be able to
extract a file (PDF file) from a mysql database and force the popup
of the File Download dialog, to allow the user to either save or open
the document (ie. and bypass loading the file using the browser's plugin)
I've found
Hi,
In this case I usually creating Iframe with zero with and zero height
and using
your header code in the iframe sorce file.
DS
-Original Message-
From: Matthew Pegg [mailto:[EMAIL PROTECTED]
Sent: Friday, June 02, 2006 7:59 AM
To: php-general@lists.php.net
Subject: [PHP] PHP/Mysql:
Hi guys I'm getting the following error and I cant seem to understand what
Im doing wrong, if someone could help me I'd apreciate it.
Here is the error message I get in some fileds of the output on the browser:
*Warning*: Invalid argument supplied for foreach() in *
Ministério Público wrote:
Hi guys I'm getting the following error and I cant seem to understand what
Im doing wrong, if someone could help me I'd apreciate it.
Here is the error message I get in some fileds of the output on the
browser:
*Warning*: Invalid argument supplied for foreach() in *
What I need to know is that if when I fopen() or the other function you gave
me I get the variables that are assigned on the html, such as the option for
example, if its name is test, could I access it retrieving the value $test
???
cause I really need to do it and I cant seem to know where to
Ministério Público wrote:
What I need to know is that if when I fopen() or the other function you
gave me I get the variables that are assigned on the html, such as the
option for example, if its name is test, could I access it retrieving
the value $test ???
No. Those functions will retrieve
Ministério Público wrote:
After using the var_dump the only thing I get is NULL, therefore I'll
try something else that I think is more complete for the fellow programmers.
Nobody's going to trawl through all of your code.
Narrow down where the problem is.
--
Postgresql php tutorials
Here it goes: in a certain page there is a dinamicaly generated Option ( one
of those boxes from wich you can select a certain thing in a list) I want to
retrieve the content of these options and the values assigned to each of
them.
Thanx.
Rodrigo
I showed where the problem is and after var_dump all I get is NULL. I just
sent the code cause I thought it would be easier to see it in context, not
to make somebody trawl trough it. If its not an array how to find out what
it is? What can I do about it?
Thanks.
Rodrigo
Ministério Público wrote:
Here it goes: in a certain page there is a dinamicaly generated Option (
one of those boxes from wich you can select a certain thing in a list) I
want to retrieve the content of these options and the values assigned to
each of them.
So if you have:
option
Chris you rule !!!
That great from here I'll be abble to go on.
Thanks.
Rodrigo
Ministério Público wrote:
I showed where the problem is and after var_dump all I get is NULL. I
just sent the code cause I thought it would be easier to see it in
context, not to make somebody trawl trough it. If its not an array how
to find out what it is? What can I do about it?
Put
Hi Tedd,
I had a hunt in the archives and couldn't find anything. Do you have any clue
about when it was?
Richard
t At 9:46 AM +1000 6/2/06, Richard Luckhurst wrote:
Hi All
I am in the process of cleaning up an application that was left half
finished. I
am fairly new to PHP so I am seeking
hi Rasmus,
I understand the point you made below - you have made this argument before
and I, for one, accepted it as valid when I first read the discussion
on internals - which is why I avoided ranting about that (and changes like it)
But I am wondering what if any your views might be on the
Matthew Pegg wrote:
Hi all,
Working on a PHP script at the moment where I want to be able to
extract a file (PDF file) from a mysql database and force the popup
of the File Download dialog, to allow the user to either save or open
the document (ie. and bypass loading the file using the
Hi.
I have a PHP file that outputs as XML from a database. i have used the
header() function to output the correct header but when I use the
simplexml function it is trying to parse the php file itself and not the
output of the php file. I can't get my head round this. Can anyone help me?
--
Hi all,
is there any easy why to check if a value is odd or not?
Thanks // Jonas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 02/06/06, Jonas Rosling [EMAIL PROTECTED] wrote:
Hi all,
is there any easy why to check if a value is odd or not?
Thanks // Jonas
Yep, use the modulo operator like so:
if ($value % 2 ==0) $odd = false;
--
http://www.web-buddha.co.uk
dynamic web programming from Reigate, Surrey
if ($value % 2 == 0 )
echo Value is even;
else
echo Value is odd;
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
Thanks // Jonas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-Ursprungligt meddelande-
Fran: Eric Mol [mailto:[EMAIL PROTECTED]
Skickat: den 2 juni 2006 15:34
Till: 'Jonas Rosling'; 'PHP List'
Amne: RE: [PHP] If value is odd or not
If ($var/2==round($var/2)){
// not odd
}else{
// odd
}
Greetings,
Eric
Thanks (all)!
-Oorspronkelijk
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
Thanks // Jonas
$value = 3;
if (strpos(($value/2),.) === FALSE) {echo even;}
else {echo odd;}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
the modulos operator:
read about what it does here:
http://php.net/manual/en/language.operators.arithmetic.php
here is a simple example of how to check if something
is odd or not (odd number that is ;-):
IG wrote:
Hi.
I have a PHP file that outputs as XML from a database. i have used the
header() function to output the correct header but when I use the
simplexml function it is trying to parse the php file itself and not the
output of the php file. I can't get my head round this. Can anyone
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
ignore every answer that doesn't use the % operator.
Thanks // Jonas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 02 June 2006 14:32, Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
if ($value%2):
// $value is odd
endif;
Cheers!
Mike
-
Mike Ford, Electronic Information Services
Jochem Maas wrote:
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
ignore every answer that doesn't use the % operator.
Thanks // Jonas
ie my answer! I think the % operator is the best way, but there was
nothing wrong with the answer I gave in
Jochem Maas wrote:
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
ignore every answer that doesn't use the % operator.
if ( is_int ( $value / 2 ) ) {
// Even
}
:-p
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of
IG wrote:
Jochem Maas wrote:
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
ignore every answer that doesn't use the % operator.
Thanks // Jonas
ie my answer! I think the % operator is the best way, but there was
not just your answer.
[snip]
if ( is_int ( $value / 2 ) ) {
// Even
}
[/snip]
:)
More?
$oddArray = array(1,3,5,7,9);
if(in_array(substr($integer, -1, 1))){
echo $integer . is odd\n;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
At 3:32 PM +0200 6/2/06, Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
Jonas:
echo($num 1);
This produces 1 for odd and 0 for even.
tedd
--
http://sperling.com
John Nichel wrote:
Jochem Maas wrote:
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
ignore every answer that doesn't use the % operator.
if ( is_int ( $value / 2 ) ) {
// Even
}
LOL.
:-p
--
PHP General Mailing List
I doubt that Jonas ever expected 'the rain of answers' that will
follow his humble question ;]
On 6/2/06, tedd [EMAIL PROTECTED] wrote:
At 3:32 PM +0200 6/2/06, Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
Jonas:
echo($num 1);
This produces 1 for odd
Hi guys, I'm trying to retrieve a certain variable from a site. Here it goes:
The site has a SELECT box that is dynamicaly updated, I need to put a
script running that will retrieve the specified SELECT with its
contents, that are labels and values. Is there a way to retrieve the
page and then
$odd = array(1,3,5,7,9);
if(inarray(substr($var,strlen($var)-1,1),$od)
{
//haha
}
else
{
//even
}
p.s. sorry for the direct mail
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
Thanks // Jonas
--
PHP General Mailing List (http://www.php.net/)
Steven Osborn wrote:
$odd = array(1,3,5,7,9);
if(inarray(substr($var,strlen($var)-1,1),$od)
{
//haha
}
else
{
//even
}
How about this
if ($var % 2 == 0) { //it's even
} else { //it's odd
}
--
Online library -- http://pueblonative.110mb.com
126 books and counting.
--
PHP General
Jochem Maas wrote:
I understand the point you made below - you have made this argument before
and I, for one, accepted it as valid when I first read the discussion
on internals - which is why I avoided ranting about that (and changes
like it)
But you didn't avoid it, you used it as an example
At 5:14 PM +0300 6/2/06, Dimiter Ivanov wrote:
I doubt that Jonas ever expected 'the rain of answers' that will
follow his humble question ;]
Well... at least the answers are getting shorter.
It might be interesting to see how long of a piece of code could be written to
answer the same
[snip]
It might be interesting to see how long of a piece of code could be
written to answer the same question.
[/snip]
I can think of a really long one using a callback function
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I can't work out how to load the text from a recordset result into a
variable for sending using mail in a script.
I have a script which creates a dynamic table then I want to load the
table's HTML into a variable which will be echoed in the mail function.
I can't work out how to do this.
I've
At 9:52 AM -0500 6/2/06, Jay Blanchard wrote:
[snip]
It might be interesting to see how long of a piece of code could be
written to answer the same question.
[/snip]
I can think of a really long one using a callback function
It's interesting to dangle bait above a pool of programmers and see
I'm kind of coming from the outside here, so forgive my ignorance on some
matters. I have some OO experience, just not with PHP and have only worked
with PHP4 so again.. kind of on the outside of all this.
Rasmus, you make a great point here. OO is structured and is all about
constraints
The Obfuscated C contest had a category for most complicated solution to a
simple problem. Like 50 lines of code to add two numbers together, stuff like
that.
-TG
= = = Original message = = =
At 9:52 AM -0500 6/2/06, Jay Blanchard wrote:
[snip]
It might be interesting to see how long of a
[snip]
It's interesting to dangle bait above a pool of programmers and see what
rises. :-)
There used to be a contest to create the most complicated solution to
accomplish a very trivial task, like turning on a light switch. However,
I can't remember what the contest was called -- it was
Jochem Maas wrote:
IG wrote:
Hi.
I have a PHP file that outputs as XML from a database. i have used the
header() function to output the correct header but when I use the
simplexml function it is trying to parse the php file itself and not
the output of the php file. I can't get my head round
IG wrote:
Jochem Maas wrote:
Jonas Rosling wrote:
Hi all,
is there any easy why to check if a value is odd or not?
ignore every answer that doesn't use the % operator.
Thanks // Jonas
ie my answer! I think the % operator is the best way, but there was
nothing wrong with the answer I
Sorry Mark,
What I meant is say a page outputs an HTML table eg:
table width=100 cellspacing=0 cellpadding=0
tr
tda/td
tdb/td
tdc/td
tdd/td
tde/td
/tr
tr
tdf/td
tdg/td
tdh/td
tdi/td
tdj/td
/tr
tr
tdk/td
tdl/td
tdm/td
tdn/td
tdo/td
/tr
tr
At 10:10 AM -0500 6/2/06, Jay Blanchard wrote:
[snip]
It's interesting to dangle bait above a pool of programmers and see what
rises. :-)
There used to be a contest to create the most complicated solution to
accomplish a very trivial task, like turning on a light switch. However,
I can't remember
Rodrigo de Oliveira Costa wrote:
Hi guys, I'm trying to retrieve a certain variable from a site. Here it
goes:
The site has a SELECT box that is dynamicaly updated, I need to put a
script running that will retrieve the specified SELECT with its
contents, that are labels and values. Is there a
I've just read a similar post and think that I should use file_get_contents
and the preg_match for the table /table tags.
...But if anyone knows a better way I'm all ears!
On 02/06/06, Tom Chubb [EMAIL PROTECTED] wrote:
Sorry Mark,
What I meant is say a page outputs an HTML table eg:
table
Richard:
The discussion was in February, I looked and couldn't find what I remembered.
So, I'm thinking that the coder sent it to me directly, but I searched my files
and again I came up with nothing -- it's not like me to lose code.
What I remember was a function that took Unicode HEX and
On 6/2/06, Tom Chubb [EMAIL PROTECTED] wrote:
What I meant is say a page outputs an HTML table eg:
table width=100 cellspacing=0 cellpadding=0
[snipped]
/table
But I want to get that code into the $message variable.
I have written many mail scripts before it's just getting the data into the
[EMAIL PROTECTED] wrote:
If it ain't broke, don't fix it works for a while, but if there are easier
and/or better ways to do things in PHP5, I want in! So someone sell me on this from the
point of view of someone who's upgraded and has learned the joys of PHP5. So far what
I've found
Actualy I went a slightly diffent way, I tried to use the file() like
on the script below and I get the content of the whole page but when I
try to get a single line from the array it all goes sideways. Here
goes the script with the correct urls, remembering that I'm using it
on the local server
At 9:00 AM -0700 6/2/06, Rasmus Lerdorf wrote:
[EMAIL PROTECTED] wrote:
-snip- (a bunch of things over my head)
Note that for all of this I am referring to PHP 5.1.x, not 5.0.x.
-Rasmus
Damn -- remind me to never disagree with you (as if I could). My self-perceived
position on the food
This one time, at band camp, Richard Lynch [EMAIL PROTECTED] wrote:
So, of all the things that COULD go wrong, we just assume it's No
files Found???
I don't think I'll ever learn to like SPL or try/catch...
Ok, I think my example was a little too simplistic...
You could of course create
[EMAIL PROTECTED] wrote:
What are some of the other killer features of PHP5 that I may be sleeping on
here.
You have got to get your hands on XMLWriter. I don't write any XHTML
inside php any more. I've wrapped the XMLWriter object inside my own
object and now I can create 100%
hello all,
i am setting up php_java.dll extension under windows/iis, my php
version is 5.1.2. can any one point me to the download location of
php_java.jar which is needed for the setup.
i searched all the sites/mirrors but its not available. do i have to
compile from source to get that jar? ...
Rodrigo de Oliveira Costa wrote:
Actualy I went a slightly diffent way, I tried to use the file() like
on the script below and I get the content of the whole page but when I
try to get a single line from the array it all goes sideways. Here
goes the script with the correct urls, remembering
Can I do the below to an URL, like retrieving the output of a site and
store it on a variable?
Thanks,
Rodrigo
Hi Peter,
Ah, I understand now.
If the file echo'ed it's output you could do:
ob_start();
include('file.php');
$output = ob_get_contents();
ob_end_clean();
or:
$output =
I just discovered the problem I have to retrieve the output of the
site and not the url since its dynamic. Ca I do it like retrieve the
output of this url:
www.tryout.com/1/2/
And of course store it on a variable? How to do it? I founr the func
below but couldnt understand how to make it work
tedd wrote:
At 9:00 AM -0700 6/2/06, Rasmus Lerdorf wrote:
[EMAIL PROTECTED] wrote:
-snip- (a bunch of things over my head)
I thought I kept the examples pretty simple actually. If you have
specific questions on them I would be happy to explain them in more detail.
-Rasmus
--
PHP
At 10:51 AM -0700 6/2/06, Rasmus Lerdorf wrote:
tedd wrote:
At 9:00 AM -0700 6/2/06, Rasmus Lerdorf wrote:
[EMAIL PROTECTED] wrote:
-snip- (a bunch of things over my head)
I thought I kept the examples pretty simple actually. If you have specific
questions on them I would be happy to explain
Rodrigo de Oliveira Costa wrote:
I just discovered the problem I have to retrieve the output of the
site and not the url since its dynamic. Ca I do it like retrieve the
output of this url:
www.tryout.com/1/2/
And of course store it on a variable? How to do it? I founr the func
below but
-Original Message-
From: tedd [mailto:[EMAIL PROTECTED]
Sent: Friday, June 02, 2006 3:11 PM
To: Rasmus Lerdorf; tedd
Cc: php-general@lists.php.net
Subject: Re: [PHP] OO purism sucks - sell me on PHP5?
SNIP
So for now, I'll stay with my tried and true box-step and
try not
really no one?
On 6/2/06, Vedanta Barooah [EMAIL PROTECTED] wrote:
hello all,
i am setting up php_java.dll extension under windows/iis, my php
version is 5.1.2. can any one point me to the download location of
php_java.jar which is needed for the setup.
i searched all the sites/mirrors but its
2006/6/2, George Babichev [EMAIL PROTECTED]:
Awesome, thank you so much! It works!
On 6/1/06, Chris [EMAIL PROTECTED] wrote:
George Babichev wrote:
Ok, I sent it to everyone and you. Now can you answer my question
please?
I type in
1
2
into my form in the program that i
it was not about windows! :)
it was about php getting into IIS instead of than .net or java
- vedanta
On 6/3/06, tedd [EMAIL PROTECTED] wrote:
really no one?
On 6/2/06, Vedanta Barooah [EMAIL PROTECTED] wrote:
hello all,
i am setting up php_java.dll extension under windows/iis, my php
I can't find the proper settings to keep unattended sessions from
expiring in about an hour. Specifically, the $_SESSION variable contents
disappear. I've read the docs, but nothing seems to work. Any ideas?
Here are the session parameters that are in effect:
session.auto_startOn
I'm going to try my best to explain what I'm trying to do.
I have my own class that has an array member. This class itself implements
Iterator. One of the fields in the array is itself an array that I would
like to iterate over. Here's some code:
class Folio implements Iterator {
$projects =
Jason Karns wrote:
I'm going to try my best to explain what I'm trying to do.
I have my own class that has an array member. This class itself implements
Iterator. One of the fields in the array is itself an array that I would
like to iterate over. Here's some code:
class Folio
Hi All,
can anone see what's wrong with the below code? I get this error,
*Parse error*: syntax error, unexpected '}' in
*/usr/local/apache2/htdocs/moviedata2.php* on line *18
*
$age=1;
while($age=100) {
$insert = INSERT INTO age (age_label) VALUES ($age);
$results = mysql_query($insert) or
Quoting Mark Sargent [EMAIL PROTECTED]:
Hi All,
can anone see what's wrong with the below code? I get this error,
*Parse error*: syntax error, unexpected '}' in
*/usr/local/apache2/htdocs/moviedata2.php* on line *18
*
$age=1;
while($age=100) {
$insert = INSERT INTO age (age_label) VALUES
-Original Message-
From: Greg Beaver [mailto:[EMAIL PROTECTED]
Sent: Friday, June 02, 2006 10:39 PM
To: Jason Karns
Cc: php-general@lists.php.net
Subject: Re: SPL Iterator and Associative Array
Jason Karns wrote:
I'm going to try my best to explain what I'm trying to do.
I
how about like this
---
$insert = INSERT INTO age (age_label) VALUES ('$age');
---
From: Mark Sargent [mailto:[EMAIL PROTECTED]
Sent: Sat 03-Jun-2006 10:02
To: PHP List
Subject: [PHP] Parse error: syntax error, unexpected '}'
Hi All,
can anone see what's
if i am not wrong the bridge is better if you are trying to put in php
into a java app server. i do know to create the jar in linux i
will try some other combinations and keep things posted.
i am not able to find the jar, anywhere yet though :(
- vedanta
On 6/3/06, Jon Anderson [EMAIL
Hi All,
sorry, found it. Forgot the ; after $age++. Cheers.
Mark Sargent.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bagus Nugroho would like to recall the message, [PHP] Parse error: syntax
error, unexpected '}'.
Hi all!
I use HTTP POST to upload a file. I've a PHP script running on the server.
Are HTTP headers passed with this request? How can I see the headers passed
to the server?
Thanks
KM
79 matches
Mail list logo